From e59e7fbfe01d467178a0ace9c57f2cae9e81d160 Mon Sep 17 00:00:00 2001 From: Hemanth S Date: Sun, 24 May 2020 04:53:44 +0530 Subject: [PATCH] Added font adaptive --- .../name/monkey/retromusic/activities/MainActivity.kt | 6 +++--- .../retromusic/glide/UserProfileGlideRequest.java | 11 +++++++---- app/src/main/res/layout/activity_about.xml | 1 + app/src/main/res/layout/list_item_color_view.xml | 2 +- app/src/main/res/layout/list_item_view.xml | 2 +- app/src/main/res/layout/list_item_view_seekbar.xml | 4 +++- app/src/main/res/layout/list_item_view_switch.xml | 2 +- app/src/main/res/layout/list_setting_item_view.xml | 1 + app/src/main/res/values/styles.xml | 4 +--- 9 files changed, 19 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt index c0c9f71a..b53bbbd8 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt @@ -59,12 +59,11 @@ import com.google.android.play.core.appupdate.AppUpdateManagerFactory import com.google.android.play.core.install.InstallState import com.google.android.play.core.install.InstallStateUpdatedListener import com.google.android.play.core.install.model.AppUpdateType -import com.google.android.play.core.install.model.InstallStatus -import com.google.android.play.core.install.model.InstallStatus.* +import com.google.android.play.core.install.model.InstallStatus.DOWNLOADED +import com.google.android.play.core.install.model.InstallStatus.INSTALLED import com.google.android.play.core.install.model.UpdateAvailability import com.google.android.play.core.tasks.Task import kotlinx.android.synthetic.main.activity_main_content.* -import java.math.BigInteger import java.util.* class MainActivity : AbsSlidingMusicPanelActivity(), @@ -621,6 +620,7 @@ class MainActivity : AbsSlidingMusicPanelActivity(), supportFragmentManager.commit { replace(R.id.fragment_container, fragment, tag) } + currentFragment = fragment as MainActivityFragmentCallbacks } private fun selectedFragment(itemId: Int) { diff --git a/app/src/main/java/code/name/monkey/retromusic/glide/UserProfileGlideRequest.java b/app/src/main/java/code/name/monkey/retromusic/glide/UserProfileGlideRequest.java index f0581ce6..9742a1bd 100644 --- a/app/src/main/java/code/name/monkey/retromusic/glide/UserProfileGlideRequest.java +++ b/app/src/main/java/code/name/monkey/retromusic/glide/UserProfileGlideRequest.java @@ -1,6 +1,7 @@ package code.name.monkey.retromusic.glide; import android.graphics.Bitmap; +import android.graphics.drawable.Drawable; import androidx.annotation.NonNull; @@ -13,6 +14,8 @@ import com.bumptech.glide.signature.MediaStoreSignature; import java.io.File; +import code.name.monkey.appthemehelper.ThemeStore; +import code.name.monkey.appthemehelper.util.TintHelper; import code.name.monkey.retromusic.App; import code.name.monkey.retromusic.R; @@ -39,10 +42,12 @@ public class UserProfileGlideRequest { public static class Builder { private RequestManager requestManager; private File profile; + private Drawable error; private Builder(RequestManager requestManager, File profile) { this.requestManager = requestManager; this.profile = profile; + error = TintHelper.createTintedDrawable(App.Companion.getContext(), R.drawable.ic_account_white_24dp, ThemeStore.Companion.accentColor(App.Companion.getContext())); } public static Builder from(@NonNull RequestManager requestManager, File profile) { @@ -51,10 +56,9 @@ public class UserProfileGlideRequest { @NonNull public BitmapRequestBuilder build() { - //noinspection unchecked return createBaseRequest(requestManager, profile) .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY) - .placeholder(DEFAULT_ERROR_IMAGE) + .error(error) .animate(DEFAULT_ANIMATION) .signature(createSignature(profile)); } @@ -68,10 +72,9 @@ public class UserProfileGlideRequest { } public BitmapRequestBuilder build() { - //noinspection unchecked return createBaseRequest(builder.requestManager, builder.profile) .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY) - .error(DEFAULT_ERROR_IMAGE) + .error(builder.error) .animate(DEFAULT_ANIMATION) .signature(createSignature(builder.profile)); } diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index f1c0419a..9189ab32 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -36,6 +36,7 @@ diff --git a/app/src/main/res/layout/list_item_color_view.xml b/app/src/main/res/layout/list_item_color_view.xml index 1f13faab..ab19660b 100644 --- a/app/src/main/res/layout/list_item_color_view.xml +++ b/app/src/main/res/layout/list_item_color_view.xml @@ -58,7 +58,7 @@ app:layout_constraintEnd_toStartOf="@android:id/widget_frame" app:layout_constraintStart_toStartOf="@+id/guideline_front_margin" app:layout_constraintTop_toBottomOf="@android:id/title" - app:lineHeightHint="20sp" + android:textAppearance="@style/TextViewNormal" tools:maxLines="2" tools:text="@tools:sample/lorem/random" /> diff --git a/app/src/main/res/layout/list_item_view.xml b/app/src/main/res/layout/list_item_view.xml index 8a222251..df7a9878 100644 --- a/app/src/main/res/layout/list_item_view.xml +++ b/app/src/main/res/layout/list_item_view.xml @@ -60,7 +60,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="@+id/guideline_front_margin" app:layout_constraintTop_toBottomOf="@android:id/title" - app:lineHeightHint="20sp" + android:textAppearance="@style/TextViewNormal" tools:maxLines="2" tools:text="@tools:sample/lorem/random" /> diff --git a/app/src/main/res/layout/list_item_view_seekbar.xml b/app/src/main/res/layout/list_item_view_seekbar.xml index a20fb1c6..b22f4bc9 100644 --- a/app/src/main/res/layout/list_item_view_seekbar.xml +++ b/app/src/main/res/layout/list_item_view_seekbar.xml @@ -58,7 +58,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="@+id/guideline_front_margin" app:layout_constraintTop_toBottomOf="@android:id/title" - app:lineHeightHint="20sp" + android:textAppearance="@style/TextViewNormal" tools:maxLines="2" tools:text="@tools:sample/lorem/random" /> @@ -71,6 +71,8 @@ diff --git a/app/src/main/res/layout/list_setting_item_view.xml b/app/src/main/res/layout/list_setting_item_view.xml index bd10afee..96ea3f17 100644 --- a/app/src/main/res/layout/list_setting_item_view.xml +++ b/app/src/main/res/layout/list_setting_item_view.xml @@ -63,6 +63,7 @@ android:ellipsize="marquee" android:fadingEdge="horizontal" android:maxLines="2" + android:textAppearance="@style/TextViewNormal" android:textColor="?android:attr/textColorSecondary" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 095d7080..a37233b3 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -109,9 +109,7 @@ +