Skip to content

Commit

Permalink
Fixed bug with text hint on Android 8 devices
Browse files Browse the repository at this point in the history
  • Loading branch information
shmutalov committed Nov 10, 2020
1 parent e6a3aa8 commit 7a0d1cf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
29 changes: 17 additions & 12 deletions app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
android:id="@+id/address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/EditTextStyle"
android:textSize="14sp" />

</com.google.android.material.textfield.TextInputLayout>
Expand Down Expand Up @@ -189,17 +190,17 @@
android:layout_marginEnd="3dp"
android:layout_weight="1"
app:errorEnabled="false"
android:hint="@string/mining_pool_address"
android:textColorHint="@color/txt_inactive"
tools:ignore="NestedWeights">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/pool"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/mining_pool_address"
android:inputType="textUri"
android:singleLine="true"
android:textColor="@color/txt_main"
android:textColorHint="@color/txt_inactive"
android:textSize="14sp" />

</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -210,19 +211,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:hint="@string/mining_pool_port"
android:textColorHint="@color/txt_inactive"
app:errorEnabled="false">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/port"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/mining_pool_port"
android:inputType="number"
android:maxLength="6"
android:singleLine="true"
android:textColor="@color/txt_main"
android:textColorHint="@color/txt_inactive"
android:textSize="14sp" />

</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -246,15 +247,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:hint="@string/usernameparametershint"
android:textColorHint="@color/txt_inactive"
app:errorEnabled="false">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/usernameparameters"
style="@style/EditTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/usernameparametershint"
android:textColor="@color/txt_main"
android:textColorHint="@color/txt_inactive"
android:textSize="14sp" />

</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -265,16 +267,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:hint="@string/passwordhint"
android:textColorHint="@color/txt_inactive"
app:errorEnabled="false">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/password"
style="@style/EditTextStyle"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/passwordhint"
android:textColor="@color/txt_main"
android:textColorHint="@color/txt_inactive"
android:textSize="14sp" />

</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -285,15 +288,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:hint="@string/workernamehint"
android:textColorHint="@color/txt_inactive"
app:errorEnabled="false">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/workername"
style="@style/EditTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/workernamehint"
android:textColor="@color/txt_main"
android:textColorHint="@color/txt_inactive"
android:textSize="14sp" />

</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -304,17 +308,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:hint="@string/mininggoalhint"
android:textColorHint="@color/txt_inactive"
app:errorEnabled="false">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/mininggoal"
style="@style/EditTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/mininggoalhint"
android:inputType="number"
android:textColor="@color/txt_main"
android:textColorHint="@color/txt_inactive"
android:textSize="14sp"
android:enabled="false" />

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values-v26/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<resources>

<style name="EditTextStyle" parent="@style/Widget.AppCompat.EditText">
<item name="android:importantForAutofill">noExcludeDescendants</item>
</style>

</resources>
4 changes: 4 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@
<!-- inactive track color (30% transparency) -->
<item name="android:colorForeground">@color/c_grey</item>
</style>

<style name="EditTextStyle" parent="@style/Widget.AppCompat.EditText">

</style>
</resources>

0 comments on commit 7a0d1cf

Please sign in to comment.