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

Commit b8edcdc2 authored by Xusong Wang's avatar Xusong Wang Committed by Android (Google) Code Review
Browse files

Merge "Revert "Refactor grant dialog to make more themeable""

parents 8f791bc5 15990971
Loading
Loading
Loading
Loading
+76 −54
Original line number Diff line number Diff line
@@ -14,43 +14,52 @@
     limitations under the License.
-->

<!-- In (hopefully very rare) case dialog is too high: allow scrolling -->
<ScrollView
<!-- Position subsequent dialogs with the button bar at same height -->
<com.android.packageinstaller.permission.ui.ManualLayoutFrame
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    style="@style/PermissionGrantScrollView">
    android:clipChildren="false">

        <!-- The dialog -->
        <LinearLayout
            android:theme="@style/Theme.PermissionGrantDialog"
            style="@style/PermissionGrantDialog">

            <LinearLayout
                android:id="@+id/content_container"
                style="@style/PermissionGrantContent">
    <!-- In (hopefully very rare) case dialog is too high: allow scrolling -->
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipChildren="false">

        <LinearLayout
                    style="@style/PermissionGrantDescription">
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:clipChildren="false">

                    <ImageView
                        android:id="@+id/permission_icon"
                        style="@style/PermissionGrantTitleIcon" />
            <!-- allow some space around dialog, esp. in landscape -->
            <Space
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="10"
                android:visibility="invisible" />

                    <TextView
                        android:id="@+id/permission_message"
                        style="@style/PermissionGrantTitleMessage" />
            <!-- The dialog -->
            <LinearLayout
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:theme="@style/PermissionGrant"
                style="@style/PermissionGrantDialog">

                </LinearLayout>
                <FrameLayout
                    android:id="@+id/content_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                <TextView
                    android:id="@+id/detail_message"
                    style="@style/PermissionGrantDetailMessage" />
                        <include layout="@layout/grant_permissions_content" />

            </LinearLayout>
                </FrameLayout>

                <!-- Buttons on bottom of dialog -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/PermissionGrantButtonList">

                    <Space
@@ -80,7 +89,20 @@
                        android:id="@+id/permission_deny_and_dont_ask_again_button"
                        android:text="@string/grant_dialog_button_deny_and_dont_ask_again"
                        style="@style/PermissionGrantButtonDenyDontAskAgain" />

                </LinearLayout>

             </LinearLayout>

            <!-- allow some space around dialog, esp. in landscape -->
            <Space
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="10"
                android:visibility="invisible" />

        </LinearLayout>

    </ScrollView>

</com.android.packageinstaller.permission.ui.ManualLayoutFrame>
+57 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<!-- Title of dialog -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/PermissionGrant"
    style="@style/PermissionGrantTitleIconAndDescription">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/PermissionGrantDescription">

        <ImageView
            android:id="@+id/permission_icon"
            style="@style/PermissionGrantTitleIcon" />

        <TextView
            android:id="@+id/permission_message"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="?attr/titleTextStyle" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        style="@style/PermissionGrantContent" >

        <TextView
            android:id="@+id/detail_message"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="@style/PermissionGrantDetailMessage" />

    </LinearLayout>

</LinearLayout>
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<!-- Landscape dimensions for the permission grant dialog. -->
<resources>
    <!-- Assuming the dimension of a sailfish, this yields 95% width in splitscreen and 65% in
         landscape -->
    <dimen name="permissionGrantDialogWeight">8.6</dimen>
    <dimen name="permissionGrantDialogWidth">334dp</dimen>
</resources>
+8 −4
Original line number Diff line number Diff line
@@ -18,16 +18,20 @@
<!-- themes for the permission grant dialog. -->
<resources>
    <style name="GrantPermissions"
           parent="@android:style/Theme.DeviceDefault.Dialog.Alert">
        <item name="android:windowNoTitle">true</item>
           parent="@android:style/Theme.DeviceDefault.Panel">
        <item name="android:windowIsFloating">false</item>
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:windowAnimationStyle">@*android:style/Animation.Material.Dialog</item>
        <!-- The following attributes change the behavior of the dialog, hence they should not be
             themed -->
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowCloseOnTouchOutside">@*android:bool/config_closeDialogWhenTouchOutside</item>
    </style>

    <style name="Theme.PermissionGrantDialog"
    <style name="PermissionGrant"
           parent="@android:style/Theme.DeviceDefault.Dialog">
        <item name="android:background">@color/google_grey_800</item>
        <item name="titleTextStyle">@style/PermissionGrantTitleMessage</item>
        <item name="android:colorBackgroundFloating">@color/google_grey_800</item>
    </style>
</resources>
 No newline at end of file
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<!-- portrait dimensions for the permission grant dialog. -->
<resources>
    <!-- This yields 95% width -->
    <dimen name="permissionGrantDialogWeight">380</dimen>
    <dimen name="permissionGrantDialogWidth">0dp</dimen>
</resources>
Loading