More code style fixes for /ui

This commit is contained in:
uberspot 2014-03-13 20:41:53 +02:00
parent 37c81400ac
commit dc5c34ffc5
16 changed files with 90 additions and 52 deletions

View File

@ -98,7 +98,7 @@ public class EditKeyActivity extends ActionBarActivity {
Vector<String> mUserIds; Vector<String> mUserIds;
Vector<PGPSecretKey> mKeys; Vector<PGPSecretKey> mKeys;
Vector<Integer> mKeysUsages; Vector<Integer> mKeysUsages;
boolean masterCanSign = true; boolean mMasterCanSign = true;
ExportHelper mExportHelper; ExportHelper mExportHelper;
@ -264,8 +264,8 @@ public class EditKeyActivity extends ActionBarActivity {
// get master key id using row id // get master key id using row id
long masterKeyId = ProviderHelper.getMasterKeyId(this, mDataUri); long masterKeyId = ProviderHelper.getMasterKeyId(this, mDataUri);
masterCanSign = ProviderHelper.getMasterKeyCanSign(this, mDataUri); mMasterCanSign = ProviderHelper.getMasterKeyCanSign(this, mDataUri);
finallyEdit(masterKeyId, masterCanSign); finallyEdit(masterKeyId, mMasterCanSign);
} }
} }
@ -432,12 +432,12 @@ public class EditKeyActivity extends ActionBarActivity {
LinearLayout container = (LinearLayout) findViewById(R.id.edit_key_container); LinearLayout container = (LinearLayout) findViewById(R.id.edit_key_container);
mUserIdsView = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false); mUserIdsView = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false);
mUserIdsView.setType(Id.type.user_id); mUserIdsView.setType(Id.type.user_id);
mUserIdsView.setCanEdit(masterCanSign); mUserIdsView.setCanEdit(mMasterCanSign);
mUserIdsView.setUserIds(mUserIds); mUserIdsView.setUserIds(mUserIds);
container.addView(mUserIdsView); container.addView(mUserIdsView);
mKeysView = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false); mKeysView = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false);
mKeysView.setType(Id.type.key); mKeysView.setType(Id.type.key);
mKeysView.setCanEdit(masterCanSign); mKeysView.setCanEdit(mMasterCanSign);
mKeysView.setKeys(mKeys, mKeysUsages); mKeysView.setKeys(mKeys, mKeysUsages);
container.addView(mKeysView); container.addView(mKeysView);
@ -493,12 +493,13 @@ public class EditKeyActivity extends ActionBarActivity {
} }
String passphrase = null; String passphrase = null;
if (mIsPassPhraseSet) if (mIsPassPhraseSet) {
passphrase = PassphraseCacheService.getCachedPassphrase(this, masterKeyId); passphrase = PassphraseCacheService.getCachedPassphrase(this, masterKeyId);
else } else {
passphrase = ""; passphrase = "";
}
if (passphrase == null) { if (passphrase == null) {
showPassphraseDialog(masterKeyId, masterCanSign); showPassphraseDialog(masterKeyId, mMasterCanSign);
} else { } else {
mCurrentPassphrase = passphrase; mCurrentPassphrase = passphrase;
finallySaveClicked(); finallySaveClicked();
@ -531,7 +532,7 @@ public class EditKeyActivity extends ActionBarActivity {
data.putSerializable(KeychainIntentService.SAVE_KEYRING_KEYS_EXPIRY_DATES, data.putSerializable(KeychainIntentService.SAVE_KEYRING_KEYS_EXPIRY_DATES,
getKeysExpiryDates(mKeysView)); getKeysExpiryDates(mKeysView));
data.putLong(KeychainIntentService.SAVE_KEYRING_MASTER_KEY_ID, getMasterKeyId()); data.putLong(KeychainIntentService.SAVE_KEYRING_MASTER_KEY_ID, getMasterKeyId());
data.putBoolean(KeychainIntentService.SAVE_KEYRING_CAN_SIGN, masterCanSign); data.putBoolean(KeychainIntentService.SAVE_KEYRING_CAN_SIGN, mMasterCanSign);
intent.putExtra(KeychainIntentService.EXTRA_DATA, data); intent.putExtra(KeychainIntentService.EXTRA_DATA, data);

View File

@ -76,4 +76,4 @@ public class HelpActivity extends ActionBarActivity {
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_about)), mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_about)),
HelpAboutFragment.class, null, (selectedTab == 4)); HelpAboutFragment.class, null, (selectedTab == 4));
} }
} }

