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

Commit 02d3b581 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Refactor grant dialog to make more themeable"

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

<!-- 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"
    android:clipChildren="false">

<!-- In (hopefully very rare) case dialog is too high: allow scrolling -->
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipChildren="false">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:clipChildren="false">

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

        <!-- The dialog -->
        <LinearLayout
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:theme="@style/PermissionGrant"
            android:theme="@style/Theme.PermissionGrantDialog"
            style="@style/PermissionGrantDialog">

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

                <LinearLayout
                    style="@style/PermissionGrantDescription">

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

                        <include layout="@layout/grant_permissions_content" />
                    <TextView
                        android:id="@+id/permission_message"
                        style="@style/PermissionGrantTitleMessage" />

                </LinearLayout>

                </FrameLayout>
                <TextView
                    android:id="@+id/detail_message"
                    style="@style/PermissionGrantDetailMessage" />

            </LinearLayout>

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

                <Space
@@ -89,20 +80,7 @@
                    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>
 No newline at end of file

</com.android.packageinstaller.permission.ui.ManualLayoutFrame>
+0 −57
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>

res/values-land/dimens.xml

deleted100644 → 0
+0 −24
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>
+4 −8
Original line number Diff line number Diff line
@@ -18,20 +18,16 @@
<!-- themes for the permission grant dialog. -->
<resources>
    <style name="GrantPermissions"
           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>
           parent="@android:style/Theme.DeviceDefault.Dialog.Alert">
        <item name="android:windowNoTitle">true</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="PermissionGrant"
    <style name="Theme.PermissionGrantDialog"
           parent="@android:style/Theme.DeviceDefault.Dialog">
        <item name="titleTextStyle">@style/PermissionGrantTitleMessage</item>
        <item name="android:colorBackgroundFloating">@color/google_grey_800</item>
        <item name="android:background">@color/google_grey_800</item>
    </style>
</resources>
 No newline at end of file

res/values-port/dimens.xml

deleted100644 → 0
+0 −23
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