diff options
author | Andrew Dolgov <[email protected]> | 2014-10-15 13:29:20 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2014-10-15 13:29:20 +0400 |
commit | 4eef7998285ebd2e1c9baace3c027023e2907cba (patch) | |
tree | aa3f86f4b0591949984f6634fc6d632f83396131 /src/org | |
parent | 6663e58d16cdc9133f5ebf36e971fbceaeaebdef (diff) |
remove actionbarsherlock, switch to appcompat stuff
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/fox/ttrss/CommonActivity.java | 7 | ||||
-rw-r--r-- | src/org/fox/ttrss/FeedsActivity.java | 5 | ||||
-rw-r--r-- | src/org/fox/ttrss/HeadlinesActivity.java | 3 | ||||
-rw-r--r-- | src/org/fox/ttrss/OnlineActivity.java | 70 | ||||
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineActivity.java | 64 | ||||
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineFeedsActivity.java | 6 | ||||
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java | 3 |
7 files changed, 76 insertions, 82 deletions
diff --git a/src/org/fox/ttrss/CommonActivity.java b/src/org/fox/ttrss/CommonActivity.java index a844df39..ec8e75e2 100644 --- a/src/org/fox/ttrss/CommonActivity.java +++ b/src/org/fox/ttrss/CommonActivity.java @@ -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")) { diff --git a/src/org/fox/ttrss/FeedsActivity.java b/src/org/fox/ttrss/FeedsActivity.java index 2e1a55e5..fd283369 100644 --- a/src/org/fox/ttrss/FeedsActivity.java +++ b/src/org/fox/ttrss/FeedsActivity.java @@ -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; diff --git a/src/org/fox/ttrss/HeadlinesActivity.java b/src/org/fox/ttrss/HeadlinesActivity.java index e96f15a2..4eead0ec 100644 --- a/src/org/fox/ttrss/HeadlinesActivity.java +++ b/src/org/fox/ttrss/HeadlinesActivity.java @@ -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 { diff --git a/src/org/fox/ttrss/OnlineActivity.java b/src/org/fox/ttrss/OnlineActivity.java index c082e797..a854f39a 100644 --- a/src/org/fox/ttrss/OnlineActivity.java +++ b/src/org/fox/ttrss/OnlineActivity.java @@ -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 (frag != null) { - frag.setSearchQuery(query); - this.query = query; - } + + if (searchView != null) { + searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + private String 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; + } + }); + } + } } } diff --git a/src/org/fox/ttrss/offline/OfflineActivity.java b/src/org/fox/ttrss/offline/OfflineActivity.java index c879b0b1..fd05b596 100644 --- a/src/org/fox/ttrss/offline/OfflineActivity.java +++ b/src/org/fox/ttrss/offline/OfflineActivity.java @@ -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 (frag != null) { - frag.setSearchQuery(query); - this.query = query; - } + + if (searchView != null) { + searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + private String 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; + } + }); + } } } } diff --git a/src/org/fox/ttrss/offline/OfflineFeedsActivity.java b/src/org/fox/ttrss/offline/OfflineFeedsActivity.java index ac5ed128..c8a9cfc1 100644 --- a/src/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/src/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -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(); diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java b/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java index 644b7c61..128a5919 100644 --- a/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java +++ b/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java @@ -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 { |