View File

@ -58,8 +58,9 @@ public class ImportKeysClipboardFragment extends Fragment {
public void onClick(View v) { public void onClick(View v) {
CharSequence clipboardText = ClipboardReflection.getClipboardText(getActivity()); CharSequence clipboardText = ClipboardReflection.getClipboardText(getActivity());
String sendText = ""; String sendText = "";
if (clipboardText != null) if (clipboardText != null) {
sendText = clipboardText.toString(); sendText = clipboardText.toString();
}
mImportActivity.loadCallback(sendText.getBytes(), null, null, null); mImportActivity.loadCallback(sendText.getBytes(), null, null, null);
} }
}); });

View File

@ -178,7 +178,8 @@ public class ImportKeysListFragment extends ListFragment implements
} }
@Override @Override
public Loader<AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>> onCreateLoader(int id, Bundle args) { public Loader<AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>>
onCreateLoader(int id, Bundle args) {
switch (id) { switch (id) {
case LOADER_ID_BYTES: { case LOADER_ID_BYTES: {
InputData inputData = getInputData(mKeyBytes, mDataUri); InputData inputData = getInputData(mKeyBytes, mDataUri);

View File

@ -36,8 +36,8 @@ import android.text.TextUtils;
import android.view.*; import android.view.*;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.*; import android.widget.*;
import android.widget.AbsListView.MultiChoiceModeListener;
import com.beardedhen.androidbootstrap.BootstrapButton; import com.beardedhen.androidbootstrap.BootstrapButton;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.Id;
@ -63,7 +63,8 @@ import java.util.HashMap;
* Public key list with sticky list headers. It does _not_ extend ListFragment because it uses * Public key list with sticky list headers. It does _not_ extend ListFragment because it uses
* StickyListHeaders library which does not extend upon ListView. * StickyListHeaders library which does not extend upon ListView.
*/ */
public class KeyListFragment extends Fragment implements SearchView.OnQueryTextListener, AdapterView.OnItemClickListener, public class KeyListFragment extends Fragment
implements SearchView.OnQueryTextListener, AdapterView.OnItemClickListener,
LoaderManager.LoaderCallbacks<Cursor> { LoaderManager.LoaderCallbacks<Cursor> {
private KeyListAdapter mAdapter; private KeyListAdapter mAdapter;
@ -185,7 +186,10 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
// todo: public/secret needs to be handled differently here // todo: public/secret needs to be handled differently here
ids = mStickyList.getWrappedList().getCheckedItemIds(); ids = mStickyList.getWrappedList().getCheckedItemIds();
ExportHelper mExportHelper = new ExportHelper((ActionBarActivity) getActivity()); ExportHelper mExportHelper = new ExportHelper((ActionBarActivity) getActivity());
mExportHelper.showExportKeysDialog(ids, Id.type.public_key, Constants.path.APP_DIR_FILE_PUB); mExportHelper
.showExportKeysDialog(ids,
Id.type.public_key,
Constants.path.APP_DIR_FILE_PUB);
break; break;
} }
case R.id.menu_key_list_multi_select_all: { case R.id.menu_key_list_multi_select_all: {
@ -310,7 +314,10 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
} else { } else {
viewIntent = new Intent(getActivity(), ViewKeyActivityJB.class); viewIntent = new Intent(getActivity(), ViewKeyActivityJB.class);
} }
viewIntent.setData(KeychainContract.KeyRings.buildPublicKeyRingsByMasterKeyIdUri(Long.toString(mAdapter.getMasterKeyId(position)))); viewIntent.setData(
KeychainContract
.KeyRings.buildPublicKeyRingsByMasterKeyIdUri(
Long.toString(mAdapter.getMasterKeyId(position))));
startActivity(viewIntent); startActivity(viewIntent);
} }
@ -347,8 +354,12 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
for (String userId : notDeleted) { for (String userId : notDeleted) {
notDeletedMsg += userId + "\n"; notDeletedMsg += userId + "\n";
} }
Toast.makeText(getActivity(), getString(R.string.error_can_not_delete_contacts, notDeletedMsg) Toast.makeText(getActivity(),
+ getResources().getQuantityString(R.plurals.error_can_not_delete_info, notDeleted.size()), getString(R.string.error_can_not_delete_contacts, notDeletedMsg)
+ getResources()
.getQuantityString(
R.plurals.error_can_not_delete_info,
notDeleted.size()),
Toast.LENGTH_LONG).show(); Toast.LENGTH_LONG).show();
mode.finish(); mode.finish();
@ -507,7 +518,9 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
button.setOnClickListener(new OnClickListener() { button.setOnClickListener(new OnClickListener() {
public void onClick(View view) { public void onClick(View view) {
Intent editIntent = new Intent(getActivity(), EditKeyActivity.class); Intent editIntent = new Intent(getActivity(), EditKeyActivity.class);
editIntent.setData(KeychainContract.KeyRings.buildSecretKeyRingsByMasterKeyIdUri(Long.toString(id))); editIntent.setData(
KeychainContract.KeyRings
.buildSecretKeyRingsByMasterKeyIdUri(Long.toString(id)));
editIntent.setAction(EditKeyActivity.ACTION_EDIT_KEY); editIntent.setAction(EditKeyActivity.ACTION_EDIT_KEY);
startActivityForResult(editIntent, 0); startActivityForResult(editIntent, 0);
} }
@ -582,7 +595,8 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
String userId = mCursor.getString(KeyListFragment.INDEX_USER_ID); String userId = mCursor.getString(KeyListFragment.INDEX_USER_ID);
String headerText = convertView.getResources().getString(R.string.user_id_no_name); String headerText = convertView.getResources().getString(R.string.user_id_no_name);
if (userId != null && userId.length() > 0) { if (userId != null && userId.length() > 0) {
headerText = "" + mCursor.getString(KeyListFragment.INDEX_USER_ID).subSequence(0, 1).charAt(0); headerText = "" +
mCursor.getString(KeyListFragment.INDEX_USER_ID).subSequence(0, 1).charAt(0);
} }
holder.mText.setText(headerText); holder.mText.setText(headerText);
holder.mCount.setVisibility(View.GONE); holder.mCount.setVisibility(View.GONE);
@ -605,9 +619,9 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
} }
// early breakout: all secret keys are assigned id 0 // early breakout: all secret keys are assigned id 0
if (mCursor.getInt(KeyListFragment.INDEX_TYPE) == KeyTypes.SECRET) if (mCursor.getInt(KeyListFragment.INDEX_TYPE) == KeyTypes.SECRET) {
return 1L; return 1L;
}
// otherwise, return the first character of the name as ID // otherwise, return the first character of the name as ID
String userId = mCursor.getString(KeyListFragment.INDEX_USER_ID); String userId = mCursor.getString(KeyListFragment.INDEX_USER_ID);
if (userId != null && userId.length() > 0) { if (userId != null && userId.length() > 0) {

View File

@ -132,7 +132,8 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements T
mSearchView = new EditText(context); mSearchView = new EditText(context);
mSearchView.setId(SEARCH_ID); mSearchView.setId(SEARCH_ID);
mSearchView.setHint(R.string.menu_search); mSearchView.setHint(R.string.menu_search);
mSearchView.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_action_search), null, null, null); mSearchView.setCompoundDrawablesWithIntrinsicBounds(
getResources().getDrawable(R.drawable.ic_action_search), null, null, null);
linearLayout.addView(mSearchView, new FrameLayout.LayoutParams( linearLayout.addView(mSearchView, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
@ -270,7 +271,7 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements T
+ Keys.CAN_ENCRYPT + " = '1' AND valid_keys." + Keys.CREATION + " <= '" + Keys.CAN_ENCRYPT + " = '1' AND valid_keys." + Keys.CREATION + " <= '"
+ now + "' AND " + "(valid_keys." + Keys.EXPIRY + " IS NULL OR valid_keys." + now + "' AND " + "(valid_keys." + Keys.EXPIRY + " IS NULL OR valid_keys."
+ Keys.EXPIRY + " >= '" + now + "')) AS " + Keys.EXPIRY + " >= '" + now + "')) AS "
+ SelectKeyCursorAdapter.PROJECTION_ROW_VALID,}; + SelectKeyCursorAdapter.PROJECTION_ROW_VALID, };
String inMasterKeyList = null; String inMasterKeyList = null;
if (mSelectedMasterKeyIds != null && mSelectedMasterKeyIds.length > 0) { if (mSelectedMasterKeyIds != null && mSelectedMasterKeyIds.length > 0) {

View File

@ -101,7 +101,10 @@ public class SelectSecretKeyLayoutFragment extends Fragment {
mKeyUserIdRest.setVisibility(View.GONE); mKeyUserIdRest.setVisibility(View.GONE);
} }
} else { } else {
mKeyMasterKeyIdHex.setText(getActivity().getResources().getString(R.string.no_keys_added_or_updated) + " for master id: " + secretKeyId); mKeyMasterKeyIdHex.setText(
getActivity().getResources()
.getString(R.string.no_keys_added_or_updated)
+ " for master id: " + secretKeyId);
mKeyUserId.setVisibility(View.GONE); mKeyUserId.setVisibility(View.GONE);
mKeyUserIdRest.setVisibility(View.GONE); mKeyUserIdRest.setVisibility(View.GONE);
} }

View File

@ -241,7 +241,8 @@ public class ViewKeyActivity extends ActionBarActivity {
// we delete only this key, so MESSAGE_NOT_DELETED will solely contain this key // we delete only this key, so MESSAGE_NOT_DELETED will solely contain this key
Toast.makeText(ViewKeyActivity.this, Toast.makeText(ViewKeyActivity.this,
getString(R.string.error_can_not_delete_contact) getString(R.string.error_can_not_delete_contact)
+ getResources().getQuantityString(R.plurals.error_can_not_delete_info, 1), + getResources()
.getQuantityString(R.plurals.error_can_not_delete_info, 1),
Toast.LENGTH_LONG).show(); Toast.LENGTH_LONG).show();
} else { } else {
setResult(RESULT_CANCELED); setResult(RESULT_CANCELED);

View File

@ -136,7 +136,10 @@ public class ViewKeyMainFragment extends Fragment implements
mActionEdit.setOnClickListener(new View.OnClickListener() { mActionEdit.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) { public void onClick(View view) {
Intent editIntent = new Intent(getActivity(), EditKeyActivity.class); Intent editIntent = new Intent(getActivity(), EditKeyActivity.class);
editIntent.setData(KeychainContract.KeyRings.buildSecretKeyRingsByMasterKeyIdUri(Long.toString(masterKeyId))); editIntent.setData(
KeychainContract
.KeyRings.buildSecretKeyRingsByMasterKeyIdUri(
Long.toString(masterKeyId)));
editIntent.setAction(EditKeyActivity.ACTION_EDIT_KEY); editIntent.setAction(EditKeyActivity.ACTION_EDIT_KEY);
startActivityForResult(editIntent, 0); startActivityForResult(editIntent, 0);
} }
@ -169,21 +172,28 @@ public class ViewKeyMainFragment extends Fragment implements
getActivity().getSupportLoaderManager().initLoader(LOADER_ID_KEYS, null, this); getActivity().getSupportLoaderManager().initLoader(LOADER_ID_KEYS, null, this);
} }
static final String[] KEYRING_PROJECTION = new String[]{KeychainContract.KeyRings._ID, KeychainContract.KeyRings.MASTER_KEY_ID, static final String[] KEYRING_PROJECTION =
new String[]{KeychainContract.KeyRings._ID, KeychainContract.KeyRings.MASTER_KEY_ID,
KeychainContract.UserIds.USER_ID}; KeychainContract.UserIds.USER_ID};
static final int KEYRING_INDEX_ID = 0; static final int KEYRING_INDEX_ID = 0;
static final int KEYRING_INDEX_MASTER_KEY_ID = 1; static final int KEYRING_INDEX_MASTER_KEY_ID = 1;
static final int KEYRING_INDEX_USER_ID = 2; static final int KEYRING_INDEX_USER_ID = 2;
static final String[] USER_IDS_PROJECTION = new String[]{KeychainContract.UserIds._ID, KeychainContract.UserIds.USER_ID, static final String[] USER_IDS_PROJECTION =
KeychainContract.UserIds.RANK,}; new String[]{KeychainContract.UserIds._ID, KeychainContract.UserIds.USER_ID,
KeychainContract.UserIds.RANK, };
// not the main user id // not the main user id
static final String USER_IDS_SELECTION = KeychainContract.UserIds.RANK + " > 0 "; static final String USER_IDS_SELECTION = KeychainContract.UserIds.RANK + " > 0 ";
static final String USER_IDS_SORT_ORDER = KeychainContract.UserIds.USER_ID + " COLLATE LOCALIZED ASC"; static final String USER_IDS_SORT_ORDER =
KeychainContract.UserIds.USER_ID + " COLLATE LOCALIZED ASC";
static final String[] KEYS_PROJECTION = new String[]{KeychainContract.Keys._ID, KeychainContract.Keys.KEY_ID, static final String[] KEYS_PROJECTION =
KeychainContract.Keys.IS_MASTER_KEY, KeychainContract.Keys.ALGORITHM, KeychainContract.Keys.KEY_SIZE, KeychainContract.Keys.CAN_CERTIFY, KeychainContract.Keys.CAN_SIGN, new String[]{KeychainContract.Keys._ID, KeychainContract.Keys.KEY_ID,
KeychainContract.Keys.CAN_ENCRYPT, KeychainContract.Keys.CREATION, KeychainContract.Keys.EXPIRY, KeychainContract.Keys.FINGERPRINT}; KeychainContract.Keys.IS_MASTER_KEY, KeychainContract.Keys.ALGORITHM,
KeychainContract.Keys.KEY_SIZE, KeychainContract.Keys.CAN_CERTIFY,
KeychainContract.Keys.CAN_SIGN, KeychainContract.Keys.CAN_ENCRYPT,
KeychainContract.Keys.CREATION, KeychainContract.Keys.EXPIRY,
KeychainContract.Keys.FINGERPRINT};
static final String KEYS_SORT_ORDER = KeychainContract.Keys.RANK + " ASC"; static final String KEYS_SORT_ORDER = KeychainContract.Keys.RANK + " ASC";
static final int KEYS_INDEX_ID = 0; static final int KEYS_INDEX_ID = 0;
static final int KEYS_INDEX_KEY_ID = 1; static final int KEYS_INDEX_KEY_ID = 1;
@ -266,7 +276,8 @@ public class ViewKeyMainFragment extends Fragment implements
} else { } else {
Date creationDate = new Date(data.getLong(KEYS_INDEX_CREATION) * 1000); Date creationDate = new Date(data.getLong(KEYS_INDEX_CREATION) * 1000);
mCreation.setText(DateFormat.getDateFormat(getActivity().getApplicationContext()).format( mCreation.setText(
DateFormat.getDateFormat(getActivity().getApplicationContext()).format(
creationDate)); creationDate));
} }
@ -276,7 +287,8 @@ public class ViewKeyMainFragment extends Fragment implements
} else { } else {
Date expiryDate = new Date(data.getLong(KEYS_INDEX_EXPIRY) * 1000); Date expiryDate = new Date(data.getLong(KEYS_INDEX_EXPIRY) * 1000);
mExpiry.setText(DateFormat.getDateFormat(getActivity().getApplicationContext()).format( mExpiry.setText(
DateFormat.getDateFormat(getActivity().getApplicationContext()).format(
expiryDate)); expiryDate));
} }
@ -397,5 +409,4 @@ public class ViewKeyMainFragment extends Fragment implements
startActivity(signIntent); startActivity(signIntent);
} }
}
}

