Loading res/values/attrs.xml +2 −1 Original line number Original line Diff line number Diff line Loading @@ -312,9 +312,10 @@ <attr name="rowCountSpecsId" format="reference" /> <attr name="rowCountSpecsId" format="reference" /> <!-- defaults to allAppsCellSpecsId, if not specified --> <!-- defaults to allAppsCellSpecsId, if not specified --> <attr name="allAppsCellSpecsTwoPanelId" format="reference" /> <attr name="allAppsCellSpecsTwoPanelId" format="reference" /> <!-- defaults to false, if not specified --> <!-- defaults to false, if not specified --> <attr name="isFixedLandscape" format="boolean" /> <attr name="isFixedLandscape" format="boolean" /> <!-- defaults to false, if not specified --> <attr name="isOldGrid" format="boolean" /> <!-- By default all categories are enabled --> <!-- By default all categories are enabled --> <attr name="deviceCategory" format="integer"> <attr name="deviceCategory" format="integer"> Loading src/com/android/launcher3/InvariantDeviceProfile.java +19 −7 Original line number Original line Diff line number Diff line Loading @@ -1031,6 +1031,7 @@ public class InvariantDeviceProfile implements SafeCloseable { private final int mAllAppsCellSpecsTwoPanelId; private final int mAllAppsCellSpecsTwoPanelId; private final int mRowCountSpecsId; private final int mRowCountSpecsId; private final boolean mIsFixedLandscape; private final boolean mIsFixedLandscape; private final boolean mIsOldGrid; public GridOption(Context context, AttributeSet attrs, Info displayInfo) { public GridOption(Context context, AttributeSet attrs, Info displayInfo) { TypedArray a = context.obtainStyledAttributes( TypedArray a = context.obtainStyledAttributes( Loading Loading @@ -1175,6 +1176,7 @@ public class InvariantDeviceProfile implements SafeCloseable { } } mIsFixedLandscape = a.getBoolean(R.styleable.GridDisplayOption_isFixedLandscape, false); mIsFixedLandscape = a.getBoolean(R.styleable.GridDisplayOption_isFixedLandscape, false); mIsOldGrid = a.getBoolean(R.styleable.GridDisplayOption_isOldGrid, false); int inlineForRotation = a.getInt(R.styleable.GridDisplayOption_inlineQsb, int inlineForRotation = a.getInt(R.styleable.GridDisplayOption_inlineQsb, DONT_INLINE_QSB); DONT_INLINE_QSB); Loading Loading @@ -1206,20 +1208,30 @@ public class InvariantDeviceProfile implements SafeCloseable { } } } } public boolean isNewGridOption() { /** return mRowCountSpecsId != INVALID_RESOURCE_HANDLE; * Returns true if the grid option should be used given the flags that are toggled on/off. } */ public boolean filterByFlag(int deviceType, boolean isFixedLandscape) { public boolean filterByFlag(int deviceType, boolean isFixedLandscape) { if (deviceType == TYPE_TABLET) { if (deviceType == TYPE_TABLET) { return Flags.oneGridRotationHandling() == mIsDualGrid; return Flags.oneGridRotationHandling() == mIsDualGrid; } } if (isFixedLandscape) { // Here we return true if fixed landscape mode should be on. return Flags.oneGridSpecs() && mIsFixedLandscape; if (mIsFixedLandscape || isFixedLandscape) { return mIsFixedLandscape && isFixedLandscape && Flags.oneGridSpecs(); } // Here we return true if we want to show the new grids. if (mRowCountSpecsId != INVALID_RESOURCE_HANDLE) { return Flags.oneGridSpecs(); } // Here we return true if we want to show the old grids. if (mIsOldGrid) { return !Flags.oneGridSpecs(); } } return ((Flags.oneGridSpecs() == isNewGridOption()) && !mIsFixedLandscape); return true; } } } } Loading Loading
res/values/attrs.xml +2 −1 Original line number Original line Diff line number Diff line Loading @@ -312,9 +312,10 @@ <attr name="rowCountSpecsId" format="reference" /> <attr name="rowCountSpecsId" format="reference" /> <!-- defaults to allAppsCellSpecsId, if not specified --> <!-- defaults to allAppsCellSpecsId, if not specified --> <attr name="allAppsCellSpecsTwoPanelId" format="reference" /> <attr name="allAppsCellSpecsTwoPanelId" format="reference" /> <!-- defaults to false, if not specified --> <!-- defaults to false, if not specified --> <attr name="isFixedLandscape" format="boolean" /> <attr name="isFixedLandscape" format="boolean" /> <!-- defaults to false, if not specified --> <attr name="isOldGrid" format="boolean" /> <!-- By default all categories are enabled --> <!-- By default all categories are enabled --> <attr name="deviceCategory" format="integer"> <attr name="deviceCategory" format="integer"> Loading
src/com/android/launcher3/InvariantDeviceProfile.java +19 −7 Original line number Original line Diff line number Diff line Loading @@ -1031,6 +1031,7 @@ public class InvariantDeviceProfile implements SafeCloseable { private final int mAllAppsCellSpecsTwoPanelId; private final int mAllAppsCellSpecsTwoPanelId; private final int mRowCountSpecsId; private final int mRowCountSpecsId; private final boolean mIsFixedLandscape; private final boolean mIsFixedLandscape; private final boolean mIsOldGrid; public GridOption(Context context, AttributeSet attrs, Info displayInfo) { public GridOption(Context context, AttributeSet attrs, Info displayInfo) { TypedArray a = context.obtainStyledAttributes( TypedArray a = context.obtainStyledAttributes( Loading Loading @@ -1175,6 +1176,7 @@ public class InvariantDeviceProfile implements SafeCloseable { } } mIsFixedLandscape = a.getBoolean(R.styleable.GridDisplayOption_isFixedLandscape, false); mIsFixedLandscape = a.getBoolean(R.styleable.GridDisplayOption_isFixedLandscape, false); mIsOldGrid = a.getBoolean(R.styleable.GridDisplayOption_isOldGrid, false); int inlineForRotation = a.getInt(R.styleable.GridDisplayOption_inlineQsb, int inlineForRotation = a.getInt(R.styleable.GridDisplayOption_inlineQsb, DONT_INLINE_QSB); DONT_INLINE_QSB); Loading Loading @@ -1206,20 +1208,30 @@ public class InvariantDeviceProfile implements SafeCloseable { } } } } public boolean isNewGridOption() { /** return mRowCountSpecsId != INVALID_RESOURCE_HANDLE; * Returns true if the grid option should be used given the flags that are toggled on/off. } */ public boolean filterByFlag(int deviceType, boolean isFixedLandscape) { public boolean filterByFlag(int deviceType, boolean isFixedLandscape) { if (deviceType == TYPE_TABLET) { if (deviceType == TYPE_TABLET) { return Flags.oneGridRotationHandling() == mIsDualGrid; return Flags.oneGridRotationHandling() == mIsDualGrid; } } if (isFixedLandscape) { // Here we return true if fixed landscape mode should be on. return Flags.oneGridSpecs() && mIsFixedLandscape; if (mIsFixedLandscape || isFixedLandscape) { return mIsFixedLandscape && isFixedLandscape && Flags.oneGridSpecs(); } // Here we return true if we want to show the new grids. if (mRowCountSpecsId != INVALID_RESOURCE_HANDLE) { return Flags.oneGridSpecs(); } // Here we return true if we want to show the old grids. if (mIsOldGrid) { return !Flags.oneGridSpecs(); } } return ((Flags.oneGridSpecs() == isNewGridOption()) && !mIsFixedLandscape); return true; } } } } Loading