diff --git a/app/src/debug/res/font/google_sans_bold.ttf b/app/src/debug/res/font/google_sans_bold.ttf new file mode 100644 index 00000000..80497666 Binary files /dev/null and b/app/src/debug/res/font/google_sans_bold.ttf differ diff --git a/app/src/debug/res/font/google_sans_medium.ttf b/app/src/debug/res/font/google_sans_medium.ttf new file mode 100644 index 00000000..1543660d Binary files /dev/null and b/app/src/debug/res/font/google_sans_medium.ttf differ diff --git a/app/src/debug/res/font/google_sans_regular.ttf b/app/src/debug/res/font/google_sans_regular.ttf new file mode 100644 index 00000000..ab605f9e Binary files /dev/null and b/app/src/debug/res/font/google_sans_regular.ttf differ diff --git a/app/src/debug/res/font/sans.xml b/app/src/debug/res/font/sans.xml index f824169f..7bbc8513 100644 --- a/app/src/debug/res/font/sans.xml +++ b/app/src/debug/res/font/sans.xml @@ -1,13 +1,12 @@ - + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bb4f033d..11590b31 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -255,11 +255,9 @@ + - diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/HomeAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/HomeAdapter.kt index b08b15df..52eaf5ee 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/HomeAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/HomeAdapter.kt @@ -109,6 +109,12 @@ class HomeAdapter( FAVOURITES -> { val viewHolder = holder as PlaylistViewHolder viewHolder.bindView(home.arrayList, R.string.favorites) + viewHolder.clickableArea.setOnClickListener { + activity.findNavController(R.id.fragment_container).navigate( + R.id.detailListFragment, + bundleOf("type" to FAVOURITES) + ) + } } GENRES -> { val viewHolder = holder as GenreViewHolder @@ -183,7 +189,6 @@ class HomeAdapter( private inner class PlaylistViewHolder(view: View) : AbsHomeViewItem(view) { fun bindView(songs: List, titleRes: Int) { - arrow.hide() recyclerView.apply { val songAdapter = SongAdapter( activity, @@ -210,7 +215,7 @@ class HomeAdapter( } } - open inner class AbsHomeViewItem(itemView: View) : RecyclerView.ViewHolder(itemView) { + open class AbsHomeViewItem(itemView: View) : RecyclerView.ViewHolder(itemView) { val recyclerView: RecyclerView = itemView.findViewById(R.id.recyclerView) val title: AppCompatTextView = itemView.findViewById(R.id.title) val arrow: ImageView = itemView.findViewById(R.id.arrow) diff --git a/app/src/main/java/code/name/monkey/retromusic/extensions/ColorExt.kt b/app/src/main/java/code/name/monkey/retromusic/extensions/ColorExt.kt index f4e02de3..48a029f2 100644 --- a/app/src/main/java/code/name/monkey/retromusic/extensions/ColorExt.kt +++ b/app/src/main/java/code/name/monkey/retromusic/extensions/ColorExt.kt @@ -23,6 +23,7 @@ import android.widget.CheckBox import android.widget.SeekBar import androidx.annotation.AttrRes import androidx.annotation.ColorInt +import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.Toolbar import androidx.fragment.app.Fragment import code.name.monkey.appthemehelper.ThemeStore @@ -140,4 +141,8 @@ fun TextInputLayout.accentColor() { fun TextInputEditText.accentColor() { +} + +fun AppCompatImageView.accentColor(): Int { + return ThemeStore.accentColor(context) } \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/DetailListFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/DetailListFragment.kt index e4045edd..493a6f01 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/DetailListFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/DetailListFragment.kt @@ -3,6 +3,7 @@ package code.name.monkey.retromusic.fragments import android.os.Bundle import android.view.View import android.widget.ImageView +import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.navArgs import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager @@ -18,7 +19,6 @@ import code.name.monkey.retromusic.model.Artist import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.repository.RealRepository import kotlinx.android.synthetic.main.fragment_playlist_detail.* -import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.launch @@ -56,7 +56,7 @@ class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_de private fun loadFavorite() { toolbar.setTitle(R.string.favorites) - CoroutineScope(IO).launch { + lifecycleScope.launch(IO) { val songs = repository.favoritePlaylistHome() withContext(Main) { recyclerView.apply { @@ -73,7 +73,7 @@ class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_de private fun loadArtists(title: Int, type: Int) { toolbar.setTitle(title) - CoroutineScope(IO).launch { + lifecycleScope.launch(IO) { val artists = if (type == TOP_ARTISTS) repository.topArtists() else repository.recentArtists() withContext(Main) { @@ -87,7 +87,7 @@ class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_de private fun loadAlbums(title: Int, type: Int) { toolbar.setTitle(title) - CoroutineScope(IO).launch { + lifecycleScope.launch(IO) { val albums = if (type == TOP_ALBUMS) repository.topAlbums() else repository.recentAlbums() withContext(Main) { diff --git a/app/src/main/java/code/name/monkey/retromusic/views/AccentIcon.kt b/app/src/main/java/code/name/monkey/retromusic/views/AccentIcon.kt new file mode 100644 index 00000000..c48c3c41 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/views/AccentIcon.kt @@ -0,0 +1,17 @@ +package code.name.monkey.retromusic.views + +import android.content.Context +import android.content.res.ColorStateList +import android.util.AttributeSet +import androidx.appcompat.widget.AppCompatImageView +import code.name.monkey.retromusic.extensions.accentColor + +class AccentIcon @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = -1 +) : AppCompatImageView(context, attrs, defStyleAttr) { + init { + imageTintList = ColorStateList.valueOf(accentColor()) + } +} \ No newline at end of file diff --git a/app/src/main/res/font/pacifico.xml b/app/src/main/res/font/pacifico.xml deleted file mode 100644 index 6cff80c8..00000000 --- a/app/src/main/res/font/pacifico.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml deleted file mode 100644 index 3c20e796..00000000 --- a/app/src/main/res/layout/fragment_main.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/section_recycler_view.xml b/app/src/main/res/layout/section_recycler_view.xml index 852c6c48..4f4d6e74 100644 --- a/app/src/main/res/layout/section_recycler_view.xml +++ b/app/src/main/res/layout/section_recycler_view.xml @@ -30,13 +30,12 @@ android:textStyle="bold" tools:text="@tools:sample/full_names" /> - + app:srcCompat="@drawable/ic_arrow_forward" /> - - - @font/pacifico - - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 50097048..5fd61389 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -63,12 +63,6 @@ ?android:attr/textColorPrimary - -