remove actionbarsherlock, switch to appcompat stuff

This commit is contained in:
Andrew Dolgov 2014-10-15 13:29:20 +04:00
parent 6663e58d16
commit 4eef799828
18 changed files with 154 additions and 207 deletions

Binary file not shown.

View File

@ -8,10 +8,9 @@
# project structure.
# Project target.
target=android-17
target=android-19
android.library.reference.1=..\\Android-ViewPagerIndicator\\library
android.library.reference.2=..\\ActionBarSherlock\\actionbarsherlock
android.library.reference.3=..\\SlidingMenu\\library
android.library.reference.2=..\\tasker-locale-api
android.library.reference.3=..\\appcompat
android.library.reference.4=..\\ActionBar-PullToRefresh\\library
android.library.reference.5=..\\ActionBar-PullToRefresh\\extras\\pulltorefresh-actionbarsherlock
android.library.reference.6=../tasker-locale-api
android.library.reference.5=../SlidingMenu/library

View File

@ -1,26 +1,26 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ugh="http://schemas.android.com/apk/res-auto" >
<item
android:id="@+id/article_img_open"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_img_open"/>
<item
android:id="@+id/article_img_copy"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_link_copy"/>
<item
android:id="@+id/article_img_share"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_img_share"/>
<item
android:id="@+id/article_img_view_caption"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_img_view_caption"/>
<!--
<item
android:id="@+id/article_img_save"
android:showAsAction=""
ugh:showAsAction=""
android:title="Save image to file"/>
-->

View File

@ -1,13 +1,13 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ugh="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/article_link_share"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/share_article"/>
<item
android:id="@+id/article_link_copy"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_link_copy"/>
</menu>

View File

@ -1,21 +1,21 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ugh="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/selection_toggle_unread"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:icon="@drawable/ic_unread_light"
android:title="@string/selection_toggle_unread"/>
<item
android:id="@+id/selection_toggle_marked"
android:icon="@drawable/ic_unimportant_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/selection_toggle_marked"/>
<item
android:id="@+id/selection_toggle_published"
android:icon="@drawable/ic_menu_unpublished_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/selection_toggle_published"/>
</menu>

View File

@ -1,41 +1,41 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ugh="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/selection_toggle_unread"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/context_selection_toggle_unread"/>
<item
android:id="@+id/selection_toggle_marked"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/context_selection_toggle_marked"/>
<item
android:id="@+id/selection_toggle_published"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/context_selection_toggle_published"/>
<group android:id="@+id/menu_group_single_article" >
<item
android:id="@+id/headlines_share_article"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/share_article"/>
<item
android:id="@+id/headlines_article_link_open"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/open_article_in_web_browser"/>
<item
android:id="@+id/headlines_article_link_copy"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_link_copy"/>
<item
android:id="@+id/catchup_above"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_mark_read_above"/>
<item
android:id="@+id/set_labels"
android:title="@string/article_set_labels"/>
<item
android:id="@+id/article_set_note"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_set_note"/>
</group>

View File

