mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-17 07:30:14 -05:00
Allow selection of none in SelectSignKeyIdActivity
This commit is contained in:
parent
5cb22ece30
commit
ad9c35f522
@ -42,9 +42,11 @@ public class SelectSignKeyIdActivity extends BaseActivity {
|
|||||||
|
|
||||||
private Uri mAppUri;
|
private Uri mAppUri;
|
||||||
private String mPreferredUserId;
|
private String mPreferredUserId;
|
||||||
|
private Intent mData;
|
||||||
|
|
||||||
private SelectSignKeyIdListFragment mListFragment;
|
private SelectSignKeyIdListFragment mListFragment;
|
||||||
private TextView mActionCreateKey;
|
private TextView mActionCreateKey;
|
||||||
|
private TextView mNone;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -67,18 +69,29 @@ public class SelectSignKeyIdActivity extends BaseActivity {
|
|||||||
createKey(mPreferredUserId);
|
createKey(mPreferredUserId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
mNone = (TextView) findViewById(R.id.api_select_sign_key_none);
|
||||||
|
mNone.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
// 0 is "none"
|
||||||
|
mData.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, 0);
|
||||||
|
|
||||||
|
setResult(Activity.RESULT_OK, mData);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
mAppUri = intent.getData();
|
mAppUri = intent.getData();
|
||||||
mPreferredUserId = intent.getStringExtra(EXTRA_USER_ID);
|
mPreferredUserId = intent.getStringExtra(EXTRA_USER_ID);
|
||||||
Intent data = intent.getParcelableExtra(EXTRA_DATA);
|
mData = intent.getParcelableExtra(EXTRA_DATA);
|
||||||
if (mAppUri == null) {
|
if (mAppUri == null) {
|
||||||
Log.e(Constants.TAG, "Intent data missing. Should be Uri of app!");
|
Log.e(Constants.TAG, "Intent data missing. Should be Uri of app!");
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Log.d(Constants.TAG, "uri: " + mAppUri);
|
Log.d(Constants.TAG, "uri: " + mAppUri);
|
||||||
startListFragments(savedInstanceState, mAppUri, data);
|
startListFragments(savedInstanceState, mAppUri, mData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,28 @@
|
|||||||
android:text="@string/api_select_sign_key_text"
|
android:text="@string/api_select_sign_key_text"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dip"
|
||||||
|
android:background="?android:attr/listDivider" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/api_select_sign_key_none"
|
||||||
|
android:background="?android:selectableItemBackground"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:text="@string/none"
|
||||||
|
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:clickable="true" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dip"
|
||||||
|
android:background="?android:attr/listDivider" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/api_select_sign_key_list_fragment"
|
android:id="@+id/api_select_sign_key_list_fragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user