mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 08:28:50 -05:00
commit
5f3c9f3eb9
@ -115,8 +115,12 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
if (date == null) {
|
if (date == null) {
|
||||||
date = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
|
date = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
DatePickerDialog dialog = new DatePickerDialog(getContext(),
|
* Using custom DatePickerDialog which overrides the setTitle because
|
||||||
|
* the DatePickerDialog title is buggy (unix warparound bug).
|
||||||
|
* See: https://code.google.com/p/android/issues/detail?id=49066
|
||||||
|
*/
|
||||||
|
DatePickerDialog dialog = new ExpiryDatePickerDialog(getContext(),
|
||||||
mExpiryDateSetListener, date.get(Calendar.YEAR), date.get(Calendar.MONTH),
|
mExpiryDateSetListener, date.get(Calendar.YEAR), date.get(Calendar.MONTH),
|
||||||
date.get(Calendar.DAY_OF_MONTH));
|
date.get(Calendar.DAY_OF_MONTH));
|
||||||
mDatePickerResultCount = 0;
|
mDatePickerResultCount = 0;
|
||||||
@ -131,6 +135,12 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// setCalendarViewShown() is supported from API 11 onwards.
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB)
|
||||||
|
// Hide calendarView in tablets because of the unix warparound bug.
|
||||||
|
dialog.getDatePicker().setCalendarViewShown(false);
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||||
if ( dialog != null && mCreatedDate != null ) {
|
if ( dialog != null && mCreatedDate != null ) {
|
||||||
dialog.getDatePicker().setMinDate(mCreatedDate.getTime().getTime()+ DateUtils.DAY_IN_MILLIS);
|
dialog.getDatePicker().setMinDate(mCreatedDate.getTime().getTime()+ DateUtils.DAY_IN_MILLIS);
|
||||||
@ -139,6 +149,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
dialog.getDatePicker().setMinDate(date.getTime().getTime()+ DateUtils.DAY_IN_MILLIS);
|
dialog.getDatePicker().setMinDate(date.getTime().getTime()+ DateUtils.DAY_IN_MILLIS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -272,3 +283,14 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ExpiryDatePickerDialog extends DatePickerDialog {
|
||||||
|
|
||||||
|
public ExpiryDatePickerDialog(Context context, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) {
|
||||||
|
super(context, callBack, year, monthOfYear, dayOfMonth);
|
||||||
|
}
|
||||||
|
//Set permanent title.
|
||||||
|
public void setTitle(CharSequence title) {
|
||||||
|
super.setTitle(getContext().getString(R.string.expiry_date_dialog_title));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -130,6 +130,7 @@
|
|||||||
<string name="label_send_key">Upload key to selected keyserver after certification</string>
|
<string name="label_send_key">Upload key to selected keyserver after certification</string>
|
||||||
<string name="label_fingerprint">Fingerprint</string>
|
<string name="label_fingerprint">Fingerprint</string>
|
||||||
<string name="select_keys_button_default">Select</string>
|
<string name="select_keys_button_default">Select</string>
|
||||||
|
<string name="expiry_date_dialog_title">Set expiry date</string>
|
||||||
|
|
||||||
<plurals name="select_keys_button">
|
<plurals name="select_keys_button">
|
||||||
<item quantity="one">%d selected</item>
|
<item quantity="one">%d selected</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user