Merge "Fix that the preview should keep the same layer when switching the screen on/off."
This commit is contained in:
@@ -67,7 +67,6 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
|
|||||||
|
|
||||||
private FontWeightAdjustmentPreferenceController mFontWeightAdjustmentController;
|
private FontWeightAdjustmentPreferenceController mFontWeightAdjustmentController;
|
||||||
private TextReadingPreviewController mPreviewController;
|
private TextReadingPreviewController mPreviewController;
|
||||||
private int mLastPreviewIndex = UNKNOWN_INDEX;
|
|
||||||
private int mEntryPoint = EntryPoint.UNKNOWN_ENTRY;
|
private int mEntryPoint = EntryPoint.UNKNOWN_ENTRY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,7 +109,10 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (savedInstanceState.containsKey(LAST_PREVIEW_INDEX)) {
|
if (savedInstanceState.containsKey(LAST_PREVIEW_INDEX)) {
|
||||||
mLastPreviewIndex = savedInstanceState.getInt(LAST_PREVIEW_INDEX);
|
final int lastPreviewIndex = savedInstanceState.getInt(LAST_PREVIEW_INDEX);
|
||||||
|
if (lastPreviewIndex != UNKNOWN_INDEX) {
|
||||||
|
mPreviewController.setCurrentItem(lastPreviewIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,10 +224,6 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
|
||||||
if (mLastPreviewIndex != UNKNOWN_INDEX) {
|
|
||||||
mPreviewController.setCurrentItem(mLastPreviewIndex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isCallingFromAnythingElseEntryPoint() {
|
protected boolean isCallingFromAnythingElseEntryPoint() {
|
||||||
|
Reference in New Issue
Block a user