search toolbar added, need to connect with API
This commit is contained in:
parent
9ca1617e29
commit
170050406c
@ -22,6 +22,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repositories{
|
||||||
|
maven {
|
||||||
|
url 'http://dl.bintray.com/amulyakhare/maven'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||||
@ -45,4 +51,6 @@ dependencies {
|
|||||||
implementation "com.squareup.okhttp3:okhttp:3.11.0"
|
implementation "com.squareup.okhttp3:okhttp:3.11.0"
|
||||||
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
|
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
|
||||||
implementation "com.squareup.okhttp3:logging-interceptor:3.11.0"
|
implementation "com.squareup.okhttp3:logging-interceptor:3.11.0"
|
||||||
|
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,17 +13,17 @@
|
|||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
|
android:theme="@style/AppTheme">
|
||||||
|
|
||||||
<activity android:name=".activity.StartupActivity"
|
<activity android:name=".activity.StartupActivity"
|
||||||
android:label="@string/title_activity_startup"
|
android:label="@string/title_activity_startup"
|
||||||
android:launchMode="singleInstance">
|
android:launchMode="singleInstance"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
109
app/src/main/java/com/uam/wmi/findmytutor/ListViewAdapter.java
Normal file
109
app/src/main/java/com/uam/wmi/findmytutor/ListViewAdapter.java
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
package com.uam.wmi.findmytutor;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
|
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||||
|
|
||||||
|
import com.uam.wmi.findmytutor.activity.MainActivity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class ListViewAdapter extends ArrayAdapter<String> {
|
||||||
|
|
||||||
|
|
||||||
|
private MainActivity activity;
|
||||||
|
private List<String> friendList;
|
||||||
|
private List<String> searchList;
|
||||||
|
|
||||||
|
public ListViewAdapter(MainActivity context, int resource, List<String> objects) {
|
||||||
|
super(context, resource, objects);
|
||||||
|
this.activity = context;
|
||||||
|
this.friendList = objects;
|
||||||
|
this.searchList = new ArrayList<>();
|
||||||
|
this.searchList.addAll(friendList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return friendList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItem(int position) {
|
||||||
|
return friendList.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
ViewHolder holder;
|
||||||
|
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
|
||||||
|
// If holder not exist then locate all view from UI file.
|
||||||
|
if (convertView == null) {
|
||||||
|
// inflate UI from XML file
|
||||||
|
convertView = inflater.inflate(R.layout.item_listview, parent, false);
|
||||||
|
// get all UI view
|
||||||
|
holder = new ViewHolder(convertView);
|
||||||
|
// set tag for holder
|
||||||
|
convertView.setTag(holder);
|
||||||
|
} else {
|
||||||
|
// if holder created, get tag from view
|
||||||
|
holder = (ViewHolder) convertView.getTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.friendName.setText(getItem(position));
|
||||||
|
|
||||||
|
//get first letter of each String item
|
||||||
|
String firstLetter = String.valueOf(getItem(position).charAt(0));
|
||||||
|
|
||||||
|
ColorGenerator generator = ColorGenerator.MATERIAL; // or use DEFAULT
|
||||||
|
// generate random color
|
||||||
|
int color = generator.getColor(getItem(position));
|
||||||
|
|
||||||
|
TextDrawable drawable = TextDrawable.builder()
|
||||||
|
.buildRound(firstLetter, color); // radius in px
|
||||||
|
|
||||||
|
holder.imageView.setImageDrawable(drawable);
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter method
|
||||||
|
public void filter(String charText) {
|
||||||
|
charText = charText.toLowerCase(Locale.getDefault());
|
||||||
|
friendList.clear();
|
||||||
|
if (charText.length() == 0) {
|
||||||
|
friendList.addAll(searchList);
|
||||||
|
} else {
|
||||||
|
for (String s : searchList) {
|
||||||
|
if (s.toLowerCase(Locale.getDefault()).contains(charText)) {
|
||||||
|
friendList.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ViewHolder {
|
||||||
|
private ImageView imageView;
|
||||||
|
private TextView friendName;
|
||||||
|
|
||||||
|
public ViewHolder(View v) {
|
||||||
|
imageView = (ImageView) v.findViewById(R.id.image_view);
|
||||||
|
friendName = (TextView) v.findViewById(R.id.text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -14,18 +14,27 @@ import android.support.v4.widget.DrawerLayout;
|
|||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.SearchView;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.mapbox.mapboxsdk.Mapbox;
|
import com.mapbox.mapboxsdk.Mapbox;
|
||||||
import com.mapbox.mapboxsdk.maps.MapView;
|
import com.mapbox.mapboxsdk.maps.MapView;
|
||||||
|
import com.uam.wmi.findmytutor.ListViewAdapter;
|
||||||
import com.uam.wmi.findmytutor.R;
|
import com.uam.wmi.findmytutor.R;
|
||||||
import com.uam.wmi.findmytutor.model.Coordinate;
|
import com.uam.wmi.findmytutor.model.Coordinate;
|
||||||
import com.uam.wmi.findmytutor.network.ApiClient;
|
import com.uam.wmi.findmytutor.network.ApiClient;
|
||||||
import com.uam.wmi.findmytutor.service.CoordinateService;
|
import com.uam.wmi.findmytutor.service.CoordinateService;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@ -49,6 +58,11 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
this.coordinates = coordinates;
|
this.coordinates = coordinates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 4 search
|
||||||
|
private ListView listView;
|
||||||
|
private ArrayList<String> stringArrayList;
|
||||||
|
private ListViewAdapter adapter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -61,9 +75,26 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void configureconfigureNavigationDrawer() {
|
private void configureconfigureNavigationDrawer() {
|
||||||
|
listView = (ListView) findViewById(R.id.list_item);
|
||||||
Toolbar toolbar = findViewById(R.id.toolbar_main);
|
Toolbar toolbar = findViewById(R.id.toolbar_main);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
//***/
|
||||||
|
|
||||||
|
setData();
|
||||||
|
adapter = new ListViewAdapter(this, R.layout.item_listview, stringArrayList);
|
||||||
|
listView.setAdapter(adapter);
|
||||||
|
|
||||||
|
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
Toast.makeText(MainActivity.this, (String)parent.getItemAtPosition(position), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//***/
|
||||||
|
|
||||||
drawerLayout = findViewById(R.id.drawer_layout);
|
drawerLayout = findViewById(R.id.drawer_layout);
|
||||||
|
|
||||||
actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
@ -144,6 +175,51 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mock 4 search bar
|
||||||
|
private void setData() {
|
||||||
|
stringArrayList = new ArrayList<>();
|
||||||
|
stringArrayList.add("Quynh Trang");
|
||||||
|
stringArrayList.add("Hoang Bien");
|
||||||
|
stringArrayList.add("Duc Tuan");
|
||||||
|
stringArrayList.add("Dang Thanh");
|
||||||
|
stringArrayList.add("Xuan Luu");
|
||||||
|
stringArrayList.add("Phan Thanh");
|
||||||
|
stringArrayList.add("Kim Kien");
|
||||||
|
stringArrayList.add("Ngo Trang");
|
||||||
|
stringArrayList.add("Thanh Ngan");
|
||||||
|
stringArrayList.add("Nguyen Duong");
|
||||||
|
stringArrayList.add("Quoc Cuong");
|
||||||
|
stringArrayList.add("Tran Ha");
|
||||||
|
stringArrayList.add("Vu Danh");
|
||||||
|
stringArrayList.add("Minh Meo");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu( Menu menu) {
|
||||||
|
getMenuInflater().inflate( R.menu.menu_main, menu);
|
||||||
|
|
||||||
|
MenuItem myActionMenuItem = menu.findItem( R.id.action_search);
|
||||||
|
final SearchView searchView = (SearchView) myActionMenuItem.getActionView();
|
||||||
|
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onQueryTextSubmit(String query) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onQueryTextChange(String newText) {
|
||||||
|
if (TextUtils.isEmpty(newText)) {
|
||||||
|
adapter.filter("");
|
||||||
|
listView.clearTextFilter();
|
||||||
|
} else {
|
||||||
|
adapter.filter(newText);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
|
8
app/src/main/res/drawable/bg_actionbar.xml
Normal file
8
app/src/main/res/drawable/bg_actionbar.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape android:shape="rectangle"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<solid android:color="@android:color/darker_gray" />
|
||||||
|
<corners android:radius="16dp" />
|
||||||
|
</shape>
|
13
app/src/main/res/drawable/ic_menu_search.xml
Normal file
13
app/src/main/res/drawable/ic_menu_search.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:pathData="M15.5 14h-0.79l-0.28-0.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-0.59 4.23-1.57l0.27 0.28 v0.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
|
||||||
|
<path
|
||||||
|
android:pathData="M0 0h24v24H0z" />
|
||||||
|
</vector>
|
@ -10,18 +10,13 @@
|
|||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
tools:openDrawer="start">
|
tools:openDrawer="start">
|
||||||
|
|
||||||
<include
|
|
||||||
layout="@layout/app_bar_main"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<android.support.design.widget.NavigationView
|
<android.support.design.widget.NavigationView
|
||||||
android:id="@+id/nav_view"
|
android:id="@+id/nav_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
app:headerLayout="@layout/nav_header_main"
|
app:headerLayout="@layout/nav_header_main"
|
||||||
app:menu="@menu/activity_main_drawer" >
|
app:menu="@menu/activity_main_drawer">
|
||||||
|
|
||||||
</android.support.design.widget.NavigationView>
|
</android.support.design.widget.NavigationView>
|
||||||
|
|
||||||
@ -72,6 +67,10 @@
|
|||||||
app:layout_anchorGravity="bottom|center"
|
app:layout_anchorGravity="bottom|center"
|
||||||
app:menu="@menu/nav_items" />
|
app:menu="@menu/nav_items" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
<include
|
||||||
|
layout="@layout/app_bar_main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout
|
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
android:id="@+id/appBar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
tools:context=".activity.MainActivity">
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
<!--<android.support.design.widget.AppBarLayout-->
|
android:layout_marginTop="5dp"
|
||||||
<!--android:layout_width="match_parent"-->
|
android:background="@android:color/transparent"
|
||||||
<!--android:layout_height="wrap_content"-->
|
android:elevation="0dp"
|
||||||
<!--android:fitsSystemWindows="true"-->
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
<!--android:theme="@style/AppTheme.NoActionBar">-->
|
|
||||||
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar_main"
|
android:id="@+id/toolbar_main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/colorPrimary"
|
android:background="@drawable/bg_actionbar"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
android:elevation="4dp"
|
||||||
android:elevation="40dp"
|
android:padding="10dp"
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
|
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||||
app:popupTheme="@style/AppTheme" />
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/editText"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ems="10"
|
|
||||||
android:inputType="textPersonName"
|
|
||||||
android:text="ToolBar Title" />
|
|
||||||
|
|
||||||
<!--</android.support.design.widget.AppBarLayout>-->
|
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
tools:context=".activity.MainActivity"
|
tools:context=".activity.MainActivity"
|
||||||
tools:showIn="@layout/activity_main">
|
tools:showIn="@layout/activity_main">
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
<ListView
|
||||||
|
android:id="@+id/list_item"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scrollbars="none"/>
|
||||||
|
</RelativeLayout>
|
24
app/src/main/res/layout/item_listview.xml
Normal file
24
app/src/main/res/layout/item_listview.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="75dp"
|
||||||
|
android:layout_weight="30"
|
||||||
|
android:contentDescription="@string/app_name" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="70"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text=""
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
11
app/src/main/res/menu/menu_main.xml
Normal file
11
app/src/main/res/menu/menu_main.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context=".activity.MainActivity">
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_search"
|
||||||
|
android:icon="@drawable/ic_menu_search"
|
||||||
|
app:showAsAction="always"
|
||||||
|
app:actionViewClass="android.support.v7.widget.SearchView"
|
||||||
|
android:title="Search"/>
|
||||||
|
</menu>
|
@ -1 +1,10 @@
|
|||||||
<resources></resources>
|
<resources>
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
<item name="android:navigationBarColor">@color/colorPrimary</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
@ -2,7 +2,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#3F51B5</color>
|
<color name="colorPrimary">#3F51B5</color>
|
||||||
<color name="colorPrimaryDark">#303F9F</color>
|
<color name="colorPrimaryDark">#303F9F</color>
|
||||||
<color name="colorAccent">#FF4081</color>
|
<color name="colorAccent">#9ef13f</color>
|
||||||
<color name="msg_no_notes">#999</color>
|
<color name="msg_no_notes">#999</color>
|
||||||
<color name="hint_enter_note">#89c3c3c3</color>
|
<color name="hint_enter_note">#89c3c3c3</color>
|
||||||
<color name="timestamp">#858585</color>
|
<color name="timestamp">#858585</color>
|
||||||
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<color name="colorWhite">#ffffff</color>
|
<color name="colorWhite">#ffffff</color>
|
||||||
|
<color name="white">#ffffff</color>
|
||||||
<color name="colorWhiteTransparent">#80ffffff</color>
|
<color name="colorWhiteTransparent">#80ffffff</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
<item name="android:navigationBarColor">@color/colorPrimary</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.NoActionBar">
|
<style name="AppTheme.NoActionBar">
|
||||||
<item name="windowActionBar">false</item>
|
<item name="windowActionBar">false</item>
|
||||||
<item name="windowNoTitle">false</item>
|
<item name="windowNoTitle">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||||
|
|
||||||
</resources>
|
|
||||||
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user