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

Commit 26bcdf14 authored by Craig Stout's avatar Craig Stout Committed by Android (Google) Code Review
Browse files

Merge "Fix alert, date picker, time picker dialogs for TV." into lmp-dev

parents bb8f4a61 fd4bc4cd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ public class TimePickerDialog extends AlertDialog implements OnClickListener,
        setView(view);
        setButton(BUTTON_POSITIVE, themeContext.getString(R.string.ok), this);
        setButton(BUTTON_NEGATIVE, themeContext.getString(R.string.cancel), this);
        setButtonPanelLayoutHint(LAYOUT_HINT_SIDE);

        mTimePicker = (TimePicker) view.findViewById(R.id.timePicker);
        mTimePicker.setIs24HourView(mIs24HourView);
+13 −21
Original line number Diff line number Diff line
@@ -20,13 +20,7 @@
    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_marginTop="@dimen/leanback_alert_dialog_vertical_margin"
    android:layout_marginRight="@dimen/leanback_alert_dialog_horizontal_margin"
    android:layout_marginBottom="@dimen/leanback_alert_dialog_vertical_margin">
    android:orientation="horizontal">

   <LinearLayout
       android:id="@+id/leftPanel"
@@ -46,14 +40,15 @@
            android:gravity="center_vertical|start"
            android:paddingStart="16dip"
            android:paddingEnd="16dip"
            android:paddingTop="16dip">
            android:paddingTop="16dip"
            android:paddingBottom="8dip">
            <ImageView android:id="@+id/icon"
                android:layout_width="32dip"
                android:layout_height="32dip"
                android:layout_marginEnd="8dip"
                android:scaleType="fitCenter"
                android:src="@null" />
            <TextView android:id="@+id/alertTitle"
            <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
                style="?attr/windowTitleStyle"
                android:singleLine="true"
                android:ellipsize="end"
@@ -90,41 +85,38 @@
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:minHeight="64dp">
        <FrameLayout android:id="@+android:id/custom"
        <FrameLayout android:id="@+id/custom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </FrameLayout>
    </LinearLayout>

    <LinearLayout android:id="@+id/buttonPanel"
        style="?attr/buttonBarStyle"
        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">
        android:gravity="end">
        <LinearLayout
            style="?attr/buttonBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layoutDirection="locale"
            android:orientation="vertical">
            <Button android:id="@+id/button3"
                style="?attr/buttonBarButtonStyle"
                style="?attr/buttonBarNeutralButtonStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLines="2"
                android:minHeight="@dimen/alert_dialog_button_bar_height" />
            <Button android:id="@+id/button2"
                style="?attr/buttonBarButtonStyle"
                style="?attr/buttonBarNegativeButtonStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLines="2"
                android:minHeight="@dimen/alert_dialog_button_bar_height" />
            <Button android:id="@+id/button1"
                style="?attr/buttonBarButtonStyle"
                style="?attr/buttonBarPositiveButtonStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLines="2"
+0 −82
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     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 xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/timePickerLayout"
    android:orientation="horizontal"
    android:layout_gravity="center_horizontal"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingStart="8dip"
    android:paddingEnd="8dip">

    <LinearLayout android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingStart="8dip"
        android:paddingEnd="8dip"
        android:layoutDirection="ltr">

        <!-- hour -->
        <NumberPicker
            android:id="@+id/hour"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dip"
            android:layout_marginBottom="16dip"
            android:focusable="true"
            android:focusableInTouchMode="true"
            />

        <!-- divider -->
        <TextView
            android:id="@+id/divider"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dip"
            android:layout_marginEnd="6dip"
            android:layout_gravity="center_vertical"
            android:importantForAccessibility="no"
            />

        <!-- minute -->
        <NumberPicker
            android:id="@+id/minute"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dip"
            android:layout_marginBottom="16dip"
            android:focusable="true"
            android:focusableInTouchMode="true"
            />

    </LinearLayout>

    <!-- AM / PM -->
    <NumberPicker
        android:id="@+id/amPm"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dip"
        android:layout_marginBottom="16dip"
        android:layout_marginStart="8dip"
        android:layout_marginEnd="8dip"
        android:focusable="true"
        android:focusableInTouchMode="true"
        />

</LinearLayout>
+2 −0
Original line number Diff line number Diff line
@@ -20,4 +20,6 @@
    <style name="Theme.Holo.Light.Dialog.Alert" parent="Theme.Leanback.Light.Dialog.Alert" />
    <style name="Theme.Material.Dialog.Alert" parent="Theme.Leanback.Dialog.Alert" />
    <style name="Theme.Material.Light.Dialog.Alert" parent="Theme.Leanback.Light.Dialog.Alert" />
    <style name="Theme.Material.Dialog" parent="Theme.Leanback.Dialog" />
    <style name="Theme.Material.Light.Dialog" parent="Theme.Leanback.Light.Dialog" />
</resources>
+1 −3
Original line number Diff line number Diff line
@@ -15,8 +15,7 @@
-->
<resources>
    <style name="AlertDialog.Leanback" parent="AlertDialog.Material">
        <item name="layout">@android:layout/alert_dialog_leanback</item>
        <item name="buttonPanelSideLayout">@android:layout/alert_dialog_leanback_button_panel_right</item>
        <item name="buttonPanelSideLayout">@android:layout/alert_dialog_leanback_button_panel_side</item>
    </style>

    <style name="AlertDialog.Leanback.Light">
@@ -24,7 +23,6 @@

    <style name="Widget.Leanback.TimePicker" parent="Widget.Material.TimePicker">
        <item name="timePickerMode">spinner</item>
        <item name="legacyLayout">@layout/time_picker_legacy_leanback</item>
    </style>

    <style name="Widget.Leanback.DatePicker" parent="Widget.Material.DatePicker">
Loading