@ -1,4 +1,4 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ugh="http://schemas.android.com/apk/res-auto">
<group android:id="@+id/menu_group_logged_in" >
<group android:id="@+id/menu_group_feeds" >
@ -7,74 +7,74 @@
<item
android:id="@+id/back_to_categories"
android:icon="@android:drawable/ic_menu_close_clear_cancel"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/back_to_categories"/>
-->
<item
android:id="@+id/subscribe_to_feed"
android:icon="@drawable/ic_new_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/subscribe_to_feed"/>
<item
android:id="@+id/show_feeds"
android:icon="@drawable/ic_list_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/menu_all_feeds"/>
<item
android:id="@+id/go_offline"
android:icon="@drawable/ic_cloud_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/go_offline"/>
<item
android:id="@+id/update_feeds"
android:icon="@drawable/ic_refresh_light"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/update_feeds"/>
<item
android:id="@+id/logout"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/logout"/>
</group>
<group android:id="@+id/menu_group_headlines" >
<item
android:id="@+id/update_headlines"
android:icon="@drawable/ic_refresh_light"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/update_headlines"/>
<item
android:id="@+id/search"
android:actionViewClass="android.widget.SearchView"
ugh:actionViewClass="android.widget.SearchView"
android:icon="@drawable/ic_search_light"
android:showAsAction="ifRoom|collapseActionView"
ugh:showAsAction="ifRoom|collapseActionView"
android:title="@string/search"/>
<item
android:id="@+id/headlines_mark_as_read"
android:icon="@drawable/ic_accept_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/headlines_mark_as_read"/>
<item
android:id="@+id/headlines_select"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:icon="@drawable/ic_select_all_light"
android:title="@string/headlines_select"/>
<item
android:id="@+id/headlines_view_mode"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/headlines_view_mode"/>
<item
android:id="@+id/headlines_toggle_sidebar"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/toggle_sidebar"/>
<!--
<item
android:id="@+id/close_feed"
android:icon="@android:drawable/ic_menu_close_clear_cancel"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/close_feed"/>
-->
@ -82,53 +82,53 @@
<!-- <group android:id="@+id/menu_group_headlines_selection" >
<item
android:id="@+id/selection_toggle_unread"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/selection_toggle_unread"/>
<item
android:id="@+id/selection_toggle_marked"
android:icon="@drawable/ic_unimportant_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/selection_toggle_marked"/>
<item
android:id="@+id/selection_toggle_published"
android:icon="@drawable/ic_menu_unpublished_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/selection_toggle_published"/>
<item
android:id="@+id/selection_select_none"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/selection_select_none"/>
</group> -->
<group android:id="@+id/menu_group_article" >
<item
android:id="@+id/toggle_marked"
android:icon="@drawable/ic_unimportant_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/article_toggle_marked"/>
<item
android:id="@+id/toggle_published"
android:icon="@drawable/ic_menu_unpublished_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/article_toggle_published"/>
<item
android:id="@+id/toggle_attachments"
android:icon="@drawable/ic_menu_attaches_light"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/attachments_prompt"/>
<item
android:id="@+id/share_article"
android:icon="@drawable/ic_share_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/share_article"/>
<!-- android:actionProviderClass="android.widget.ShareActionProvider" -->
<item
android:id="@+id/set_labels"
android:showAsAction=""
ugh:showAsAction=""
android:icon="@drawable/ic_labels_light"
android:title="@string/article_set_labels"/>
<item
android:id="@+id/article_set_note"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/article_set_note"/>
<item
@ -138,28 +138,28 @@
<item
android:id="@+id/set_unread"
android:icon="@drawable/ic_read_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/article_set_unread"/>
</group>
<item
android:id="@+id/donate"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/trial_purchase"/>
</group>
<item
android:id="@+id/preferences"
android:icon="@android:drawable/ic_menu_preferences"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/preferences"/>
<group android:id="@+id/menu_group_logged_out" >
<item
android:id="@+id/login"
android:icon="@android:drawable/ic_menu_rotate"
android:showAsAction="ifRoom|withText"
ugh:showAsAction="ifRoom|withText"
android:title="@string/login_login"/>
</group>

View File

