summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeo Piskas <geopiskas@gmail.com>2012-12-27 17:17:23 +0200
committerGeo Piskas <geopiskas@gmail.com>2013-01-01 19:33:44 +0200
commit2dbd9bb31bd0fc708bd47cac296722de30f8d7af (patch)
treeb867c92ea9058ec3aced12b3789b15a7b595c847
parent6bcb54284da6cc5f008de6be35b3cfdd6ace4888 (diff)
downloaddevice_samsung_crespo-2dbd9bb31bd0fc708bd47cac296722de30f8d7af.zip
device_samsung_crespo-2dbd9bb31bd0fc708bd47cac296722de30f8d7af.tar.gz
device_samsung_crespo-2dbd9bb31bd0fc708bd47cac296722de30f8d7af.tar.bz2
CrespoParts: Added DisplayHomeAsUp feature.
Enabled back feature by pressing the app icon at the top left corner. Screenshot: http://i.imgur.com/57u32.png PatchSet 2: Fixed whitespace errors. Change-Id: Ie05f2b27e102da49f46c963a54d07b963aa3c34e
-rw-r--r--CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java b/CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java
index e868086..3325a53 100644
--- a/CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java
+++ b/CrespoParts/src/com/cyanogenmod/settings/device/DeviceSettings.java
@@ -32,6 +32,7 @@ import android.os.IBinder;
import android.support.v13.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
+import android.view.MenuItem;
import com.cyanogenmod.settings.device.R;
@@ -63,6 +64,7 @@ public class DeviceSettings extends Activity {
setContentView(mViewPager);
final ActionBar bar = getActionBar();
+ bar.setDisplayHomeAsUpEnabled(true);
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
bar.setTitle(R.string.app_name);
@@ -84,6 +86,15 @@ public class DeviceSettings extends Activity {
outState.putInt("tab", getActionBar().getSelectedNavigationIndex());
}
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ finish();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
public static class TabsAdapter extends FragmentPagerAdapter
implements ActionBar.TabListener, ViewPager.OnPageChangeListener {
private final Context mContext;