am 7194361c: Merge "Properly handle dispatchRestoreInstanceState for new-style DatePicker" into lmp-dev
* commit '7194361cdaad9150f8440dda99ccdc04556e73e2': Properly handle dispatchRestoreInstanceState for new-style DatePicker
This commit is contained in:
@@ -392,10 +392,9 @@ public class DatePicker extends FrameLayout {
|
||||
mDelegate.setSpinnersShown(shown);
|
||||
}
|
||||
|
||||
// Override so we are in complete control of save / restore for this widget.
|
||||
@Override
|
||||
protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
|
||||
mDelegate.dispatchRestoreInstanceState(container);
|
||||
dispatchThawSelfOnly(container);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -406,7 +405,7 @@ public class DatePicker extends FrameLayout {
|
||||
|
||||
@Override
|
||||
protected void onRestoreInstanceState(Parcelable state) {
|
||||
SavedState ss = (SavedState) state;
|
||||
BaseSavedState ss = (BaseSavedState) state;
|
||||
super.onRestoreInstanceState(ss.getSuperState());
|
||||
mDelegate.onRestoreInstanceState(ss);
|
||||
}
|
||||
@@ -452,7 +451,6 @@ public class DatePicker extends FrameLayout {
|
||||
|
||||
void onConfigurationChanged(Configuration newConfig);
|
||||
|
||||
void dispatchRestoreInstanceState(SparseArray<Parcelable> container);
|
||||
Parcelable onSaveInstanceState(Parcelable superState);
|
||||
void onRestoreInstanceState(Parcelable state);
|
||||
|
||||
@@ -847,11 +845,6 @@ public class DatePicker extends FrameLayout {
|
||||
setCurrentLocale(newConfig.locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
|
||||
mDelegator.dispatchThawSelfOnly(container);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Parcelable onSaveInstanceState(Parcelable superState) {
|
||||
return new SavedState(superState, getYear(), getMonth(), getDayOfMonth());
|
||||
|
||||
@@ -528,11 +528,6 @@ class DatePickerCalendarDelegate extends DatePicker.AbstractDatePickerDelegate i
|
||||
mDayFormat = new SimpleDateFormat("d", newConfig.locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public Parcelable onSaveInstanceState(Parcelable superState) {
|
||||
final int year = mCurrentDate.get(Calendar.YEAR);
|
||||
@@ -557,7 +552,7 @@ class DatePickerCalendarDelegate extends DatePicker.AbstractDatePickerDelegate i
|
||||
public void onRestoreInstanceState(Parcelable state) {
|
||||
SavedState ss = (SavedState) state;
|
||||
|
||||
mCurrentDate.set(ss.getSelectedDay(), ss.getSelectedMonth(), ss.getSelectedYear());
|
||||
mCurrentDate.set(ss.getSelectedYear(), ss.getSelectedMonth(), ss.getSelectedDay());
|
||||
mCurrentView = ss.getCurrentView();
|
||||
mMinDate.setTimeInMillis(ss.getMinDate());
|
||||
mMaxDate.setTimeInMillis(ss.getMaxDate());
|
||||
|
||||
Reference in New Issue
Block a user