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

Commit fe80e631 authored by Craig Stout's avatar Craig Stout
Browse files

Update leanback alert dialogs.

Now based on Material instead of Holo.

b/15418510

Change-Id: I69103b429ff1b4f66b3968fa64e652182833652f
parent fc0fa9ab
Loading
Loading
Loading
Loading
+46 −55
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2014, 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.
*/
     Copyright (C) 2014 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
@@ -22,11 +20,13 @@
    android:id="@+id/parentPanel"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:background="@drawable/dialog_background_material"
    android:translationZ="@dimen/floating_window_z"
    android:layout_marginLeft="@dimen/leanback_alert_dialog_horizontal_margin"
    android:layout_marginRight="@dimen/leanback_alert_dialog_horizontal_margin"
    android:layout_marginTop="@dimen/leanback_alert_dialog_vertical_margin"
    android:layout_marginBottom="@dimen/leanback_alert_dialog_vertical_margin"
    android:orientation="vertical">
    android:layout_marginRight="@dimen/leanback_alert_dialog_horizontal_margin"
    android:layout_marginBottom="@dimen/leanback_alert_dialog_vertical_margin">

    <LinearLayout android:id="@+id/topPanel"
        android:layout_width="match_parent"
@@ -37,16 +37,17 @@
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center_vertical|start"
            android:minHeight="@dimen/alert_dialog_title_height"
            android:layout_marginStart="16dip"
            android:layout_marginEnd="16dip">
            android:paddingStart="16dip"
            android:paddingEnd="16dip"
            android:paddingTop="16dip">
            <ImageView android:id="@+id/icon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingEnd="8dip"
                android:layout_width="32dip"
                android:layout_height="32dip"
                android:layout_marginEnd="8dip"
                android:scaleType="fitCenter"
                android:src="@null" />
            <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
                style="?android:attr/windowTitleStyle"
            <TextView android:id="@+id/alertTitle"
                style="?attr/windowTitleStyle"
                android:singleLine="true"
                android:ellipsize="end"
                android:layout_width="match_parent"
@@ -67,13 +68,12 @@
            android:layout_height="wrap_content"
            android:clipToPadding="false">
            <TextView android:id="@+id/message"
                style="?android:attr/textAppearanceMedium"
                style="?attr/textAppearanceMedium"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingStart="16dip"
                android:paddingEnd="16dip"
                android:paddingTop="8dip"
                android:paddingBottom="8dip"/>
                android:paddingTop="16dip" />
        </ScrollView>
    </LinearLayout>

@@ -91,41 +91,32 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="@dimen/alert_dialog_button_bar_height"
        android:orientation="vertical">
        android:orientation="vertical"
        android:gravity="end"
        android:padding="16dip">
        <LinearLayout
            style="?android:attr/buttonBarStyle"
            android:layout_width="match_parent"
            style="?attr/buttonBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layoutDirection="locale"
            android:measureWithLargestChild="true">
            <Button android:id="@+id/button2"
            android:layoutDirection="locale">
            <Button android:id="@+id/button3"
                style="?attr/buttonBarButtonStyle"
                android:layout_width="wrap_content"
                android:layout_gravity="start"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:maxLines="2"
                style="?android:attr/buttonBarButtonStyle"
                android:textSize="14sp"
                android:minHeight="@dimen/alert_dialog_button_bar_height"
                android:layout_height="wrap_content" />
            <Button android:id="@+id/button3"
                android:minHeight="@dimen/alert_dialog_button_bar_height" />
            <Button android:id="@+id/button2"
                style="?attr/buttonBarButtonStyle"
                android:layout_width="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:maxLines="2"
                style="?android:attr/buttonBarButtonStyle"
                android:textSize="14sp"
                android:minHeight="@dimen/alert_dialog_button_bar_height"
                android:layout_height="wrap_content" />
                android:minHeight="@dimen/alert_dialog_button_bar_height" />
            <Button android:id="@+id/button1"
                style="?attr/buttonBarButtonStyle"
                android:layout_width="wrap_content"
                android:layout_gravity="end"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:maxLines="2"
                android:minHeight="@dimen/alert_dialog_button_bar_height"
                style="?android:attr/buttonBarButtonStyle"
                android:textSize="14sp"
                android:layout_height="wrap_content" />
                android:minHeight="@dimen/alert_dialog_button_bar_height" />
        </LinearLayout>
     </LinearLayout>