@ -1,64 +1,64 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ugh="http://schemas.android.com/apk/res-auto" >
<group android:id="@+id/menu_group_feeds" >
<item
android:id="@+id/go_online"
android:icon="@drawable/ic_cloud_light"
android:showAsAction="ifRoom|withText"
ugh:showAsAction="ifRoom|withText"
android:title="@string/go_online"
android:visible="false"/>
<item
android:id="@+id/show_feeds"
android:icon="@drawable/ic_list_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/menu_all_feeds"/>
</group>
<group android:id="@+id/menu_group_headlines" >
<item
android:id="@+id/search"
android:actionViewClass="android.widget.SearchView"
ugh:actionViewClass="android.widget.SearchView"
android:icon="@drawable/ic_search_light"
android:showAsAction="ifRoom|collapseActionView"
ugh:showAsAction="ifRoom|collapseActionView"
android:title="@string/search"/>
<item
android:id="@+id/headlines_mark_as_read"
android:icon="@drawable/ic_accept_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/headlines_mark_as_read"/>
<item
android:id="@+id/headlines_select"
android:icon="@drawable/ic_select_all_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/headlines_select"/>
<item
android:id="@+id/headlines_view_mode"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/headlines_view_mode"/>
<item
android:id="@+id/headlines_toggle_sidebar"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/toggle_sidebar"/>
</group>
<!--
<group android:id="@+id/menu_group_headlines_selection" >
<item
android:id="@+id/selection_toggle_unread"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/selection_toggle_unread"/>
<item
android:id="@+id/selection_toggle_marked"
android:icon="@drawable/ic_unimportant_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/selection_toggle_marked"/>
<item
android:id="@+id/selection_toggle_published"
android:icon="@drawable/ic_menu_unpublished_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/selection_toggle_published"/>
<item
android:id="@+id/selection_select_none"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/selection_select_none"/>
</group>
-->
@ -66,22 +66,22 @@
<item
android:id="@+id/toggle_marked"
android:icon="@drawable/ic_unimportant_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/article_toggle_marked"/>
<item
android:id="@+id/toggle_published"
android:icon="@drawable/ic_menu_unpublished_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/article_toggle_published"/>
<item
android:id="@+id/share_article"
android:icon="@drawable/ic_share_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/share_article"/>
<item
android:id="@+id/set_unread"
android:icon="@drawable/ic_read_light"
android:showAsAction="ifRoom"
ugh:showAsAction="ifRoom"
android:title="@string/article_set_unread"/>
<item
android:id="@+id/catchup_above"
@ -90,7 +90,7 @@
<item
android:id="@+id/preferences"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/preferences"/>
</menu>

View File

@ -1,9 +1,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ugh="http://schemas.android.com/apk/res-auto" >
<item
android:id="@+id/preferences"
android:icon="@android:drawable/ic_menu_preferences"
android:showAsAction=""
ugh:showAsAction=""
android:title="@string/preferences"/>
</menu>

View File

@ -1,16 +0,0 @@
<resources>
<string-array name="pref_theme_names">
<item>@string/theme_dark</item>
<item>@string/theme_dark_gray</item>
<item>@string/theme_light</item>
<item>@string/theme_sepia</item>
<item>@string/theme_system</item>
</string-array>
<string-array name="pref_theme_values" translatable="false">
<item>THEME_DARK</item>
<item>THEME_DARK_GRAY</item>
<item>THEME_LIGHT</item>
<item>THEME_SEPIA</item>
<item>THEME_SYSTEM</item>
</string-array>
</resources>

View File

