From 1293eac5c84340c4bdb4c9bef283de3e2710c7da Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Fri, 22 Feb 2019 13:34:24 +0800 Subject: Add a search view in MainActivity and add a SearchActivity. --- app/src/main/res/drawable/ic_search_white_24dp.xml | 5 +++ app/src/main/res/layout/activity_search.xml | 43 ++++++++++++++++++++++ app/src/main/res/layout/app_bar_main.xml | 32 +++++++++++++--- app/src/main/res/menu/main_activity.xml | 9 ++++- app/src/main/res/menu/menu_search.xml | 10 +++++ app/src/main/res/values/strings.xml | 10 +++++ app/src/main/res/values/styles.xml | 12 +++++- app/src/main/res/xml/searchable.xml | 6 +++ 8 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 app/src/main/res/drawable/ic_search_white_24dp.xml create mode 100644 app/src/main/res/layout/activity_search.xml create mode 100644 app/src/main/res/menu/menu_search.xml create mode 100644 app/src/main/res/xml/searchable.xml (limited to 'app/src/main/res') diff --git a/app/src/main/res/drawable/ic_search_white_24dp.xml b/app/src/main/res/drawable/ic_search_white_24dp.xml new file mode 100644 index 00000000..be5ad99c --- /dev/null +++ b/app/src/main/res/drawable/ic_search_white_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml new file mode 100644 index 00000000..bd440eac --- /dev/null +++ b/app/src/main/res/layout/activity_search.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml index f8894bda..9c1dfa84 100644 --- a/app/src/main/res/layout/app_bar_main.xml +++ b/app/src/main/res/layout/app_bar_main.xml @@ -11,15 +11,37 @@ android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> - + android:layout_height="wrap_content"> + + + + + + + + diff --git a/app/src/main/res/menu/main_activity.xml b/app/src/main/res/menu/main_activity.xml index 2be22f5f..2a4357aa 100644 --- a/app/src/main/res/menu/main_activity.xml +++ b/app/src/main/res/menu/main_activity.xml @@ -5,8 +5,15 @@ tools:context="ml.docilealligator.infinityforreddit.MainActivity"> + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_search.xml b/app/src/main/res/menu/menu_search.xml new file mode 100644 index 00000000..afd34627 --- /dev/null +++ b/app/src/main/res/menu/menu_search.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 486fd853..a8058872 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,7 @@ Infinity Login + Search Open navigation drawer Close navigation drawer @@ -8,6 +9,7 @@ Settings Download Refresh + Search Error loading image. Tap to retry. Error loading posts.\nTap to retry. @@ -51,4 +53,12 @@ Subreddit Banner Image Error loading post + + Infinity + Search anything + Search + Hello World from section: %1$d + Tab 1 + Tab 2 + Tab 3 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 1ea7c276..1b770151 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -13,10 +13,13 @@ + + - @@ -37,4 +40,11 @@ true + + diff --git a/app/src/main/res/xml/searchable.xml b/app/src/main/res/xml/searchable.xml new file mode 100644 index 00000000..9b87146c --- /dev/null +++ b/app/src/main/res/xml/searchable.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file -- cgit v1.2.3