aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--[-rwxr-xr-x]src/com/cyanogenmod/lockclock/preference/Preferences.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/lockclock/preference/Preferences.java b/src/com/cyanogenmod/lockclock/preference/Preferences.java
index f60ab4d..a138c75 100755..100644
--- a/src/com/cyanogenmod/lockclock/preference/Preferences.java
+++ b/src/com/cyanogenmod/lockclock/preference/Preferences.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 The CyanogenMod Project (DvTonder)
+ * Copyright (C) 2012-2014 The CyanogenMod Project (DvTonder)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
package com.cyanogenmod.lockclock.preference;
import android.annotation.SuppressLint;
+import android.app.ActionBar;
import android.appwidget.AppWidgetManager;
import android.content.Intent;
import android.preference.PreferenceActivity;
@@ -50,6 +51,15 @@ public class Preferences extends PreferenceActivity {
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.options_menu, menu);
+
+ ActionBar mActionBar = getActionBar();
+ // Show up navigation and hide 'done' button when not triggered from adding a new widget
+ if ((mActionBar != null) && (mNewWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID)) {
+ mActionBar.setDisplayHomeAsUpEnabled(true);
+ MenuItem item = menu.findItem(R.id.menu_done);
+ item.setVisible(false);
+ }
+
return true;
}
@@ -58,6 +68,7 @@ public class Preferences extends PreferenceActivity {
// Handle item selection
switch (item.getItemId()) {
case R.id.menu_done:
+ case android.R.id.home:
myResult(RESULT_OK);
finish();
return true;