</LinearLayout>
+60 −68
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2014, 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.
*/
     Copyright (C) 2014 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
@@ -22,16 +20,18 @@
    android:id="@+id/parentPanel"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:background="@drawable/dialog_background_material"
    android:translationZ="@dimen/floating_window_z"
    android:layout_marginLeft="@dimen/leanback_alert_dialog_horizontal_margin"
    android:layout_marginRight="@dimen/leanback_alert_dialog_horizontal_margin"
    android:layout_marginTop="@dimen/leanback_alert_dialog_vertical_margin"
    android:layout_marginBottom="@dimen/leanback_alert_dialog_vertical_margin"
    android:orientation="horizontal">
    android:layout_marginRight="@dimen/leanback_alert_dialog_horizontal_margin"
    android:layout_marginBottom="@dimen/leanback_alert_dialog_vertical_margin">

   <LinearLayout
       android:id="@+id/leftPanel"
       android:layout_width="0dp"
      android:layout_weight="0.66"
       android:layout_weight="1"
       android:layout_height="wrap_content"
       android:orientation="vertical">

@@ -44,16 +44,17 @@
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center_vertical|start"
            android:minHeight="@dimen/alert_dialog_title_height"
            android:layout_marginStart="16dip"
            android:layout_marginEnd="16dip">
            android:paddingStart="16dip"
            android:paddingEnd="16dip"
            android:paddingTop="16dip">
            <ImageView android:id="@+id/icon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingEnd="8dip"
                android:layout_width="32dip"
                android:layout_height="32dip"
                android:layout_marginEnd="8dip"
                android:scaleType="fitCenter"
                android:src="@null" />
            <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
                style="?android:attr/windowTitleStyle"
            <TextView android:id="@+id/alertTitle"
                style="?attr/windowTitleStyle"
                android:singleLine="true"
                android:ellipsize="end"
                android:layout_width="match_parent"
@@ -66,6 +67,7 @@
    <LinearLayout android:id="@+id/contentPanel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical"
        android:minHeight="64dp">
        <ScrollView android:id="@+id/scrollView"
@@ -73,13 +75,13 @@
            android:layout_height="wrap_content"
            android:clipToPadding="false">
            <TextView android:id="@+id/message"
                style="?android:attr/textAppearanceMedium"
                style="?attr/textAppearanceMedium"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingStart="16dip"
                android:paddingEnd="16dip"
                android:paddingTop="8dip"
                android:paddingBottom="8dip"/>
                android:paddingTop="16dip"
		android:paddingBottom="16dip" />
        </ScrollView>
    </LinearLayout>

@@ -95,48 +97,38 @@
    </LinearLayout>

    <LinearLayout android:id="@+id/buttonPanel"
        android:layout_width="0dp"
	android:layout_weight="0.33"
        android:layout_height="match_parent"
        android:minHeight="@dimen/alert_dialog_button_bar_height"
	android:paddingLeft="32dp"
	android:paddingRight="32dp"
        android:orientation="horizontal">
        <LinearLayout
            style="?android:attr/buttonBarStyle"
            android:layout_width="match_parent"
        android:layout_width="wrap_content"
