Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c8e94a3 authored by Todd Lee's avatar Todd Lee
Browse files

Let floating windows on watches fill screen

This change allows devices to specify that floating windows do not strictly need to wrap content - but rather they can fill screen if needed. This is intended specifically for devices with small form factors/displays.

This addresses some inconsistencies with Wear & Dialogs specifically (as floating windows have implicit bearing on visibility - i.e. parent occlusion being dependent on ActivityInfo#isTranslucentOrFloating)

Fixes: b/232341122, b/231638625, b/294275950
Test: check dialogs backgrounds
Change-Id: I1bee8b973463c2d1fa04234ffeb9efbc48054a94
parent 8012b479
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -333,6 +333,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
    private long mBackgroundFadeDurationMillis = -1;
    private Boolean mSharedElementsUseOverlay;

    private Boolean mAllowFloatingWindowsFillScreen;

    private boolean mIsStartingWindow;
    private int mTheme = -1;

@@ -361,6 +363,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        mRenderShadowsInCompositor = Settings.Global.getInt(context.getContentResolver(),
                DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR, 1) != 0;
        mProxyOnBackInvokedDispatcher = new ProxyOnBackInvokedDispatcher(context);
        mAllowFloatingWindowsFillScreen = context.getResources().getBoolean(
                com.android.internal.R.bool.config_allowFloatingWindowsFillScreen);
    }

    /**
@@ -2422,7 +2426,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        mIsFloating = a.getBoolean(R.styleable.Window_windowIsFloating, false);
        int flagsToUpdate = (FLAG_LAYOUT_IN_SCREEN|FLAG_LAYOUT_INSET_DECOR)
                & (~getForcedWindowFlags());
        if (mIsFloating) {
        if (mIsFloating && !mAllowFloatingWindowsFillScreen) {
            setLayout(WRAP_CONTENT, WRAP_CONTENT);
            setFlags(0, flagsToUpdate);
        } else {
+4 −0
Original line number Diff line number Diff line
@@ -77,4 +77,8 @@

    <!-- Default hyphenation frequency setting (0=NONE, 1=NORMAL, 2=FULL). -->
    <item name="config_preferredHyphenationFrequency" format="integer" type="dimen">1</item>

    <!-- Floating windows can be fullscreen (i.e. windowIsFloating can still have fullscreen
         window that does not wrap content). -->
    <bool name="config_allowFloatingWindowsFillScreen">true</bool>
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -6699,6 +6699,10 @@
    <!-- Whether unlocking and waking a device are sequenced -->
    <bool name="config_orderUnlockAndWake">false</bool>

    <!-- Floating windows can be fullscreen (i.e. windowIsFloating can still have fullscreen
     window that does not wrap content). -->
    <bool name="config_allowFloatingWindowsFillScreen">false</bool>

    <!-- Whether scroll haptic feedback is enabled for rotary encoder scrolls on
         {@link MotionEvent#AXIS_SCROLL} generated by {@link InputDevice#SOURCE_ROTARY_ENCODER}
         devices. -->
+3 −0
Original line number Diff line number Diff line
@@ -5226,6 +5226,9 @@
  <!-- Whether we order unlocking and waking -->
  <java-symbol type="bool" name="config_orderUnlockAndWake" />

  <!-- Allow windowIsFloating to fill screen. -->
  <java-symbol type="bool" name="config_allowFloatingWindowsFillScreen" />

  <!-- External TV Input Logging Configs -->
  <java-symbol type="bool" name="config_tvExternalInputLoggingDisplayNameFilterEnabled" />
  <java-symbol type="array" name="config_tvExternalInputLoggingDeviceOnScreenDisplayNames" />