Merge "Always refresh device profile when multi window mode changed" into sc-v2-dev
This commit is contained in:
commit
125158232e
|
@ -554,6 +554,14 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||||
AbstractFloatingView.closeOpenViews(this, false, TYPE_ICON_SURFACE);
|
AbstractFloatingView.closeOpenViews(this, false, TYPE_ICON_SURFACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) {
|
||||||
|
super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig);
|
||||||
|
// Always update device profile when multi window mode changed.
|
||||||
|
initDeviceProfile(mDeviceProfile.inv);
|
||||||
|
dispatchDeviceProfileChanged();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
int diff = newConfig.diff(mOldConfig);
|
int diff = newConfig.diff(mOldConfig);
|
||||||
|
@ -592,11 +600,9 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||||
|
|
||||||
private void initDeviceProfile(InvariantDeviceProfile idp) {
|
private void initDeviceProfile(InvariantDeviceProfile idp) {
|
||||||
// Load configuration-specific DeviceProfile
|
// Load configuration-specific DeviceProfile
|
||||||
mDeviceProfile = idp.getDeviceProfile(this);
|
mDeviceProfile = isInMultiWindowMode()
|
||||||
if (isInMultiWindowMode()) {
|
? mDeviceProfile.getMultiWindowProfile(this, getMultiWindowDisplaySize())
|
||||||
mDeviceProfile = mDeviceProfile.getMultiWindowProfile(
|
: idp.getDeviceProfile(this);
|
||||||
this, getMultiWindowDisplaySize());
|
|
||||||
}
|
|
||||||
|
|
||||||
onDeviceProfileInitiated();
|
onDeviceProfileInitiated();
|
||||||
mModelWriter = mModel.getWriter(getDeviceProfile().isVerticalBarLayout(), true, this);
|
mModelWriter = mModel.getWriter(getDeviceProfile().isVerticalBarLayout(), true, this);
|
||||||
|
|
Loading…
Reference in New Issue