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

Commit 1194725e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[PM] Update the UI of PIA V2" into main

parents ba0c7873 e483dafa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@

    <FrameLayout
        android:layout_width="40dp"
        android:layout_height="40dp">
        android:layout_height="40dp"
        android:layout_gravity="center_vertical">

        <CheckBox
            android:id="@+id/keep_data_checkbox"
+12 −0
Original line number Diff line number Diff line
@@ -103,6 +103,18 @@ public class UiUtil {
        }
    }

    /**
     * Get the id of the button panel of the alert dialog.
     */
    public static int getAlertDialogButtonPanelId(@NonNull Context context) {
        if (PackageUtil.isMaterialDesignEnabled(context)) {
            return R.id.buttonPanel;
        } else {
            return context.getResources().getIdentifier("buttonPanel",
                    /* defType= */ "id", /* defPackage= */ "android");
        }
    }

    /**
     * If material design is enabled, return the MaterialAlertDialog. Otherwise, return the
     * system AlertDialog.
+11 −1
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public class InstallationFragment extends DialogFragment {
    private View mMoreDetailsClickableLayout = null;
    private View mMoreDetailsExpandedLayout = null;
    private boolean mIsMoreDetailsExpanded = false;
    private View mButtonPanel = null;

    @Override
    public void onAttach(@NonNull Context context) {
@@ -168,6 +169,15 @@ public class InstallationFragment extends DialogFragment {
        final InstallStage installStage = getCurrentInstallStage();
        this.setCancelable(true);

        // When A11y is enabled, if there are no buttons in some cases E.g. installing,
        // the button panel should not be focused without any descriptions. Set the button
        // panel is not focusable to avoid it being focused.
        if (mButtonPanel == null) {
            mButtonPanel =
                    mDialog.requireViewById(UiUtil.getAlertDialogButtonPanelId(requireContext()));
            mButtonPanel.setFocusable(false);
        }

        // show the title and reset the paddings of the custom message textview
        if (mTitleTemplate != null) {
            mTitleTemplate.setVisibility(View.VISIBLE);
@@ -506,7 +516,7 @@ public class InstallationFragment extends DialogFragment {

        // Hide the title and set the message
        mCustomMessageTextView.setText(R.string.message_anonymous_source_warning);
        dialog.setTitle(null);
        dialog.setTitle("");
        mTitleTemplate =
                dialog.findViewById(UiUtil.getAlertDialogTitleTemplateId(requireContext()));
        if (mTitleTemplate != null) {