@ -1,5 +1,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="LightTheme" parent="Theme.Sherlock.Light.DarkActionBar">
<style name="LightTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="smallScreenBackground">#eeeeee</item>
<item name="ttrssHorizontalDivider">@android:drawable/divider_horizontal_bright</item>
<item name="feedlistBackground"><!-- #e0e0e0 -->@drawable/shadow_feeds</item>
@ -46,7 +46,7 @@
<!-- <item name="android:actionBarStyle">@style/ActionBarSepia</item> -->
</style>
<style name="DarkTheme" parent="Theme.Sherlock">
<style name="DarkTheme" parent="Theme.AppCompat">
<item name="smallScreenBackground">@android:color/transparent</item>
<item name="ttrssHorizontalDivider">@android:drawable/divider_horizontal_dark</item>
<item name="feedlistBackground">@android:color/transparent</item>
@ -76,36 +76,6 @@
<item name="articleNoteBackground">#303030</item>
</style>
<style name="SystemTheme" parent="Theme.Sherlock.DeviceDefault">
<item name="smallScreenBackground">@android:color/transparent</item>
<item name="ttrssHorizontalDivider">@android:drawable/divider_horizontal_dark</item>
<item name="feedlistBackground">@android:color/transparent</item>
<item name="unreadCounterColor">#ffffff</item>
<item name="headlinesBackground">@android:color/black</item>
<item name="headlinesBackgroundSolid">@android:color/black</item>
<item name="articleBackground">@android:color/black</item>
<item name="headlineSelectedBackground">@color/ics_cyan</item>
<item name="headlineUnreadBackground">#202020</item>
<item name="headlineNormalBackground">#151515</item>
<item name="feedsSelectedBackground">@color/ics_cyan</item>
<item name="feedlistTextColor">@android:color/primary_text_dark</item>
<item name="feedlistSelectedTextColor">@android:color/black</item>
<item name="headlineTextColor">@android:color/secondary_text_dark</item>
<item name="headlineUnreadTextColor">@android:color/primary_text_dark</item>
<item name="headlineSelectedTextColor">@android:color/white</item>
<item name="headlineExcerptTextColor">@android:color/secondary_text_dark</item>
<item name="headlineSelectedExcerptTextColor">@android:color/black</item>
<item name="headlineSecondaryTextColor">#909090</item>
<item name="headlineSelectedSecondaryTextColor">#404040</item>
<item name="headlineTitleHighScoreUnreadTextColor">#00FF00</item>
<item name="linkColor">@color/ics_cyan</item>
<item name="loadingBackground">@android:color/black</item>
<item name="unreadCounterBackground">@drawable/counter_background_dark</item>
<item name="unreadSelectedCounterBackground">@drawable/counter_background_dark</item>
<item name="articleNoteTextColor">@android:color/secondary_text_dark</item>
<item name="articleNoteBackground">#303030</item>
</style>
<style name="DarkGrayTheme" parent="DarkTheme">
<item name="smallScreenBackground">@color/feeds_dark_gray</item>
<item name="ttrssHorizontalDivider">@android:drawable/divider_horizontal_dark</item>
@ -124,7 +94,7 @@
<item name="headlineSelectedSecondaryTextColor">#a0a0a0</item>
</style>
<style name="ActionBarDarkGray" parent="Widget.Sherlock.ActionBar.Solid">
<style name="ActionBarDarkGray" parent="Widget.AppCompat.ActionBar.Solid">
<item name="android:background">#232527</item>
</style>

View File