View File

@ -148,4 +148,4 @@ public class CreateKeyDialogFragment extends DialogFragment {
return dialog.create(); return dialog.create();
} }
} }

View File

@ -88,7 +88,8 @@ public class DeleteFileDialogFragment extends DialogFragment {
null); null);
// Message is received after deleting is done in ApgService // Message is received after deleting is done in ApgService
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(activity, deletingDialog) { KeychainIntentServiceHandler saveHandler =
new KeychainIntentServiceHandler(activity, deletingDialog) {
public void handleMessage(Message message) { public void handleMessage(Message message) {
// handle messages by standard ApgHandler first // handle messages by standard ApgHandler first
super.handleMessage(message); super.handleMessage(message);
@ -120,4 +121,4 @@ public class DeleteFileDialogFragment extends DialogFragment {
return alert.create(); return alert.create();
} }
} }

View File

@ -117,8 +117,9 @@ public class DeleteKeyDialogFragment extends DialogFragment {
String selectionIDs = ""; String selectionIDs = "";
for (int i = 0; i < keyRingRowIds.length; i++) { for (int i = 0; i < keyRingRowIds.length; i++) {
selectionIDs += "'" + String.valueOf(keyRingRowIds[i]) + "'"; selectionIDs += "'" + String.valueOf(keyRingRowIds[i]) + "'";
if (i + 1 < keyRingRowIds.length) if (i + 1 < keyRingRowIds.length) {
selectionIDs += ","; selectionIDs += ",";
}
} }
selection += selectionIDs + ")"; selection += selectionIDs + ")";
@ -139,7 +140,9 @@ public class DeleteKeyDialogFragment extends DialogFragment {
// check if a corresponding secret key exists... // check if a corresponding secret key exists...
Cursor secretCursor = activity.getContentResolver().query( Cursor secretCursor = activity.getContentResolver().query(
KeychainContract.KeyRings.buildSecretKeyRingsByMasterKeyIdUri(String.valueOf(masterKeyId)), KeychainContract.KeyRings
.buildSecretKeyRingsByMasterKeyIdUri(
String.valueOf(masterKeyId)),
null, null, null, null null, null, null, null
); );
if (secretCursor != null && secretCursor.getCount() > 0) { if (secretCursor != null && secretCursor.getCount() > 0) {
@ -204,4 +207,4 @@ public class DeleteKeyDialogFragment extends DialogFragment {
Log.w(Constants.TAG, "Messenger is null!", e); Log.w(Constants.TAG, "Messenger is null!", e);
} }
} }
} }

