aboutsummaryrefslogtreecommitdiffstats
path: root/org_apg/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'org_apg/src/org')
-rw-r--r--org_apg/src/org/apg/Id.java1
-rw-r--r--org_apg/src/org/apg/ui/EditKeyActivity.java4
-rw-r--r--org_apg/src/org/apg/ui/MainActivity.java1
-rw-r--r--org_apg/src/org/apg/ui/SelectPublicKeyListActivity.java45
-rw-r--r--org_apg/src/org/apg/ui/SelectSecretKeyListActivity.java8
5 files changed, 42 insertions, 17 deletions
diff --git a/org_apg/src/org/apg/Id.java b/org_apg/src/org/apg/Id.java
index 6b721d3a8..9a2d7f90d 100644
--- a/org_apg/src/org/apg/Id.java
+++ b/org_apg/src/org/apg/Id.java
@@ -50,6 +50,7 @@ public final class Id {
public static final int reply = 0x21070016;
public static final int cancel = 0x21070017;
public static final int save = 0x21070018;
+ public static final int okay = 0x21070019;
}
}
diff --git a/org_apg/src/org/apg/ui/EditKeyActivity.java b/org_apg/src/org/apg/ui/EditKeyActivity.java
index 1c60688d5..8f7a642f9 100644
--- a/org_apg/src/org/apg/ui/EditKeyActivity.java
+++ b/org_apg/src/org/apg/ui/EditKeyActivity.java
@@ -66,10 +66,10 @@ public class EditKeyActivity extends BaseActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- menu.add(2, Id.menu.option.cancel, 0, R.string.btn_doNotSave)
+ menu.add(1, Id.menu.option.cancel, 0, R.string.btn_doNotSave)
// .setIcon(R.drawable.ic_menu_search_holo_light)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
- menu.add(2, Id.menu.option.save, 1, R.string.btn_save)
+ menu.add(1, Id.menu.option.save, 1, R.string.btn_save)
// .setIcon(R.drawable.ic_suggestions_add)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
return true;
diff --git a/org_apg/src/org/apg/ui/MainActivity.java b/org_apg/src/org/apg/ui/MainActivity.java
index f19c76ad7..d53757e12 100644
--- a/org_apg/src/org/apg/ui/MainActivity.java
+++ b/org_apg/src/org/apg/ui/MainActivity.java
@@ -78,6 +78,7 @@ public class MainActivity extends BaseActivity {
final ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(false);
+ actionBar.setHomeButtonEnabled(false);
// if (!mPreferences.hasSeenHelp()) {
// showDialog(Id.dialog.help);
diff --git a/org_apg/src/org/apg/ui/SelectPublicKeyListActivity.java b/org_apg/src/org/apg/ui/SelectPublicKeyListActivity.java
index 4b2c39875..0b6d6c43a 100644
--- a/org_apg/src/org/apg/ui/SelectPublicKeyListActivity.java
+++ b/org_apg/src/org/apg/ui/SelectPublicKeyListActivity.java
@@ -22,7 +22,9 @@ import org.apg.Apg;
import org.apg.Id;
import org.apg.R;
+import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuItem;
import android.app.SearchManager;
import android.content.Intent;
@@ -43,6 +45,12 @@ public class SelectPublicKeyListActivity extends BaseActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+
+ final ActionBar actionBar = getSupportActionBar();
+ actionBar.setDisplayShowTitleEnabled(true);
+ actionBar.setDisplayHomeAsUpEnabled(false);
+ actionBar.setHomeButtonEnabled(false);
+
setContentView(R.layout.select_public_key);
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
@@ -51,20 +59,6 @@ public class SelectPublicKeyListActivity extends BaseActivity {
// needed in Android 1.5, where the XML attribute gets ignored
mList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
- Button okButton = (Button) findViewById(R.id.btn_ok);
- okButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- okClicked();
- }
- });
-
- Button cancelButton = (Button) findViewById(R.id.btn_cancel);
- cancelButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- cancelClicked();
- }
- });
-
mFilterLayout = findViewById(R.id.layout_filter);
mFilterInfo = (TextView) mFilterLayout.findViewById(R.id.filterInfo);
mClearFilterButton = (Button) mFilterLayout.findViewById(R.id.btn_clear);
@@ -166,6 +160,29 @@ public class SelectPublicKeyListActivity extends BaseActivity {
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, Id.menu.option.search, 0, R.string.menu_search).setIcon(
android.R.drawable.ic_menu_search);
+ menu.add(1, Id.menu.option.cancel, 0, R.string.btn_doNotSave).setShowAsAction(
+ MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ menu.add(1, Id.menu.option.okay, 1, R.string.btn_okay).setShowAsAction(
+ MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
return true;
}
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+
+ case Id.menu.option.okay:
+ okClicked();
+ return true;
+
+ case Id.menu.option.cancel:
+ cancelClicked();
+ return true;
+
+ default:
+ break;
+
+ }
+ return false;
+ }
}
diff --git a/org_apg/src/org/apg/ui/SelectSecretKeyListActivity.java b/org_apg/src/org/apg/ui/SelectSecretKeyListActivity.java
index 50f855ebc..774ce6e41 100644
--- a/org_apg/src/org/apg/ui/SelectSecretKeyListActivity.java
+++ b/org_apg/src/org/apg/ui/SelectSecretKeyListActivity.java
@@ -20,6 +20,7 @@ import org.apg.Apg;
import org.apg.Id;
import org.apg.R;
+import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.Menu;
import android.app.SearchManager;
@@ -46,10 +47,15 @@ public class SelectSecretKeyListActivity extends BaseActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
+ final ActionBar actionBar = getSupportActionBar();
+ actionBar.setDisplayShowTitleEnabled(true);
+ actionBar.setDisplayHomeAsUpEnabled(false);
+ actionBar.setHomeButtonEnabled(false);
setContentView(R.layout.select_secret_key);
+ setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
+
mList = (ListView) findViewById(R.id.list);
mList.setOnItemClickListener(new OnItemClickListener() {