Skip to content

Commit

Permalink
Fix darkmode issue with Country dropdown (#1474)
Browse files Browse the repository at this point in the history
The Country adapter's dropdown views had illegible text.
Fix this by using the correct `textColorSecondary` color
in darkmode.
  • Loading branch information
mshafrir-stripe authored Sep 4, 2019
1 parent daf4de0 commit 834790c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
File renamed without changes.
2 changes: 2 additions & 0 deletions stripe/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
<color name="color_text_unselected_primary_default">#e1e1e1</color>
<color name="toolbar_color_default">#1f1f1f</color>
<color name="toolbar_color_default_dark">#000000</color>

<color name="text_color_secondary">@android:color/secondary_text_dark</color>
</resources>
3 changes: 3 additions & 0 deletions stripe/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<color name="slate_50">#3332325d</color>
<color name="toolbar_color_default">#ff3f51b5</color>
<color name="toolbar_color_default_dark">#ff324090</color>

<color name="title_text_color">@android:color/white</color>
<color name="text_color_secondary">@android:color/secondary_text_light</color>
</resources>
4 changes: 2 additions & 2 deletions stripe/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<item name="colorControlNormal">@color/control_normal_color_default</item>
<item name="colorPrimary">@color/toolbar_color_default</item>
<item name="colorPrimaryDark">@color/toolbar_color_default_dark</item>
<item name="titleTextColor">@android:color/white</item>
<item name="android:textColorSecondary">@android:color/secondary_text_light</item>
<item name="titleTextColor">@color/title_text_color</item>
<item name="android:textColorSecondary">@color/text_color_secondary</item>
</style>

<style name="StripeToolBarStyle" parent="@style/ThemeOverlay.AppCompat">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import java.util.Locale
internal class CountryAdapter(
context: Context,
private val initialCountries: List<String>
) : ArrayAdapter<String>(context, R.layout.menu_text_view) {
) : ArrayAdapter<String>(context, R.layout.country_text_view) {
private val countryFilter: Filter = createFilter()
private var suggestions: List<String>? = initialCountries

Expand All @@ -38,7 +38,7 @@ internal class CountryAdapter(
view
} else {
val countryText = LayoutInflater.from(context).inflate(
R.layout.menu_text_view, viewGroup, false) as TextView
R.layout.country_text_view, viewGroup, false) as TextView
countryText.text = getItem(i)
countryText
}
Expand Down

0 comments on commit 834790c

Please sign in to comment.