diff options
author | Nils Griebner <nils@nils-griebner.de> | 2018-06-16 01:25:49 +0300 |
---|---|---|
committer | Nils Griebner <nils@nils-griebner.de> | 2018-06-16 01:25:49 +0300 |
commit | fa5d52cfeb5661350697ece2abf7e39ae63ace90 (patch) | |
tree | d01940c55786fc76ceab60272349af5f690c7083 /News-Android-App | |
parent | a7bf38f8640e509e57aea5aa91db187163a43961 (diff) |
Add resources for search function
Diffstat (limited to 'News-Android-App')
-rw-r--r-- | News-Android-App/src/main/res/menu/news_reader.xml | 13 | ||||
-rw-r--r-- | News-Android-App/src/main/res/values/strings.xml | 12 | ||||
-rw-r--r-- | News-Android-App/src/main/res/xml/pref_general.xml | 6 |
3 files changed, 27 insertions, 4 deletions
diff --git a/News-Android-App/src/main/res/menu/news_reader.xml b/News-Android-App/src/main/res/menu/news_reader.xml index 91ae9861..2fe1d412 100644 --- a/News-Android-App/src/main/res/menu/news_reader.xml +++ b/News-Android-App/src/main/res/menu/news_reader.xml @@ -8,10 +8,15 @@ app:showAsAction="never" /> <item - android:id="@+id/app_bar_search" - android:actionViewClass="android.widget.SearchView" - android:icon="@drawable/ic_search_black_24dp" - android:title="Search" /> + android:id="@+id/menu_search" + android:enabled="true" + android:icon="@drawable/ic_search_white_24dp" + android:iconifiedByDefault="false" + android:title="Search" + android:visible="true" + app:actionViewClass="android.widget.SearchView" + app:showAsAction="always|collapseActionView" /> + <item android:id="@+id/menu_StartImageCaching" android:title="@string/menu_StartImageCaching" android:orderInCategory="95" diff --git a/News-Android-App/src/main/res/values/strings.xml b/News-Android-App/src/main/res/values/strings.xml index 231c0437..955e32e4 100644 --- a/News-Android-App/src/main/res/values/strings.xml +++ b/News-Android-App/src/main/res/values/strings.xml @@ -114,6 +114,9 @@ <!-- General settings --> <string name="pref_header_general">General</string> <string name="pref_title_general_sort_order">Sort Order</string> + <string name="pref_general_search_in">Search In</string> + <string name="pref_general_search_in_title">Title</string> + <string name="pref_general_search_in_body">Body</string> <string name="pref_general_sort_order_new_old">New -> Old</string> @@ -128,6 +131,15 @@ <item>0</item> </string-array> + <string-array name="pref_general_search_in" translatable="false"> + <item>@string/pref_general_search_in_title</item> + <item>@string/pref_general_search_in_body</item> + </string-array> + <string-array name="pref_general_search_in_values" translatable="false"> + <item>0</item> + <item>1</item> + </string-array> + <string name="dialog_clearing_cache">Clearing cache</string> <string name="dialog_clearing_cache_please_wait">Clearing cacheā¦ Please wait.</string> diff --git a/News-Android-App/src/main/res/xml/pref_general.xml b/News-Android-App/src/main/res/xml/pref_general.xml index e7a4ba23..b78f5e00 100644 --- a/News-Android-App/src/main/res/xml/pref_general.xml +++ b/News-Android-App/src/main/res/xml/pref_general.xml @@ -81,6 +81,12 @@ android:entryValues="@array/pref_general_sort_order_values_not_translated" android:key="sp_sort_order" android:title="@string/pref_title_general_sort_order" /> + <ListPreference + android:defaultValue="1" + android:entries="@array/pref_general_search_in" + android:entryValues="@array/pref_general_search_in_values" + android:key="sp_search_in" + android:title="@string/pref_general_search_in" /> <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to |