View File

@ -61,7 +61,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
private Messenger mMessenger; private Messenger mMessenger;
private EditText mPassphraseEditText; private EditText mPassphraseEditText;
private boolean canKB; private boolean mCanKB;
/** /**
* Creates new instance of this dialog fragment * Creates new instance of this dialog fragment
@ -128,7 +128,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
} }
}); });
alert.setCancelable(false); alert.setCancelable(false);
canKB = false; mCanKB = false;
return alert.create(); return alert.create();
} }
String userId = PgpKeyHelper.getMainUserIdSafe(activity, secretKey); String userId = PgpKeyHelper.getMainUserIdSafe(activity, secretKey);
@ -221,14 +221,14 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
} }
}); });
canKB = true; mCanKB = true;
return alert.create(); return alert.create();
} }
@Override @Override
public void onActivityCreated(Bundle arg0) { public void onActivityCreated(Bundle arg0) {
super.onActivityCreated(arg0); super.onActivityCreated(arg0);
if (canKB) { if (mCanKB) {
// request focus and open soft keyboard // request focus and open soft keyboard
mPassphraseEditText.requestFocus(); mPassphraseEditText.requestFocus();
getDialog().getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE); getDialog().getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);

View File

@ -100,8 +100,9 @@ public class ProgressDialogFragment extends DialogFragment {
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
super.onCancel(dialog); super.onCancel(dialog);
if (this.mOnCancelListener != null) if (this.mOnCancelListener != null) {
this.mOnCancelListener.onCancel(dialog); this.mOnCancelListener.onCancel(dialog);
}
} }
/** /**
@ -150,4 +151,4 @@ public class ProgressDialogFragment extends DialogFragment {
return dialog; return dialog;
} }
} }

View File

@ -183,4 +183,4 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
Log.w(Constants.TAG, "Messenger is null!", e); Log.w(Constants.TAG, "Messenger is null!", e);
} }
} }
} }

View File

@ -96,4 +96,4 @@ public class ShareNfcDialogFragment extends DialogFragment {
return alert.create(); return alert.create();
} }
} }