From 2162c85c125a2155f29ddcd436d36ff9a472c3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 9 Jan 2014 15:12:41 +0100 Subject: use bootstrap buttons --- .../sufficientlysecure/keychain/ui/EncryptActivity.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 2dfdf254e..681548c9b 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -55,10 +55,8 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.animation.AnimationUtils; import android.widget.ArrayAdapter; -import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; -import android.widget.ImageButton; import android.widget.ImageView; import android.widget.Spinner; import android.widget.TextView; @@ -68,6 +66,7 @@ import android.widget.ViewFlipper; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; +import com.beardedhen.androidbootstrap.BootstrapButton; public class EncryptActivity extends SherlockFragmentActivity { @@ -87,7 +86,7 @@ public class EncryptActivity extends SherlockFragmentActivity { private long mEncryptionKeyIds[] = null; private EditText mMessage = null; - private Button mSelectKeysButton = null; + private BootstrapButton mSelectKeysButton = null; private boolean mEncryptEnabled = false; private String mEncryptString = ""; @@ -117,7 +116,7 @@ public class EncryptActivity extends SherlockFragmentActivity { private EditText mFilename = null; private CheckBox mDeleteAfter = null; - private ImageButton mBrowse = null; + private BootstrapButton mBrowse = null; private String mInputFilename = null; private String mOutputFilename = null; @@ -825,7 +824,7 @@ public class EncryptActivity extends SherlockFragmentActivity { mModeLabel.setOnClickListener(nextModeClickListener); mMessage = (EditText) findViewById(R.id.message); - mSelectKeysButton = (Button) findViewById(R.id.btn_selectEncryptKeys); + mSelectKeysButton = (BootstrapButton) findViewById(R.id.btn_selectEncryptKeys); mSign = (CheckBox) findViewById(R.id.sign); mMainUserId = (TextView) findViewById(R.id.mainUserId); mMainUserIdRest = (TextView) findViewById(R.id.mainUserIdRest); @@ -841,7 +840,7 @@ public class EncryptActivity extends SherlockFragmentActivity { mMessage.setMinimumHeight(height); mFilename = (EditText) findViewById(R.id.filename); - mBrowse = (ImageButton) findViewById(R.id.btn_browse); + mBrowse = (BootstrapButton) findViewById(R.id.btn_browse); mBrowse.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { FileHelper.openFile(EncryptActivity.this, mFilename.getText().toString(), "*/*", @@ -896,9 +895,9 @@ public class EncryptActivity extends SherlockFragmentActivity { private void updateView() { if (mEncryptionKeyIds == null || mEncryptionKeyIds.length == 0) { - mSelectKeysButton.setText(R.string.no_keys_selected); + mSelectKeysButton.setText(getString(R.string.no_keys_selected)); } else if (mEncryptionKeyIds.length == 1) { - mSelectKeysButton.setText(R.string.one_key_selected); + mSelectKeysButton.setText(getString(R.string.one_key_selected)); } else { mSelectKeysButton.setText("" + mEncryptionKeyIds.length + " " + getResources().getString(R.string.n_keys_selected)); -- cgit v1.2.3 From bb161d5fa9d56c5fc7369c979d6fd4eeff187987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 9 Jan 2014 22:58:52 +0100 Subject: implement navigation drawer --- .../keychain/ui/EncryptActivity.java | 34 ++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 681548c9b..24caebb3a 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -63,12 +63,11 @@ import android.widget.TextView; import android.widget.Toast; import android.widget.ViewFlipper; -import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; import com.beardedhen.androidbootstrap.BootstrapButton; -public class EncryptActivity extends SherlockFragmentActivity { +public class EncryptActivity extends DrawerActivity { /* Intents */ public static final String ACTION_ENCRYPT = Constants.INTENT_PREFIX + "ENCRYPT"; @@ -153,13 +152,6 @@ public class EncryptActivity extends SherlockFragmentActivity { public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - // app icon in Action Bar clicked; go home - Intent intent = new Intent(this, MainActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(intent); - return true; - case Id.menu.option.encrypt_to_clipboard: encryptToClipboardClicked(); @@ -187,6 +179,8 @@ public class EncryptActivity extends SherlockFragmentActivity { initView(); + setupDrawerNavigation(savedInstanceState); + // Handle intent actions handleActions(getIntent()); @@ -491,8 +485,9 @@ public class EncryptActivity extends SherlockFragmentActivity { if (!file.exists() || !file.isFile()) { Toast.makeText( this, - getString(R.string.error_message, getString(R.string.error_file_not_found)), - Toast.LENGTH_SHORT).show(); + getString(R.string.error_message, + getString(R.string.error_file_not_found)), Toast.LENGTH_SHORT) + .show(); return; } } @@ -510,7 +505,8 @@ public class EncryptActivity extends SherlockFragmentActivity { gotPassPhrase = (passPhrase.length() != 0); if (!gotPassPhrase) { - Toast.makeText(this, R.string.passphrase_must_not_be_empty, Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.passphrase_must_not_be_empty, Toast.LENGTH_SHORT) + .show(); return; } } else { @@ -522,8 +518,8 @@ public class EncryptActivity extends SherlockFragmentActivity { } if (!encryptIt && mSecretKeyId == 0) { - Toast.makeText(this, R.string.select_encryption_or_signature_key, Toast.LENGTH_SHORT) - .show(); + Toast.makeText(this, R.string.select_encryption_or_signature_key, + Toast.LENGTH_SHORT).show(); return; } @@ -852,10 +848,12 @@ public class EncryptActivity extends SherlockFragmentActivity { Choice[] choices = new Choice[] { new Choice(Id.choice.compression.none, getString(R.string.choice_none) + " (" + getString(R.string.compression_fast) + ")"), - new Choice(Id.choice.compression.zip, "ZIP (" + getString(R.string.compression_fast) + ")"), - new Choice(Id.choice.compression.zlib, "ZLIB (" + getString(R.string.compression_fast) + ")"), - new Choice(Id.choice.compression.bzip2, "BZIP2 (" + getString(R.string.compression_very_slow) - + ")"), }; + new Choice(Id.choice.compression.zip, "ZIP (" + + getString(R.string.compression_fast) + ")"), + new Choice(Id.choice.compression.zlib, "ZLIB (" + + getString(R.string.compression_fast) + ")"), + new Choice(Id.choice.compression.bzip2, "BZIP2 (" + + getString(R.string.compression_very_slow) + ")"), }; ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, choices); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); -- cgit v1.2.3 From 100ae50e02ef3dfd0330a6e1e7084726ddea69a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 12 Jan 2014 21:33:37 +0100 Subject: cleanup layouts, prepare layouts for new key view --- .../src/org/sufficientlysecure/keychain/ui/EncryptActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 24caebb3a..c974dfd46 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -172,7 +172,7 @@ public class EncryptActivity extends DrawerActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.encrypt); + setContentView(R.layout.encrypt_activity); // set actionbar without home button if called from another app ActionBarHelper.setBackButton(this); -- cgit v1.2.3