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

Commit 47745d48 authored by Tetiana Meronyk's avatar Tetiana Meronyk Committed by Android (Google) Code Review
Browse files

Merge "Add custom dialog with icon" into udc-dev

parents 1ce89ea1 ded66ac2
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 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.
  -->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
       android:insetTop="@dimen/dialog_button_vertical_inset"
       android:insetBottom="@dimen/dialog_button_vertical_inset">
    <ripple android:color="?android:attr/colorControlHighlight">
        <item android:id="@android:id/mask">
            <shape android:shape="rectangle">
                <solid android:color="@android:color/white"/>
                <corners android:radius="?android:attr/buttonCornerRadius"/>
            </shape>
        </item>
        <item>
            <shape android:shape="rectangle">
                <corners android:radius="?android:attr/buttonCornerRadius"/>
                <solid android:color="?androidprv:attr/colorAccentPrimary"/>
                <padding android:left="@dimen/dialog_button_horizontal_padding"
                         android:top="@dimen/dialog_button_vertical_padding"
                         android:right="@dimen/dialog_button_horizontal_padding"
                         android:bottom="@dimen/dialog_button_vertical_padding"/>
            </shape>
        </item>
    </ripple>
</inset>
+42 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2023 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.
  -->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
       android:insetTop="@dimen/dialog_button_vertical_inset"
       android:insetBottom="@dimen/dialog_button_vertical_inset">
    <ripple android:color="?android:attr/colorControlHighlight">
        <item android:id="@android:id/mask">
            <shape android:shape="rectangle">
                <solid android:color="@android:color/white"/>
                <corners android:radius="?android:attr/buttonCornerRadius"/>
            </shape>
        </item>
        <item>
            <shape android:shape="rectangle">
                <corners android:radius="?android:attr/buttonCornerRadius"/>
                <solid android:color="@android:color/transparent"/>
                <stroke android:color="?androidprv:attr/colorAccentPrimaryVariant"
                        android:width="1dp"
                />
                <padding android:left="@dimen/dialog_button_horizontal_padding"
                         android:top="@dimen/dialog_button_vertical_padding"
                         android:right="@dimen/dialog_button_horizontal_padding"
                         android:bottom="@dimen/dialog_button_vertical_padding"/>
            </shape>
        </item>
    </ripple>
</inset>
+25 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2023 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.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24.0dp"
        android:height="24.0dp"
        android:viewportWidth="24"
        android:viewportHeight="24"
        android:tint="?android:attr/colorControlNormal">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M17,17Q17.625,17 18.062,16.562Q18.5,16.125 18.5,15.5Q18.5,14.875 18.062,14.438Q17.625,14 17,14Q16.375,14 15.938,14.438Q15.5,14.875 15.5,15.5Q15.5,16.125 15.938,16.562Q16.375,17 17,17ZM17,20Q17.775,20 18.425,19.637Q19.075,19.275 19.475,18.675Q18.925,18.35 18.3,18.175Q17.675,18 17,18Q16.325,18 15.7,18.175Q15.075,18.35 14.525,18.675Q14.925,19.275 15.575,19.637Q16.225,20 17,20ZM12,22Q8.525,21.125 6.263,18.012Q4,14.9 4,11.1V5L12,2L20,5V10.675Q19.525,10.475 19.025,10.312Q18.525,10.15 18,10.075V6.4L12,4.15L6,6.4V11.1Q6,12.275 6.312,13.45Q6.625,14.625 7.188,15.688Q7.75,16.75 8.55,17.65Q9.35,18.55 10.325,19.15Q10.6,19.95 11.05,20.675Q11.5,21.4 12.075,21.975Q12.05,21.975 12.038,21.988Q12.025,22 12,22ZM17,22Q14.925,22 13.463,20.538Q12,19.075 12,17Q12,14.925 13.463,13.462Q14.925,12 17,12Q19.075,12 20.538,13.462Q22,14.925 22,17Q22,19.075 20.538,20.538Q19.075,22 17,22ZM12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Q12,11.65 12,11.65Z"/>
</vector>
+99 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2023 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.
  -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center"
              android:padding="@dimen/grant_admin_dialog_padding"
              android:paddingBottom="0dp">
    <ImageView
        android:id="@+id/dialog_with_icon_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription=""/>
    <TextView
        android:id="@+id/dialog_with_icon_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        style="@style/DialogWithIconTitle"
        android:text="@string/user_grant_admin_title"
        android:textDirection="locale"/>
    <TextView
        android:id="@+id/dialog_with_icon_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:gravity="center"
        style="@style/TextAppearanceSmall"
        android:text=""
        android:textDirection="locale"/>
    <LinearLayout
        android:id="@+id/custom_layout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:paddingBottom="0dp">
    </LinearLayout>
    <LinearLayout
        android:id="@+id/button_panel"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:paddingBottom="0dp">
        <Button
            android:id="@+id/button_cancel"
            style="@style/DialogButtonNegative"
            android:layout_width="wrap_content"
            android:buttonCornerRadius="28dp"
            android:layout_height="wrap_content"
            android:visibility="gone"/>
        <Space
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:layout_weight="1" >
        </Space>
        <Button
            android:id="@+id/button_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            style="@style/DialogButtonNegative"
            android:buttonCornerRadius="40dp"
            android:clickable="true"
            android:focusable="true"
            android:text="Back"
            android:visibility="gone"
        />
        <Space
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:layout_weight="0.05"
        >
        </Space>
        <Button
            android:id="@+id/button_ok"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            style="@style/DialogButtonPositive"
            android:clickable="true"
            android:focusable="true"
            android:visibility="gone"
        />
    </LinearLayout>
</LinearLayout>
+9 −0
Original line number Diff line number Diff line
@@ -112,4 +112,13 @@

    <!-- Size of grant admin privileges dialog padding -->
    <dimen name="grant_admin_dialog_padding">16dp</dimen>

    <dimen name="dialog_button_horizontal_padding">16dp</dimen>
    <dimen name="dialog_button_vertical_padding">8dp</dimen>
    <!-- The button will be 48dp tall, but the background needs to be 36dp tall -->
    <dimen name="dialog_button_vertical_inset">6dp</dimen>
    <dimen name="dialog_top_padding">24dp</dimen>
    <dimen name="dialog_bottom_padding">18dp</dimen>
    <dimen name="dialog_side_padding">24dp</dimen>
    <dimen name="dialog_button_bar_top_padding">32dp</dimen>
</resources>
Loading