Fix font not loading in Android 5
This commit is contained in:
parent
29e9008980
commit
8303c376ca
5 changed files with 24 additions and 34 deletions
|
@ -4,6 +4,7 @@ import android.util.DisplayMetrics
|
|||
import android.view.*
|
||||
import androidx.annotation.IntDef
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.recyclerview.widget.*
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.adapter.album.AlbumFullWidthAdapter
|
||||
|
@ -34,9 +35,7 @@ class HomeAdapter(
|
|||
else -> {
|
||||
AlbumViewHolder(
|
||||
LayoutInflater.from(activity).inflate(
|
||||
R.layout.metal_section_recycler_view,
|
||||
parent,
|
||||
false
|
||||
R.layout.metal_section_recycler_view, parent, false
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -135,10 +134,7 @@ class HomeAdapter(
|
|||
recyclerView.apply {
|
||||
show()
|
||||
layoutManager = GridLayoutManager(
|
||||
activity,
|
||||
1,
|
||||
GridLayoutManager.HORIZONTAL,
|
||||
false
|
||||
activity, 1, GridLayoutManager.HORIZONTAL, false
|
||||
)
|
||||
val artistAdapter = ArtistAdapter(
|
||||
activity,
|
||||
|
@ -164,17 +160,10 @@ class HomeAdapter(
|
|||
recyclerView.apply {
|
||||
show()
|
||||
val songAdapter = SongAdapter(
|
||||
activity,
|
||||
songs,
|
||||
R.layout.item_album_card,
|
||||
false,
|
||||
null
|
||||
activity, songs, R.layout.item_album_card, false, null
|
||||
)
|
||||
layoutManager = GridLayoutManager(
|
||||
activity,
|
||||
1,
|
||||
GridLayoutManager.HORIZONTAL,
|
||||
false
|
||||
activity, 1, GridLayoutManager.HORIZONTAL, false
|
||||
)
|
||||
adapter = songAdapter
|
||||
|
||||
|
@ -190,7 +179,7 @@ class HomeAdapter(
|
|||
open inner class AbsHomeViewItem(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
val recyclerView: RecyclerView = itemView.findViewById(R.id.recyclerView)
|
||||
val titleContainer: View = itemView.findViewById(R.id.titleContainer)
|
||||
val title: MaterialTextView = itemView.findViewById(R.id.title)
|
||||
val title: AppCompatTextView = itemView.findViewById(R.id.title)
|
||||
val text: MaterialTextView = itemView.findViewById(R.id.text)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<shape
|
||||
android:dither="true"
|
||||
android:shape="ring"
|
||||
android:thickness="4dp"
|
||||
android:thickness="3dp"
|
||||
android:type="sweep"
|
||||
android:useLevel="false">
|
||||
<solid android:color="?colorOnSecondary" />
|
||||
|
@ -25,7 +25,7 @@
|
|||
<item android:id="@android:id/progress">
|
||||
<shape
|
||||
android:shape="ring"
|
||||
android:thickness="4dp"
|
||||
android:thickness="3dp"
|
||||
android:type="sweep"
|
||||
android:useLevel="true">
|
||||
<solid android:color="?colorAccent" />
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<font
|
||||
android:font="@font/circular_std_book"
|
||||
android:fontStyle="normal"
|
||||
android:fontWeight="400" />
|
||||
app:font="@font/circular_std_book"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="400" />
|
||||
<font
|
||||
android:font="@font/circular_std_medium"
|
||||
android:fontStyle="normal"
|
||||
android:fontWeight="600" />
|
||||
app:font="@font/circular_std_medium"
|
||||
app:fontStyle="normal"
|
||||
app:fontWeight="600" />
|
||||
|
||||
<font
|
||||
android:font="@font/circular_std_black"
|
||||
android:fontWeight="900" />
|
||||
app:font="@font/circular_std_black"
|
||||
app:fontWeight="900" />
|
||||
|
||||
</font-family>
|
|
@ -39,10 +39,10 @@
|
|||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/text"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextViewCaption"
|
||||
android:visibility="gone"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
app:behavior_hideable="false"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:cardBackgroundColor="?colorSecondary"
|
||||
app:cardCornerRadius="0dp"
|
||||
app:cardUseCompatPadding="false"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
|
||||
app:strokeWidth="0dp">
|
||||
|
@ -54,12 +55,12 @@
|
|||
android:elevation="0dp"
|
||||
android:visibility="gone"
|
||||
app:itemBackground="@drawable/bottom_navigation_item_background"
|
||||
app:itemHorizontalTranslationEnabled="false"
|
||||
app:itemIconTint="@drawable/bottom_navigation_item_colors"
|
||||
app:itemTextAppearanceActive="@style/BottomSheetItemTextAppearanceActive"
|
||||
app:itemTextAppearanceInactive="@style/BottomSheetItemTextAppearanceInactive"
|
||||
app:itemTextColor="@drawable/bottom_navigation_item_colors"
|
||||
app:labelVisibilityMode="labeled"
|
||||
app:itemHorizontalTranslationEnabled="false"
|
||||
app:menu="@menu/bottom_navigation_main"
|
||||
tools:layout_height="56dp" />
|
||||
|
||||
|
|
Loading…
Reference in a new issue