Merge "Update text field style to Material 2 for suw"
This commit is contained in:
commit
462823c777
21
library/main/res/drawable-v21/suw_edit_text_bg_shape.xml
Normal file
21
library/main/res/drawable-v21/suw_edit_text_bg_shape.xml
Normal 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>
|
52
library/main/res/drawable-v21/suw_edittext_bg.xml
Normal file
52
library/main/res/drawable-v21/suw_edittext_bg.xml
Normal 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>
|
|
@ -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>
|
||||
|
|
|
@ -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. -->
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue