diff options
author | Andrew Dolgov <[email protected]> | 2014-10-30 15:17:15 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2014-10-30 15:17:15 +0300 |
commit | 3dc5a9668f484f6c5d98fc818964b87c5fa1873c (patch) | |
tree | 5fd42a3a9eea6d2e5d5059d931fe6a0e61c630b8 /org.fox.ttrss | |
parent | f62363bc9600aade9154896c3249e80f155d0c20 (diff) |
simplify visible actionbar icons
Diffstat (limited to 'org.fox.ttrss')
4 files changed, 12 insertions, 95 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java index ef08c18f..8ded90d1 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java @@ -27,7 +27,6 @@ import android.view.MenuItem; import android.view.View; import android.view.Window; import android.widget.EditText; -import android.widget.SearchView; import android.widget.TextView; import com.google.gson.Gson; @@ -759,7 +758,7 @@ public class OnlineActivity extends CommonActivity { startActivityForResult(intent, 0); return true; case R.id.search: - if (hf != null && isCompatMode()) { + if (hf != null) { Dialog dialog = new Dialog(this); final EditText edit = new EditText(this); @@ -1582,45 +1581,7 @@ public class OnlineActivity extends CommonActivity { m_headlinesActionMode.finish(); } } - - if (!isCompatMode()) { - SearchView searchView = (SearchView) search.getActionView(); - - if (searchView != null) { - searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { - private String query = ""; - - @Override - public boolean onQueryTextSubmit(String query) { - HeadlinesFragment frag = (HeadlinesFragment) getSupportFragmentManager() - .findFragmentByTag(FRAG_HEADLINES); - - if (frag != null) { - frag.setSearchQuery(query); - this.query = query; - } - - return false; - } - - @Override - public boolean onQueryTextChange(String newText) { - if (newText.equals("") && !newText.equals(this.query)) { - HeadlinesFragment frag = (HeadlinesFragment) getSupportFragmentManager() - .findFragmentByTag(FRAG_HEADLINES); - - if (frag != null) { - frag.setSearchQuery(newText); - this.query = newText; - } - } - - return false; - } - }); - } - } - } + } } protected void refresh(boolean includeHeadlines) { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java index d6d88c63..978ce211 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java @@ -23,7 +23,6 @@ import android.view.MenuItem; import android.view.View; import android.view.Window; import android.widget.EditText; -import android.widget.SearchView; import android.widget.TextView; import org.fox.ttrss.CommonActivity; @@ -281,7 +280,7 @@ public class OfflineActivity extends CommonActivity { switchOnline(); return true; case R.id.search: - if (ohf != null && isCompatMode()) { + if (ohf != null) { Dialog dialog = new Dialog(this); final EditText edit = new EditText(this); @@ -622,47 +621,7 @@ public class OfflineActivity extends CommonActivity { article.close(); } } - - if (!isCompatMode()) { - MenuItem search = m_menu.findItem(R.id.search); - - SearchView searchView = (SearchView) search.getActionView(); - - if (searchView != null) { - searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { - private String query = ""; - - @Override - public boolean onQueryTextSubmit(String query) { - OfflineHeadlinesFragment frag = (OfflineHeadlinesFragment) getSupportFragmentManager() - .findFragmentByTag(FRAG_HEADLINES); - - if (frag != null) { - frag.setSearchQuery(query); - this.query = query; - } - - return false; - } - - @Override - public boolean onQueryTextChange(String newText) { - if (newText.equals("") && !newText.equals(this.query)) { - OfflineHeadlinesFragment frag = (OfflineHeadlinesFragment) getSupportFragmentManager() - .findFragmentByTag(FRAG_HEADLINES); - - if (frag != null) { - frag.setSearchQuery(newText); - this.query = newText; - } - } - - return false; - } - }); - } - } - } + } } private void switchOnline() { diff --git a/org.fox.ttrss/src/main/res/menu/main_menu.xml b/org.fox.ttrss/src/main/res/menu/main_menu.xml index 81e06712..15391862 100644 --- a/org.fox.ttrss/src/main/res/menu/main_menu.xml +++ b/org.fox.ttrss/src/main/res/menu/main_menu.xml @@ -14,13 +14,13 @@ <item android:id="@+id/subscribe_to_feed" android:icon="@drawable/ic_new_light" - app:showAsAction="ifRoom" + app:showAsAction="" android:title="@string/subscribe_to_feed"/> <item android:id="@+id/show_feeds" android:icon="@drawable/ic_list_light" - app:showAsAction="ifRoom" + app:showAsAction="" android:title="@string/menu_all_feeds"/> <item android:id="@+id/go_offline" @@ -45,9 +45,8 @@ android:title="@string/update_headlines"/> <item android:id="@+id/search" - app:actionViewClass="android.widget.SearchView" android:icon="@drawable/ic_search_light" - app:showAsAction="ifRoom|collapseActionView" + app:showAsAction="ifRoom" android:title="@string/search"/> <item android:id="@+id/headlines_mark_as_read" @@ -56,7 +55,7 @@ android:title="@string/headlines_mark_as_read"/> <item android:id="@+id/headlines_select" - app:showAsAction="ifRoom" + app:showAsAction="" android:icon="@drawable/ic_select_all_light" android:title="@string/headlines_select"/> @@ -138,7 +137,7 @@ <item android:id="@+id/set_unread" android:icon="@drawable/ic_read_light" - app:showAsAction="ifRoom" + app:showAsAction="" android:title="@string/article_set_unread"/> </group> diff --git a/org.fox.ttrss/src/main/res/menu/offline_menu.xml b/org.fox.ttrss/src/main/res/menu/offline_menu.xml index 49709f18..5f20f869 100644 --- a/org.fox.ttrss/src/main/res/menu/offline_menu.xml +++ b/org.fox.ttrss/src/main/res/menu/offline_menu.xml @@ -10,15 +10,13 @@ <item android:id="@+id/show_feeds" android:icon="@drawable/ic_list_light" - app:showAsAction="ifRoom" + app:showAsAction="" android:title="@string/menu_all_feeds"/> </group> <group android:id="@+id/menu_group_headlines" > <item android:id="@+id/search" - app:actionViewClass="android.widget.SearchView" android:icon="@drawable/ic_search_light" - app:showAsAction="ifRoom|collapseActionView" android:title="@string/search"/> <item android:id="@+id/headlines_mark_as_read" @@ -28,7 +26,7 @@ <item android:id="@+id/headlines_select" android:icon="@drawable/ic_select_all_light" - app:showAsAction="ifRoom" + app:showAsAction="" android:title="@string/headlines_select"/> <item android:id="@+id/headlines_view_mode" @@ -81,7 +79,7 @@ <item android:id="@+id/set_unread" android:icon="@drawable/ic_read_light" - app:showAsAction="ifRoom" + app:showAsAction="" android:title="@string/article_set_unread"/> <item android:id="@+id/catchup_above" |