diff options
Diffstat (limited to 'OpenKeychain/src/main')
5 files changed, 48 insertions, 39 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index d0be052d8..7fa403485 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -110,8 +110,6 @@ public class KeyListFragment extends LoaderFragment private String mQuery; private SearchView mSearchView; - boolean hideMenu = false; - /** * Load custom layout with StickyListView from library */ @@ -172,8 +170,8 @@ public class KeyListFragment extends LoaderFragment TextView title = (TextView) getActivity().findViewById(R.id.custom_actionbar_text); title.setText(R.string.swipe_to_update); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - hideMenu = true; - activity.invalidateOptionsMenu(); +// hideMenu = true; +// activity.invalidateOptionsMenu(); } } else { bar.setTitle(getActivity().getTitle()); @@ -184,8 +182,8 @@ public class KeyListFragment extends LoaderFragment bar.setDisplayShowCustomEnabled(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - hideMenu = false; - activity.invalidateOptionsMenu(); +// hideMenu = false; +// activity.invalidateOptionsMenu(); } } } @@ -470,10 +468,6 @@ public class KeyListFragment extends LoaderFragment MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() { @Override public boolean onMenuItemActionExpand(MenuItem item) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - hideMenu = true; - getActivity().invalidateOptionsMenu(); - } // disable swipe-to-refresh // mSwipeRefreshLayout.setIsLocked(true); @@ -485,22 +479,12 @@ public class KeyListFragment extends LoaderFragment mQuery = null; getLoaderManager().restartLoader(0, null, KeyListFragment.this); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - hideMenu = false; - getActivity().invalidateOptionsMenu(); - } // enable swipe-to-refresh // mSwipeRefreshLayout.setIsLocked(false); return true; } }); - if (hideMenu) { - for (int i = 0; i < menu.size(); i++) { - menu.getItem(i).setVisible(false); - } - } - super.onCreateOptionsMenu(menu, inflater); } diff --git a/OpenKeychain/src/main/res/layout/toolbar.xml b/OpenKeychain/src/main/res/layout/toolbar.xml index 4c1ad4e54..5d83a2aa1 100644 --- a/OpenKeychain/src/main/res/layout/toolbar.xml +++ b/OpenKeychain/src/main/res/layout/toolbar.xml @@ -1,10 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar 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" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" android:background="?attr/colorPrimaryDark" + android:elevation="4dp" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" - app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
\ No newline at end of file + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + tools:ignore="UnusedAttribute" />
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/menu/key_list.xml b/OpenKeychain/src/main/res/menu/key_list.xml index 716a426a0..aab6c2e60 100644 --- a/OpenKeychain/src/main/res/menu/key_list.xml +++ b/OpenKeychain/src/main/res/menu/key_list.xml @@ -11,53 +11,53 @@ <item android:id="@+id/menu_key_list_search_cloud" - app:showAsAction="always|withText" android:icon="@drawable/ic_action_search_cloud" - android:title="@string/menu_add_keys" /> + android:title="@string/menu_search_cloud" + app:showAsAction="ifRoom|withText" /> <item android:id="@+id/menu_key_list_add" - app:showAsAction="always|withText" android:icon="@drawable/ic_action_qr_code" - android:title="@string/import_qr_code_button" /> + android:title="@string/import_qr_code_button" + app:showAsAction="ifRoom|withText" /> <item android:id="@+id/menu_key_list_export" - app:showAsAction="never" - android:title="@string/menu_export_all_keys" /> + android:title="@string/menu_export_all_keys" + app:showAsAction="never" /> <item android:id="@+id/menu_key_list_create" - app:showAsAction="never" - android:title="@string/menu_create_key" /> + android:title="@string/menu_create_key" + app:showAsAction="never" /> <item android:id="@+id/menu_key_list_import_existing_key" - app:showAsAction="never" - android:title="@string/menu_import_existing_key" /> + android:title="@string/menu_import_existing_key" + app:showAsAction="never" /> <item android:id="@+id/menu_key_list_debug_cons" - app:showAsAction="never" android:title="Debug / Consolidate" - android:visible="false" /> + android:visible="false" + app:showAsAction="never" /> <item android:id="@+id/menu_key_list_debug_read" - app:showAsAction="never" android:title="Debug / DB restore" - android:visible="false" /> + android:visible="false" + app:showAsAction="never" /> <item android:id="@+id/menu_key_list_debug_write" - app:showAsAction="never" android:title="Debug / DB backup" - android:visible="false" /> + android:visible="false" + app:showAsAction="never" /> <item android:id="@+id/menu_key_list_debug_first_time" - app:showAsAction="never" android:title="Debug / Show first time screen" - android:visible="false" /> + android:visible="false" + app:showAsAction="never" /> </menu> diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 87de16f6a..deb2f05f3 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -98,6 +98,7 @@ <string name="menu_encrypt_to">"Encrypt to…"</string> <string name="menu_select_all">"Select all"</string> <string name="menu_add_keys">"Add keys"</string> + <string name="menu_search_cloud">"Search cloud"</string> <string name="menu_export_all_keys">"Export all keys"</string> <string name="menu_advanced">"Show advanced info"</string> diff --git a/OpenKeychain/src/main/res/values/themes.xml b/OpenKeychain/src/main/res/values/themes.xml index 2f5577f00..602c85247 100644 --- a/OpenKeychain/src/main/res/values/themes.xml +++ b/OpenKeychain/src/main/res/values/themes.xml @@ -8,5 +8,26 @@ <item name="colorPrimaryDark">@color/colorPrimary</item> <item name="android:windowNoTitle">true</item> <item name="windowActionBar">false</item> + <item name="searchViewStyle">@style/MySearchViewStyle</item> + </style> + + <!-- http://android-developers.blogspot.de/2014/10/appcompat-v21-material-design-for-pre.html --> + <style name="MySearchViewStyle" parent="Widget.AppCompat.SearchView"> + <!-- Background for the search query section (e.g. EditText) --> + <!--<item name="queryBackground">...</item>--> + <!-- Background for the actions section (e.g. voice, submit) --> + <!--<item name="submitBackground">...</item>--> + <!-- Close button icon --> + <!--<item name="closeIcon">...</item>--> + <!-- Search button icon --> + <!--<item name="searchIcon">...</item>--> + <!-- Go/commit button icon --> + <!--<item name="goIcon">...</item>--> + <!-- Voice search button icon --> + <!--<item name="voiceIcon">...</item>--> + <!-- Commit icon shown in the query suggestion row --> + <!--<item name="commitIcon">...</item>--> + <!-- Layout for query suggestion rows --> + <!--<item name="suggestionRowLayout">...</item>--> </style> </resources>
\ No newline at end of file |