diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-16 20:15:48 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-16 20:15:48 +0200 |
commit | f6c5251b98b5ae1bc31a1d1940530174588c3e27 (patch) | |
tree | ce31e7712455739b5e3149c2607b712763a375b2 /src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java | |
parent | d94e2a7670f20b60ef42435753da118b364fdbab (diff) | |
parent | 3994d02ddfb52a4418951a22bb72f55f85a76fbb (diff) | |
download | AntennaPod-f6c5251b98b5ae1bc31a1d1940530174588c3e27.zip |
Merge branch 'develop' into playback-speed
Conflicts:
pom.xml
src/de/danoeh/antennapod/service/PlaybackService.java
src/de/danoeh/antennapod/util/playback/PlaybackController.java
Diffstat (limited to 'src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java')
-rw-r--r-- | src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java b/src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java index a30777fb1..4ea0b1699 100644 --- a/src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java +++ b/src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java @@ -4,12 +4,12 @@ import android.app.SearchManager; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.app.ActionBarActivity; import android.util.Log; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - +import android.view.Menu; +import android.view.MenuItem; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.fragment.MiroGuideChannellistFragment; @@ -19,72 +19,72 @@ import de.danoeh.antennapod.preferences.UserPreferences; * Displays results when a search for miroguide channels has been performed. It * uses a MiroGuideChannelListFragment to display the results. */ -public class MiroGuideSearchActivity extends SherlockFragmentActivity { - private static final String TAG = "MiroGuideSearchActivity"; +public class MiroGuideSearchActivity extends ActionBarActivity { + private static final String TAG = "MiroGuideSearchActivity"; - private MiroGuideChannellistFragment listFragment; + private MiroGuideChannellistFragment listFragment; - @Override - protected void onCreate(Bundle arg0) { - setTheme(UserPreferences.getTheme()); - super.onCreate(arg0); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - setContentView(R.layout.miroguidesearch); - } + @Override + protected void onCreate(Bundle arg0) { + setTheme(UserPreferences.getTheme()); + super.onCreate(arg0); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setContentView(R.layout.miroguidesearch); + } - @Override - protected void onResume() { - super.onResume(); - Intent intent = getIntent(); - if (Intent.ACTION_SEARCH.equals(intent.getAction())) { - String query = intent.getStringExtra(SearchManager.QUERY); - getSupportActionBar() - .setSubtitle( - getString(R.string.search_term_label) + "\"" - + query + "\""); - handleSearchRequest(query); - } - } + @Override + protected void onResume() { + super.onResume(); + Intent intent = getIntent(); + if (Intent.ACTION_SEARCH.equals(intent.getAction())) { + String query = intent.getStringExtra(SearchManager.QUERY); + getSupportActionBar() + .setSubtitle( + getString(R.string.search_term_label) + "\"" + + query + "\""); + handleSearchRequest(query); + } + } - private void handleSearchRequest(String query) { - if (AppConfig.DEBUG) - Log.d(TAG, "Performing search"); - FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); - listFragment = MiroGuideChannellistFragment.newInstance("name", query, - "name"); - ft.replace(R.id.channellistFragment, listFragment); - ft.commit(); - } + private void handleSearchRequest(String query) { + if (AppConfig.DEBUG) + Log.d(TAG, "Performing search"); + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + listFragment = MiroGuideChannellistFragment.newInstance("name", query, + "name"); + ft.replace(R.id.channellistFragment, listFragment); + ft.commit(); + } - @Override - protected void onNewIntent(Intent intent) { - setIntent(intent); - } + @Override + protected void onNewIntent(Intent intent) { + setIntent(intent); + } - @Override - public boolean onCreateOptionsMenu(Menu menu) { - menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) - .setIcon( - obtainStyledAttributes( - new int[] { R.attr.action_search }) - .getDrawable(0)) - .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) + .setIcon( + obtainStyledAttributes( + new int[]{R.attr.action_search}) + .getDrawable(0)), + MenuItem.SHOW_AS_ACTION_IF_ROOM); - return true; - } + return true; + } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - finish(); - return true; - case R.id.search_item: - onSearchRequested(); - return true; - default: - return false; - } - } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + case R.id.search_item: + onSearchRequested(); + return true; + default: + return false; + } + } } |