[mobile] fix bottom sheet color

pull/123/head
FongMi 3 years ago
parent 42ee444c72
commit 6224efcdc9
  1. 2
      app/src/main/res/values/styles.xml
  2. 6
      app/src/mobile/java/com/fongmi/android/tv/Product.java
  3. BIN
      app/src/mobile/res/drawable-nodpi/wallpaper_3.webp
  4. BIN
      app/src/mobile/res/drawable-nodpi/wallpaper_4.webp
  5. 2
      app/src/mobile/res/drawable/shape_bottom_sheet.xml

@ -34,7 +34,7 @@
<item name="android:background">@drawable/shape_bottom_sheet</item>
</style>
<style name="ThemeOverlay.App.BottomSheetDialog" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<style name="ThemeOverlay.App.BottomSheetDialog" parent="Theme.MaterialComponents.DayNight.BottomSheetDialog">
<item name="bottomSheetStyle">@style/ModalBottomSheetDialog</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowIsFloating">false</item>

@ -38,12 +38,14 @@ public class Product {
}
private static Bitmap crop(Bitmap bitmap) {
int width = ResUtil.getScreenWidth();
int height = ResUtil.getScreenHeight();
if (bitmap.getWidth() >= bitmap.getHeight()) {
return Bitmap.createBitmap(bitmap, bitmap.getWidth() / 2 - bitmap.getHeight() / 2, 0, bitmap.getHeight(), bitmap.getHeight());
} else if (bitmap.getWidth() < width && bitmap.getHeight() < height) {
return bitmap;
} else {
Matrix matrix = new Matrix();
int width = ResUtil.getScreenWidth();
int height = ResUtil.getScreenHeight();
matrix.postScale((float) width / bitmap.getWidth(), (float) height / bitmap.getHeight());
return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, false);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 64 B

@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white" />
<solid android:color="?attr/colorSurface" />
<corners
android:topLeftRadius="12dp"

Loading…
Cancel
Save