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

Commit 4de63945 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Make all SystemUIDialog's the same configurable width (1/2)

This CL sets the default width of SystemUIDialog to be MATCH_PARENT on
phones and 624dp on tablets/foldables.

Moreover, as part of b/203389579, the width on tablets/foldables can be
configured using a system property. That configurable width will be
removed once b/203389579 is fixed, before the sc-v2 release.

Bug: 203389579
Test: Manual
Change-Id: I5a54914666415c9aa278d42492d9339480222df0
parent cd2a1b2a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -105,5 +105,5 @@
    <dimen name="qs_detail_margin_top">0dp</dimen>

    <!-- The width of large/content heavy dialogs (e.g. Internet, Media output, etc) -->
    <dimen name="large_dialog_width">624dp</dimen>
    <dimen name="large_dialog_width">504dp</dimen>
</resources>
+0 −2
Original line number Diff line number Diff line
@@ -104,8 +104,6 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
        lp.setFitInsetsIgnoringVisibility(true);
        window.setAttributes(lp);
        window.setContentView(mDialogView);
        window.setLayout(mContext.getResources().getDimensionPixelSize(R.dimen.large_dialog_width),
                ViewGroup.LayoutParams.WRAP_CONTENT);

        mHeaderTitle = mDialogView.requireViewById(R.id.header_title);
        mHeaderSubtitle = mDialogView.requireViewById(R.id.header_subtitle);
+0 −2
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.view.WindowInsets
import android.widget.ImageView
import android.widget.TextView
@@ -65,7 +64,6 @@ class PrivacyDialog(
        window?.apply {
            attributes.fitInsetsTypes = attributes.fitInsetsTypes or WindowInsets.Type.statusBars()
            attributes.receiveInsetsIgnoringZOrder = true
            setLayout(context.resources.getDimensionPixelSize(R.dimen.qs_panel_width), WRAP_CONTENT)
            setGravity(Gravity.TOP or Gravity.CENTER_HORIZONTAL)
        }

+0 −4
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;
@@ -187,9 +186,6 @@ public class InternetDialog extends SystemUIDialog implements
        final Window window = getWindow();
        window.setContentView(mDialogView);

        // Only fix the width for large screen or tablet.
        window.setLayout(mContext.getResources().getDimensionPixelSize(
                R.dimen.large_dialog_width), ViewGroup.LayoutParams.WRAP_CONTENT);
        window.setWindowAnimations(R.style.Animation_InternetDialog);

        mInternetDialogLayout = mDialogView.requireViewById(R.id.internet_connectivity_dialog);
+0 −4
Original line number Diff line number Diff line
@@ -71,10 +71,6 @@ class UserDialog(
            setType(WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL)
            attributes.fitInsetsTypes = attributes.fitInsetsTypes or WindowInsets.Type.statusBars()
            attributes.receiveInsetsIgnoringZOrder = true
            setLayout(
                    context.resources.getDimensionPixelSize(R.dimen.notification_panel_width),
                    ViewGroup.LayoutParams.WRAP_CONTENT
            )
            setGravity(Gravity.CENTER)
        }
        setContentView(R.layout.qs_user_dialog_content)
Loading