Merge "Update text field style to Material 2 for suw"

This commit is contained in:
TreeHugger Robot 2017-12-14 20:24:54 +00:00 committed by Android (Google) Code Review
commit 462823c777
7 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="4dp" android:topRightRadius="4dp"/>
<solid android:color="?attr/suwEditTextBackgroundColor"/>
</shape>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false">
<layer-list>
<item android:drawable="@drawable/suw_edit_text_bg_shape" android:bottom="1dp"/>
<item android:gravity="bottom">
<shape>
<size android:height="1dp"/>
<solid android:color="?android:attr/textColorSecondary"/>
</shape>
</item>
</layer-list>
</item>
<item android:state_focused="false" android:state_pressed="false">
<layer-list>
<item android:drawable="@drawable/suw_edit_text_bg_shape" android:bottom="1dp" />
<item android:gravity="bottom">
<shape>
<size android:height="1dp"/>
<solid android:color="?android:attr/textColorSecondary"/>
</shape>
</item>
</layer-list>
</item>
<item>
<layer-list>
<item android:drawable="@drawable/suw_edit_text_bg_shape" android:bottom="2dp" />
<item android:gravity="bottom">
<shape>
<size android:height="2dp"/>
<solid android:color="?android:attr/colorAccent"/>
</shape>
</item>
</layer-list>
</item>
</selector>

View file

@ -93,4 +93,9 @@
<item name="suwNavBarButtonBackground">@drawable/suw_navbar_btn_bg</item>
</style>
<style name="SuwEditText" parent="@android:style/Widget.Material.EditText">
<item name="android:minHeight">@dimen/suw_edit_text_min_height</item>
<item name="android:background">@drawable/suw_edittext_bg</item>
</style>
</resources>

View file

@ -21,6 +21,7 @@
<attr name="suwLayoutTheme" format="reference" />
<attr name="suwMarginSides" format="dimension|reference" />
<attr name="suwButtonColor" format="color" />
<attr name="suwEditTextBackgroundColor" format="color" />
<!-- Subset of values in "gravity" in frameworks/base/core/res/res/values/attrs.xml. Only
horizontal values are listed here as the header does not support vertical gravity. -->

View file

@ -45,5 +45,6 @@
<color name="suw_glif_background_color_dark">#ff000000</color>
<color name="suw_glif_background_color_light">#ffffffff</color>
<color name="suw_glif_v3_footer_button_color">#ff1a73e8</color>
<color name="suw_glif_edittext_bg_light_color">#F1F3F4</color>
</resources>

View file

@ -135,4 +135,7 @@
<dimen name="suw_progress_bar_margin_vertical">-7dp</dimen>
<dimen name="suw_glif_progress_bar_margin_vertical">7dp</dimen>
<!-- Edit Text dimensions -->
<dimen name="suw_edit_text_min_height">56dp</dimen>
</resources>

View file

@ -30,6 +30,8 @@
<item name="suwDividerInsetStartNoIcon">?attr/suwMarginSides</item>
<item name="suwGlifHeaderGravity">center_horizontal</item>
<item name="suwScrollIndicators">top|bottom</item>
<item name="suwEditTextBackgroundColor">@color/suw_glif_edittext_bg_light_color</item> <!-- TODO: Change color -->
<item name="android:editTextStyle">@style/SuwEditText</item>
</style>
<style name="SuwThemeGlifV2.Light" parent="SuwThemeGlif.Light">
@ -43,6 +45,8 @@
<item name="suwDividerInsetStartNoIcon">?attr/suwMarginSides</item>
<item name="suwGlifHeaderGravity">center_horizontal</item>
<item name="suwScrollIndicators">top|bottom</item>
<item name="suwEditTextBackgroundColor">@color/suw_glif_edittext_bg_light_color</item>
<item name="android:editTextStyle">@style/SuwEditText</item>
</style>
<style name="SuwThemeGlifV3" parent="SuwThemeGlifV2">
@ -313,4 +317,9 @@
<item name="suwNavBarTextColor">?android:attr/textColorPrimary</item>
</style>
<style name="SuwEditText" parent="@android:style/Widget.EditText">
<item name="android:minHeight">@dimen/suw_edit_text_min_height</item>
</style>
</resources>