Update zen rule type selection and view.

Separate rule type selection from naming, launch 3P UI for non-system rules.

Bug: 22977552
Change-Id: Ifbd82da2192c4aaf5f239a188a016d9e1af542d6
This commit is contained in:
Julia Reynolds
2015-09-29 08:15:43 -04:00
parent a3b0c07a57
commit f7748e4ae1
11 changed files with 378 additions and 312 deletions

View File

@@ -43,37 +43,4 @@
android:textColor="@color/zen_rule_name_warning"
android:text="@string/zen_mode_rule_name_warning" />
<RadioGroup
android:id="@+id/rule_types"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginRight="22dp"
android:orientation="vertical"
android:checkedButton="@+id/rule_type_schedule" >
<RadioButton android:id="@+id/rule_type_schedule"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/zen_schedule_rule_type_name" />
<RadioButton android:id="@+id/rule_type_event"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/zen_event_rule_type_name" />
<RadioButton android:id="@+id/rule_type_3"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioButton android:id="@+id/rule_type_4"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioButton android:id="@+id/rule_type_5"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RadioGroup>
</LinearLayout>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingEnd="?android:attr/scrollbarSize"
android:background="?android:attr/selectableItemBackground" >
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dip"
android:layout_marginEnd="6dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textSize="16sp"
android:ellipsize="marquee"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:fadingEdge="horizontal" />
<TextView android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_alignStart="@id/title"
android:textSize="14sp"
android:textColor="?android:attr/textColorSecondary"
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
android:maxLines="2"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbarStyle="outsideOverlay"
android:fastScrollEnabled="true"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:paddingTop="20dp"
android:paddingBottom="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/rule_container" />
</ScrollView>