@ -8,15 +8,14 @@ import android.database.sqlite.SQLiteDatabase;
import android.graphics.Point;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Display;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragmentActivity;
public class CommonActivity extends SherlockFragmentActivity {
public class CommonActivity extends ActionBarActivity {
private final String TAG = this.getClass().getSimpleName();
public final static String FRAG_HEADLINES = "headlines";
@ -184,8 +183,6 @@ public class CommonActivity extends SherlockFragmentActivity {
if (prefs.getString("theme", defaultTheme).equals("THEME_DARK")) {
setTheme(R.style.DarkTheme);
} else if (prefs.getString("theme", defaultTheme).equals("THEME_SYSTEM")) {
setTheme(R.style.SystemTheme);
} else if (prefs.getString("theme", defaultTheme).equals("THEME_SEPIA")) {
setTheme(R.style.SepiaTheme);
} else if (prefs.getString("theme", defaultTheme).equals("THEME_DARK_GRAY")) {

View File

@ -12,20 +12,17 @@ import org.fox.ttrss.util.AppRater;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.ComponentName;
import android.content.Intent;
import android.content.Intent.ShortcutIconResource;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.MenuItem;
import android.widget.LinearLayout;
import com.actionbarsherlock.view.MenuItem;
import com.google.gson.JsonElement;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;

View File

@ -4,8 +4,6 @@ import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.ArticleList;
import org.fox.ttrss.types.Feed;
import com.actionbarsherlock.view.MenuItem;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
@ -14,6 +12,7 @@ import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventListener {

View File

@ -17,8 +17,7 @@ import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshAttacher;
import android.animation.ObjectAnimator;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.Dialog;
@ -37,20 +36,18 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.view.ActionMode;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.SearchView;
import android.widget.TextView;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@ -124,7 +121,7 @@ public class OnlineActivity extends CommonActivity {
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.headlines_action_menu, menu);
return true;
@ -1259,7 +1256,7 @@ public class OnlineActivity extends CommonActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);
m_menu = menu;
@ -1572,7 +1569,7 @@ public class OnlineActivity extends CommonActivity {
if (hf != null) {
if (hf.getSelectedArticles().size() > 0 && m_headlinesActionMode == null) {
m_headlinesActionMode = startActionMode(m_headlinesActionModeCallback);
m_headlinesActionMode = startSupportActionMode(m_headlinesActionModeCallback);
} else if (hf.getSelectedArticles().size() == 0 && m_headlinesActionMode != null) {
m_headlinesActionMode.finish();
}
@ -1580,38 +1577,41 @@ public class OnlineActivity extends CommonActivity {
if (!isCompatMode()) {
SearchView searchView = (SearchView) search.getActionView();
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
private String query = "";
@Override
public boolean onQueryTextSubmit(String query) {
HeadlinesFragment frag = (HeadlinesFragment) getSupportFragmentManager()
.findFragmentByTag(FRAG_HEADLINES);
if (searchView != null) {
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
private String query = "";
if (frag != null) {
frag.setSearchQuery(query);
this.query = query;
}
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
if (newText.equals("") && !newText.equals(this.query)) {
@Override
public boolean onQueryTextSubmit(String query) {
HeadlinesFragment frag = (HeadlinesFragment) getSupportFragmentManager()
.findFragmentByTag(FRAG_HEADLINES);
if (frag != null) {
frag.setSearchQuery(newText);
this.query = newText;
frag.setSearchQuery(query);
this.query = query;
}
return false;
}
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;
}
});
}
}
}
}

View File

@ -21,19 +21,18 @@ import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.BaseColumns;
import android.support.v7.view.ActionMode;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
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.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
public class OfflineActivity extends CommonActivity {
private final String TAG = this.getClass().getSimpleName();
@ -62,7 +61,7 @@ public class OfflineActivity extends CommonActivity {
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.headlines_action_menu, menu);
return true;
@ -572,7 +571,7 @@ public class OfflineActivity extends CommonActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.offline_menu, menu);
m_menu = menu;
@ -593,7 +592,7 @@ public class OfflineActivity extends CommonActivity {
if (hf != null) {
if (hf.getSelectedArticleCount() > 0 && m_headlinesActionMode == null) {
m_headlinesActionMode = startActionMode(m_headlinesActionModeCallback);
m_headlinesActionMode = startSupportActionMode(m_headlinesActionModeCallback);
} else if (hf.getSelectedArticleCount() == 0 && m_headlinesActionMode != null) {
m_headlinesActionMode.finish();
}
@ -628,37 +627,40 @@ public class OfflineActivity extends CommonActivity {
MenuItem search = m_menu.findItem(R.id.search);
SearchView searchView = (SearchView) search.getActionView();
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
private String query = "";
@Override
public boolean onQueryTextSubmit(String query) {
OfflineHeadlinesFragment frag = (OfflineHeadlinesFragment) getSupportFragmentManager()
.findFragmentByTag(FRAG_HEADLINES);
if (searchView != null) {
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
private String query = "";
if (frag != null) {
frag.setSearchQuery(query);
this.query = query;
}
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
if (newText.equals("") && !newText.equals(this.query)) {
@Override
public boolean onQueryTextSubmit(String query) {
OfflineHeadlinesFragment frag = (OfflineHeadlinesFragment) getSupportFragmentManager()
.findFragmentByTag(FRAG_HEADLINES);
if (frag != null) {
frag.setSearchQuery(newText);
this.query = newText;
frag.setSearchQuery(query);
this.query = query;
}
return false;
}
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;
}
});
}
}
}
}

View File

@ -3,6 +3,8 @@ package org.fox.ttrss.offline;
import org.fox.ttrss.GlobalState;
import org.fox.ttrss.R;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import android.animation.LayoutTransition;
import android.annotation.SuppressLint;
import android.content.Intent;
@ -14,12 +16,10 @@ import android.provider.BaseColumns;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.actionbarsherlock.view.MenuItem;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
public class OfflineFeedsActivity extends OfflineActivity implements OfflineHeadlinesEventListener {
private final String TAG = this.getClass().getSimpleName();

View File

@ -3,8 +3,6 @@ package org.fox.ttrss.offline;
import org.fox.ttrss.GlobalState;
import org.fox.ttrss.R;
import com.actionbarsherlock.view.MenuItem;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
@ -16,6 +14,7 @@ import android.provider.BaseColumns;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
public class OfflineHeadlinesActivity extends OfflineActivity implements OfflineHeadlinesEventListener {