android:background="#ffffff"
        android:layout_height="wrap_content"
	android:layout_gravity="center_vertical"
        android:minHeight="@dimen/alert_dialog_button_bar_height"
        android:orientation="vertical"
        android:gravity="end"
        android:padding="16dip">
        <LinearLayout
            style="?attr/buttonBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layoutDirection="locale"
            android:measureWithLargestChild="true">
            <Button android:id="@+id/button1"
                android:layout_width="match_parent"
                android:gravity="center_vertical"
                android:layout_weight="1"
                android:maxLines="2"
                style="?android:attr/buttonBarButtonStyle"
                android:textSize="14sp"
                android:minHeight="@dimen/alert_dialog_button_bar_height"
                android:layout_height="wrap_content" />
	    android:orientation="vertical">
            <Button android:id="@+id/button3"
                style="?attr/buttonBarButtonStyle"
                android:layout_width="match_parent"
                android:gravity="center_vertical"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:maxLines="2"
                style="?android:attr/buttonBarButtonStyle"
                android:textSize="14sp"
                android:minHeight="@dimen/alert_dialog_button_bar_height"
                android:layout_height="wrap_content" />
                android:minHeight="@dimen/alert_dialog_button_bar_height" />
            <Button android:id="@+id/button2"
                style="?attr/buttonBarButtonStyle"
                android:layout_width="match_parent"
                android:gravity="center_vertical"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:maxLines="2"
                android:minHeight="@dimen/alert_dialog_button_bar_height"
                style="?android:attr/buttonBarButtonStyle"
                android:textSize="14sp"
                android:layout_height="wrap_content" />
                android:minHeight="@dimen/alert_dialog_button_bar_height" />
            <Button android:id="@+id/button1"
                style="?attr/buttonBarButtonStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLines="2"
                android:minHeight="@dimen/alert_dialog_button_bar_height" />
        </LinearLayout>
     </LinearLayout>
</LinearLayout>
+0 −48
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2014, 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:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <View
        android:layout_width="match_parent"
        android:layout_height="2dip"
        android:background="@android:color/leanback_dark_gray" />
    <LinearLayout android:id="@+id/body"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:baselineAligned="false"
        android:padding="16dip">

        <ProgressBar android:id="@android:id/progress"
            style="?android:attr/progressBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:max="10000"
            android:layout_marginEnd="16dip" />

        <TextView android:id="@+id/message"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical" />
    </LinearLayout>
</LinearLayout>
+5 −0
Original line number Diff line number Diff line
@@ -16,8 +16,13 @@
<resources>
    <style name="Theme.Dialog.Alert" parent="Theme.Leanback.Light.Dialog.Alert" />
    <style name="Theme.Dialog.AppError" parent="Theme.Leanback.Dialog.AppError" />
    <style name="Theme.Dialog.TimePicker" parent="Theme.Leanback.Dialog.TimePicker" />
    <style name="Theme.Holo.Dialog.Alert" parent="Theme.Leanback.Dialog.Alert" />
    <style name="Theme.Holo.Dialog.TimePicker" parent="Theme.Leanback.Dialog.TimePicker" />
    <style name="Theme.Holo.Light.Dialog.Alert" parent="Theme.Leanback.Light.Dialog.Alert" />
    <style name="Theme.Holo.Light.Dialog.TimePicker" parent="Theme.Leanback.Light.Dialog.TimePicker" />
    <style name="Theme.Material.Dialog.Alert" parent="Theme.Leanback.Dialog.Alert" />
    <style name="Theme.Material.Dialog.TimePicker" parent="Theme.Leanback.Dialog.TimePicker" />
    <style name="Theme.Material.Light.Dialog.Alert" parent="Theme.Leanback.Light.Dialog.Alert" />
    <style name="Theme.Material.Light.Dialog.TimePicker" parent="Theme.Leanback.Light.Dialog.TimePicker" />
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -16,4 +16,6 @@
<resources>
    <style name="Theme.DeviceDefault.Dialog.Alert" parent="Theme.Leanback.Dialog.Alert" />
    <style name="Theme.DeviceDefault.Light.Dialog.Alert" parent="Theme.Leanback.Light.Dialog.Alert" />
    <style name="Theme.DeviceDefault.Dialog.TimePicker" parent="Theme.Leanback.Dialog.TimePicker" />
    <style name="Theme.DeviceDefault.Light.Dialog.TimePicker" parent="Theme.Leanback.Light.Dialog.TimePicker" />
</resources>
Loading