diff options
-rw-r--r-- | library/main/res/drawable-v21/suw_edit_text_bg_shape.xml | 21 | ||||
-rw-r--r-- | library/main/res/drawable-v21/suw_edittext_bg.xml | 52 | ||||
-rw-r--r-- | library/main/res/values-v21/styles.xml | 5 | ||||
-rw-r--r-- | library/main/res/values/attrs.xml | 1 | ||||
-rw-r--r-- | library/main/res/values/colors.xml | 1 | ||||
-rw-r--r-- | library/main/res/values/dimens.xml | 3 | ||||
-rw-r--r-- | library/main/res/values/styles.xml | 9 |
7 files changed, 92 insertions, 0 deletions
diff --git a/library/main/res/drawable-v21/suw_edit_text_bg_shape.xml b/library/main/res/drawable-v21/suw_edit_text_bg_shape.xml new file mode 100644 index 0000000..ad55ec6 --- /dev/null +++ b/library/main/res/drawable-v21/suw_edit_text_bg_shape.xml @@ -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>
\ No newline at end of file diff --git a/library/main/res/drawable-v21/suw_edittext_bg.xml b/library/main/res/drawable-v21/suw_edittext_bg.xml new file mode 100644 index 0000000..b69c10b --- /dev/null +++ b/library/main/res/drawable-v21/suw_edittext_bg.xml @@ -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> diff --git a/library/main/res/values-v21/styles.xml b/library/main/res/values-v21/styles.xml index 6e4c0dd..f78149b 100644 --- a/library/main/res/values-v21/styles.xml +++ b/library/main/res/values-v21/styles.xml @@ -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> diff --git a/library/main/res/values/attrs.xml b/library/main/res/values/attrs.xml index ec21f87..7820a6d 100644 --- a/library/main/res/values/attrs.xml +++ b/library/main/res/values/attrs.xml @@ -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. --> diff --git a/library/main/res/values/colors.xml b/library/main/res/values/colors.xml index 7d2575e..b653c98 100644 --- a/library/main/res/values/colors.xml +++ b/library/main/res/values/colors.xml @@ -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> diff --git a/library/main/res/values/dimens.xml b/library/main/res/values/dimens.xml index 5978a4e..f5c2563 100644 --- a/library/main/res/values/dimens.xml +++ b/library/main/res/values/dimens.xml @@ -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> diff --git a/library/main/res/values/styles.xml b/library/main/res/values/styles.xml index e1e229f..1d7d28b 100644 --- a/library/main/res/values/styles.xml +++ b/library/main/res/values/styles.xml @@ -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> |