OSDN Git Service

Update new UI layout of Conditional cards
authorMill Chen <millchen@google.com>
Thu, 8 Nov 2018 10:55:01 +0000 (18:55 +0800)
committerMill Chen <millchen@google.com>
Fri, 9 Nov 2018 03:21:58 +0000 (11:21 +0800)
Bug: 113451905
Test: visual
Change-Id: I20ec526bd2b5b2679cd7e0e4388a2a897fe6a24d

res/layout/homepage_condition_full_tile.xml
res/layout/homepage_condition_half_tile.xml
res/layout/vertical_divider.xml [new file with mode: 0644]
res/values/dimens.xml

index f00132b..01d345b 100644 (file)
     <LinearLayout
         android:id="@+id/content"
         android:layout_width="match_parent"
-        android:layout_height="@dimen/homepage_condition_full_card_height"
+        android:layout_height="wrap_content"
         android:paddingStart="@dimen/homepage_card_padding_start"
         android:paddingEnd="@dimen/homepage_card_padding_end"
+        android:paddingTop="@dimen/homepage_condition_full_card_padding_top"
+        android:paddingBottom="@dimen/homepage_condition_full_card_padding_bottom"
         android:orientation="horizontal"
         android:gravity="center_vertical">
 
 
         </LinearLayout>
 
-        <View
-            android:id="@+id/divider"
-            android:layout_width="@dimen/homepage_condition_full_card_divider_width"
-            android:layout_height="match_parent"
-            android:layout_marginTop="@dimen/homepage_condition_full_card_divider_padding_top"
-            android:layout_marginBottom="@dimen/homepage_condition_full_card_divider_padding_bottom"
-            android:background="?android:attr/dividerVertical" />
+        <include layout="@layout/vertical_divider"/>
 
         <Button
             android:id="@+id/first_action"
index 9cde951..847de42 100644 (file)
@@ -40,6 +40,8 @@
             android:id="@android:id/title"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:maxLines="1"
+            android:ellipsize="end"
             android:layout_marginTop="@dimen/homepage_condition_half_card_title_margin_top"
             android:layout_marginBottom="@dimen/homepage_condition_card_title_margin_bottom"
             style="@style/TextAppearance.ConditionCardTitle"/>
@@ -48,6 +50,9 @@
             android:id="@android:id/summary"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:maxLines="1"
+            android:ellipsize="end"
+            android:layout_marginBottom="@dimen/homepage_condition_half_card_summary_margin_bottom"
             style="@style/TextAppearance.ConditionCardSummary"/>
 
         <include layout="@layout/horizontal_divider"/>
diff --git a/res/layout/vertical_divider.xml b/res/layout/vertical_divider.xml
new file mode 100644 (file)
index 0000000..4f1cc43
--- /dev/null
@@ -0,0 +1,23 @@
+<?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.
+-->
+
+<View
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/divider"
+    android:layout_width="@dimen/vertical_divider_width"
+    android:layout_height="match_parent"
+    android:background="?android:attr/dividerVertical"/>
index c91ffb5..1433874 100755 (executable)
     <dimen name="horizontal_divider_margin_bottom">8dp</dimen>
     <dimen name="horizontal_divider_height">.75dp</dimen>
 
+    <!-- Vertical divider size -->
+    <dimen name="vertical_divider_width">.75dp</dimen>
+
     <!-- Signal icon in NetworkSelectSetting -->
     <dimen name="signal_strength_icon_size">24dp</dimen>
 
     <dimen name="homepage_condition_half_card_height">150dp</dimen>
     <dimen name="homepage_condition_half_card_padding_top">12dp</dimen>
     <dimen name="homepage_condition_half_card_title_margin_top">12dp</dimen>
-    <dimen name="homepage_condition_full_card_height">72dp</dimen>
+    <dimen name="homepage_condition_half_card_summary_margin_bottom">12dp</dimen>
     <dimen name="homepage_condition_full_card_padding_start">24dp</dimen>
     <dimen name="homepage_condition_full_card_padding_end">24dp</dimen>
-    <dimen name="homepage_condition_full_card_divider_width">.75dp</dimen>
-    <dimen name="homepage_condition_full_card_divider_padding_top">12dp</dimen>
-    <dimen name="homepage_condition_full_card_divider_padding_bottom">12dp</dimen>
+    <dimen name="homepage_condition_full_card_padding_top">12dp</dimen>
+    <dimen name="homepage_condition_full_card_padding_bottom">12dp</dimen>
 
 </resources>