constantly modernizing the ui
@ -72,7 +72,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.EditKeyActivity"
|
android:name=".ui.EditKeyActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|keyboard"
|
android:configChanges="keyboardHidden|orientation|keyboard"
|
||||||
android:label="@string/title_editKey" />
|
android:label="@string/title_editKey"
|
||||||
|
android:uiOptions="splitActionBarWhenNarrow" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.SelectPublicKeyListActivity"
|
android:name=".ui.SelectPublicKeyListActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|keyboard"
|
android:configChanges="keyboardHidden|orientation|keyboard"
|
||||||
|
BIN
org_apg/res/drawable-hdpi/abs__ab_bottom_solid_light_holo.9.png
Normal file
After Width: | Height: | Size: 144 B |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.7 KiB |
BIN
org_apg/res/drawable-mdpi/abs__ab_bottom_solid_light_holo.9.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
org_apg/res/drawable-xhdpi/abs__ab_bottom_solid_light_holo.9.png
Normal file
After Width: | Height: | Size: 166 B |
@ -62,26 +62,26 @@
|
|||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout -->
|
||||||
android:layout_width="fill_parent"
|
<!-- android:layout_width="fill_parent" -->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content" -->
|
||||||
android:orientation="horizontal"
|
<!-- android:orientation="horizontal" -->
|
||||||
style="@android:style/ButtonBar">
|
<!-- style="@android:style/ButtonBar"> -->
|
||||||
|
|
||||||
<Button
|
<!-- <Button -->
|
||||||
android:id="@+id/btn_save"
|
<!-- android:id="@+id/btn_save" -->
|
||||||
android:layout_width="0dip"
|
<!-- android:layout_width="0dip" -->
|
||||||
android:layout_height="fill_parent"
|
<!-- android:layout_height="fill_parent" -->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1" -->
|
||||||
android:text="@string/btn_save"/>
|
<!-- android:text="@string/btn_save"/> -->
|
||||||
|
|
||||||
<Button
|
<!-- <Button -->
|
||||||
android:id="@+id/btn_discard"
|
<!-- android:id="@+id/btn_discard" -->
|
||||||
android:layout_width="0dip"
|
<!-- android:layout_width="0dip" -->
|
||||||
android:layout_height="fill_parent"
|
<!-- android:layout_height="fill_parent" -->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1" -->
|
||||||
android:text="@string/btn_doNotSave"/>
|
<!-- android:text="@string/btn_doNotSave"/> -->
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- </LinearLayout> -->
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
|
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<!-- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" -->
|
||||||
|
<!-- android:layout_width="fill_parent" -->
|
||||||
|
<!-- android:layout_height="fill_parent" -->
|
||||||
|
<!-- android:orientation="vertical" -->
|
||||||
|
<!-- android:paddingTop="5dip" > -->
|
||||||
|
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical"
|
android:layout_margin="10dip"
|
||||||
android:paddingTop="5dip" >
|
android:fillViewport="true" >
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="0dip"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:fillViewport="true"
|
|
||||||
android:padding="10dip" >
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_marginLeft="5dip"
|
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -322,27 +320,26 @@
|
|||||||
android:layout_marginBottom="5dip"
|
android:layout_marginBottom="5dip"
|
||||||
android:background="?android:attr/listDivider" />
|
android:background="?android:attr/listDivider" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<LinearLayout
|
</ScrollView> <!-- <LinearLayout -->
|
||||||
style="@android:style/ButtonBar"
|
<!-- style="@android:style/ButtonBar" -->
|
||||||
android:layout_width="fill_parent"
|
<!-- android:layout_width="fill_parent" -->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content" -->
|
||||||
android:orientation="horizontal" >
|
<!-- android:orientation="horizontal" > -->
|
||||||
|
|
||||||
<Button
|
<!-- <Button -->
|
||||||
android:id="@+id/btn_encryptToClipboard"
|
<!-- android:id="@+id/btn_encryptToClipboard" -->
|
||||||
android:layout_width="0dip"
|
<!-- android:layout_width="0dip" -->
|
||||||
android:layout_height="fill_parent"
|
<!-- android:layout_height="fill_parent" -->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1" -->
|
||||||
android:text="@string/btn_encryptToClipboard" />
|
<!-- android:text="@string/btn_encryptToClipboard" /> -->
|
||||||
|
|
||||||
<Button
|
<!-- <Button -->
|
||||||
android:id="@+id/btn_encrypt"
|
<!-- android:id="@+id/btn_encrypt" -->
|
||||||
android:layout_width="0dip"
|
<!-- android:layout_width="0dip" -->
|
||||||
android:layout_height="fill_parent"
|
<!-- android:layout_height="fill_parent" -->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1" -->
|
||||||
android:text="@string/btn_encrypt" />
|
<!-- android:text="@string/btn_encrypt" /> -->
|
||||||
</LinearLayout>
|
<!-- </LinearLayout> -->
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- </LinearLayout> -->
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
|
<!--
|
||||||
|
Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -14,18 +15,31 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<include android:id="@+id/layout_filter" layout="@layout/filter_info"/>
|
<include
|
||||||
|
android:id="@+id/layout_filter"
|
||||||
|
layout="@layout/filter_info" />
|
||||||
|
|
||||||
<ExpandableListView
|
<ExpandableListView
|
||||||
android:id="@+id/list"
|
android:id="@+id/list"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
android:isScrollContainer="true" />
|
android:isScrollContainer="true" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="90dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/abs__ab_bottom_solid_light_holo"
|
||||||
|
android:paddingBottom="3dp"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingTop="3dp"
|
||||||
|
android:text="@string/listInformation" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -55,10 +55,10 @@
|
|||||||
<string name="section_advanced">Advanced</string>
|
<string name="section_advanced">Advanced</string>
|
||||||
|
|
||||||
<!-- btn_lowerCase: capitalized words, no punctuation -->
|
<!-- btn_lowerCase: capitalized words, no punctuation -->
|
||||||
<string name="btn_signToClipboard">Sign To Clipboard</string>
|
<string name="btn_signToClipboard">Sign (Clipboard)</string>
|
||||||
<string name="btn_encryptToClipboard">Encrypt To Clipboard</string>
|
<string name="btn_encryptToClipboard">Encrypt (Clipboard)</string>
|
||||||
<string name="btn_encryptAndEmail">Encrypt And Email</string>
|
<string name="btn_encryptAndEmail">Encrypt (Email)</string>
|
||||||
<string name="btn_signAndEmail">Sign And Email</string>
|
<string name="btn_signAndEmail">Sign (Email)</string>
|
||||||
<string name="btn_encrypt">Encrypt</string>
|
<string name="btn_encrypt">Encrypt</string>
|
||||||
<string name="btn_sign">Sign</string>
|
<string name="btn_sign">Sign</string>
|
||||||
<string name="btn_decrypt">Decrypt</string>
|
<string name="btn_decrypt">Decrypt</string>
|
||||||
@ -222,6 +222,7 @@
|
|||||||
<string name="keySendSuccess">Successfully sent key to server</string>
|
<string name="keySendSuccess">Successfully sent key to server</string>
|
||||||
<string name="keySignSuccess">Successfully signed key</string>
|
<string name="keySignSuccess">Successfully signed key</string>
|
||||||
<string name="qrScanImportSuccess">Successfully validated and imported key</string>
|
<string name="qrScanImportSuccess">Successfully validated and imported key</string>
|
||||||
|
<string name="listInformation">Long press one entry in this list to show more options!</string>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
error_lowerCase: phrases, no punctuation, all lowercase,
|
error_lowerCase: phrases, no punctuation, all lowercase,
|
||||||
|
@ -45,8 +45,11 @@ public final class Id {
|
|||||||
public static final int key_server = 0x21070011;
|
public static final int key_server = 0x21070011;
|
||||||
public static final int scanQRCode = 0x21070012;
|
public static final int scanQRCode = 0x21070012;
|
||||||
public static final int encrypt = 0x21070013;
|
public static final int encrypt = 0x21070013;
|
||||||
public static final int decrypt = 0x21070014;
|
public static final int encrypt_to_clipboard = 0x21070014;
|
||||||
public static final int encrypt_ = 0x21070015;
|
public static final int decrypt = 0x21070015;
|
||||||
|
public static final int decrypt_to_clipboard = 0x21070016;
|
||||||
|
public static final int cancel = 0x21070017;
|
||||||
|
public static final int save = 0x21070018;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ import org.spongycastle.openpgp.PGPSecretKeyRing;
|
|||||||
import org.apg.R;
|
import org.apg.R;
|
||||||
|
|
||||||
import com.actionbarsherlock.view.Menu;
|
import com.actionbarsherlock.view.Menu;
|
||||||
|
import com.actionbarsherlock.view.MenuItem;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@ -51,21 +52,55 @@ import java.security.NoSuchProviderException;
|
|||||||
import java.security.SignatureException;
|
import java.security.SignatureException;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
public class EditKeyActivity extends BaseActivity implements OnClickListener {
|
public class EditKeyActivity extends BaseActivity {
|
||||||
|
|
||||||
private PGPSecretKeyRing mKeyRing = null;
|
private PGPSecretKeyRing mKeyRing = null;
|
||||||
|
|
||||||
private SectionView mUserIds;
|
private SectionView mUserIds;
|
||||||
private SectionView mKeys;
|
private SectionView mKeys;
|
||||||
|
|
||||||
private Button mSaveButton;
|
// private Button mSaveButton;
|
||||||
private Button mDiscardButton;
|
// private Button mDiscardButton;
|
||||||
|
|
||||||
private String mCurrentPassPhrase = null;
|
private String mCurrentPassPhrase = null;
|
||||||
private String mNewPassPhrase = null;
|
private String mNewPassPhrase = null;
|
||||||
|
|
||||||
private Button mChangePassPhrase;
|
private Button mChangePassPhrase;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
menu.add(2, 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)
|
||||||
|
// .setIcon(R.drawable.ic_suggestions_add)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
|
||||||
|
case android.R.id.home:
|
||||||
|
startActivity(new Intent(this, SecretKeyListActivity.class));
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case Id.menu.option.save:
|
||||||
|
saveClicked();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case Id.menu.option.cancel:
|
||||||
|
finish();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -103,11 +138,11 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mSaveButton = (Button) findViewById(R.id.btn_save);
|
// mSaveButton = (Button) findViewById(R.id.btn_save);
|
||||||
mDiscardButton = (Button) findViewById(R.id.btn_discard);
|
// mDiscardButton = (Button) findViewById(R.id.btn_discard);
|
||||||
|
|
||||||
mSaveButton.setOnClickListener(this);
|
// mSaveButton.setOnClickListener(this);
|
||||||
mDiscardButton.setOnClickListener(this);
|
// mDiscardButton.setOnClickListener(this);
|
||||||
|
|
||||||
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
|
||||||
@ -128,9 +163,9 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
|
|||||||
|
|
||||||
updatePassPhraseButtonText();
|
updatePassPhraseButtonText();
|
||||||
|
|
||||||
Toast.makeText(this,
|
// Toast.makeText(this,
|
||||||
getString(R.string.warningMessage, getString(R.string.keyEditingIsBeta)),
|
// getString(R.string.warningMessage, getString(R.string.keyEditingIsBeta)),
|
||||||
Toast.LENGTH_LONG).show();
|
// Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getMasterKeyId() {
|
private long getMasterKeyId() {
|
||||||
@ -145,14 +180,14 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
|
|||||||
|| (mNewPassPhrase != null && !mNewPassPhrase.equals(""));
|
|| (mNewPassPhrase != null && !mNewPassPhrase.equals(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
// public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
menu.add(0, Id.menu.option.preferences, 0, R.string.menu_preferences).setIcon(
|
// menu.add(0, Id.menu.option.preferences, 0, R.string.menu_preferences).setIcon(
|
||||||
android.R.drawable.ic_menu_preferences);
|
// android.R.drawable.ic_menu_preferences);
|
||||||
menu.add(0, Id.menu.option.about, 1, R.string.menu_about).setIcon(
|
// menu.add(0, Id.menu.option.about, 1, R.string.menu_about).setIcon(
|
||||||
android.R.drawable.ic_menu_info_details);
|
// android.R.drawable.ic_menu_info_details);
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dialog onCreateDialog(int id) {
|
protected Dialog onCreateDialog(int id) {
|
||||||
@ -210,14 +245,14 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick(View v) {
|
// public void onClick(View v) {
|
||||||
if (v == mSaveButton) {
|
// if (v == mSaveButton) {
|
||||||
// TODO: some warning
|
// // TODO: some warning
|
||||||
saveClicked();
|
// saveClicked();
|
||||||
} else if (v == mDiscardButton) {
|
// } else if (v == mDiscardButton) {
|
||||||
finish();
|
// finish();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
private void saveClicked() {
|
private void saveClicked() {
|
||||||
if (!havePassPhrase()) {
|
if (!havePassPhrase()) {
|
||||||
|
@ -76,8 +76,13 @@ public class EncryptActivity extends BaseActivity {
|
|||||||
private boolean mReturnResult = false;
|
private boolean mReturnResult = false;
|
||||||
private EditText mMessage = null;
|
private EditText mMessage = null;
|
||||||
private Button mSelectKeysButton = null;
|
private Button mSelectKeysButton = null;
|
||||||
private Button mEncryptButton = null;
|
// private Button mEncryptButton = null;
|
||||||
private Button mEncryptToClipboardButton = null;
|
private boolean mEncryptEnabled = false;
|
||||||
|
private String mEncryptString = "";
|
||||||
|
// private Button mEncryptToClipboardButton = null;
|
||||||
|
private boolean mEncryptToClipboardEnabled = false;
|
||||||
|
private String mEncryptToClipboardString = "";
|
||||||
|
|
||||||
private CheckBox mSign = null;
|
private CheckBox mSign = null;
|
||||||
private TextView mMainUserId = null;
|
private TextView mMainUserId = null;
|
||||||
private TextView mMainUserIdRest = null;
|
private TextView mMainUserIdRest = null;
|
||||||
@ -118,8 +123,16 @@ public class EncryptActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
menu.add(1, Id.menu.option.encrypt, 0, R.string.btn_encrypt)
|
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
if (mEncryptToClipboardEnabled) {
|
||||||
|
menu.add(1, Id.menu.option.encrypt_to_clipboard, 0, mEncryptToClipboardString)
|
||||||
|
.setShowAsAction(
|
||||||
|
MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
|
}
|
||||||
|
if (mEncryptEnabled) {
|
||||||
|
menu.add(1, Id.menu.option.encrypt, 1, mEncryptString).setShowAsAction(
|
||||||
|
MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -127,15 +140,13 @@ public class EncryptActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case Id.menu.option.key_server: {
|
case Id.menu.option.encrypt_to_clipboard: {
|
||||||
startActivity(new Intent(this, KeyServerQueryActivity.class));
|
encryptToClipboardClicked();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case Id.menu.option.scanQRCode: {
|
case Id.menu.option.encrypt: {
|
||||||
Intent intent = new Intent(this, ImportFromQRCodeActivity.class);
|
encryptClicked();
|
||||||
intent.setAction(Apg.Intent.IMPORT_FROM_QR_CODE);
|
|
||||||
startActivityForResult(intent, Id.request.import_from_qr_code);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -220,8 +231,8 @@ public class EncryptActivity extends BaseActivity {
|
|||||||
|
|
||||||
mMessage = (EditText) findViewById(R.id.message);
|
mMessage = (EditText) findViewById(R.id.message);
|
||||||
mSelectKeysButton = (Button) findViewById(R.id.btn_selectEncryptKeys);
|
mSelectKeysButton = (Button) findViewById(R.id.btn_selectEncryptKeys);
|
||||||
mEncryptButton = (Button) findViewById(R.id.btn_encrypt);
|
// mEncryptButton = (Button) findViewById(R.id.btn_encrypt);
|
||||||
mEncryptToClipboardButton = (Button) findViewById(R.id.btn_encryptToClipboard);
|
// mEncryptToClipboardButton = (Button) findViewById(R.id.btn_encryptToClipboard);
|
||||||
mSign = (CheckBox) findViewById(R.id.sign);
|
mSign = (CheckBox) findViewById(R.id.sign);
|
||||||
mMainUserId = (TextView) findViewById(R.id.mainUserId);
|
mMainUserId = (TextView) findViewById(R.id.mainUserId);
|
||||||
mMainUserIdRest = (TextView) findViewById(R.id.mainUserIdRest);
|
mMainUserIdRest = (TextView) findViewById(R.id.mainUserIdRest);
|
||||||
@ -275,17 +286,17 @@ public class EncryptActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mEncryptToClipboardButton.setOnClickListener(new OnClickListener() {
|
// mEncryptToClipboardButton.setOnClickListener(new OnClickListener() {
|
||||||
public void onClick(View v) {
|
// public void onClick(View v) {
|
||||||
encryptToClipboardClicked();
|
// encryptToClipboardClicked();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
mEncryptButton.setOnClickListener(new OnClickListener() {
|
// mEncryptButton.setOnClickListener(new OnClickListener() {
|
||||||
public void onClick(View v) {
|
// public void onClick(View v) {
|
||||||
encryptClicked();
|
// encryptClicked();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
mSelectKeysButton.setOnClickListener(new OnClickListener() {
|
mSelectKeysButton.setOnClickListener(new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -479,57 +490,93 @@ public class EncryptActivity extends BaseActivity {
|
|||||||
private void updateButtons() {
|
private void updateButtons() {
|
||||||
switch (mSource.getCurrentView().getId()) {
|
switch (mSource.getCurrentView().getId()) {
|
||||||
case R.id.sourceFile: {
|
case R.id.sourceFile: {
|
||||||
mEncryptToClipboardButton.setVisibility(View.INVISIBLE);
|
mEncryptEnabled = true;
|
||||||
mEncryptButton.setText(R.string.btn_encrypt);
|
mEncryptToClipboardEnabled = false;
|
||||||
|
|
||||||
|
// mEncryptToClipboardButton.setVisibility(View.INVISIBLE);
|
||||||
|
// mEncryptButton.setText(R.string.btn_encrypt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case R.id.sourceMessage: {
|
case R.id.sourceMessage: {
|
||||||
mSourceLabel.setText(R.string.label_message);
|
mSourceLabel.setText(R.string.label_message);
|
||||||
if (mReturnResult) {
|
if (mReturnResult) {
|
||||||
mEncryptToClipboardButton.setVisibility(View.INVISIBLE);
|
mEncryptToClipboardEnabled = false;
|
||||||
|
// mEncryptToClipboardButton.setVisibility(View.INVISIBLE);
|
||||||
} else {
|
} else {
|
||||||
mEncryptToClipboardButton.setVisibility(View.VISIBLE);
|
mEncryptToClipboardEnabled = true;
|
||||||
|
// mEncryptToClipboardButton.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (mMode.getCurrentView().getId() == R.id.modeSymmetric) {
|
if (mMode.getCurrentView().getId() == R.id.modeSymmetric) {
|
||||||
if (mReturnResult) {
|
if (mReturnResult) {
|
||||||
mEncryptButton.setText(R.string.btn_encrypt);
|
mEncryptString = getString(R.string.btn_encrypt);
|
||||||
|
// mEncryptButton.setText(R.string.btn_encrypt);
|
||||||
} else {
|
} else {
|
||||||
mEncryptButton.setText(R.string.btn_encryptAndEmail);
|
mEncryptString = getString(R.string.btn_encryptAndEmail);
|
||||||
|
|
||||||
|
// mEncryptButton.setText(R.string.btn_encryptAndEmail);
|
||||||
}
|
}
|
||||||
mEncryptButton.setEnabled(true);
|
mEncryptEnabled = true;
|
||||||
mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard);
|
mEncryptToClipboardString = getString(R.string.btn_encryptToClipboard);
|
||||||
mEncryptToClipboardButton.setEnabled(true);
|
mEncryptToClipboardEnabled = true;
|
||||||
|
|
||||||
|
// mEncryptButton.setEnabled(true);
|
||||||
|
// mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard);
|
||||||
|
// mEncryptToClipboardButton.setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
if (mEncryptionKeyIds == null || mEncryptionKeyIds.length == 0) {
|
if (mEncryptionKeyIds == null || mEncryptionKeyIds.length == 0) {
|
||||||
if (getSecretKeyId() == 0) {
|
if (getSecretKeyId() == 0) {
|
||||||
if (mReturnResult) {
|
if (mReturnResult) {
|
||||||
mEncryptButton.setText(R.string.btn_encrypt);
|
mEncryptString = getString(R.string.btn_encrypt);
|
||||||
|
// mEncryptButton.setText(R.string.btn_encrypt);
|
||||||
} else {
|
} else {
|
||||||
mEncryptButton.setText(R.string.btn_encryptAndEmail);
|
mEncryptString = getString(R.string.btn_encryptAndEmail);
|
||||||
|
|
||||||
|
// mEncryptButton.setText(R.string.btn_encryptAndEmail);
|
||||||
}
|
}
|
||||||
mEncryptButton.setEnabled(false);
|
mEncryptEnabled = false;
|
||||||
mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard);
|
mEncryptToClipboardString = getString(R.string.btn_encryptToClipboard);
|
||||||
mEncryptToClipboardButton.setEnabled(false);
|
mEncryptToClipboardEnabled = false;
|
||||||
|
|
||||||
|
// mEncryptButton.setEnabled(false);
|
||||||
|
// mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard);
|
||||||
|
// mEncryptToClipboardButton.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
if (mReturnResult) {
|
if (mReturnResult) {
|
||||||
mEncryptButton.setText(R.string.btn_sign);
|
mEncryptString = getString(R.string.btn_sign);
|
||||||
|
|
||||||
|
// mEncryptButton.setText(R.string.btn_sign);
|
||||||
} else {
|
} else {
|
||||||
mEncryptButton.setText(R.string.btn_signAndEmail);
|
mEncryptString = getString(R.string.btn_signAndEmail);
|
||||||
|
|
||||||
|
// mEncryptButton.setText(R.string.btn_signAndEmail);
|
||||||
}
|
}
|
||||||
mEncryptButton.setEnabled(true);
|
|
||||||
mEncryptToClipboardButton.setText(R.string.btn_signToClipboard);
|
mEncryptEnabled = true;
|
||||||
mEncryptToClipboardButton.setEnabled(true);
|
mEncryptToClipboardString = getString(R.string.btn_signToClipboard);
|
||||||
|
mEncryptToClipboardEnabled = true;
|
||||||
|
|
||||||
|
// mEncryptButton.setEnabled(true);
|
||||||
|
// mEncryptToClipboardButton.setText(R.string.btn_signToClipboard);
|
||||||
|
// mEncryptToClipboardButton.setEnabled(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mReturnResult) {
|
if (mReturnResult) {
|
||||||
mEncryptButton.setText(R.string.btn_encrypt);
|
mEncryptString = getString(R.string.btn_encrypt);
|
||||||
|
|
||||||
|
// mEncryptButton.setText(R.string.btn_encrypt);
|
||||||
} else {
|
} else {
|
||||||
mEncryptButton.setText(R.string.btn_encryptAndEmail);
|
mEncryptString = getString(R.string.btn_encryptAndEmail);
|
||||||
|
|
||||||
|
// mEncryptButton.setText(R.string.btn_encryptAndEmail);
|
||||||
}
|
}
|
||||||
mEncryptButton.setEnabled(true);
|
|
||||||
mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard);
|
mEncryptEnabled = true;
|
||||||
mEncryptToClipboardButton.setEnabled(true);
|
mEncryptToClipboardString = getString(R.string.btn_encryptToClipboard);
|
||||||
|
mEncryptToClipboardEnabled = true;
|
||||||
|
// mEncryptButton.setEnabled(true);
|
||||||
|
// mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard);
|
||||||
|
// mEncryptToClipboardButton.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -539,6 +586,9 @@ public class EncryptActivity extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// build new action bar
|
||||||
|
invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMode() {
|
private void updateMode() {
|
||||||
|
@ -68,7 +68,7 @@ public class MainActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void decryptOnClick(View view) {
|
public void decryptOnClick(View view) {
|
||||||
Intent intent = new Intent(MainActivity.this, EncryptActivity.class);
|
Intent intent = new Intent(MainActivity.this, DecryptActivity.class);
|
||||||
intent.setAction(Apg.Intent.DECRYPT);
|
intent.setAction(Apg.Intent.DECRYPT);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
@ -49,23 +49,24 @@ public class PublicKeyListActivity extends KeyListActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
menu.add(1, Id.menu.option.key_server, 0, R.string.menu_keyServer)
|
menu.add(1, Id.menu.option.search, 0, R.string.menu_search)
|
||||||
.setIcon(R.drawable.ic_menu_find_holo_light)
|
.setIcon(R.drawable.ic_menu_search_holo_light)
|
||||||
.setShowAsAction(
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||||
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
|
||||||
menu.add(1, Id.menu.option.scanQRCode, 1, R.string.menu_scanQRCode)
|
menu.add(1, Id.menu.option.scanQRCode, 1, R.string.menu_scanQRCode)
|
||||||
// .setIcon(R.drawable.ic_suggestions_add)
|
// .setIcon(R.drawable.ic_suggestions_add)
|
||||||
.setShowAsAction(
|
.setShowAsAction(
|
||||||
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
menu.add(0, Id.menu.option.import_keys, 2, R.string.menu_importKeys)
|
|
||||||
|
menu.add(1, Id.menu.option.key_server, 2, R.string.menu_keyServer)
|
||||||
|
.setIcon(R.drawable.ic_menu_find_holo_light)
|
||||||
|
.setShowAsAction(
|
||||||
|
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
|
menu.add(0, Id.menu.option.import_keys, 3, R.string.menu_importKeys)
|
||||||
// .setIcon(R.drawable.ic_suggestions_add)
|
// .setIcon(R.drawable.ic_suggestions_add)
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
menu.add(0, Id.menu.option.export_keys, 3, R.string.menu_exportKeys)
|
menu.add(0, Id.menu.option.export_keys, 4, R.string.menu_exportKeys)
|
||||||
// .setIcon(R.drawable.ic_menu_share_holo_light)
|
// .setIcon(R.drawable.ic_menu_share_holo_light)
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
menu.add(1, Id.menu.option.search, 4, R.string.menu_search)
|
|
||||||
.setIcon(R.drawable.ic_menu_search_holo_light)
|
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -54,20 +54,20 @@ public class SecretKeyListActivity extends KeyListActivity implements OnChildCli
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
menu.add(1, Id.menu.option.create, 0, R.string.menu_createKey)
|
menu.add(3, Id.menu.option.search, 0, R.string.menu_search)
|
||||||
|
.setIcon(R.drawable.ic_menu_search_holo_light)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||||
|
menu.add(1, Id.menu.option.create, 1, R.string.menu_createKey)
|
||||||
.setIcon(R.drawable.ic_suggestions_add)
|
.setIcon(R.drawable.ic_suggestions_add)
|
||||||
.setShowAsAction(
|
.setShowAsAction(
|
||||||
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
menu.add(0, Id.menu.option.import_keys, 1, R.string.menu_importKeys)
|
menu.add(0, Id.menu.option.import_keys, 2, R.string.menu_importKeys)
|
||||||
// .setIcon(R.drawable.ic_menu_find_holo_light)
|
// .setIcon(R.drawable.ic_menu_find_holo_light)
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
menu.add(0, Id.menu.option.export_keys, 2, R.string.menu_exportKeys)
|
menu.add(0, Id.menu.option.export_keys, 3, R.string.menu_exportKeys)
|
||||||
// .setIcon(R.drawable.ic_menu_find_holo_light)
|
// .setIcon(R.drawable.ic_menu_find_holo_light)
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
|
|
||||||
menu.add(3, Id.menu.option.search, 3, R.string.menu_search)
|
|
||||||
.setIcon(R.drawable.ic_menu_search_holo_light)
|
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|