mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
commit
51ff397ef2
@ -65,7 +65,7 @@
|
||||
android:gravity="right"
|
||||
android:numeric="integer"
|
||||
android:padding="4dp"
|
||||
android:text="1024" />
|
||||
android:text="@string/default_key_bit_size" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
|
@ -328,7 +328,8 @@
|
||||
<string name="fast">fast</string>
|
||||
<string name="slow">slow</string>
|
||||
<string name="very_slow">very slow</string>
|
||||
|
||||
<string name="default_key_bit_size">2048</string>
|
||||
|
||||
<!-- APG 2.0 -->
|
||||
|
||||
|
||||
|
@ -59,10 +59,14 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
||||
Button mExpiryDateButton;
|
||||
GregorianCalendar mExpiryDate;
|
||||
|
||||
private int mDatePickerResultCount = 0;
|
||||
private DatePickerDialog.OnDateSetListener mExpiryDateSetListener = new DatePickerDialog.OnDateSetListener() {
|
||||
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
|
||||
GregorianCalendar date = new GregorianCalendar(year, monthOfYear, dayOfMonth);
|
||||
setExpiryDate(date);
|
||||
if(mDatePickerResultCount++ == 0) // Note: Ignore results after the first one - android sends multiples.
|
||||
{
|
||||
GregorianCalendar date = new GregorianCalendar(year, monthOfYear, dayOfMonth);
|
||||
setExpiryDate(date);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -111,11 +115,15 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
||||
DatePickerDialog dialog = new DatePickerDialog(getContext(),
|
||||
mExpiryDateSetListener, date.get(Calendar.YEAR), date.get(Calendar.MONTH),
|
||||
date.get(Calendar.DAY_OF_MONTH));
|
||||
mDatePickerResultCount = 0;
|
||||
dialog.setCancelable(true);
|
||||
dialog.setButton(Dialog.BUTTON_NEGATIVE, getContext()
|
||||
.getString(R.string.btn_noDate), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
setExpiryDate(null);
|
||||
if(mDatePickerResultCount++ == 0) // Note: Ignore results after the first one - android sends multiples.
|
||||
{
|
||||
setExpiryDate(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
|
Loading…
Reference in New Issue
Block a user