Added font adaptive

This commit is contained in:
Hemanth S 2020-05-24 04:53:44 +05:30
parent 10503c183a
commit e59e7fbfe0
9 changed files with 19 additions and 14 deletions

View file

@ -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.InstallState
import com.google.android.play.core.install.InstallStateUpdatedListener 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.AppUpdateType
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.* 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.install.model.UpdateAvailability
import com.google.android.play.core.tasks.Task import com.google.android.play.core.tasks.Task
import kotlinx.android.synthetic.main.activity_main_content.* import kotlinx.android.synthetic.main.activity_main_content.*
import java.math.BigInteger
import java.util.* import java.util.*
class MainActivity : AbsSlidingMusicPanelActivity(), class MainActivity : AbsSlidingMusicPanelActivity(),
@ -621,6 +620,7 @@ class MainActivity : AbsSlidingMusicPanelActivity(),
supportFragmentManager.commit { supportFragmentManager.commit {
replace(R.id.fragment_container, fragment, tag) replace(R.id.fragment_container, fragment, tag)
} }
currentFragment = fragment as MainActivityFragmentCallbacks
} }
private fun selectedFragment(itemId: Int) { private fun selectedFragment(itemId: Int) {

View file

@ -1,6 +1,7 @@
package code.name.monkey.retromusic.glide; package code.name.monkey.retromusic.glide;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@ -13,6 +14,8 @@ import com.bumptech.glide.signature.MediaStoreSignature;
import java.io.File; 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.App;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
@ -39,10 +42,12 @@ public class UserProfileGlideRequest {
public static class Builder { public static class Builder {
private RequestManager requestManager; private RequestManager requestManager;
private File profile; private File profile;
private Drawable error;
private Builder(RequestManager requestManager, File profile) { private Builder(RequestManager requestManager, File profile) {
this.requestManager = requestManager; this.requestManager = requestManager;
this.profile = profile; 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) { public static Builder from(@NonNull RequestManager requestManager, File profile) {
@ -51,10 +56,9 @@ public class UserProfileGlideRequest {
@NonNull @NonNull
public BitmapRequestBuilder<File, Bitmap> build() { public BitmapRequestBuilder<File, Bitmap> build() {
//noinspection unchecked
return createBaseRequest(requestManager, profile) return createBaseRequest(requestManager, profile)
.diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY) .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)
.placeholder(DEFAULT_ERROR_IMAGE) .error(error)
.animate(DEFAULT_ANIMATION) .animate(DEFAULT_ANIMATION)
.signature(createSignature(profile)); .signature(createSignature(profile));
} }
@ -68,10 +72,9 @@ public class UserProfileGlideRequest {
} }
public BitmapRequestBuilder<?, Bitmap> build() { public BitmapRequestBuilder<?, Bitmap> build() {
//noinspection unchecked
return createBaseRequest(builder.requestManager, builder.profile) return createBaseRequest(builder.requestManager, builder.profile)
.diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY) .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)
.error(DEFAULT_ERROR_IMAGE) .error(builder.error)
.animate(DEFAULT_ANIMATION) .animate(DEFAULT_ANIMATION)
.signature(createSignature(builder.profile)); .signature(createSignature(builder.profile));
} }

View file

@ -36,6 +36,7 @@
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container" android:id="@+id/container"
android:overScrollMode="never"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

View file

@ -58,7 +58,7 @@
app:layout_constraintEnd_toStartOf="@android:id/widget_frame" app:layout_constraintEnd_toStartOf="@android:id/widget_frame"
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin" app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
app:layout_constraintTop_toBottomOf="@android:id/title" app:layout_constraintTop_toBottomOf="@android:id/title"
app:lineHeightHint="20sp" android:textAppearance="@style/TextViewNormal"
tools:maxLines="2" tools:maxLines="2"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />

View file

@ -60,7 +60,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin" app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
app:layout_constraintTop_toBottomOf="@android:id/title" app:layout_constraintTop_toBottomOf="@android:id/title"
app:lineHeightHint="20sp" android:textAppearance="@style/TextViewNormal"
tools:maxLines="2" tools:maxLines="2"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />

View file

@ -58,7 +58,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin" app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
app:layout_constraintTop_toBottomOf="@android:id/title" app:layout_constraintTop_toBottomOf="@android:id/title"
app:lineHeightHint="20sp" android:textAppearance="@style/TextViewNormal"
tools:maxLines="2" tools:maxLines="2"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
@ -71,6 +71,8 @@
<SeekBar <SeekBar
android:id="@+id/seekbar" android:id="@+id/seekbar"
android:maxHeight="2dp"
android:progressDrawable="@drawable/color_progress_seek"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"

View file

@ -60,7 +60,7 @@
app:layout_constraintEnd_toStartOf="@android:id/checkbox" app:layout_constraintEnd_toStartOf="@android:id/checkbox"
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin" app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
app:layout_constraintTop_toBottomOf="@android:id/title" app:layout_constraintTop_toBottomOf="@android:id/title"
app:lineHeightHint="20sp" android:textAppearance="@style/TextViewNormal"
tools:maxLines="2" tools:maxLines="2"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />

View file

@ -63,6 +63,7 @@
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextViewNormal"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View file

@ -109,9 +109,7 @@
<style name="ErrorHandlingTheme" parent="Theme.MaterialComponents.Light.NoActionBar" /> <style name="ErrorHandlingTheme" parent="Theme.MaterialComponents.Light.NoActionBar" />
<style name="TextViewNormal"> <style name="TextViewNormal" parent="TextAppearance.AppCompat.Body2" />
<item name="android:textSize">14sp</item>
</style>
<style name="TextViewHeadline4" parent="TextAppearance.MaterialComponents.Headline4" /> <style name="TextViewHeadline4" parent="TextAppearance.MaterialComponents.Headline4" />