Skip to content

Commit 8931839

Browse files
authored
Merge pull request #14849 from woocommerce/woomob-1547-ipppos-we-dont-show-pictures-on-tablets-card-reader
[WOOMOB-1547] Fix card reader dialog images not showing on tablets
2 parents f8bb8f0 + 1be89d8 commit 8931839

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- [Internal] Improve WebView experience by using Authenticated WebView for more scenarios [https://github.com/woocommerce/woocommerce-android/pull/14826]
77
- [Internal] Update In-Person Payments setup flow to use Authenticated WebView [https://github.com/woocommerce/woocommerce-android/pull/14827]
88
- [*] Improved the Filters button colors on the Orders and Products screens [https://github.com/woocommerce/woocommerce-android/pull/14832]
9+
- [*] Fixed an issue when images for the card reader flows were not shown on tablets [https://github.com/woocommerce/woocommerce-android/pull/14849]
910
- [*] Fixed an issue where the count of the filters applied to the orders was not updated correctly [https://github.com/woocommerce/woocommerce-android/pull/14844]
1011

1112
23.5

WooCommerce/src/main/kotlin/com/woocommerce/android/util/UiHelpers.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,14 @@ object UiHelpers {
110110
@Suppress("MagicNumber")
111111
private fun isFontScaleIncreased(fontScale: Float): Boolean = fontScale > 1.5f
112112

113-
private fun Context.isDisplaySizeScaleIncreased(): Boolean =
114-
resources.displayMetrics.densityDpi > DisplayMetrics.DENSITY_DEVICE_STABLE
113+
@Suppress("MagicNumber")
114+
private fun Context.isDisplaySizeScaleIncreased(): Boolean {
115+
val densityDpi = resources.displayMetrics.densityDpi
116+
val deviceStableDensity = DisplayMetrics.DENSITY_DEVICE_STABLE
117+
val increasePercentage = ((densityDpi - deviceStableDensity).toFloat() / deviceStableDensity) * 100
118+
// require a >15% increase in density rather than any increase.
119+
return increasePercentage > 15f
120+
}
115121

116122
/**
117123
* Returns View.GONE if either the font scale is large or the accessibility display size is changed, otherwise View.VISIBLE.

0 commit comments

Comments
 (0)