Skip to content

Commit c0dfeb0

Browse files
committed
Adds more style customizations.
1 parent a7a16f8 commit c0dfeb0

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

app/src/main/res/layout/activity_main.xml

+28
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,32 @@
6161
/>
6262

6363
</android.support.design.widget.TextInputLayout>
64+
65+
<android.support.design.widget.TextInputLayout
66+
67+
app:theme="@style/override_theme2"
68+
android:layout_width="fill_parent"
69+
android:layout_height="wrap_content">
70+
71+
<android.support.v7.widget.AppCompatEditText
72+
android:layout_width="fill_parent"
73+
android:layout_height="wrap_content"
74+
android:hint="Special empty 2"
75+
/>
76+
77+
</android.support.design.widget.TextInputLayout>
78+
79+
<android.support.design.widget.TextInputLayout
80+
app:theme="@style/override_theme2"
81+
android:layout_width="fill_parent"
82+
android:layout_height="wrap_content">
83+
84+
<android.support.v7.widget.AppCompatEditText
85+
android:layout_width="fill_parent"
86+
android:layout_height="wrap_content"
87+
android:hint="Special hint2"
88+
android:text="This should look different2"
89+
/>
90+
91+
</android.support.design.widget.TextInputLayout>
6492
</LinearLayout>

app/src/main/res/values/styles.xml

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@
55
<!-- Customize your theme here. -->
66
<item name="colorPrimary">#2196F3</item>
77
<item name="colorPrimaryDark">#1565C0</item>
8-
<item name="colorAccent">#ffbE63</item>
8+
<item name="colorAccent">#ffbE63</item> <!-- Used for the underline and floating color -->
99
</style>
1010

1111
<style name="override_theme" parent="AppTheme">
1212
<item name="colorPrimary">#FF0000</item>
1313
<item name="colorPrimaryDark">#00FF00</item>
1414
<item name="colorAccent">#00FFFF</item>
15+
<item name="android:textColorHint">#FF0000</item> <!-- Used for the hint text AND floating when text is filled in -->
16+
</style>
17+
18+
<style name="override_theme2" parent="AppTheme">
19+
<item name="colorControlNormal">#7F0000</item> <!-- Used for the underline when not selected -->
20+
<item name="colorControlActivated">#007F00</item> <!-- Underline and floating text when active -->
21+
<item name="colorControlHighlight">#007F7F</item>
1522
</style>
1623

1724
</resources>

0 commit comments

Comments
 (0)