Update libs
This commit is contained in:
commit
e082da1dcc
175 changed files with 1591 additions and 3014 deletions
|
@ -31,8 +31,8 @@ android {
|
|||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
applicationId "code.name.monkey.retromusic"
|
||||
versionCode 324
|
||||
versionName '3.1.700'
|
||||
versionCode 333
|
||||
versionName '3.1.900'
|
||||
|
||||
multiDexEnabled true
|
||||
|
||||
|
@ -127,38 +127,47 @@ dependencies {
|
|||
implementation "androidx.palette:palette:1.0.0"
|
||||
implementation 'androidx.annotation:annotation:1.1.0'
|
||||
implementation 'androidx.preference:preference:1.1.0-beta01'
|
||||
implementation 'com.google.android.material:material:1.1.0-alpha07'
|
||||
implementation 'androidx.palette:palette-ktx:1.0.0'
|
||||
|
||||
implementation 'com.google.android.material:material:1.1.0-alpha07'
|
||||
implementation 'com.google.android.material:material:1.1.0-alpha07'
|
||||
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
|
||||
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
|
||||
|
||||
implementation 'com.afollestad.material-dialogs:core:3.0.0-alpha1'
|
||||
implementation 'com.afollestad.material-dialogs:input:3.0.0-alpha1'
|
||||
implementation 'com.afollestad.material-dialogs:color:3.0.0-alpha1'
|
||||
implementation 'com.afollestad.material-dialogs:bottomsheets:3.0.0-alpha1'
|
||||
implementation 'com.afollestad:material-cab:0.1.12'
|
||||
|
||||
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
||||
kapt 'com.github.bumptech.glide:compiler:4.8.0'
|
||||
implementation 'com.github.bumptech.glide:okhttp3-integration:4.8.0'
|
||||
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
|
||||
|
||||
implementation('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar') {
|
||||
transitive = true
|
||||
}
|
||||
implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
|
||||
implementation 'com.github.kabouzeid:RecyclerView-FastScroll:1.0.16-kmod'
|
||||
|
||||
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
|
||||
/*UI Library*/
|
||||
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
|
||||
implementation 'com.r0adkll:slidableactivity:2.0.6'
|
||||
/*Backend all*/
|
||||
implementation 'com.github.kabouzeid:AndroidSlidingUpPanel:3.3.0-kmod3'
|
||||
implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3'
|
||||
implementation 'org.nanohttpd:nanohttpd:2.3.1'
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
implementation 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:3.4.0.201406110918-r'
|
||||
|
||||
implementation 'com.github.jetradarmobile:android-snowfall:1.2.0'
|
||||
implementation 'com.github.takahirom.downloadable.calligraphy:downloadable-calligraphy:0.1.3'
|
||||
implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
|
||||
implementation 'com.github.kabouzeid:RecyclerView-FastScroll:1.0.16-kmod'
|
||||
implementation 'com.github.kabouzeid:AndroidSlidingUpPanel:3.3.0-kmod3'
|
||||
implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3'
|
||||
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
|
||||
implementation project(':appthemehelper')
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
},
|
||||
{
|
||||
"name": "Gaming Inc.",
|
||||
"summary": "Discord server maintainer",
|
||||
"link": "https://discord.gg/qTecXXn",
|
||||
"profile_image": "https://i.imgur.com/FMqPDSS.png"
|
||||
"summary": "Telegram & Discord server maintainer",
|
||||
"link": "https://t.me/Gaming_Inc",
|
||||
"profile_image": "https://i.imgur.com/pfvN7d9.png"
|
||||
},
|
||||
{
|
||||
"name": "Marko Ivanović",
|
||||
|
@ -34,5 +34,11 @@
|
|||
"summary": "Telegram and Design contributor",
|
||||
"link": "https://t.me/Allstargaurav",
|
||||
"profile_image": "https://i.imgur.com/EertxDu.jpg"
|
||||
},
|
||||
{
|
||||
"name": "Abilas Sathiya",
|
||||
"summary": "Design & Suggestions",
|
||||
"link": "https://t.me/@abs2606",
|
||||
"profile_image": "https://i.imgur.com/MUyEWlx.jpg"
|
||||
}
|
||||
]
|
File diff suppressed because one or more lines are too long
|
@ -16,8 +16,6 @@ package code.name.monkey.retromusic
|
|||
|
||||
import code.name.monkey.retromusic.providers.RepositoryImpl
|
||||
import code.name.monkey.retromusic.providers.interfaces.Repository
|
||||
import code.name.monkey.retromusic.rest.KogouClient
|
||||
import code.name.monkey.retromusic.rest.service.KuGouApiService
|
||||
import code.name.monkey.retromusic.util.schedulers.BaseSchedulerProvider
|
||||
import code.name.monkey.retromusic.util.schedulers.SchedulerProvider
|
||||
|
||||
|
@ -30,8 +28,4 @@ object Injection {
|
|||
fun provideSchedulerProvider(): BaseSchedulerProvider {
|
||||
return SchedulerProvider.getInstance()
|
||||
}
|
||||
|
||||
fun provideKuGouApiService(): KuGouApiService {
|
||||
return KogouClient().apiService
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.view.animation.AnimationUtils
|
|||
import android.widget.ImageView
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.util.Pair
|
||||
import androidx.core.widget.NestedScrollView
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -20,6 +19,11 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
|||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||
import code.name.monkey.retromusic.activities.tageditor.AbsTagEditorActivity
|
||||
import code.name.monkey.retromusic.activities.tageditor.AlbumTagEditorActivity
|
||||
import code.name.monkey.retromusic.adapter.album.HorizontalAlbumAdapter
|
||||
import code.name.monkey.retromusic.adapter.song.SimpleSongAdapter
|
||||
import code.name.monkey.retromusic.dialogs.AddToPlaylistDialog
|
||||
import code.name.monkey.retromusic.dialogs.DeleteSongsDialog
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
|
@ -32,11 +36,6 @@ import code.name.monkey.retromusic.misc.AppBarStateChangeListener
|
|||
import code.name.monkey.retromusic.model.Album
|
||||
import code.name.monkey.retromusic.mvp.contract.AlbumDetailsContract
|
||||
import code.name.monkey.retromusic.mvp.presenter.AlbumDetailsPresenter
|
||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||
import code.name.monkey.retromusic.activities.tageditor.AbsTagEditorActivity
|
||||
import code.name.monkey.retromusic.activities.tageditor.AlbumTagEditorActivity
|
||||
import code.name.monkey.retromusic.adapter.album.HorizontalAlbumAdapter
|
||||
import code.name.monkey.retromusic.adapter.song.SimpleSongAdapter
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
|
@ -55,8 +54,7 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
private lateinit var simpleSongAdapter: SimpleSongAdapter
|
||||
private var disposable = CompositeDisposable()
|
||||
|
||||
var album: Album? = null
|
||||
private set
|
||||
private lateinit var album: Album
|
||||
|
||||
private val savedSortOrder: String
|
||||
get() = PreferenceUtil.getInstance().albumDetailSongSortOrder
|
||||
|
@ -80,7 +78,6 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
setLightNavigationBar(true)
|
||||
setNavigationbarColorAuto()
|
||||
|
||||
|
||||
ActivityCompat.postponeEnterTransition(this)
|
||||
|
||||
val albumId = intent.getIntExtra(EXTRA_ALBUM_ID, -1)
|
||||
|
@ -90,23 +87,16 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
setupRecyclerView()
|
||||
setupToolbarMarginHeight()
|
||||
|
||||
contentContainer.setOnScrollChangeListener { _: NestedScrollView?, _: Int, scrollY: Int, _: Int, oldScrollY: Int ->
|
||||
run {
|
||||
if (scrollY > oldScrollY) {
|
||||
actionShuffleAll.shrink(true)
|
||||
}
|
||||
if (scrollY < oldScrollY) {
|
||||
actionShuffleAll.extend(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
actionShuffleAll.setOnClickListener { MusicPlayerRemote.openAndShuffleQueue(album!!.songs!!, true) }
|
||||
|
||||
artistImage = findViewById(R.id.artistImage)
|
||||
artistImage.setOnClickListener {
|
||||
val artistPairs = arrayOf<Pair<*, *>>(Pair.create(image, resources.getString(R.string.transition_artist_image)))
|
||||
NavigationUtil.goToArtist(this, album!!.artistId, *artistPairs)
|
||||
NavigationUtil.goToArtist(this, album.artistId, *artistPairs)
|
||||
}
|
||||
playAction.apply {
|
||||
setOnClickListener { MusicPlayerRemote.openQueue(album.songs!!, 0, true) }
|
||||
}
|
||||
shuffleAction.apply {
|
||||
setOnClickListener { MusicPlayerRemote.openAndShuffleQueue(album.songs!!, true) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,13 +134,13 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
|
||||
appBarLayout?.apply {
|
||||
addOnOffsetChangedListener(object : AppBarStateChangeListener() {
|
||||
override fun onStateChanged(appBarLayout: AppBarLayout, state: AppBarStateChangeListener.State) {
|
||||
override fun onStateChanged(appBarLayout: AppBarLayout, state: State) {
|
||||
val color: Int = when (state) {
|
||||
AppBarStateChangeListener.State.COLLAPSED -> {
|
||||
State.COLLAPSED -> {
|
||||
setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(this@AlbumDetailsActivity)))
|
||||
ThemeStore.primaryColor(this@AlbumDetailsActivity)
|
||||
}
|
||||
AppBarStateChangeListener.State.EXPANDED, AppBarStateChangeListener.State.IDLE -> {
|
||||
State.EXPANDED, State.IDLE -> {
|
||||
setLightStatusbar(false)
|
||||
Color.TRANSPARENT
|
||||
}
|
||||
|
@ -242,9 +232,9 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
private fun loadAlbumCover() {
|
||||
GlideApp.with(this)
|
||||
.asBitmapPalette()
|
||||
.load(RetroGlideExtension.getSongModel(album!!.safeGetFirstSong()))
|
||||
.load(RetroGlideExtension.getSongModel(album.safeGetFirstSong()))
|
||||
.transition(RetroGlideExtension.getDefaultTransition())
|
||||
.songOptions(album!!.safeGetFirstSong())
|
||||
.songOptions(album.safeGetFirstSong())
|
||||
.dontAnimate()
|
||||
.into(object : RetroMusicColoredTarget(image as ImageView) {
|
||||
override fun onColorReady(color: Int) {
|
||||
|
@ -259,10 +249,14 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
songTitle.setTextColor(themeColor)
|
||||
moreTitle.setTextColor(themeColor)
|
||||
|
||||
actionShuffleAll.backgroundTintList = ColorStateList.valueOf(themeColor)
|
||||
playAction.backgroundTintList = ColorStateList.valueOf(themeColor)
|
||||
shuffleAction.backgroundTintList = ColorStateList.valueOf(themeColor)
|
||||
ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(themeColor))).apply {
|
||||
actionShuffleAll.setTextColor(this)
|
||||
actionShuffleAll.iconTint = this
|
||||
playAction.setTextColor(this)
|
||||
playAction.iconTint = this
|
||||
|
||||
shuffleAction.setTextColor(this)
|
||||
shuffleAction.iconTint = this
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -304,12 +298,12 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
}
|
||||
R.id.action_tag_editor -> {
|
||||
val intent = Intent(this, AlbumTagEditorActivity::class.java)
|
||||
intent.putExtra(AbsTagEditorActivity.EXTRA_ID, album!!.id)
|
||||
intent.putExtra(AbsTagEditorActivity.EXTRA_ID, album.id)
|
||||
startActivityForResult(intent, TAG_EDITOR_REQUEST)
|
||||
return true
|
||||
}
|
||||
R.id.action_go_to_artist -> {
|
||||
NavigationUtil.goToArtist(this, album!!.artistId)
|
||||
NavigationUtil.goToArtist(this, album.artistId)
|
||||
return true
|
||||
}
|
||||
/*Sort*/
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.app.Activity
|
|||
import android.content.Intent
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.text.Html
|
||||
|
@ -13,7 +14,6 @@ import android.view.*
|
|||
import android.view.animation.AnimationUtils
|
||||
import android.widget.Toast
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.widget.NestedScrollView
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -23,6 +23,10 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
|||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||
import code.name.monkey.retromusic.adapter.album.AlbumAdapter
|
||||
import code.name.monkey.retromusic.adapter.album.HorizontalAlbumAdapter
|
||||
import code.name.monkey.retromusic.adapter.song.SimpleSongAdapter
|
||||
import code.name.monkey.retromusic.dialogs.AddToPlaylistDialog
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||
|
@ -34,10 +38,6 @@ import code.name.monkey.retromusic.mvp.contract.ArtistDetailContract
|
|||
import code.name.monkey.retromusic.mvp.presenter.ArtistDetailsPresenter
|
||||
import code.name.monkey.retromusic.rest.LastFMRestClient
|
||||
import code.name.monkey.retromusic.rest.model.LastFmArtist
|
||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||
import code.name.monkey.retromusic.adapter.album.AlbumAdapter
|
||||
import code.name.monkey.retromusic.adapter.album.HorizontalAlbumAdapter
|
||||
import code.name.monkey.retromusic.adapter.song.SimpleSongAdapter
|
||||
import code.name.monkey.retromusic.util.*
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import kotlinx.android.synthetic.main.activity_artist_content.*
|
||||
|
@ -53,7 +53,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
private var biography: Spanned? = null
|
||||
private lateinit var artist: Artist
|
||||
private var lastFMRestClient: LastFMRestClient? = null
|
||||
private var artistDetailsPresenter: ArtistDetailsPresenter? = null
|
||||
private lateinit var artistDetailsPresenter: ArtistDetailsPresenter
|
||||
private lateinit var songAdapter: SimpleSongAdapter
|
||||
private lateinit var albumAdapter: AlbumAdapter
|
||||
private var forceDownload: Boolean = false
|
||||
|
@ -64,7 +64,6 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
window.enterTransition = slide
|
||||
}
|
||||
|
||||
|
||||
override fun createContentView(): View {
|
||||
return wrapSlidingMusicPanel(R.layout.activity_artist_details)
|
||||
}
|
||||
|
@ -85,17 +84,13 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
setUpViews()
|
||||
|
||||
artistDetailsPresenter = ArtistDetailsPresenter(this, intent.extras!!)
|
||||
artistDetailsPresenter!!.subscribe()
|
||||
artistDetailsPresenter.subscribe()
|
||||
|
||||
contentContainer.setOnScrollChangeListener { _: NestedScrollView?, _: Int, scrollY: Int, _: Int, oldScrollY: Int ->
|
||||
run {
|
||||
if (scrollY > oldScrollY) {
|
||||
actionShuffleAll.shrink(true)
|
||||
}
|
||||
if (scrollY < oldScrollY) {
|
||||
actionShuffleAll.extend(true)
|
||||
}
|
||||
}
|
||||
playAction.apply {
|
||||
setOnClickListener { MusicPlayerRemote.openQueue(artist.songs, 0, true) }
|
||||
}
|
||||
shuffleAction.apply {
|
||||
setOnClickListener { MusicPlayerRemote.openAndShuffleQueue(artist.songs, true) }
|
||||
}
|
||||
|
||||
biographyText.setOnClickListener {
|
||||
|
@ -105,7 +100,6 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
biographyText.maxLines = 4
|
||||
}
|
||||
}
|
||||
actionShuffleAll.setOnClickListener { MusicPlayerRemote.openAndShuffleQueue(getArtist().songs, true) }
|
||||
}
|
||||
|
||||
private fun setUpViews() {
|
||||
|
@ -125,17 +119,16 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
private fun setupToolbarMarginHeight() {
|
||||
val primaryColor = ThemeStore.primaryColor(this)
|
||||
TintHelper.setTintAuto(contentContainer!!, primaryColor, true)
|
||||
if (collapsingToolbarLayout != null) {
|
||||
collapsingToolbarLayout!!.setContentScrimColor(primaryColor)
|
||||
collapsingToolbarLayout!!.setStatusBarScrimColor(ColorUtil.darkenColor(primaryColor))
|
||||
collapsingToolbarLayout?.let {
|
||||
it.setContentScrimColor(primaryColor)
|
||||
it.setStatusBarScrimColor(ColorUtil.darkenColor(primaryColor))
|
||||
}
|
||||
|
||||
toolbar!!.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp)
|
||||
toolbar?.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp)
|
||||
setSupportActionBar(toolbar)
|
||||
|
||||
supportActionBar!!.title = null
|
||||
|
||||
|
||||
if (toolbar != null && !PreferenceUtil.getInstance().fullScreenMode) {
|
||||
val params = toolbar!!.layoutParams as ViewGroup.MarginLayoutParams
|
||||
params.topMargin = RetroUtil.getStatusBarHeight()
|
||||
|
@ -143,13 +136,13 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
}
|
||||
|
||||
appBarLayout?.addOnOffsetChangedListener(object : AppBarStateChangeListener() {
|
||||
override fun onStateChanged(appBarLayout: AppBarLayout, state: AppBarStateChangeListener.State) {
|
||||
override fun onStateChanged(appBarLayout: AppBarLayout, state: State) {
|
||||
val color: Int = when (state) {
|
||||
AppBarStateChangeListener.State.COLLAPSED -> {
|
||||
State.COLLAPSED -> {
|
||||
setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(appBarLayout.context)))
|
||||
ThemeStore.primaryColor(appBarLayout.context)
|
||||
}
|
||||
AppBarStateChangeListener.State.EXPANDED, AppBarStateChangeListener.State.IDLE -> {
|
||||
State.EXPANDED, State.IDLE -> {
|
||||
setLightStatusbar(false)
|
||||
Color.TRANSPARENT
|
||||
}
|
||||
|
@ -158,6 +151,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
ToolbarContentTintHelper.setToolbarContentColorBasedOnToolbarColor(appBarLayout.context, toolbar, color)
|
||||
}
|
||||
})
|
||||
setColors(ThemeStore.accentColor(this))
|
||||
}
|
||||
|
||||
private fun setupRecyclerView() {
|
||||
|
@ -190,7 +184,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
artistDetailsPresenter!!.unsubscribe()
|
||||
artistDetailsPresenter.unsubscribe()
|
||||
}
|
||||
|
||||
override fun loading() {}
|
||||
|
@ -208,10 +202,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
}
|
||||
|
||||
private fun getArtist(): Artist {
|
||||
if (artist == null) {
|
||||
artist = Artist()
|
||||
}
|
||||
return this.artist!!
|
||||
return this.artist;
|
||||
}
|
||||
|
||||
private fun setArtist(artist: Artist) {
|
||||
|
@ -283,6 +274,11 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
override fun onColorReady(color: Int) {
|
||||
setColors(color)
|
||||
}
|
||||
|
||||
override fun onLoadFailed(errorDrawable: Drawable?) {
|
||||
super.onLoadFailed(errorDrawable)
|
||||
setColors(defaultFooterColor)
|
||||
}
|
||||
})
|
||||
forceDownload = false;
|
||||
}
|
||||
|
@ -295,10 +291,14 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
songTitle.setTextColor(textColor)
|
||||
biographyTitle.setTextColor(textColor)
|
||||
|
||||
actionShuffleAll.backgroundTintList = ColorStateList.valueOf(textColor)
|
||||
playAction.backgroundTintList = ColorStateList.valueOf(textColor)
|
||||
shuffleAction.backgroundTintList = ColorStateList.valueOf(textColor)
|
||||
ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(textColor))).apply {
|
||||
actionShuffleAll.setTextColor(this)
|
||||
actionShuffleAll.iconTint = this
|
||||
playAction.setTextColor(this)
|
||||
playAction.iconTint = this
|
||||
|
||||
shuffleAction.setTextColor(this)
|
||||
shuffleAction.iconTint = this
|
||||
}
|
||||
|
||||
findViewById<View>(R.id.root).setBackgroundColor(ThemeStore.primaryColor(this))
|
||||
|
@ -356,8 +356,8 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
}
|
||||
|
||||
private fun reload() {
|
||||
artistDetailsPresenter!!.unsubscribe()
|
||||
artistDetailsPresenter!!.subscribe()
|
||||
artistDetailsPresenter.unsubscribe()
|
||||
artistDetailsPresenter.subscribe()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package code.name.monkey.retromusic.activities
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
|
@ -11,13 +10,11 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||
import code.name.monkey.retromusic.adapter.song.ShuffleButtonSongAdapter
|
||||
import code.name.monkey.retromusic.adapter.song.SongAdapter
|
||||
import code.name.monkey.retromusic.extensions.applyToolbar
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.helper.menu.GenreMenuHelper
|
||||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.model.Genre
|
||||
|
@ -27,12 +24,7 @@ import code.name.monkey.retromusic.mvp.presenter.GenreDetailsPresenter
|
|||
import code.name.monkey.retromusic.util.RetroColorUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
import com.afollestad.materialcab.MaterialCab
|
||||
import kotlinx.android.synthetic.main.activity_playing_queue.*
|
||||
import kotlinx.android.synthetic.main.activity_playlist_detail.*
|
||||
import kotlinx.android.synthetic.main.activity_playlist_detail.appBarLayout
|
||||
import kotlinx.android.synthetic.main.activity_playlist_detail.empty
|
||||
import kotlinx.android.synthetic.main.activity_playlist_detail.recyclerView
|
||||
import kotlinx.android.synthetic.main.activity_playlist_detail.toolbar
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
|
@ -43,18 +35,17 @@ class GenreDetailsActivity : AbsSlidingMusicPanelActivity(), GenreDetailsContrac
|
|||
|
||||
private var genre: Genre? = null
|
||||
private var presenter: GenreDetailsPresenter? = null
|
||||
private var songAdapter: SongAdapter? = null
|
||||
private lateinit var songAdapter: ShuffleButtonSongAdapter
|
||||
private var cab: MaterialCab? = null
|
||||
|
||||
private fun checkIsEmpty() {
|
||||
empty!!.visibility = if (songAdapter!!.itemCount == 0) View.VISIBLE else View.GONE
|
||||
empty?.visibility = if (songAdapter.itemCount == 0) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
setDrawUnderStatusBar()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
setStatusbarColor(Color.TRANSPARENT)
|
||||
setNavigationbarColorAuto()
|
||||
setTaskDescriptionColorAuto()
|
||||
|
@ -62,34 +53,30 @@ class GenreDetailsActivity : AbsSlidingMusicPanelActivity(), GenreDetailsContrac
|
|||
setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(this)))
|
||||
toggleBottomNavigationView(true)
|
||||
|
||||
genre = intent.extras!!.getParcelable(EXTRA_GENRE_ID)
|
||||
presenter = GenreDetailsPresenter(this, genre!!.id)
|
||||
genre = intent?.extras?.getParcelable(EXTRA_GENRE_ID)
|
||||
presenter = genre?.id?.let { GenreDetailsPresenter(this, it) }
|
||||
|
||||
setUpToolBar()
|
||||
setupRecyclerView()
|
||||
actionShuffleAll.setOnClickListener { MusicPlayerRemote.openAndShuffleQueue(songAdapter!!.dataSet, true) }
|
||||
|
||||
}
|
||||
|
||||
private fun setUpToolBar() {
|
||||
val primaryColor = ThemeStore.primaryColor(this)
|
||||
appBarLayout.setBackgroundColor(primaryColor)
|
||||
applyToolbar(toolbar)
|
||||
actionShuffleAll.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this))
|
||||
ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(ThemeStore.accentColor(this)))).apply {
|
||||
actionShuffleAll.setTextColor(this)
|
||||
actionShuffleAll.iconTint = this
|
||||
}
|
||||
title = genre!!.name
|
||||
|
||||
title = genre?.name
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
presenter!!.subscribe()
|
||||
presenter?.subscribe()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
presenter!!.unsubscribe()
|
||||
presenter?.unsubscribe()
|
||||
}
|
||||
|
||||
override fun createContentView(): View {
|
||||
|
@ -123,22 +110,13 @@ class GenreDetailsActivity : AbsSlidingMusicPanelActivity(), GenreDetailsContrac
|
|||
|
||||
private fun setupRecyclerView() {
|
||||
ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView, ThemeStore.accentColor(this))
|
||||
songAdapter = SongAdapter(this, ArrayList(), R.layout.item_list, false, this)
|
||||
songAdapter = ShuffleButtonSongAdapter(this, ArrayList(), R.layout.item_list, false, this)
|
||||
recyclerView.apply {
|
||||
itemAnimator = DefaultItemAnimator()
|
||||
layoutManager = LinearLayoutManager(this@GenreDetailsActivity)
|
||||
adapter = songAdapter
|
||||
}.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
if (dy > 0) {
|
||||
actionShuffleAll.shrink(true)
|
||||
} else if (dy < 0) {
|
||||
actionShuffleAll.extend(true)
|
||||
}
|
||||
}
|
||||
})
|
||||
songAdapter!!.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
|
||||
}
|
||||
songAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
|
||||
override fun onChanged() {
|
||||
super.onChanged()
|
||||
checkIsEmpty()
|
||||
|
@ -147,7 +125,7 @@ class GenreDetailsActivity : AbsSlidingMusicPanelActivity(), GenreDetailsContrac
|
|||
}
|
||||
|
||||
override fun showData(list: ArrayList<Song>) {
|
||||
songAdapter!!.swapDataSet(list)
|
||||
songAdapter.swapDataSet(list)
|
||||
}
|
||||
|
||||
override fun openCab(menuRes: Int, callback: MaterialCab.Callback): MaterialCab {
|
||||
|
@ -171,7 +149,7 @@ class GenreDetailsActivity : AbsSlidingMusicPanelActivity(), GenreDetailsContrac
|
|||
|
||||
override fun onMediaStoreChanged() {
|
||||
super.onMediaStoreChanged()
|
||||
presenter!!.subscribe()
|
||||
presenter?.subscribe()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -13,6 +13,7 @@ import androidx.core.app.ActivityCompat
|
|||
import androidx.fragment.app.Fragment
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||
import code.name.monkey.retromusic.dialogs.OptionsSheetDialogFragment
|
||||
import code.name.monkey.retromusic.fragments.mainactivity.LibraryFragment
|
||||
import code.name.monkey.retromusic.fragments.mainactivity.folders.FoldersFragment
|
||||
import code.name.monkey.retromusic.fragments.mainactivity.home.BannerHomeFragment
|
||||
|
@ -116,7 +117,7 @@ class MainActivity : AbsSlidingMusicPanelActivity(), SharedPreferences.OnSharedP
|
|||
PreferenceUtil.getInstance().unregisterOnSharedPreferenceChangedListener(this)
|
||||
}
|
||||
|
||||
fun setCurrentFragment(fragment: Fragment, b: Boolean) {
|
||||
private fun setCurrentFragment(fragment: Fragment, b: Boolean) {
|
||||
val trans = supportFragmentManager.beginTransaction()
|
||||
trans.replace(R.id.fragment_container, fragment, null)
|
||||
if (b) {
|
||||
|
@ -288,8 +289,7 @@ class MainActivity : AbsSlidingMusicPanelActivity(), SharedPreferences.OnSharedP
|
|||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
if (item.itemId == android.R.id.home) {
|
||||
NavigationUtil.goToSearch(this);
|
||||
return true
|
||||
OptionsSheetDialogFragment.newInstance().show(supportFragmentManager, "Main_Menu")
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package code.name.monkey.retromusic.activities
|
|||
|
||||
import android.content.res.ColorStateList
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
|
@ -46,6 +47,16 @@ class PlayingQueueActivity : AbsMusicServiceActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
return when (item.itemId) {
|
||||
android.R.id.home -> {
|
||||
onBackPressed()
|
||||
true
|
||||
}
|
||||
else -> super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setUpRecyclerView() {
|
||||
recyclerViewDragDropManager = RecyclerViewDragDropManager()
|
||||
val animator = RefactoredDefaultItemAnimator()
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package code.name.monkey.retromusic.activities
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
|
@ -10,14 +9,12 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||
import code.name.monkey.retromusic.adapter.song.OrderablePlaylistSongAdapter
|
||||
import code.name.monkey.retromusic.adapter.song.PlaylistSongAdapter
|
||||
import code.name.monkey.retromusic.adapter.song.SongAdapter
|
||||
import code.name.monkey.retromusic.extensions.applyToolbar
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.helper.menu.PlaylistMenuHelper
|
||||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.loaders.PlaylistLoader
|
||||
|
@ -25,6 +22,7 @@ import code.name.monkey.retromusic.model.AbsCustomPlaylist
|
|||
import code.name.monkey.retromusic.model.Playlist
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.mvp.contract.PlaylistSongsContract
|
||||
import code.name.monkey.retromusic.mvp.contract.PlaylistSongsContract.*
|
||||
import code.name.monkey.retromusic.mvp.presenter.PlaylistSongsPresenter
|
||||
import code.name.monkey.retromusic.util.PlaylistsUtil
|
||||
import code.name.monkey.retromusic.util.RetroColorUtil
|
||||
|
@ -36,7 +34,7 @@ import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils
|
|||
import kotlinx.android.synthetic.main.activity_playlist_detail.*
|
||||
import java.util.*
|
||||
|
||||
class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, PlaylistSongsContract.PlaylistSongsView {
|
||||
class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, PlaylistSongsView {
|
||||
|
||||
private var playlist: Playlist? = null
|
||||
private var cab: MaterialCab? = null
|
||||
|
@ -54,6 +52,7 @@ class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, Playli
|
|||
setTaskDescriptionColorAuto()
|
||||
setLightNavigationBar(true)
|
||||
setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(this)))
|
||||
|
||||
toggleBottomNavigationView(true)
|
||||
|
||||
playlist = intent.extras!!.getParcelable(EXTRA_PLAYLIST)
|
||||
|
@ -99,22 +98,6 @@ class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, Playli
|
|||
checkIsEmpty()
|
||||
}
|
||||
})
|
||||
recyclerView!!.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
if (dy > 0) {
|
||||
actionShuffleAll.shrink(true)
|
||||
} else if (dy < 0) {
|
||||
actionShuffleAll.extend(true)
|
||||
}
|
||||
}
|
||||
})
|
||||
actionShuffleAll.setOnClickListener {
|
||||
if (adapter.dataSet.isEmpty()) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
MusicPlayerRemote.openAndShuffleQueue(adapter.dataSet, true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
@ -123,13 +106,6 @@ class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, Playli
|
|||
}
|
||||
|
||||
private fun setUpToolBar() {
|
||||
|
||||
actionShuffleAll.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this))
|
||||
ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(ThemeStore.accentColor(this)))).apply {
|
||||
actionShuffleAll.setTextColor(this)
|
||||
actionShuffleAll.iconTint = this
|
||||
}
|
||||
|
||||
applyToolbar(toolbar)
|
||||
title = playlist!!.name
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.mvp.contract.SearchContract
|
||||
import code.name.monkey.retromusic.mvp.presenter.SearchPresenter
|
||||
import code.name.monkey.retromusic.activities.base.AbsMusicServiceActivity
|
||||
import code.name.monkey.retromusic.adapter.SearchAdapter
|
||||
import code.name.monkey.retromusic.mvp.contract.SearchContract
|
||||
import code.name.monkey.retromusic.mvp.presenter.SearchPresenter
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import kotlinx.android.synthetic.main.activity_search.*
|
||||
import java.util.*
|
||||
|
@ -52,17 +52,18 @@ class SearchActivity : AbsMusicServiceActivity(), OnQueryTextListener, SearchCon
|
|||
setUpToolBar()
|
||||
setupSearchView()
|
||||
|
||||
if (intent.getBooleanExtra("mic_search", false)) {
|
||||
if (intent.getBooleanExtra(EXTRA_SHOW_MIC, false)) {
|
||||
startMicSearch()
|
||||
}
|
||||
|
||||
back.setOnClickListener { onBackPressed() }
|
||||
voiceSearch.setOnClickListener { startMicSearch() }
|
||||
|
||||
searchContainer.setCardBackgroundColor(ColorStateList.valueOf(ColorUtil.darkenColor(ThemeStore.primaryColor(this))))
|
||||
searchContainer.setCardBackgroundColor(RetroUtil.toolbarColor(this))
|
||||
|
||||
keyboardPopup.setOnClickListener {
|
||||
val inputManager = getSystemService(Service.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputManager.showSoftInput(searchView,0)
|
||||
inputManager.showSoftInput(searchView, 0)
|
||||
}
|
||||
|
||||
keyboardPopup.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this))
|
||||
|
@ -215,9 +216,11 @@ class SearchActivity : AbsMusicServiceActivity(), OnQueryTextListener, SearchCon
|
|||
}
|
||||
|
||||
companion object {
|
||||
|
||||
val TAG: String = SearchActivity::class.java.simpleName
|
||||
|
||||
const val EXTRA_SHOW_MIC = "extra_show_mic"
|
||||
const val QUERY: String = "query"
|
||||
|
||||
private const val REQ_CODE_SPEECH_INPUT = 9002
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,14 +82,14 @@ class UserInfoActivity : AbsBaseActivity() {
|
|||
Toast.makeText(this, "Umm name is empty", Toast.LENGTH_SHORT).show()
|
||||
return@setOnClickListener
|
||||
}
|
||||
val bioString = bio.text.toString().trim() { it <= ' ' }
|
||||
/*val bioString = bio.text.toString().trim() { it <= ' ' }
|
||||
if (TextUtils.isEmpty(bioString)) {
|
||||
Toast.makeText(this, "Umm bio is empty", Toast.LENGTH_SHORT).show()
|
||||
return@setOnClickListener
|
||||
|
||||
}
|
||||
}*/
|
||||
PreferenceUtil.getInstance().userName = nameString
|
||||
PreferenceUtil.getInstance().userBio = bioString
|
||||
//PreferenceUtil.getInstance().userBio = bioString
|
||||
setResult(Activity.RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ class UserInfoActivity : AbsBaseActivity() {
|
|||
|
||||
private fun selectBannerImage() {
|
||||
|
||||
if (PreferenceUtil.getInstance().bannerImage.isEmpty()) {
|
||||
if (TextUtils.isEmpty(PreferenceUtil.getInstance().bannerImage)) {
|
||||
val pickImageIntent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
|
||||
pickImageIntent.type = "image/*"
|
||||
//pickImageIntent.putExtra("crop", "true")
|
||||
|
@ -138,8 +138,7 @@ class UserInfoActivity : AbsBaseActivity() {
|
|||
pickImageIntent.putExtra("aspectY", 9)
|
||||
pickImageIntent.putExtra("scale", true)
|
||||
//intent.setAction(Intent.ACTION_GET_CONTENT);
|
||||
startActivityForResult(Intent.createChooser(pickImageIntent,
|
||||
"Select Picture"), PICK_BANNER_REQUEST)
|
||||
startActivityForResult(Intent.createChooser(pickImageIntent, "Select Picture"), PICK_BANNER_REQUEST)
|
||||
} else {
|
||||
PreferenceUtil.getInstance().setBannerImagePath("")
|
||||
bannerImage.setImageResource(android.R.color.transparent)
|
||||
|
@ -193,11 +192,12 @@ class UserInfoActivity : AbsBaseActivity() {
|
|||
}
|
||||
}
|
||||
CROP_BANNER_REQUEST -> {
|
||||
val extras: Bundle = data.extras!!
|
||||
val selectedBitmap: Bitmap = extras.getParcelable("data")
|
||||
val profileImagePath = saveToInternalStorage(selectedBitmap, USER_BANNER)
|
||||
PreferenceUtil.getInstance().saveProfileImage(profileImagePath)
|
||||
loadImageFromStorage(profileImagePath)
|
||||
val selectedBitmap: Bitmap? = data.extras?.getParcelable("date")
|
||||
val profileImagePath = selectedBitmap?.let { saveToInternalStorage(it, USER_BANNER) }
|
||||
profileImagePath?.let {
|
||||
PreferenceUtil.getInstance().saveProfileImage(it)
|
||||
loadImageFromStorage(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ class AlbumTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
|
|||
private val disposable = CompositeDisposable()
|
||||
|
||||
private fun setupToolbar() {
|
||||
bannerTitle.setTextColor(Color.WHITE)
|
||||
toolbar.setNavigationOnClickListener { onBackPressed() }
|
||||
ToolbarContentTintHelper.setToolbarContentColorBasedOnToolbarColor(this, toolbar, Color.TRANSPARENT)
|
||||
title = null
|
||||
|
|
|
@ -29,7 +29,6 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
|
|||
setSupportActionBar(toolbar)
|
||||
}
|
||||
title = null
|
||||
bannerTitle.setTextColor(ThemeStore.textColorPrimary(this))
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
@ -44,7 +43,7 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
|
|||
|
||||
private fun setUpViews() {
|
||||
fillViewsWithFileTags()
|
||||
MaterialUtil.setTint(songTextContainer,false)
|
||||
MaterialUtil.setTint(songTextContainer, false)
|
||||
MaterialUtil.setTint(composerContainer, false)
|
||||
MaterialUtil.setTint(albumTextContainer, false)
|
||||
MaterialUtil.setTint(artistContainer, false)
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
package code.name.monkey.retromusic.adapter
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.adapter.CollageSongAdapter.CollageSongViewHolder
|
||||
import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author Hemanth S (h4h13).
|
||||
*/
|
||||
class CollageSongAdapter(private val activity: Activity, private val dataSet: ArrayList<Song>) : RecyclerView.Adapter<CollageSongViewHolder>() {
|
||||
|
||||
override fun onBindViewHolder(holder: CollageSongViewHolder, position: Int) {
|
||||
holder.bindSongs()
|
||||
if (dataSet.size > 8) {
|
||||
for (i in 0 until dataSet.subList(0, 8).size) {
|
||||
GlideApp.with(activity)
|
||||
.asBitmapPalette()
|
||||
.load(RetroGlideExtension.getSongModel(dataSet[i]))
|
||||
.transition(RetroGlideExtension.getDefaultTransition())
|
||||
.songOptions(dataSet[i])
|
||||
.into(object : RetroMusicColoredTarget(holder.itemView.findViewById(holder.ids[i]) as ImageView) {
|
||||
override fun onColorReady(color: Int) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CollageSongViewHolder {
|
||||
return CollageSongViewHolder(LayoutInflater.from(activity).inflate(R.layout.item_collage, parent, false))
|
||||
}
|
||||
|
||||
inner class CollageSongViewHolder(itemView: View) : MediaEntryViewHolder(itemView) {
|
||||
|
||||
val ids = arrayListOf(R.id.image_2, R.id.image_3, R.id.image_4, R.id.image_5, R.id.image_6, R.id.image_7, R.id.image_8, R.id.image_9)
|
||||
private var textView: TextView = itemView.findViewById(R.id.image_1)
|
||||
|
||||
fun bindSongs() {
|
||||
for (i in ids) {
|
||||
val imageView = itemView.findViewById<ImageView>(i)
|
||||
imageView.setOnClickListener {
|
||||
textView.setOnClickListener { MusicPlayerRemote.openQueue(dataSet, 0, true) }
|
||||
}
|
||||
}
|
||||
|
||||
val context = itemView.context
|
||||
val color = ThemeStore.accentColor(context);
|
||||
|
||||
textView.setOnClickListener { MusicPlayerRemote.openQueue(dataSet, 0, true) }
|
||||
textView.setBackgroundColor(color);
|
||||
textView.setTextColor(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,11 +25,11 @@ class GenreAdapter(private val mActivity: Activity, dataSet: ArrayList<Genre>, p
|
|||
this.dataSet = dataSet
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GenreAdapter.ViewHolder {
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
return ViewHolder(LayoutInflater.from(mActivity).inflate(mItemLayoutRes, parent, false))
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: GenreAdapter.ViewHolder, position: Int) {
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val genre = dataSet[position]
|
||||
if (holder.title != null) {
|
||||
holder.title!!.text = genre.name
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package code.name.monkey.retromusic.adapter
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.adapter.song.SongAdapter
|
||||
import java.util.*
|
||||
|
||||
class SpanSongsAdapter(activity: AppCompatActivity, dataSet: ArrayList<Song>, itemLayoutRes: Int, usePalette: Boolean, cabHolder: CabHolder?) : SongAdapter(activity, dataSet, itemLayoutRes, usePalette, cabHolder) {
|
||||
|
||||
override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) {
|
||||
super.onBindViewHolder(holder, position)
|
||||
if (position == 0) {
|
||||
val params = StaggeredGridLayoutManager.LayoutParams(StaggeredGridLayoutManager.LayoutParams.WRAP_CONTENT, StaggeredGridLayoutManager.LayoutParams.MATCH_PARENT)
|
||||
params.isFullSpan = true
|
||||
holder.itemView.layoutParams = params
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,6 +12,8 @@ import androidx.core.util.Pair
|
|||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
|
||||
import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
||||
|
@ -21,13 +23,10 @@ import code.name.monkey.retromusic.helper.menu.SongsMenuHelper
|
|||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.model.Album
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
|
||||
import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||
import java.util.*
|
||||
|
||||
|
||||
open class AlbumAdapter(protected val activity: AppCompatActivity,
|
||||
|
@ -200,7 +199,10 @@ open class AlbumAdapter(protected val activity: AppCompatActivity,
|
|||
if (isInQuickSelectMode) {
|
||||
toggleChecked(adapterPosition)
|
||||
} else {
|
||||
val albumPairs = arrayOf<Pair<*, *>>(Pair.create(image, activity.resources.getString(R.string.transition_album_art)))
|
||||
val pairImageView = Pair.create<View, String>(image, activity.resources.getString(R.string.transition_album_art))
|
||||
val pairs = ArrayList<Pair<View, String>>()
|
||||
pairs.add(pairImageView)
|
||||
val albumPairs: Array<Pair<View, String>> = pairs.toTypedArray()
|
||||
NavigationUtil.goToAlbum(activity, dataSet[adapterPosition].id, *albumPairs)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
|
||||
import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
|
||||
import code.name.monkey.retromusic.dialogs.ClearSmartPlaylistDialog
|
||||
import code.name.monkey.retromusic.dialogs.DeletePlaylistDialog
|
||||
import code.name.monkey.retromusic.helper.menu.PlaylistMenuHelper
|
||||
|
@ -23,8 +25,6 @@ import code.name.monkey.retromusic.model.Playlist
|
|||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist
|
||||
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist
|
||||
import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
|
||||
import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import java.util.*
|
||||
|
@ -61,17 +61,7 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL
|
|||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
/* if (getItemViewType(position) == SMART_PLAYLIST) {
|
||||
if (holder.viewList != null) {
|
||||
holder.viewList.get(0).setOnClickListener(
|
||||
v -> NavigationUtil.goToPlaylistNew(activity, new HistoryPlaylist(activity)));
|
||||
holder.viewList.get(1).setOnClickListener(
|
||||
v -> NavigationUtil.goToPlaylistNew(activity, new LastAddedPlaylist(activity)));
|
||||
holder.viewList.get(2).setOnClickListener(
|
||||
v -> NavigationUtil.goToPlaylistNew(activity, new MyTopTracksPlaylist(activity)));
|
||||
}
|
||||
return;
|
||||
}*/
|
||||
|
||||
val playlist = dataSet[position]
|
||||
val songs = getSongs(playlist)
|
||||
holder.itemView.isActivated = isChecked(playlist)
|
||||
|
|
|
@ -20,7 +20,7 @@ abstract class AbsOffsetSongAdapter : SongAdapter {
|
|||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SongAdapter.ViewHolder {
|
||||
if (viewType == OFFSET_ITEM) {
|
||||
val view = LayoutInflater.from(activity).inflate(R.layout.item_list_single_row, parent, false)
|
||||
val view = LayoutInflater.from(activity).inflate(R.layout.item_list_quick_actions, parent, false)
|
||||
return createViewHolder(view)
|
||||
}
|
||||
return super.onCreateViewHolder(parent, viewType)
|
||||
|
|
|
@ -1,20 +1,29 @@
|
|||
package code.name.monkey.retromusic.adapter.song
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.util.Pair
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import java.util.*
|
||||
|
||||
|
||||
open class PlaylistSongAdapter(activity: AppCompatActivity, dataSet: ArrayList<Song>, @LayoutRes itemLayoutRes: Int, usePalette: Boolean, cabHolder: CabHolder?) : AbsOffsetSongAdapter(activity, dataSet, itemLayoutRes, usePalette, cabHolder, false) {
|
||||
open class PlaylistSongAdapter(activity: AppCompatActivity,
|
||||
dataSet: ArrayList<Song>,
|
||||
@LayoutRes itemLayoutRes: Int,
|
||||
usePalette: Boolean,
|
||||
cabHolder: CabHolder?) :
|
||||
AbsOffsetSongAdapter(activity, dataSet, itemLayoutRes, usePalette, cabHolder, false) {
|
||||
|
||||
init {
|
||||
this.setMultiSelectMenuRes(R.menu.menu_cannot_delete_single_songs_playlist_songs_selection)
|
||||
|
@ -25,35 +34,30 @@ open class PlaylistSongAdapter(activity: AppCompatActivity, dataSet: ArrayList<S
|
|||
}
|
||||
|
||||
override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) {
|
||||
if (holder.itemViewType == AbsOffsetSongAdapter.OFFSET_ITEM) {
|
||||
val textColor = ThemeStore.textColorSecondary(activity)
|
||||
if (holder.title != null) {
|
||||
holder.title!!.text = MusicUtil.getPlaylistInfoString(activity, dataSet)
|
||||
holder.title!!.setTextColor(textColor)
|
||||
|
||||
if (holder.itemViewType == OFFSET_ITEM) {
|
||||
|
||||
val buttonColor = RetroUtil.toolbarColor(activity)
|
||||
val textColor = MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(buttonColor))
|
||||
val viewHolder = holder as ViewHolder
|
||||
|
||||
viewHolder.playAction?.let {
|
||||
it.backgroundTintList = ColorStateList.valueOf(buttonColor)
|
||||
it.setTextColor(textColor)
|
||||
it.iconTint = ColorStateList.valueOf(textColor)
|
||||
it.setOnClickListener {
|
||||
MusicPlayerRemote.openQueue(dataSet, 0, true)
|
||||
}
|
||||
}
|
||||
viewHolder.shuffleAction?.let {
|
||||
it.backgroundTintList = ColorStateList.valueOf(buttonColor)
|
||||
it.setTextColor(textColor)
|
||||
it.iconTint = ColorStateList.valueOf(textColor)
|
||||
it.setOnClickListener {
|
||||
MusicPlayerRemote.openAndShuffleQueue(dataSet, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (holder.text != null) {
|
||||
holder.text!!.visibility = View.GONE
|
||||
}
|
||||
if (holder.menu != null) {
|
||||
holder.menu!!.visibility = View.GONE
|
||||
}
|
||||
if (holder.image != null) {
|
||||
val padding = activity.resources.getDimensionPixelSize(R.dimen.default_item_margin) / 2
|
||||
holder.image!!.setPadding(padding, padding, padding, padding)
|
||||
holder.image!!.setColorFilter(textColor)
|
||||
holder.image!!.setImageResource(R.drawable.ic_timer_white_24dp)
|
||||
}
|
||||
if (holder.dragView != null) {
|
||||
holder.dragView!!.visibility = View.GONE
|
||||
}
|
||||
if (holder.separator != null) {
|
||||
holder.separator!!.visibility = View.GONE
|
||||
}
|
||||
if (holder.shortSeparator != null) {
|
||||
holder.shortSeparator!!.visibility = View.GONE
|
||||
}
|
||||
} else {
|
||||
super.onBindViewHolder(holder, position - 1)
|
||||
}
|
||||
|
@ -61,6 +65,9 @@ open class PlaylistSongAdapter(activity: AppCompatActivity, dataSet: ArrayList<S
|
|||
|
||||
open inner class ViewHolder(itemView: View) : AbsOffsetSongAdapter.ViewHolder(itemView) {
|
||||
|
||||
val playAction: MaterialButton? = itemView.findViewById(R.id.playAction)
|
||||
val shuffleAction: MaterialButton? = itemView.findViewById(R.id.shuffleAction)
|
||||
|
||||
override var songMenuRes: Int
|
||||
get() = R.menu.menu_item_cannot_delete_single_songs_playlist_song
|
||||
set(value) {
|
||||
|
@ -78,7 +85,6 @@ open class PlaylistSongAdapter(activity: AppCompatActivity, dataSet: ArrayList<S
|
|||
}
|
||||
|
||||
companion object {
|
||||
|
||||
val TAG = PlaylistSongAdapter::class.java.simpleName
|
||||
val TAG: String = PlaylistSongAdapter::class.java.simpleName
|
||||
}
|
||||
}
|
|
@ -1,13 +1,18 @@
|
|||
package code.name.monkey.retromusic.adapter.song
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.view.View
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import java.util.*
|
||||
|
||||
|
||||
|
@ -22,8 +27,30 @@ class ShuffleButtonSongAdapter(activity: AppCompatActivity,
|
|||
}
|
||||
|
||||
override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) {
|
||||
if (holder.itemViewType == AbsOffsetSongAdapter.OFFSET_ITEM) {
|
||||
if (holder.itemViewType == OFFSET_ITEM) {
|
||||
val accentColor = ThemeStore.accentColor(activity.applicationContext)
|
||||
val buttonColor = RetroUtil.toolbarColor(activity)
|
||||
val textColor = MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(buttonColor))
|
||||
val viewHolder = holder as ViewHolder
|
||||
|
||||
viewHolder.playAction?.let {
|
||||
it.backgroundTintList = ColorStateList.valueOf(buttonColor)
|
||||
it.setTextColor(textColor)
|
||||
it.iconTint = ColorStateList.valueOf(textColor)
|
||||
it.setOnClickListener {
|
||||
MusicPlayerRemote.openQueue(dataSet, 0, true)
|
||||
}
|
||||
}
|
||||
viewHolder.shuffleAction?.let {
|
||||
it.backgroundTintList = ColorStateList.valueOf(buttonColor)
|
||||
it.setTextColor(textColor)
|
||||
it.iconTint = ColorStateList.valueOf(textColor)
|
||||
it.setOnClickListener {
|
||||
MusicPlayerRemote.openAndShuffleQueue(dataSet, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (holder.title != null) {
|
||||
holder.title!!.text = activity.resources.getString(R.string.action_shuffle_all)
|
||||
holder.title!!.setTextColor(accentColor)
|
||||
|
@ -52,9 +79,11 @@ class ShuffleButtonSongAdapter(activity: AppCompatActivity,
|
|||
}
|
||||
|
||||
inner class ViewHolder(itemView: View) : AbsOffsetSongAdapter.ViewHolder(itemView) {
|
||||
val playAction: MaterialButton? = itemView.findViewById(R.id.playAction)
|
||||
val shuffleAction: MaterialButton? = itemView.findViewById(R.id.shuffleAction)
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
if (itemViewType == AbsOffsetSongAdapter.OFFSET_ITEM) {
|
||||
if (itemViewType == OFFSET_ITEM) {
|
||||
MusicPlayerRemote.openAndShuffleQueue(dataSet, true)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ class AppWidgetBig : BaseAppWidget() {
|
|||
RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp,
|
||||
MaterialValueHelper.getPrimaryTextColor(context, false))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.Companion.createBitmap(
|
||||
RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp,
|
||||
RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_32dp,
|
||||
MaterialValueHelper.getPrimaryTextColor(context, false))!!, 1f))
|
||||
|
||||
linkButtons(context, appWidgetView)
|
||||
|
@ -84,7 +84,7 @@ class AppWidgetBig : BaseAppWidget() {
|
|||
}
|
||||
|
||||
// Set correct drawable for pause state
|
||||
val playPauseRes = if (isPlaying) R.drawable.ic_pause_white_24dp else R.drawable.ic_play_arrow_white_24dp
|
||||
val playPauseRes = if (isPlaying) R.drawable.ic_pause_white_24dp else R.drawable.ic_play_arrow_white_32dp
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(
|
||||
RetroUtil.getTintedVectorDrawable(service, playPauseRes,
|
||||
MaterialValueHelper.getPrimaryTextColor(service, false))!!, 1f))
|
||||
|
|
|
@ -52,7 +52,7 @@ class AppWidgetCard : BaseAppWidget() {
|
|||
appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art)
|
||||
appWidgetView.setImageViewBitmap(R.id.button_next, BaseAppWidget.Companion.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_prev, BaseAppWidget.Companion.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.Companion.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.Companion.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_32dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
|
||||
linkButtons(context, appWidgetView)
|
||||
pushUpdate(context, appWidgetIds, appWidgetView)
|
||||
|
@ -78,7 +78,7 @@ class AppWidgetCard : BaseAppWidget() {
|
|||
}
|
||||
|
||||
// Set correct drawable for pause state
|
||||
val playPauseRes = if (isPlaying) R.drawable.ic_pause_white_24dp else R.drawable.ic_play_arrow_white_24dp
|
||||
val playPauseRes = if (isPlaying) R.drawable.ic_pause_white_24dp else R.drawable.ic_play_arrow_white_32dp
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.Companion.createBitmap(
|
||||
RetroUtil.getTintedVectorDrawable(service, playPauseRes,
|
||||
MaterialValueHelper.getSecondaryTextColor(service, true))!!, 1f))
|
||||
|
@ -127,7 +127,7 @@ class AppWidgetCard : BaseAppWidget() {
|
|||
// Set correct drawable for pause state
|
||||
val playPauseRest = if (isPlaying) R.drawable.ic_pause_white_24dp
|
||||
else
|
||||
R.drawable.ic_play_arrow_white_24dp
|
||||
R.drawable.ic_play_arrow_white_32dp
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(service, playPauseRest, color)!!, 1f))
|
||||
// Set prev/next button drawables
|
||||
appWidgetView.setImageViewBitmap(R.id.button_next, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(service, R.drawable.ic_skip_next_white_24dp, color)!!, 1f))
|
||||
|
|
|
@ -51,7 +51,7 @@ class AppWidgetClassic : BaseAppWidget() {
|
|||
appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art)
|
||||
appWidgetView.setImageViewBitmap(R.id.button_next, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_prev, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_32dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
|
||||
linkButtons(context, appWidgetView)
|
||||
pushUpdate(context, appWidgetIds, appWidgetView)
|
||||
|
@ -114,7 +114,7 @@ class AppWidgetClassic : BaseAppWidget() {
|
|||
val playPauseRes = if (isPlaying)
|
||||
R.drawable.ic_pause_white_24dp
|
||||
else
|
||||
R.drawable.ic_play_arrow_white_24dp
|
||||
R.drawable.ic_play_arrow_white_32dp
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause,
|
||||
BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(service, playPauseRes, color)!!, 1f))
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class AppWidgetSmall : BaseAppWidget() {
|
|||
appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art)
|
||||
appWidgetView.setImageViewBitmap(R.id.button_next, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_prev, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_32dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
|
||||
linkButtons(context, appWidgetView)
|
||||
pushUpdate(context, appWidgetIds, appWidgetView)
|
||||
|
@ -120,7 +120,7 @@ class AppWidgetSmall : BaseAppWidget() {
|
|||
val playPauseRes = if (isPlaying)
|
||||
R.drawable.ic_pause_white_24dp
|
||||
else
|
||||
R.drawable.ic_play_arrow_white_24dp
|
||||
R.drawable.ic_play_arrow_white_32dp
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.Companion.createBitmap(RetroUtil.getTintedVectorDrawable(service, playPauseRes, color)!!, 1f))
|
||||
|
||||
// Set prev/next button drawables
|
||||
|
|
|
@ -36,7 +36,7 @@ class AppWidgetText : BaseAppWidget() {
|
|||
|
||||
appWidgetView.setImageViewBitmap(R.id.button_next, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, ContextCompat.getColor(context, R.color.md_white_1000)), 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_prev, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, ContextCompat.getColor(context, R.color.md_white_1000)), 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, ContextCompat.getColor(context, R.color.md_white_1000)), 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_32dp, ContextCompat.getColor(context, R.color.md_white_1000)), 1f))
|
||||
|
||||
appWidgetView.setTextColor(R.id.title, ContextCompat.getColor(context, R.color.md_white_1000))
|
||||
appWidgetView.setTextColor(R.id.text, ContextCompat.getColor(context, R.color.md_white_1000))
|
||||
|
@ -94,7 +94,7 @@ class AppWidgetText : BaseAppWidget() {
|
|||
val playPauseRes = if (isPlaying)
|
||||
R.drawable.ic_pause_white_24dp
|
||||
else
|
||||
R.drawable.ic_play_arrow_white_24dp
|
||||
R.drawable.ic_play_arrow_white_32dp
|
||||
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, playPauseRes, ContextCompat.getColor(context, R.color.md_white_1000)), 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_next, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, ContextCompat.getColor(context, R.color.md_white_1000)), 1f))
|
||||
appWidgetView.setImageViewBitmap(R.id.button_prev, BaseAppWidget.createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, ContextCompat.getColor(context, R.color.md_white_1000)), 1f))
|
||||
|
|
|
@ -14,88 +14,27 @@
|
|||
|
||||
package code.name.monkey.retromusic.dialogs
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.core.app.ShareCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.retromusic.App
|
||||
import code.name.monkey.retromusic.Constants.USER_PROFILE
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.MainActivity
|
||||
import code.name.monkey.retromusic.activities.bugreport.BugReportActivity
|
||||
import code.name.monkey.retromusic.util.Compressor
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.android.synthetic.main.fragment_main_options.*
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnClickListener {
|
||||
|
||||
private val disposable = CompositeDisposable()
|
||||
|
||||
private val timeOfTheDay: String
|
||||
get() {
|
||||
var message = getString(R.string.title_good_day)
|
||||
val c = Calendar.getInstance()
|
||||
|
||||
when (c.get(Calendar.HOUR_OF_DAY)) {
|
||||
in 0..5 -> message = getString(R.string.title_good_night)
|
||||
in 6..11 -> message = getString(R.string.title_good_morning)
|
||||
in 12..15 -> message = getString(R.string.title_good_afternoon)
|
||||
in 16..19 -> message = getString(R.string.title_good_evening)
|
||||
in 20..23 -> message = getString(R.string.title_good_night)
|
||||
}
|
||||
return message
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
disposable.dispose()
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_main_options, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
text.setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
text.text = PreferenceUtil.getInstance().userBio
|
||||
titleWelcome.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
titleWelcome.text = String.format("%s %s!", timeOfTheDay, PreferenceUtil.getInstance().userName)
|
||||
|
||||
loadImageFromStorage()
|
||||
|
||||
actionSettings.setOnClickListener(this)
|
||||
|
||||
actionSleepTimer.setOnClickListener(this)
|
||||
actionLibrary.setOnClickListener(this)
|
||||
userInfoContainer.setOnClickListener(this)
|
||||
actionEqualizer.setOnClickListener(this)
|
||||
actionFolders.setOnClickListener(this)
|
||||
actionRate.setOnClickListener(this)
|
||||
actionShare.setOnClickListener(this)
|
||||
actionBugReport.setOnClickListener(this)
|
||||
buyProContainer.apply {
|
||||
setCardBackgroundColor(ThemeStore.accentColor(context!!))
|
||||
visibility = if (!App.isProVersion) View.VISIBLE else View.GONE
|
||||
setOnClickListener {
|
||||
NavigationUtil.goToProVersion(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
||||
import com.afollestad.materialdialogs.customview.customView
|
||||
import kotlinx.android.synthetic.main.fragment_main_settings.*
|
||||
|
||||
class OptionsSheetDialogFragment : DialogFragment(), View.OnClickListener {
|
||||
|
||||
override fun onClick(view: View) {
|
||||
val mainActivity = activity as MainActivity? ?: return
|
||||
|
@ -103,18 +42,16 @@ class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnCl
|
|||
R.id.actionFolders -> mainActivity.selectedFragment(R.id.action_folder)
|
||||
R.id.actionLibrary -> mainActivity.selectedFragment(PreferenceUtil.getInstance().lastPage)
|
||||
R.id.actionSettings -> NavigationUtil.goToSettings(mainActivity)
|
||||
|
||||
R.id.actionSleepTimer -> if (fragmentManager != null) {
|
||||
SleepTimerDialog().show(fragmentManager!!, TAG)
|
||||
}
|
||||
R.id.userInfoContainer -> NavigationUtil.goToUserInfo(mainActivity)
|
||||
R.id.actionRate -> NavigationUtil.goToPlayStore(mainActivity)
|
||||
R.id.actionShare -> shareApp()
|
||||
R.id.actionBugReport -> prepareBugReport()
|
||||
R.id.actionEqualizer -> NavigationUtil.openEqualizer(mainActivity)
|
||||
|
||||
}
|
||||
dismiss()
|
||||
materialDialog.dismiss()
|
||||
}
|
||||
|
||||
private fun prepareBugReport() {
|
||||
|
@ -122,33 +59,48 @@ class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnCl
|
|||
}
|
||||
|
||||
private fun shareApp() {
|
||||
val shareIntent = ShareCompat.IntentBuilder.from(activity)
|
||||
.setType("songText/plain")
|
||||
ShareCompat.IntentBuilder.from(activity)
|
||||
.setType("text/plain")
|
||||
.setChooserTitle(R.string.action_share)
|
||||
.setText(String.format(getString(R.string.app_share), activity!!.packageName))
|
||||
.intent
|
||||
if (shareIntent.resolveActivity(activity!!.packageManager) != null) {
|
||||
startActivity(
|
||||
Intent.createChooser(shareIntent, resources.getText(R.string.action_share)))
|
||||
}
|
||||
.startChooser()
|
||||
}
|
||||
|
||||
private fun loadImageFromStorage() {
|
||||
private lateinit var actionSettings: View
|
||||
private lateinit var actionSleepTimer: View
|
||||
private lateinit var actionLibrary: View
|
||||
private lateinit var actionEqualizer: View
|
||||
private lateinit var actionFolders: View
|
||||
private lateinit var actionRate: View
|
||||
private lateinit var actionShare: View
|
||||
private lateinit var actionBugReport: View
|
||||
private lateinit var materialDialog: MaterialDialog
|
||||
|
||||
disposable.add(Compressor(context!!)
|
||||
.setMaxHeight(300)
|
||||
.setMaxWidth(300)
|
||||
.setQuality(75)
|
||||
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
||||
.compressToBitmapAsFlowable(
|
||||
File(PreferenceUtil.getInstance().profileImage, USER_PROFILE))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ userImage!!.setImageBitmap(it) }, {
|
||||
userImage!!.setImageDrawable(ContextCompat
|
||||
.getDrawable(context!!, R.drawable.ic_account_white_24dp))
|
||||
}, {
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val layout = LayoutInflater.from(context).inflate(R.layout.fragment_main_options, null)
|
||||
actionSettings = layout.findViewById(R.id.actionSettings)
|
||||
actionSleepTimer = layout.findViewById(R.id.actionSleepTimer)
|
||||
actionLibrary = layout.findViewById(R.id.actionLibrary)
|
||||
actionEqualizer = layout.findViewById(R.id.actionEqualizer)
|
||||
actionFolders = layout.findViewById(R.id.actionFolders)
|
||||
actionRate = layout.findViewById(R.id.actionRate)
|
||||
actionShare = layout.findViewById(R.id.actionShare)
|
||||
actionBugReport = layout.findViewById(R.id.actionBugReport)
|
||||
|
||||
}))
|
||||
actionSettings.setOnClickListener(this)
|
||||
actionSleepTimer.setOnClickListener(this)
|
||||
actionLibrary.setOnClickListener(this)
|
||||
actionEqualizer.setOnClickListener(this)
|
||||
actionFolders.setOnClickListener(this)
|
||||
actionRate.setOnClickListener(this)
|
||||
actionShare.setOnClickListener(this)
|
||||
actionBugReport.setOnClickListener(this)
|
||||
|
||||
materialDialog = MaterialDialog(activity!!, BottomSheet())
|
||||
.show {
|
||||
customView(view = layout, scrollable = true)
|
||||
}
|
||||
return materialDialog
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -27,47 +27,6 @@ import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
|||
|
||||
class RemoveFromPlaylistDialog : DialogFragment() {
|
||||
|
||||
/*override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(code.name.monkey.retromusic.R.layout.dialog_delete, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
val songs = arguments!!.getParcelableArrayList<Song>("songs")
|
||||
val content: CharSequence
|
||||
if (songs!!.size > 1) {
|
||||
content = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_x_songs_from_playlist, songs.size), Html.FROM_HTML_MODE_LEGACY)
|
||||
} else {
|
||||
Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_x_songs_from_playlist, songs.size))
|
||||
}
|
||||
} else {
|
||||
content = Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_song_x_from_playlist, songs[0].title))
|
||||
}
|
||||
bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
bannerTitle.text = content;
|
||||
actionDelete.apply {
|
||||
setIconResource(code.name.monkey.retromusic.R.drawable.ic_delete_white_24dp)
|
||||
setText(code.name.monkey.retromusic.R.string.remove_action)
|
||||
setTextColor(ThemeStore.textColorSecondary(context))
|
||||
setOnClickListener {
|
||||
val playlistSongs = ArrayList<PlaylistSong>()
|
||||
playlistSongs.addAll(songs as ArrayList<PlaylistSong>)
|
||||
PlaylistsUtil.removeFromPlaylist(activity!!, playlistSongs)
|
||||
dismiss()
|
||||
}
|
||||
MaterialUtil.setTint(this)
|
||||
}
|
||||
|
||||
|
||||
actionCancel.apply {
|
||||
setIconResource(code.name.monkey.retromusic.R.drawable.ic_close_white_24dp)
|
||||
setTextColor(ThemeStore.textColorSecondary(context))
|
||||
setOnClickListener { dismiss() }
|
||||
MaterialUtil.setTint(this, false)
|
||||
}
|
||||
}
|
||||
*/
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val songs = arguments!!.getParcelableArrayList<PlaylistSong>("songs")
|
||||
|
||||
|
@ -82,16 +41,17 @@ class RemoveFromPlaylistDialog : DialogFragment() {
|
|||
}
|
||||
|
||||
|
||||
return MaterialDialog(activity!!, BottomSheet()).show {
|
||||
title(title)
|
||||
message(text = content)
|
||||
negativeButton(android.R.string.cancel)
|
||||
positiveButton(R.string.remove_action) {
|
||||
if (activity == null)
|
||||
return@positiveButton
|
||||
PlaylistsUtil.removeFromPlaylist(activity!!, songs as MutableList<PlaylistSong>)
|
||||
}
|
||||
}
|
||||
return MaterialDialog(activity!!, BottomSheet())
|
||||
.show {
|
||||
title(title)
|
||||
message(text = content)
|
||||
negativeButton(android.R.string.cancel)
|
||||
positiveButton(R.string.remove_action) {
|
||||
if (activity == null)
|
||||
return@positiveButton
|
||||
PlaylistsUtil.removeFromPlaylist(activity!!, songs as MutableList<PlaylistSong>)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -124,7 +124,7 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
miniPlayerPlayPauseButton!!.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
miniPlayerPlayPauseButton!!.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
miniPlayerPlayPauseButton!!.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
|
|||
val audioManager = audioManager
|
||||
audioManager?.setStreamVolume(AudioManager.STREAM_MUSIC, i, 0)
|
||||
setPauseWhenZeroVolume(i < 1)
|
||||
volumeDown!!.setImageResource(if (i == 0) R.drawable.ic_volume_off_white_24dp else R.drawable.ic_volume_down_white_24dp)
|
||||
volumeDown?.setImageResource(if (i == 0) R.drawable.ic_volume_off_white_24dp else R.drawable.ic_volume_down_white_24dp)
|
||||
|
||||
}
|
||||
|
||||
|
@ -118,8 +118,8 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
|
|||
}
|
||||
|
||||
private fun setPauseWhenZeroVolume(pauseWhenZeroVolume: Boolean) {
|
||||
if (PreferenceUtil.getInstance().pauseOnZeroVolume() && pauseWhenZeroVolume)
|
||||
if (MusicPlayerRemote.isPlaying) {
|
||||
if (PreferenceUtil.getInstance().pauseOnZeroVolume())
|
||||
if (MusicPlayerRemote.isPlaying && pauseWhenZeroVolume) {
|
||||
MusicPlayerRemote.pauseSong()
|
||||
} else {
|
||||
MusicPlayerRemote.resumePlaying()
|
||||
|
|
|
@ -3,13 +3,12 @@ package code.name.monkey.retromusic.fragments.base
|
|||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.dialogs.OptionsSheetDialogFragment
|
||||
import code.name.monkey.retromusic.activities.MainActivity
|
||||
import code.name.monkey.retromusic.dialogs.OptionsSheetDialogFragment
|
||||
|
||||
abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
|
||||
|
||||
|
@ -50,6 +49,6 @@ abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
|
|||
}
|
||||
|
||||
protected fun showMainMenu() {
|
||||
OptionsSheetDialogFragment.newInstance().show(childFragmentManager, "Main Menu")
|
||||
OptionsSheetDialogFragment.newInstance().show(childFragmentManager, "Main_Menu")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,91 +0,0 @@
|
|||
package code.name.monkey.retromusic.fragments.mainactivity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.model.Genre
|
||||
import code.name.monkey.retromusic.mvp.contract.GenreContract
|
||||
import code.name.monkey.retromusic.mvp.presenter.GenrePresenter
|
||||
import code.name.monkey.retromusic.adapter.GenreAdapter
|
||||
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewFragment
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import java.util.*
|
||||
|
||||
class GenreFragment : AbsLibraryPagerRecyclerViewFragment<GenreAdapter, LinearLayoutManager>(), GenreContract.GenreView {
|
||||
|
||||
private var mPresenter: GenrePresenter? = null
|
||||
|
||||
override val emptyMessage: Int
|
||||
get() = R.string.no_genres
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setHasOptionsMenu(true)
|
||||
mPresenter = GenrePresenter(this)
|
||||
}
|
||||
|
||||
override fun setMenuVisibility(menuVisible: Boolean) {
|
||||
super.setMenuVisibility(menuVisible)
|
||||
if (menuVisible) {
|
||||
libraryFragment.setTitle(if (PreferenceUtil.getInstance().tabTitles()) R.string.library else R.string.genres)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
libraryFragment.setTitle(if (PreferenceUtil.getInstance().tabTitles()) R.string.library else R.string.genres)
|
||||
if (adapter!!.dataSet.isEmpty()) {
|
||||
mPresenter!!.subscribe()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
mPresenter!!.unsubscribe()
|
||||
}
|
||||
|
||||
override fun createLayoutManager(): LinearLayoutManager {
|
||||
return LinearLayoutManager(activity)
|
||||
}
|
||||
|
||||
override fun createAdapter(): GenreAdapter {
|
||||
val dataSet = adapter!!.dataSet
|
||||
return GenreAdapter(libraryFragment.mainActivity, dataSet, R.layout.item_list)
|
||||
}
|
||||
|
||||
override fun loading() {
|
||||
|
||||
}
|
||||
|
||||
override fun showData(list: ArrayList<Genre>) {
|
||||
adapter!!.swapDataSet(list)
|
||||
}
|
||||
|
||||
override fun showEmptyView() {
|
||||
adapter!!.swapDataSet(ArrayList())
|
||||
}
|
||||
|
||||
override fun completed() {
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
super.onCreateOptionsMenu(menu, inflater)
|
||||
menu.removeItem(R.id.action_sort_order)
|
||||
menu.removeItem(R.id.action_grid_size)
|
||||
menu.removeItem(R.id.action_new_playlist)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
fun newInstance(): GenreFragment {
|
||||
val args = Bundle()
|
||||
val fragment = GenreFragment()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package code.name.monkey.retromusic.fragments.mainactivity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
|
@ -9,25 +10,26 @@ import android.view.MenuItem;
|
|||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.util.Pair;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.afollestad.materialcab.MaterialCab;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
import code.name.monkey.appthemehelper.common.ATHToolbarActivity;
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
@ -50,12 +52,12 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
private Toolbar toolbar;
|
||||
private AppBarLayout appBarLayout;
|
||||
private View contentContainer;
|
||||
private MaterialCardView toolbarContainer;
|
||||
|
||||
private MaterialCab cab;
|
||||
private FragmentManager fragmentManager;
|
||||
private ImageView userImage;
|
||||
private CompositeDisposable disposable;
|
||||
private TextView bannerTitle;
|
||||
|
||||
|
||||
@NonNull
|
||||
public static Fragment newInstance(int tab) {
|
||||
|
@ -84,16 +86,15 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
View view = inflater.inflate(R.layout.fragment_library, container, false);
|
||||
disposable = new CompositeDisposable();
|
||||
contentContainer = view.findViewById(R.id.fragmentContainer);
|
||||
bannerTitle = view.findViewById(R.id.bannerTitle);
|
||||
toolbarContainer = view.findViewById(R.id.toolbarContainer);
|
||||
appBarLayout = view.findViewById(R.id.appBarLayout);
|
||||
toolbar = view.findViewById(R.id.toolbar);
|
||||
userImage = view.findViewById(R.id.userImage);
|
||||
userImage.setOnClickListener(v -> showMainMenu());
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
public void setTitle(@StringRes int name) {
|
||||
bannerTitle.setText(getString(name));
|
||||
toolbar.setTitle(getString(name));
|
||||
}
|
||||
|
||||
public void addOnAppBarOffsetChangedListener(@NonNull AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
||||
|
@ -143,17 +144,16 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
private void setupToolbar() {
|
||||
int primaryColor = ThemeStore.Companion.primaryColor(getContext());
|
||||
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
||||
bannerTitle.setTextColor(ThemeStore.Companion.textColorPrimary(getContext()));
|
||||
|
||||
toolbar.setBackgroundColor(primaryColor);
|
||||
toolbar.setNavigationIcon(null);
|
||||
toolbar.setBackgroundColor(RetroUtil.toolbarColor(getMainActivity()));
|
||||
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
|
||||
toolbar.setOnClickListener(v -> {
|
||||
Pair<View, String> pair = new Pair<>(toolbarContainer, getString(R.string.transition_toolbar));
|
||||
NavigationUtil.goToSearch(getMainActivity(), pair);
|
||||
});
|
||||
appBarLayout.setBackgroundColor(primaryColor);
|
||||
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||
getMainActivity().setLightStatusbar(!ATHUtil.INSTANCE.isWindowBackgroundDark(getContext())));
|
||||
getMainActivity().setTitle(null);
|
||||
getMainActivity().setSupportActionBar(toolbar);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private Fragment getCurrentFragment() {
|
||||
|
@ -359,7 +359,8 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
int id = item.getItemId();
|
||||
switch (id) {
|
||||
case R.id.action_search:
|
||||
NavigationUtil.goToSearch(getMainActivity());
|
||||
Pair<View, String> pair = new Pair<>(toolbarContainer, getString(R.string.transition_toolbar));
|
||||
NavigationUtil.goToSearch(getMainActivity(), pair);
|
||||
break;
|
||||
case R.id.action_new_playlist:
|
||||
CreatePlaylistDialog.Companion.create().show(getChildFragmentManager(), "CREATE_PLAYLIST");
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package code.name.monkey.retromusic.fragments.mainactivity.folders;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.MediaScannerConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
|
@ -14,10 +14,7 @@ import android.view.MenuItem;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -29,12 +26,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.afollestad.materialcab.MaterialCab;
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import com.afollestad.materialdialogs.bottomsheets.BottomSheet;
|
||||
import com.bumptech.glide.request.Request;
|
||||
import com.bumptech.glide.request.target.SizeReadyCallback;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
||||
|
@ -59,7 +50,6 @@ import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
|||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.adapter.SongFileAdapter;
|
||||
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment;
|
||||
import code.name.monkey.retromusic.glide.GlideApp;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
import code.name.monkey.retromusic.helper.menu.SongMenuHelper;
|
||||
import code.name.monkey.retromusic.helper.menu.SongsMenuHelper;
|
||||
|
@ -73,11 +63,10 @@ import code.name.monkey.retromusic.model.Song;
|
|||
import code.name.monkey.retromusic.util.FileUtil;
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||
import code.name.monkey.retromusic.util.RetroColorUtil;
|
||||
import code.name.monkey.retromusic.util.RetroUtil;
|
||||
import code.name.monkey.retromusic.util.ViewUtil;
|
||||
import code.name.monkey.retromusic.views.BreadCrumbLayout;
|
||||
|
||||
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
||||
|
||||
public class FoldersFragment extends AbsMainActivityFragment implements
|
||||
MainActivityFragmentCallbacks,
|
||||
CabHolder, BreadCrumbLayout.SelectionCallback, SongFileAdapter.Callbacks,
|
||||
|
@ -95,16 +84,12 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
|||
|
||||
private View coordinatorLayout, container, empty;
|
||||
|
||||
private TextView title;
|
||||
|
||||
private Toolbar toolbar;
|
||||
|
||||
private BreadCrumbLayout breadCrumbs;
|
||||
|
||||
private AppBarLayout appBarLayout;
|
||||
|
||||
private ImageView userImage;
|
||||
|
||||
private FastScrollRecyclerView recyclerView;
|
||||
|
||||
private Comparator<File> fileComparator = (lhs, rhs) -> {
|
||||
|
@ -162,14 +147,12 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
|||
|
||||
private void initViews(View view) {
|
||||
coordinatorLayout = view.findViewById(R.id.coordinatorLayout);
|
||||
userImage = view.findViewById(R.id.userImage);
|
||||
userImage.setOnClickListener(v -> showMainMenu());
|
||||
|
||||
recyclerView = view.findViewById(R.id.recyclerView);
|
||||
appBarLayout = view.findViewById(R.id.appBarLayout);
|
||||
breadCrumbs = view.findViewById(R.id.breadCrumbs);
|
||||
toolbar = view.findViewById(R.id.toolbar);
|
||||
empty = view.findViewById(android.R.id.empty);
|
||||
title = view.findViewById(R.id.bannerTitle);
|
||||
container = view.findViewById(R.id.container);
|
||||
}
|
||||
|
||||
|
@ -242,19 +225,15 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
|||
}
|
||||
|
||||
private void setUpAppbarColor() {
|
||||
title.setTextColor(ThemeStore.Companion.textColorPrimary(getContext()));
|
||||
|
||||
int primaryColor = ThemeStore.Companion.primaryColor(getContext());
|
||||
|
||||
getActivity().setTitle(null);
|
||||
getMainActivity().setSupportActionBar(toolbar);
|
||||
TintHelper.setTintAuto(container, primaryColor, true);
|
||||
appBarLayout.setBackgroundColor(primaryColor);
|
||||
toolbar.setBackgroundColor(primaryColor);
|
||||
toolbar.setNavigationOnClickListener(v -> {
|
||||
getActivity().onBackPressed();
|
||||
toolbar.setBackgroundColor(RetroUtil.toolbarColor(getMainActivity()));
|
||||
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
|
||||
toolbar.setOnClickListener(v -> {
|
||||
showMainMenu();
|
||||
});
|
||||
|
||||
breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), ColorUtil.INSTANCE.darkenColor(primaryColor)));
|
||||
breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(),
|
||||
ColorUtil.INSTANCE.darkenColor(primaryColor)));
|
||||
|
@ -348,10 +327,6 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
//noinspection ConstantConditions
|
||||
getActivity().onBackPressed();
|
||||
break;
|
||||
case R.id.action_go_to_start_directory:
|
||||
setCrumb(new BreadCrumbLayout.Crumb(tryGetCanonicalFile(PreferenceUtil.getInstance().getStartDirectory())), true);
|
||||
return true;
|
||||
|
@ -489,8 +464,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
|||
|
||||
private void checkIsEmpty() {
|
||||
if (empty != null) {
|
||||
empty
|
||||
.setVisibility(adapter == null || adapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
|
||||
empty.setVisibility(adapter == null || adapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -754,21 +728,13 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
|||
|
||||
@Override
|
||||
protected Dialog createDialog(@NonNull Context context) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.progress_bar, null);
|
||||
view.setBackgroundColor(ThemeStore.Companion.primaryColor(context));
|
||||
ProgressBar progressBar = view.findViewById(R.id.progressBar);
|
||||
TintHelper.setTintAuto(progressBar, ThemeStore.Companion.accentColor(context), false);
|
||||
|
||||
MaterialDialog materialDialog = new MaterialDialog(context, new BottomSheet());
|
||||
materialDialog.setContentView(view);
|
||||
materialDialog.title(R.string.listing_files, "");
|
||||
materialDialog.setOnCancelListener(dialog -> cancel(false));
|
||||
materialDialog.setOnDismissListener(dialog -> cancel(false));
|
||||
materialDialog.negativeButton(android.R.string.cancel, "", materialDialog1 -> {
|
||||
cancel(false);
|
||||
return null;
|
||||
});
|
||||
return materialDialog;
|
||||
ProgressDialog dialog = new ProgressDialog(context);
|
||||
dialog.setIndeterminate(true);
|
||||
dialog.setTitle(R.string.listing_files);
|
||||
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||
dialog.setOnCancelListener(dialog1 -> cancel(false));
|
||||
dialog.setOnDismissListener(dialog1 -> cancel(false));
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,19 @@ package code.name.monkey.retromusic.fragments.mainactivity.home
|
|||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Bundle
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import android.widget.ImageView
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.util.Pair
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.common.ATHToolbarActivity
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||
import code.name.monkey.retromusic.Constants
|
||||
import code.name.monkey.retromusic.Constants.USER_BANNER
|
||||
import code.name.monkey.retromusic.Constants.USER_PROFILE
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.adapter.HomeAdapter
|
||||
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment
|
||||
|
@ -32,14 +33,12 @@ import code.name.monkey.retromusic.util.NavigationUtil
|
|||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.request.Request
|
||||
import com.bumptech.glide.request.target.SizeReadyCallback
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import com.bumptech.glide.request.transition.Transition
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.android.synthetic.main.abs_playlists.*
|
||||
import kotlinx.android.synthetic.main.fragment_banner_home.*
|
||||
import kotlinx.android.synthetic.main.fragment_home.recyclerView
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
@ -56,13 +55,32 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
private lateinit var topPlayed: View
|
||||
private lateinit var actionShuffle: View
|
||||
private lateinit var history: View
|
||||
private lateinit var userImage: ImageView
|
||||
private lateinit var toolbar: Toolbar
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, viewGroup: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(if (PreferenceUtil.getInstance().isHomeBanner) R.layout.fragment_banner_home else R.layout.fragment_home, viewGroup, false)
|
||||
}
|
||||
|
||||
private fun loadImageFromStorage() {
|
||||
disposable.add(Compressor(context!!)
|
||||
.setMaxHeight(300)
|
||||
.setMaxWidth(300)
|
||||
.setQuality(75)
|
||||
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
||||
.compressToBitmapAsFlowable(File(PreferenceUtil.getInstance().profileImage, Constants.USER_PROFILE))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
if (it != null) {
|
||||
userImage.setImageBitmap(it)
|
||||
} else {
|
||||
userImage.setImageDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_person_flat))
|
||||
}
|
||||
}) {
|
||||
userImage.setImageDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_person_flat))
|
||||
})
|
||||
}
|
||||
|
||||
private val displayMetrics: DisplayMetrics
|
||||
get() {
|
||||
val display = mainActivity.windowManager.defaultDisplay
|
||||
|
@ -71,44 +89,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
return metrics
|
||||
}
|
||||
|
||||
private fun getTimeOfTheDay() {
|
||||
val c = Calendar.getInstance()
|
||||
val timeOfDay = c.get(Calendar.HOUR_OF_DAY)
|
||||
|
||||
var images = arrayOf<String>()
|
||||
when (timeOfDay) {
|
||||
in 0..5 -> images = resources.getStringArray(R.array.night)
|
||||
in 6..11 -> images = resources.getStringArray(R.array.morning)
|
||||
in 12..15 -> images = resources.getStringArray(R.array.after_noon)
|
||||
in 16..19 -> images = resources.getStringArray(R.array.evening)
|
||||
in 20..23 -> images = resources.getStringArray(R.array.night)
|
||||
}
|
||||
|
||||
val day = images[Random().nextInt(images.size)]
|
||||
loadTimeImage(day)
|
||||
}
|
||||
|
||||
|
||||
private fun loadTimeImage(day: String) {
|
||||
if (bannerImage != null) {
|
||||
if (PreferenceUtil.getInstance().bannerImage.isEmpty()) {
|
||||
GlideApp.with(activity!!)
|
||||
.load(day)
|
||||
.placeholder(R.drawable.material_design_default)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.into(bannerImage!!)
|
||||
} else {
|
||||
disposable.add(Compressor(context!!)
|
||||
.setQuality(100)
|
||||
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
||||
.compressToBitmapAsFlowable(File(PreferenceUtil.getInstance().bannerImage, USER_BANNER))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe { bannerImage!!.setImageBitmap(it) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
homePresenter = HomePresenter(this)
|
||||
|
@ -118,7 +98,9 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
toolbar = view.findViewById(R.id.toolbar)
|
||||
|
||||
bannerImage?.setOnClickListener {
|
||||
NavigationUtil.goToUserInfo(activity!!)
|
||||
}
|
||||
if (!PreferenceUtil.getInstance().isHomeBanner)
|
||||
setStatusbarColorAuto(view)
|
||||
|
||||
|
@ -142,9 +124,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
NavigationUtil.goToPlaylistNew(mainActivity, HistoryPlaylist(mainActivity))
|
||||
}
|
||||
|
||||
userImage = view.findViewById(R.id.userImage)
|
||||
userImage.setOnClickListener { showMainMenu() }
|
||||
|
||||
homePresenter = HomePresenter(this)
|
||||
|
||||
contentContainerView = view.findViewById(R.id.contentContainer)
|
||||
|
@ -156,6 +135,12 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
homePresenter.subscribe()
|
||||
|
||||
checkPadding()
|
||||
|
||||
userInfoContainer.setOnClickListener {
|
||||
NavigationUtil.goToUserInfo(activity!!)
|
||||
}
|
||||
titleWelcome.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
titleWelcome.text = String.format("%s", PreferenceUtil.getInstance().userName)
|
||||
}
|
||||
|
||||
private fun checkPadding() {
|
||||
|
@ -167,12 +152,22 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
(recyclerView.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = (marginSpan * 2.3f).toInt()
|
||||
}
|
||||
|
||||
private fun toolbarColor(): Int {
|
||||
return if (PreferenceUtil.getInstance().isHomeBanner) {
|
||||
toolbarContainer.setBackgroundColor(Color.TRANSPARENT)
|
||||
ColorUtil.withAlpha(RetroUtil.toolbarColor(mainActivity), 0.85f)
|
||||
} else {
|
||||
RetroUtil.toolbarColor(mainActivity)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupToolbar() {
|
||||
mainActivity.title = null
|
||||
toolbar.apply {
|
||||
setBackgroundColor(if (PreferenceUtil.getInstance().isHomeBanner) Color.TRANSPARENT else ThemeStore.primaryColor(context))
|
||||
setNavigationOnClickListener {
|
||||
NavigationUtil.goToSearch(activity)
|
||||
setBackgroundColor(toolbarColor())
|
||||
setNavigationIcon(R.drawable.ic_menu_white_24dp)
|
||||
setOnClickListener {
|
||||
val pairImageView = Pair.create<View, String>(toolbarContainer, resources.getString(R.string.transition_toolbar))
|
||||
NavigationUtil.goToSearch(activity!!, pairImageView)
|
||||
}
|
||||
}
|
||||
mainActivity.setSupportActionBar(toolbar)
|
||||
|
@ -243,11 +238,51 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
if (item.itemId == R.id.action_search) {
|
||||
NavigationUtil.goToSearch(mainActivity)
|
||||
val pairImageView = Pair.create<View, String>(toolbarContainer, resources.getString(R.string.transition_toolbar))
|
||||
NavigationUtil.goToSearch(mainActivity, true, pairImageView)
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
private fun getTimeOfTheDay() {
|
||||
val c = Calendar.getInstance()
|
||||
val timeOfDay = c.get(Calendar.HOUR_OF_DAY)
|
||||
|
||||
var images = arrayOf<String>()
|
||||
when (timeOfDay) {
|
||||
in 0..5 -> images = resources.getStringArray(R.array.night)
|
||||
in 6..11 -> images = resources.getStringArray(R.array.morning)
|
||||
in 12..15 -> images = resources.getStringArray(R.array.after_noon)
|
||||
in 16..19 -> images = resources.getStringArray(R.array.evening)
|
||||
in 20..23 -> images = resources.getStringArray(R.array.night)
|
||||
}
|
||||
|
||||
val day = images[Random().nextInt(images.size)]
|
||||
loadTimeImage(day)
|
||||
}
|
||||
|
||||
|
||||
private fun loadTimeImage(day: String) {
|
||||
if (bannerImage != null) {
|
||||
if (PreferenceUtil.getInstance().bannerImage.isEmpty()) {
|
||||
GlideApp.with(activity!!)
|
||||
.load(day)
|
||||
.placeholder(R.drawable.material_design_default)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.into(bannerImage!!)
|
||||
} else {
|
||||
disposable.add(Compressor(context!!)
|
||||
.setQuality(100)
|
||||
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
||||
.compressToBitmapAsFlowable(File(PreferenceUtil.getInstance().bannerImage, USER_BANNER))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe { bannerImage!!.setImageBitmap(it) })
|
||||
}
|
||||
}
|
||||
loadImageFromStorage()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val TAG: String = "BannerHomeFragment"
|
||||
|
|
|
@ -120,7 +120,7 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
private fun updatePlayPauseDrawableState() {
|
||||
when {
|
||||
MusicPlayerRemote.isPlaying -> playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
else -> playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
else -> playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playerPlayPauseFab.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playerPlayPauseFab.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playerPlayPauseFab.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
private fun updatePlayPauseDrawableState() {
|
||||
when {
|
||||
MusicPlayerRemote.isPlaying -> playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
else -> playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
else -> playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment(), PopupMenu.OnMe
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ class LockScreenPlayerControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_big);
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_big);
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_64dp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ class SimplePlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_32dp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,332 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.fragments.player.slide
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.graphics.Color
|
||||
import android.graphics.PorterDuff
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.SeekBar
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.LinearSmoothScroller
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.*
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.service.MusicService
|
||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||
import code.name.monkey.retromusic.adapter.song.SimpleSongAdapter
|
||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
import kotlinx.android.synthetic.main.fragment_slide_player.*
|
||||
|
||||
/**
|
||||
* Created by hemanths on 3/15/19
|
||||
*/
|
||||
class SlidePlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Callback {
|
||||
private var lastColor: Int = 0
|
||||
override val paletteColor: Int
|
||||
get() = lastColor
|
||||
|
||||
override fun playerToolbar(): Toolbar {
|
||||
return playerToolbar
|
||||
}
|
||||
|
||||
override fun onShow() {
|
||||
|
||||
}
|
||||
|
||||
override fun onHide() {
|
||||
|
||||
}
|
||||
|
||||
override fun onBackPressed(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun toolbarIconColor(): Int {
|
||||
return Color.WHITE
|
||||
}
|
||||
|
||||
override fun onColorChanged(color: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onFavoriteToggled() {
|
||||
toggleFavorite(MusicPlayerRemote.currentSong)
|
||||
}
|
||||
|
||||
override fun toggleFavorite(song: Song) {
|
||||
super.toggleFavorite(song)
|
||||
if (song.id == MusicPlayerRemote.currentSong.id) {
|
||||
updateIsFavorite()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_slide_player, container, false)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
progressViewUpdateHelper.start()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
progressViewUpdateHelper.stop()
|
||||
}
|
||||
|
||||
|
||||
override fun onPlayingMetaChanged() {
|
||||
super.onPlayingMetaChanged()
|
||||
updateSong()
|
||||
updateIsFavorite()
|
||||
}
|
||||
|
||||
override fun onQueueChanged() {
|
||||
super.onQueueChanged()
|
||||
updateQueue()
|
||||
}
|
||||
|
||||
override fun onServiceConnected() {
|
||||
updatePlayPauseDrawableState()
|
||||
updateRepeatState()
|
||||
updateShuffleState()
|
||||
updateSong()
|
||||
updateIsFavorite()
|
||||
updateQueue()
|
||||
}
|
||||
|
||||
private fun updateQueue() {
|
||||
songAdapter.swapDataSet(MusicPlayerRemote.playingQueue)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private fun updatePlayPauseDrawableState() {
|
||||
if (MusicPlayerRemote.isPlaying) {
|
||||
albumCoverContainer.cardElevation = 24.0f
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
albumCoverContainer.cardElevation = 0.0f
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
}
|
||||
}
|
||||
|
||||
fun updateRepeatState() {
|
||||
when (MusicPlayerRemote.repeatMode) {
|
||||
MusicService.REPEAT_MODE_NONE -> {
|
||||
repeatButton.setImageResource(R.drawable.ic_repeat_white_24dp)
|
||||
repeatButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
MusicService.REPEAT_MODE_ALL -> {
|
||||
repeatButton.setImageResource(R.drawable.ic_repeat_white_24dp)
|
||||
repeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
MusicService.REPEAT_MODE_THIS -> {
|
||||
repeatButton.setImageResource(R.drawable.ic_repeat_one_white_24dp)
|
||||
repeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun updateShuffleState() {
|
||||
when (MusicPlayerRemote.shuffleMode) {
|
||||
MusicService.SHUFFLE_MODE_SHUFFLE -> shuffleButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
else -> shuffleButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun updateSong() {
|
||||
val song = MusicPlayerRemote.currentSong
|
||||
title.text = song.title
|
||||
text.text = song.artistName
|
||||
|
||||
GlideApp.with(activity!!).asBitmapPalette()
|
||||
.load(RetroGlideExtension.getSongModel(song))
|
||||
.songOptions(song)
|
||||
.transition(RetroGlideExtension.getDefaultTransition())
|
||||
.into(object : RetroMusicColoredTarget(playerImage) {
|
||||
override fun onColorReady(color: Int) {
|
||||
setColor(color)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun setColor(color: Int) {
|
||||
lastColor = color
|
||||
val colorBg = ATHUtil.resolveColor(context!!, android.R.attr.colorBackground)
|
||||
if (ColorUtil.isColorLight(colorBg)) {
|
||||
lastPlaybackControlsColor = MaterialValueHelper.getSecondaryTextColor(context!!, true)
|
||||
lastDisabledPlaybackControlsColor = MaterialValueHelper.getSecondaryDisabledTextColor(context!!, true)
|
||||
} else {
|
||||
lastPlaybackControlsColor = MaterialValueHelper.getPrimaryTextColor(context!!, false)
|
||||
lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(context!!, false)
|
||||
}
|
||||
|
||||
val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
|
||||
color
|
||||
} else {
|
||||
ThemeStore.accentColor(context!!)
|
||||
}
|
||||
|
||||
|
||||
text.setTextColor(colorFinal)
|
||||
playerQueueSubHeader.setTextColor(colorFinal)
|
||||
TintHelper.setTintAuto(playPauseButton, lastPlaybackControlsColor, false)
|
||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal)
|
||||
|
||||
updateRepeatState()
|
||||
updateShuffleState()
|
||||
updatePrevNextColor()
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setUpMusicControllers()
|
||||
setUpPlayerToolbar()
|
||||
(activity as AbsSlidingMusicPanelActivity).setAntiDragView(recyclerView)
|
||||
playerQueueSubHeader.setTextColor(ThemeStore.accentColor(context!!))
|
||||
}
|
||||
|
||||
private fun setUpMusicControllers() {
|
||||
setUpPlayPauseFab()
|
||||
setUpPrevNext()
|
||||
setUpRepeatButton()
|
||||
setUpShuffleButton()
|
||||
setUpProgressSlider()
|
||||
setUpRecyclerView()
|
||||
}
|
||||
|
||||
private lateinit var songAdapter: SimpleSongAdapter
|
||||
|
||||
private fun setUpRecyclerView() {
|
||||
songAdapter = SimpleSongAdapter(context = activity as AppCompatActivity,
|
||||
songs = ArrayList(), i = R.layout.item_song, useNumbers = true)
|
||||
recyclerView.apply {
|
||||
adapter = songAdapter
|
||||
layoutManager = LinearLayoutManager(context)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setUpProgressSlider() {
|
||||
progressSlider.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() {
|
||||
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
||||
if (fromUser) {
|
||||
MusicPlayerRemote.seekTo(progress)
|
||||
onUpdateProgressViews(MusicPlayerRemote.songProgressMillis, MusicPlayerRemote.songDurationMillis)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||
progressSlider.max = total
|
||||
|
||||
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
|
||||
animator.duration = AbsPlayerControlsFragment.SLIDER_ANIMATION_TIME
|
||||
animator.interpolator = LinearInterpolator()
|
||||
animator.start()
|
||||
|
||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||
}
|
||||
|
||||
private fun setUpPlayPauseFab() {
|
||||
playPauseButton.setOnClickListener(PlayPauseButtonOnClickHandler())
|
||||
}
|
||||
|
||||
private fun setUpRepeatButton() {
|
||||
repeatButton.setOnClickListener { MusicPlayerRemote.cycleRepeatMode() }
|
||||
}
|
||||
|
||||
private fun setUpShuffleButton() {
|
||||
shuffleButton.setOnClickListener { MusicPlayerRemote.toggleShuffleMode() }
|
||||
}
|
||||
|
||||
private fun setUpPrevNext() {
|
||||
updatePrevNextColor()
|
||||
nextButton.setOnClickListener { MusicPlayerRemote.playNextSong() }
|
||||
previousButton.setOnClickListener { MusicPlayerRemote.back() }
|
||||
}
|
||||
|
||||
private fun updatePrevNextColor() {
|
||||
nextButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
previousButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
|
||||
private var lastPlaybackControlsColor: Int = 0
|
||||
private var lastDisabledPlaybackControlsColor: Int = 0
|
||||
private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
|
||||
|
||||
override fun onPlayStateChanged() {
|
||||
updatePlayPauseDrawableState()
|
||||
}
|
||||
|
||||
override fun onRepeatModeChanged() {
|
||||
updateRepeatState()
|
||||
}
|
||||
|
||||
override fun onShuffleModeChanged() {
|
||||
updateShuffleState()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
progressViewUpdateHelper = MusicProgressViewUpdateHelper(this)
|
||||
}
|
||||
|
||||
private fun setUpPlayerToolbar() {
|
||||
playerToolbar.inflateMenu(R.menu.menu_player)
|
||||
playerToolbar.setNavigationOnClickListener { activity!!.onBackPressed() }
|
||||
playerToolbar.setOnMenuItemClickListener(this)
|
||||
|
||||
ToolbarContentTintHelper.colorizeToolbar(playerToolbar, Color.WHITE, activity)
|
||||
}
|
||||
|
||||
fun RecyclerView.smoothSnapToPosition(position: Int, snapMode: Int = LinearSmoothScroller.SNAP_TO_START) {
|
||||
val smoothScroller = object : LinearSmoothScroller(this.context) {
|
||||
override fun getVerticalSnapPreference(): Int {
|
||||
return snapMode
|
||||
}
|
||||
|
||||
override fun getHorizontalSnapPreference(): Int {
|
||||
return snapMode
|
||||
}
|
||||
}
|
||||
smoothScroller.targetPosition = position
|
||||
this.layoutManager?.startSmoothScroll(smoothScroller)
|
||||
}
|
||||
}
|
|
@ -75,8 +75,7 @@ abstract class AbsSettingsFragment : PreferenceFragmentCompat() {
|
|||
dialogFragment = AlbumCoverStylePreferenceDialog.newInstance(preference.key);
|
||||
}
|
||||
if (preference is MaterialListPreference) {
|
||||
val entries = preference.entries
|
||||
|
||||
preference.entries
|
||||
dialogFragment = MaterialListPreferenceDialog.newInstance(preference)
|
||||
}
|
||||
if (preference is BlacklistPreference) {
|
||||
|
|
|
@ -14,27 +14,24 @@
|
|||
|
||||
package code.name.monkey.retromusic.fragments.settings
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.content.res.ColorStateList
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.retromusic.Constants.USER_PROFILE
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.App
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.SettingsActivity
|
||||
import code.name.monkey.retromusic.util.Compressor
|
||||
import code.name.monkey.retromusic.extensions.hide
|
||||
import code.name.monkey.retromusic.extensions.show
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.android.synthetic.main.fragment_main_settings.*
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
|
||||
class MainSettingsFragment : Fragment(), View.OnClickListener {
|
||||
|
@ -70,30 +67,27 @@ class MainSettingsFragment : Fragment(), View.OnClickListener {
|
|||
otherSettings.setOnClickListener(this)
|
||||
aboutSettings.setOnClickListener(this)
|
||||
|
||||
text.setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
text.text = PreferenceUtil.getInstance().userBio
|
||||
titleWelcome.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
titleWelcome.text = String.format("%s %s!", getTimeOfTheDay(), PreferenceUtil.getInstance().userName)
|
||||
userInfoContainer.setOnClickListener { NavigationUtil.goToUserInfo(activity!!) }
|
||||
buyProContainer.apply {
|
||||
if (!App.isProVersion) show() else hide()
|
||||
setOnClickListener {
|
||||
NavigationUtil.goToProVersion(context)
|
||||
}
|
||||
}
|
||||
buyPremium.setOnClickListener {
|
||||
NavigationUtil.goToProVersion(context!!)
|
||||
}
|
||||
MaterialUtil.setTint(buyPremium)
|
||||
val primaryColor = MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(ThemeStore.primaryColor(context!!)))
|
||||
text.setTextColor(ColorUtil.withAlpha(primaryColor, 0.75f))
|
||||
//title.setTextColor(primaryColor)
|
||||
text2.setTextColor(primaryColor)
|
||||
text3.imageTintList = ColorStateList.valueOf(primaryColor)
|
||||
|
||||
}
|
||||
|
||||
private fun inflateFragment(fragment: Fragment, @StringRes title: Int) {
|
||||
if (activity != null) {
|
||||
(activity as SettingsActivity).setupFragment(fragment, title)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getTimeOfTheDay(): String {
|
||||
var message = getString(R.string.title_good_day)
|
||||
val c = Calendar.getInstance()
|
||||
val timeOfDay = c.get(Calendar.HOUR_OF_DAY)
|
||||
|
||||
when (timeOfDay) {
|
||||
in 0..5 -> message = getString(R.string.title_good_night)
|
||||
in 6..11 -> message = getString(R.string.title_good_morning)
|
||||
in 12..15 -> message = getString(R.string.title_good_afternoon)
|
||||
in 16..19 -> message = getString(R.string.title_good_evening)
|
||||
in 20..23 -> message = getString(R.string.title_good_night)
|
||||
}
|
||||
return message
|
||||
}
|
||||
}
|
|
@ -36,8 +36,6 @@ class PersonaizeSettingsFragment : AbsSettingsFragment(), SharedPreferences.OnSh
|
|||
activity!!.recreate()
|
||||
return@setOnPreferenceChangeListener true
|
||||
}
|
||||
|
||||
|
||||
val toggleFullScreen: TwoStatePreference = findPreference("toggle_full_screen")!!
|
||||
toggleFullScreen.setOnPreferenceChangeListener { _, _ ->
|
||||
activity!!.recreate()
|
||||
|
|
|
@ -96,8 +96,7 @@ object MusicPlayerRemote {
|
|||
val isServiceConnected: Boolean
|
||||
get() = musicService != null
|
||||
|
||||
fun bindToService(context: Context,
|
||||
callback: ServiceConnection): ServiceToken? {
|
||||
fun bindToService(context: Context, callback: ServiceConnection): ServiceToken? {
|
||||
|
||||
var realActivity: Activity? = (context as Activity).parent
|
||||
if (realActivity == null) {
|
||||
|
@ -105,6 +104,7 @@ object MusicPlayerRemote {
|
|||
}
|
||||
|
||||
val contextWrapper = ContextWrapper(realActivity)
|
||||
|
||||
contextWrapper.startService(Intent(contextWrapper, MusicService::class.java))
|
||||
|
||||
val binder = ServiceBinder(callback)
|
||||
|
@ -129,24 +129,21 @@ object MusicPlayerRemote {
|
|||
}
|
||||
|
||||
private fun getFilePathFromUri(context: Context, uri: Uri): String? {
|
||||
|
||||
var cursor: Cursor? = null
|
||||
val column = "_data"
|
||||
val projection = arrayOf(column)
|
||||
var cursor: Cursor? = null
|
||||
|
||||
try {
|
||||
cursor = context.contentResolver.query(uri, projection, null, null, null)
|
||||
cursor.use {
|
||||
if (it.moveToFirst()) {
|
||||
val columnIndex = it.getColumnIndexOrThrow(column)
|
||||
return it.getString(columnIndex)
|
||||
}
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
val column_index = cursor.getColumnIndexOrThrow(column)
|
||||
return cursor.getString(column_index)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, e.message)
|
||||
} finally {
|
||||
cursor!!.close()
|
||||
cursor?.close()
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.misc
|
||||
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
object DisposableManager {
|
||||
|
||||
private var compositeDisposable: CompositeDisposable? = null
|
||||
|
||||
fun add(disposable: Disposable) {
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
fun dispose() {
|
||||
getCompositeDisposable().dispose()
|
||||
}
|
||||
|
||||
private fun getCompositeDisposable(): CompositeDisposable {
|
||||
if (compositeDisposable == null || compositeDisposable!!.isDisposed) {
|
||||
compositeDisposable = CompositeDisposable()
|
||||
}
|
||||
return compositeDisposable!!
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.misc
|
||||
|
||||
import androidx.annotation.CallSuper
|
||||
import io.reactivex.Observer
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
class DisposingObserver<T> : Observer<T> {
|
||||
@CallSuper
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
DisposableManager.add(d)
|
||||
}
|
||||
|
||||
override fun onNext(next: T) {}
|
||||
|
||||
override fun onError(e: Throwable) {}
|
||||
|
||||
override fun onComplete() {}
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.misc;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/*Don't delete even if its not showing not using*/
|
||||
public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior<FloatingActionButton> {
|
||||
private static final String TAG = "ScrollingFABBehavior";
|
||||
Handler mHandler;
|
||||
|
||||
public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
|
||||
@NonNull FloatingActionButton child,
|
||||
@NonNull View target) {
|
||||
super.onStopNestedScroll(coordinatorLayout, child, target);
|
||||
|
||||
if (mHandler == null)
|
||||
mHandler = new Handler();
|
||||
|
||||
|
||||
mHandler.postDelayed(() -> {
|
||||
child.animate().translationY(0).setInterpolator(new LinearInterpolator()).start();
|
||||
Log.d("FabAnim", "startHandler()");
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
|
||||
@NonNull FloatingActionButton child,
|
||||
@NonNull View target,
|
||||
int dxConsumed,
|
||||
int dyConsumed,
|
||||
int dxUnconsumed,
|
||||
int dyUnconsumed) {
|
||||
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);
|
||||
|
||||
//child -> Floating Action Button
|
||||
if (dyConsumed > 0) {
|
||||
Log.d("Scrolling", "Up");
|
||||
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) child.getLayoutParams();
|
||||
int fab_bottomMargin = layoutParams.bottomMargin;
|
||||
child.animate().translationY(child.getHeight() + fab_bottomMargin).setInterpolator(new LinearInterpolator()).start();
|
||||
} else if (dyConsumed < 0) {
|
||||
Log.d("Scrolling", "down");
|
||||
child.animate().translationY(0).setInterpolator(new LinearInterpolator()).start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
|
||||
@NonNull FloatingActionButton child,
|
||||
@NonNull View directTargetChild,
|
||||
@NonNull View target,
|
||||
int nestedScrollAxes) {
|
||||
if (mHandler != null) {
|
||||
mHandler.removeMessages(0);
|
||||
Log.d("Scrolling", "stopHandler()");
|
||||
}
|
||||
return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.misc;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private int space;
|
||||
|
||||
public SpacesItemDecoration(int space) {
|
||||
this.space = space;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view,
|
||||
RecyclerView parent, RecyclerView.State state) {
|
||||
outRect.right = space;
|
||||
outRect.bottom = space;
|
||||
}
|
||||
}
|
|
@ -69,7 +69,7 @@ class AlbumCoverStylePreferenceDialog : PreferenceDialogFragmentCompat(), ViewPa
|
|||
viewPager.pageMargin = ViewUtil.convertDpToPixel(32f, resources).toInt()
|
||||
viewPager.currentItem = PreferenceUtil.getInstance().albumCoverStyle.ordinal
|
||||
|
||||
return MaterialDialog(activity!!, BottomSheet()).show {
|
||||
return MaterialDialog(activity!!).show {
|
||||
title(R.string.pref_title_album_cover_style)
|
||||
positiveButton(R.string.set) {
|
||||
val nowPlayingScreen = AlbumCoverStyle.values()[viewPagerPosition]
|
||||
|
|
|
@ -16,11 +16,13 @@ package code.name.monkey.retromusic.preferences
|
|||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.graphics.PorterDuff
|
||||
import android.os.Bundle
|
||||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEDialogPreference
|
||||
import androidx.preference.DialogPreference
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.dialogs.BlacklistFolderChooserDialog
|
||||
import code.name.monkey.retromusic.providers.BlacklistStore
|
||||
|
@ -30,7 +32,7 @@ import com.afollestad.materialdialogs.list.listItems
|
|||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
class BlacklistPreference : ATEDialogPreference {
|
||||
class BlacklistPreference : DialogPreference {
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
|
||||
|
@ -38,6 +40,10 @@ class BlacklistPreference : ATEDialogPreference {
|
|||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
}
|
||||
|
||||
class BlacklistPreferenceDialog : DialogFragment(), BlacklistFolderChooserDialog.FolderCallback {
|
||||
|
|
|
@ -17,10 +17,12 @@ package code.name.monkey.retromusic.preferences
|
|||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.content.res.TypedArray
|
||||
import android.graphics.PorterDuff
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceDialogFragmentCompat
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.retromusic.R
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
||||
|
@ -30,13 +32,25 @@ import com.afollestad.materialdialogs.list.listItemsSingleChoice
|
|||
class MaterialListPreference : ListPreference {
|
||||
private val mLayoutRes = R.layout.ate_preference_list
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
|
||||
private fun init(context: Context) {
|
||||
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
override fun getDialogLayoutResource(): Int {
|
||||
return mLayoutRes
|
||||
|
@ -64,7 +78,7 @@ class MaterialListPreferenceDialog : PreferenceDialogFragmentCompat() {
|
|||
|
||||
val entries = arguments?.getStringArrayList(EXTRA_ENTRIES)
|
||||
val entriesValues = arguments?.getStringArrayList(EXTRA_ENTRIES_VALUES)
|
||||
return MaterialDialog(activity!!, BottomSheet())
|
||||
materialDialog = MaterialDialog(activity!!, BottomSheet())
|
||||
.show {
|
||||
title(text = materialListPreference.title.toString())
|
||||
positiveButton(R.string.set)
|
||||
|
@ -75,11 +89,14 @@ class MaterialListPreferenceDialog : PreferenceDialogFragmentCompat() {
|
|||
dismiss()
|
||||
}
|
||||
}
|
||||
return materialDialog
|
||||
}
|
||||
|
||||
private lateinit var materialDialog: MaterialDialog
|
||||
|
||||
override fun onDialogClosed(positiveResult: Boolean) {
|
||||
if (positiveResult) {
|
||||
dismiss()
|
||||
materialDialog.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,10 +84,9 @@ class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewP
|
|||
viewPager.currentItem = PreferenceUtil.getInstance().nowPlayingScreen.ordinal
|
||||
|
||||
|
||||
return MaterialDialog(activity!!, BottomSheet()).show {
|
||||
return MaterialDialog(activity!!).show {
|
||||
title(R.string.pref_title_album_cover_style)
|
||||
positiveButton(R.string.set) {
|
||||
|
||||
val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition]
|
||||
if (isNowPlayingThemes(nowPlayingScreen)) {
|
||||
val result = getString(nowPlayingScreen.titleRes) + " theme is Pro version feature."
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.providers
|
||||
|
||||
import android.content.ContentValues
|
||||
import android.content.Context
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import android.database.sqlite.SQLiteOpenHelper
|
||||
import code.name.monkey.retromusic.loaders.SongLoader
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
|
||||
class NotPlayedStore(val context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, VERSION) {
|
||||
|
||||
private val dataBaseCreate = "CREATE TABLE IF NOT EXISTS $NAME ( $ID LONG PRIMARY KEY )"
|
||||
|
||||
override fun onCreate(db: SQLiteDatabase) {
|
||||
db.execSQL(dataBaseCreate)
|
||||
}
|
||||
|
||||
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||
db.execSQL("DROP TABLE IF EXISTS $NAME")
|
||||
}
|
||||
|
||||
fun removeSong(id: Long) {
|
||||
val db = writableDatabase
|
||||
db.apply {
|
||||
beginTransaction()
|
||||
delete(NAME, "$ID = $id", null)
|
||||
setTransactionSuccessful()
|
||||
endTransaction()
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
fun addAllSongs(songs: ArrayList<Song>) {
|
||||
SongLoader.getAllSongs(context)
|
||||
.map {
|
||||
val database = writableDatabase;
|
||||
database.apply {
|
||||
val contentValues = ContentValues()
|
||||
for (song in songs) {
|
||||
contentValues.put(ID, song.id)
|
||||
insert(NAME, null, contentValues)
|
||||
}
|
||||
setTransactionSuccessful()
|
||||
endTransaction()
|
||||
}
|
||||
return@map true
|
||||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val NAME = "not_played_songs"
|
||||
const val ID = "song_id"
|
||||
const val DATABASE_NAME = "not_played.db"
|
||||
private const val VERSION = 1
|
||||
private var sInstance: NotPlayedStore? = null
|
||||
|
||||
@Synchronized
|
||||
fun getInstance(context: Context): NotPlayedStore {
|
||||
if (sInstance == null) {
|
||||
sInstance = NotPlayedStore(context.applicationContext)
|
||||
}
|
||||
return sInstance!!
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
|
||||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.rest;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import code.name.monkey.retromusic.App;
|
||||
import code.name.monkey.retromusic.rest.service.KuGouApiService;
|
||||
import okhttp3.Cache;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
import static code.name.monkey.retromusic.Constants.BASE_API_URL_KUGOU;
|
||||
|
||||
/**
|
||||
* Created by hemanths on 23/08/17.
|
||||
*/
|
||||
|
||||
public class KogouClient {
|
||||
|
||||
private static final String BASE_URL = BASE_API_URL_KUGOU;
|
||||
|
||||
private KuGouApiService apiService;
|
||||
|
||||
public KogouClient() {
|
||||
this(createDefaultOkHttpClientBuilder().build());
|
||||
}
|
||||
|
||||
private KogouClient(@NonNull Call.Factory client) {
|
||||
Retrofit restAdapter = new Retrofit.Builder()
|
||||
.baseUrl(BASE_URL)
|
||||
.callFactory(client)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
|
||||
.build();
|
||||
|
||||
apiService = restAdapter.create(KuGouApiService.class);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static Cache createDefaultCache(Context context) {
|
||||
File cacheDir = new File(context.getCacheDir().getAbsolutePath(), "/okhttp-lastfm/");
|
||||
if (cacheDir.mkdirs() || cacheDir.isDirectory()) {
|
||||
return new Cache(cacheDir, 1024 * 1024 * 10);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Interceptor createCacheControlInterceptor() {
|
||||
return chain -> {
|
||||
Request modifiedRequest = chain.request().newBuilder()
|
||||
.addHeader("Cache-Control", String.format("max-age=%d, max-stale=%d", 31536000, 31536000))
|
||||
.build();
|
||||
return chain.proceed(modifiedRequest);
|
||||
};
|
||||
}
|
||||
|
||||
private static OkHttpClient.Builder createDefaultOkHttpClientBuilder() {
|
||||
return new OkHttpClient.Builder()
|
||||
.cache(createDefaultCache(App.Companion.getInstance()))
|
||||
.addInterceptor(createCacheControlInterceptor());
|
||||
}
|
||||
|
||||
public KuGouApiService getApiService() {
|
||||
return apiService;
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.rest.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Created by hefuyi on 2017/1/20.
|
||||
*/
|
||||
|
||||
public class KuGouRawLyric {
|
||||
|
||||
private static final String CHARSET = "charset";
|
||||
private static final String CONTENT = "content";
|
||||
private static final String FMT = "fmt";
|
||||
private static final String INFO = "info";
|
||||
private static final String STATUS = "status";
|
||||
|
||||
@SerializedName(CHARSET)
|
||||
public String charset;
|
||||
|
||||
@SerializedName(CONTENT)
|
||||
public String content;
|
||||
|
||||
@SerializedName(FMT)
|
||||
public String fmt;
|
||||
@SerializedName(INFO)
|
||||
public String info;
|
||||
@SerializedName(STATUS)
|
||||
public int status;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "KuGouRawLyric{" +
|
||||
"charset='" + charset + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", fmt='" + fmt + '\'' +
|
||||
", info='" + info + '\'' +
|
||||
", status=" + status +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.rest.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Created by hefuyi on 2017/1/20.
|
||||
*/
|
||||
|
||||
public class KuGouSearchLyricResult {
|
||||
|
||||
private static final String INFO = "info";
|
||||
private static final String STATUS = "status";
|
||||
private static final String PROPOSAL = "proposal";
|
||||
private static final String KEYWORD = "keyword";
|
||||
private static final String CANDIDATES = "candidates";
|
||||
|
||||
@NonNull
|
||||
@SerializedName(INFO)
|
||||
public String info;
|
||||
|
||||
@SerializedName(STATUS)
|
||||
public int status;
|
||||
|
||||
@NonNull
|
||||
@SerializedName(PROPOSAL)
|
||||
public String proposal;
|
||||
|
||||
@NonNull
|
||||
@SerializedName(KEYWORD)
|
||||
public String keyword;
|
||||
|
||||
@NonNull
|
||||
@SerializedName(CANDIDATES)
|
||||
public List<Candidates> candidates;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "KuGouSearchLyricResult{" +
|
||||
"info='" + info + '\'' +
|
||||
", status=" + status +
|
||||
", proposal='" + proposal + '\'' +
|
||||
", keyword='" + keyword + '\'' +
|
||||
", candidates=" + candidates +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class Candidates {
|
||||
private static final String NICKNAME = "nickname";
|
||||
private static final String ACCESSKEY = "accesskey";
|
||||
private static final String SCORE = "score";
|
||||
private static final String DURATION = "duration";
|
||||
private static final String UID = "uid";
|
||||
private static final String SONG = "song";
|
||||
private static final String ID = "id";
|
||||
private static final String SINGER = "singer";
|
||||
private static final String LANGUAGE = "language";
|
||||
@SerializedName(NICKNAME)
|
||||
public String nickname;
|
||||
@SerializedName(ACCESSKEY)
|
||||
public String accesskey;
|
||||
@SerializedName(SCORE)
|
||||
public int score;
|
||||
@SerializedName(DURATION)
|
||||
public long duration;
|
||||
@SerializedName(UID)
|
||||
public String uid;
|
||||
@SerializedName(SONG)
|
||||
public String songName;
|
||||
@SerializedName(ID)
|
||||
public String id;
|
||||
@SerializedName(SINGER)
|
||||
public String singer;
|
||||
@SerializedName(LANGUAGE)
|
||||
public String language;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Candidates{" +
|
||||
"nickname='" + nickname + '\'' +
|
||||
", accesskey='" + accesskey + '\'' +
|
||||
", score=" + score +
|
||||
", duration=" + duration +
|
||||
", uid='" + uid + '\'' +
|
||||
", songName='" + songName + '\'' +
|
||||
", id='" + id + '\'' +
|
||||
", singer='" + singer + '\'' +
|
||||
", language='" + language + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.rest.service;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import code.name.monkey.retromusic.rest.model.KuGouRawLyric;
|
||||
import code.name.monkey.retromusic.rest.model.KuGouSearchLyricResult;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* Created by hemanths on 28/07/17.
|
||||
*/
|
||||
|
||||
public interface KuGouApiService {
|
||||
|
||||
@NonNull
|
||||
@GET("search?ver=1&man=yes&client=pc")
|
||||
Observable<KuGouSearchLyricResult> searchLyric(@Query("keyword") @NonNull String songName, @Query("duration") @NonNull String duration);
|
||||
|
||||
@NonNull
|
||||
@GET("download?ver=1&client=pc&fmt=lrc&charset=utf8")
|
||||
Observable<KuGouRawLyric> getRawLyric(@Query("id") @NonNull String id, @Query("accesskey") @NonNull String accesskey);
|
||||
}
|
|
@ -173,7 +173,7 @@ class PlayingNotificationImpl : PlayingNotification() {
|
|||
if (isPlaying)
|
||||
R.drawable.ic_pause_white_24dp
|
||||
else
|
||||
R.drawable.ic_play_arrow_white_24dp, primary)!!, 1.5f)
|
||||
R.drawable.ic_play_arrow_white_32dp, primary)!!, 1.5f)
|
||||
|
||||
notificationLayout.setTextColor(R.id.title, primary)
|
||||
notificationLayout.setTextColor(R.id.text, secondary)
|
||||
|
|
|
@ -52,7 +52,7 @@ class PlayingNotificationImpl24 : PlayingNotification() {
|
|||
val playButtonResId = if (isPlaying)
|
||||
R.drawable.ic_pause_white_24dp
|
||||
else
|
||||
R.drawable.ic_play_arrow_white_24dp
|
||||
R.drawable.ic_play_arrow_white_32dp
|
||||
|
||||
val action = Intent(service, MainActivity::class.java)
|
||||
action.putExtra("expand", true)
|
||||
|
|
|
@ -163,7 +163,7 @@ class PlayingNotificationOreo : PlayingNotification() {
|
|||
if (isPlaying)
|
||||
R.drawable.ic_pause_white_24dp
|
||||
else
|
||||
R.drawable.ic_play_arrow_white_24dp, primary)!!, PlayingNotification.NOTIFICATION_CONTROLS_SIZE_MULTIPLIER)
|
||||
R.drawable.ic_play_arrow_white_32dp, primary)!!, PlayingNotification.NOTIFICATION_CONTROLS_SIZE_MULTIPLIER)
|
||||
|
||||
notificationLayout.setTextColor(R.id.title, primary)
|
||||
notificationLayout.setTextColor(R.id.subtitle, secondary)
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.transform;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
/**
|
||||
* Created by hemanths on 3/9/19
|
||||
*/
|
||||
public class RoundStackTransformer implements ViewPager.PageTransformer {
|
||||
@Override
|
||||
public void transformPage(@NonNull View page, float position) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.transform
|
||||
|
||||
import android.view.View
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
|
||||
class StackPagerTransformer : ViewPager.PageTransformer {
|
||||
|
||||
|
||||
override fun transformPage(view: View, position: Float) {
|
||||
|
||||
if (position < -1f) {
|
||||
view.translationX = view.width * position
|
||||
}
|
||||
|
||||
if (position < 0f) {
|
||||
view.translationX = 0f
|
||||
view.scaleX = 1f
|
||||
view.scaleY = 1f
|
||||
|
||||
} else if (position <= 1f) {
|
||||
|
||||
val scaleFactor = MIN_SCALE + (1 - MIN_SCALE) * (1 - Math.abs(position))
|
||||
view.pivotY = 0.5f * view.height
|
||||
view.translationX = view.width * -position
|
||||
view.scaleX = scaleFactor
|
||||
view.scaleY = scaleFactor
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val MIN_SCALE = 0.75f
|
||||
}
|
||||
}
|
|
@ -26,10 +26,8 @@ import androidx.annotation.Nullable;
|
|||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
import code.name.monkey.retromusic.model.Genre;
|
||||
import code.name.monkey.retromusic.model.Playlist;
|
||||
import code.name.monkey.retromusic.activities.AboutActivity;
|
||||
import code.name.monkey.retromusic.activities.AlbumDetailsActivity;
|
||||
import code.name.monkey.retromusic.activities.ArtistDetailActivity;
|
||||
|
@ -45,6 +43,9 @@ import code.name.monkey.retromusic.activities.SettingsActivity;
|
|||
import code.name.monkey.retromusic.activities.SupportDevelopmentActivity;
|
||||
import code.name.monkey.retromusic.activities.UserInfoActivity;
|
||||
import code.name.monkey.retromusic.activities.WhatsNewActivity;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
import code.name.monkey.retromusic.model.Genre;
|
||||
import code.name.monkey.retromusic.model.Playlist;
|
||||
|
||||
import static code.name.monkey.retromusic.Constants.RATE_ON_GOOGLE_PLAY;
|
||||
import static code.name.monkey.retromusic.util.RetroUtil.openUrl;
|
||||
|
@ -146,19 +147,28 @@ public class NavigationUtil {
|
|||
ActivityCompat.startActivity(activity, new Intent(activity, LicenseActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToSearch(Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class), null);
|
||||
public static void goToSearch(@NonNull Activity activity,
|
||||
@Nullable Pair... sharedElements) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class),
|
||||
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
||||
}
|
||||
|
||||
public static void goToSupportDevelopment(Activity activity) {
|
||||
public static void goToSearch(@NonNull Activity activity, boolean isMicOpen,
|
||||
@Nullable Pair... sharedElements) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class)
|
||||
.putExtra(SearchActivity.EXTRA_SHOW_MIC, isMicOpen),
|
||||
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
||||
}
|
||||
|
||||
public static void goToSupportDevelopment(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SupportDevelopmentActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToPlayStore(Activity activity) {
|
||||
public static void goToPlayStore(@NonNull Activity activity) {
|
||||
openUrl(activity, RATE_ON_GOOGLE_PLAY);
|
||||
}
|
||||
|
||||
public static void gotoWhatNews(Activity activity) {
|
||||
public static void gotoWhatNews(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, WhatsNewActivity.class), null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,15 +61,26 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||
import code.name.monkey.retromusic.App;
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
||||
public class RetroUtil {
|
||||
|
||||
private static final int[] TEMP_ARRAY = new int[1];
|
||||
private static final String SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar";
|
||||
|
||||
public static int calculateNoOfColumns(Context context) {
|
||||
public static int toolbarColor(@NonNull Context context) {
|
||||
int color = ThemeStore.Companion.primaryColor(context);
|
||||
if (ATHUtil.INSTANCE.isWindowBackgroundDark(context)) {
|
||||
return ATHUtil.INSTANCE.resolveColor(context, R.attr.cardBackgroundColor);
|
||||
} else {
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
||||
public static int calculateNoOfColumns(@NonNull Context context) {
|
||||
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||
float dpWidth = displayMetrics.widthPixels / displayMetrics.density;
|
||||
return (int) (dpWidth / 180);
|
||||
|
|
|
@ -1,113 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import code.name.monkey.retromusic.App;
|
||||
|
||||
public class SystemUtils {
|
||||
|
||||
private static final String STATUS_BAR_HEIGHT_RES_NAME = "status_bar_height";
|
||||
private static final String NAV_BAR_HEIGHT_RES_NAME = "navigation_bar_height";
|
||||
private static final String NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME = "navigation_bar_height_landscape";
|
||||
private static final String NAV_BAR_WIDTH_RES_NAME = "navigation_bar_width";
|
||||
private static final String SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar";
|
||||
private final float mSmallestWidthDp;
|
||||
private final boolean mInPortrait;
|
||||
|
||||
private Activity activity;
|
||||
|
||||
public SystemUtils(Activity activity) {
|
||||
this.activity = activity;
|
||||
Resources resources = activity.getResources();
|
||||
mSmallestWidthDp = getSmallestWidthDp(activity);
|
||||
mInPortrait = (resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
|
||||
}
|
||||
|
||||
private static boolean hasNavBar(Resources resources) {
|
||||
int id = resources.getIdentifier(SHOW_NAV_BAR_RES_NAME, "bool", "android");
|
||||
if (id > 0)
|
||||
return resources.getBoolean(id);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getNavigationBarHeight() {
|
||||
int result = 0;
|
||||
int resourceId = App.Companion.getContext().getResources().getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = App.Companion.getContext().getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int getComboHeight() {
|
||||
if (isNavigationAtBottom()) {
|
||||
return getNavigationBarWidth();
|
||||
} else {
|
||||
return getNavigationBarHeight();
|
||||
}
|
||||
}
|
||||
|
||||
public int getNavigationBarWidth() {
|
||||
Resources res = activity.getResources();
|
||||
int result = 0;
|
||||
if (hasNavBar(activity.getResources())) {
|
||||
if (!isNavigationAtBottom())
|
||||
return getInternalDimensionSize(res, NAV_BAR_WIDTH_RES_NAME);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void addPadding(ViewGroup viewGroup) {
|
||||
Context context = viewGroup.getContext();
|
||||
Resources resources = context.getResources();
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) viewGroup.getLayoutParams();
|
||||
if (isNavigationAtBottom()) {
|
||||
params.leftMargin = getNavigationBarWidth();
|
||||
params.rightMargin = getNavigationBarWidth();
|
||||
} else {
|
||||
params.bottomMargin = getNavigationBarHeight();
|
||||
}
|
||||
}
|
||||
|
||||
private int getInternalDimensionSize(Resources res, String key) {
|
||||
int result = 0;
|
||||
int resourceId = res.getIdentifier(key, "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = res.getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private float getSmallestWidthDp(Activity activity) {
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
activity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
|
||||
float widthDp = metrics.widthPixels / metrics.density;
|
||||
float heightDp = metrics.heightPixels / metrics.density;
|
||||
return Math.min(widthDp, heightDp);
|
||||
}
|
||||
|
||||
boolean isNavigationAtBottom() {
|
||||
return (mSmallestWidthDp >= 600 || mInPortrait);
|
||||
}
|
||||
|
||||
}
|
|
@ -19,8 +19,6 @@ import android.content.res.ColorStateList
|
|||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
|
||||
|
@ -47,20 +45,8 @@ class ColorIconsImageView : AppCompatImageView {
|
|||
|
||||
private fun setIconBackgroundColor(color: Int) {
|
||||
setBackgroundResource(R.drawable.color_circle_gradient)
|
||||
|
||||
val alpha = if (ATHUtil.isWindowBackgroundDark(context)) {
|
||||
1.0f
|
||||
} else {
|
||||
0.12f
|
||||
}
|
||||
val filterColor = if (ATHUtil.isWindowBackgroundDark(context)) {
|
||||
ThemeStore.primaryColor(context)
|
||||
} else {
|
||||
color
|
||||
}
|
||||
|
||||
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, alpha))
|
||||
imageTintList = ColorStateList.valueOf(filterColor)
|
||||
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, 0.22f))
|
||||
imageTintList = ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.75f))
|
||||
requestLayout()
|
||||
invalidate()
|
||||
}
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.views
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.util.AttributeSet
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import com.google.android.material.button.MaterialButton
|
||||
|
||||
class MaterialButtonTextColor @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = -1) : MaterialButton(context, attrs, defStyleAttr) {
|
||||
|
||||
init {
|
||||
setTextColor(MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(ThemeStore.primaryColor(getContext()))))
|
||||
iconTint = ColorStateList.valueOf(ATHUtil.resolveColor(context, R.attr.iconColor))
|
||||
rippleColor = ColorStateList.valueOf(ColorUtil.withAlpha(ThemeStore.accentColor(context), 0.4f))
|
||||
//minHeight = RetroUtil.convertDpToPixel(42f, context).toInt()
|
||||
iconSize = RetroUtil.convertDpToPixel(20f, context).toInt()
|
||||
}
|
||||
}
|
|
@ -1,225 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.views;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import androidx.annotation.NonNull;
|
||||
import android.util.Property;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
||||
|
||||
public class PlayPauseDrawable extends Drawable {
|
||||
private static final long PLAY_PAUSE_ANIMATION_DURATION = 250;
|
||||
|
||||
private static final Property<PlayPauseDrawable, Float> PROGRESS =
|
||||
new Property<PlayPauseDrawable, Float>(Float.class, "progress") {
|
||||
@Override
|
||||
public Float get(@NonNull PlayPauseDrawable d) {
|
||||
return d.getProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(@NonNull PlayPauseDrawable d, Float value) {
|
||||
d.setProgress(value);
|
||||
}
|
||||
};
|
||||
|
||||
private final Path leftPauseBar = new Path();
|
||||
private final Path rightPauseBar = new Path();
|
||||
private final Paint paint = new Paint();
|
||||
private final float pauseBarWidth;
|
||||
private final float pauseBarHeight;
|
||||
private final float pauseBarDistance;
|
||||
|
||||
private float width;
|
||||
private float height;
|
||||
|
||||
private float progress;
|
||||
private boolean isPlay;
|
||||
private boolean isPlaySet;
|
||||
|
||||
private Animator animator;
|
||||
|
||||
public PlayPauseDrawable(@NonNull Context context) {
|
||||
final Resources res = context.getResources();
|
||||
paint.setAntiAlias(true);
|
||||
paint.setStyle(Paint.Style.FILL);
|
||||
paint.setColor(Color.WHITE);
|
||||
|
||||
pauseBarWidth = res.getDimensionPixelSize(R.dimen.pause_bar_width);
|
||||
pauseBarHeight = res.getDimensionPixelSize(R.dimen.pause_bar_height);
|
||||
pauseBarDistance = res.getDimensionPixelSize(R.dimen.pause_bar_distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Linear interpolate between a and b with parameter t.
|
||||
*/
|
||||
private static float lerp(float a, float b, float t) {
|
||||
return a + (b - a) * t;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBoundsChange(@NonNull final Rect bounds) {
|
||||
super.onBoundsChange(bounds);
|
||||
if (bounds.width() > 0 && bounds.height() > 0) {
|
||||
width = bounds.width();
|
||||
height = bounds.height();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(@NonNull Canvas canvas) {
|
||||
leftPauseBar.rewind();
|
||||
rightPauseBar.rewind();
|
||||
|
||||
// The current distance between the two pause bars.
|
||||
final float barDist = lerp(pauseBarDistance, 0f, progress);
|
||||
// The current width of each pause bar.
|
||||
float rawBarWidth = lerp(pauseBarWidth, pauseBarHeight / 1.75f, progress);
|
||||
// We have to round the bar width when finishing the progress to prevent the gap
|
||||
// that might occur onDraw because of a pixel is lost when casting float to int instead of rounding it.
|
||||
final float barWidth = progress == 1f ? Math.round(rawBarWidth) : rawBarWidth;
|
||||
// The current position of the left pause bar's top left coordinate.
|
||||
final float firstBarTopLeft = lerp(0f, barWidth, progress);
|
||||
// The current position of the right pause bar's top right coordinate.
|
||||
final float secondBarTopRight = lerp(2f * barWidth + barDist, barWidth + barDist, progress);
|
||||
|
||||
// Draw the left pause bar. The left pause bar transforms into the
|
||||
// top half of the play button triangle by animating the position of the
|
||||
// rectangle's top left coordinate and expanding its bottom width.
|
||||
leftPauseBar.moveTo(0f, 0f);
|
||||
leftPauseBar.lineTo(firstBarTopLeft, -pauseBarHeight);
|
||||
leftPauseBar.lineTo(barWidth, -pauseBarHeight);
|
||||
leftPauseBar.lineTo(barWidth, 0f);
|
||||
leftPauseBar.close();
|
||||
|
||||
// Draw the right pause bar. The right pause bar transforms into the
|
||||
// bottom half of the play button triangle by animating the position of the
|
||||
// rectangle's top right coordinate and expanding its bottom width.
|
||||
rightPauseBar.moveTo(barWidth + barDist, 0f);
|
||||
rightPauseBar.lineTo(barWidth + barDist, -pauseBarHeight);
|
||||
rightPauseBar.lineTo(secondBarTopRight, -pauseBarHeight);
|
||||
rightPauseBar.lineTo(2 * barWidth + barDist, 0f);
|
||||
rightPauseBar.close();
|
||||
|
||||
final int saveCount = canvas.save();
|
||||
|
||||
// Translate the play button a tiny bit to the right so it looks more centered.
|
||||
canvas.translate(lerp(0f, pauseBarHeight / 8f, progress), 0f);
|
||||
|
||||
// (1) Pause --> Play: rotate 0 to 90 degrees clockwise.
|
||||
// (2) Play --> Pause: rotate 90 to 180 degrees clockwise.
|
||||
final float rotationProgress = isPlay ? 1f - progress : progress;
|
||||
final float startingRotation = isPlay ? 90f : 0f;
|
||||
canvas.rotate(lerp(startingRotation, startingRotation + 90f, rotationProgress), width / 2f, height / 2f);
|
||||
|
||||
// Position the pause/play button in the center of the drawable's bounds.
|
||||
canvas.translate(Math.round(width / 2f - ((2f * barWidth + barDist) / 2f)), Math.round(height / 2f + (pauseBarHeight / 2f)));
|
||||
|
||||
// Draw the two bars that form the animated pause/play button.
|
||||
canvas.drawPath(leftPauseBar, paint);
|
||||
canvas.drawPath(rightPauseBar, paint);
|
||||
|
||||
canvas.restoreToCount(saveCount);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private Animator getPausePlayAnimator() {
|
||||
isPlaySet = !isPlaySet;
|
||||
final Animator anim = ObjectAnimator.ofFloat(this, PROGRESS, isPlay ? 1f : 0f, isPlay ? 0f : 1f);
|
||||
anim.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
isPlay = !isPlay;
|
||||
}
|
||||
});
|
||||
return anim;
|
||||
}
|
||||
|
||||
private float getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
private void setProgress(float progress) {
|
||||
this.progress = progress;
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha(int alpha) {
|
||||
paint.setAlpha(alpha);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter cf) {
|
||||
paint.setColorFilter(cf);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOpacity() {
|
||||
return PixelFormat.TRANSLUCENT;
|
||||
}
|
||||
|
||||
public void setPlay(boolean animate) {
|
||||
if (animate) {
|
||||
if (!isPlaySet) {
|
||||
togglePlayPause();
|
||||
}
|
||||
} else {
|
||||
isPlaySet = true;
|
||||
isPlay = true;
|
||||
setProgress(1f);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPause(boolean animate) {
|
||||
if (animate) {
|
||||
if (isPlaySet) {
|
||||
togglePlayPause();
|
||||
}
|
||||
} else {
|
||||
isPlaySet = false;
|
||||
isPlay = false;
|
||||
setProgress(0f);
|
||||
}
|
||||
}
|
||||
|
||||
public void togglePlayPause() {
|
||||
if (animator != null) {
|
||||
animator.cancel();
|
||||
}
|
||||
|
||||
animator = getPausePlayAnimator();
|
||||
animator.setInterpolator(new DecelerateInterpolator());
|
||||
animator.setDuration(PLAY_PAUSE_ANIMATION_DURATION);
|
||||
animator.start();
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Hemanth Savarala.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3
|
||||
*
|
||||
* This is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
package code.name.monkey.retromusic.views
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
|
||||
class TintIconColorToolbar : Toolbar {
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
|
||||
|
||||
|
||||
override fun setNavigationIcon(icon: Drawable?) {
|
||||
super.setNavigationIcon(icon)
|
||||
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
}
|
24
app/src/main/res/drawable/ic_blur_on_white_24dp.xml
Normal file
24
app/src/main/res/drawable/ic_blur_on_white_24dp.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M6 13c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm0 4c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm0-8c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm-3 0.5c-0.28 0-0.5 0.22 -0.5 0.5 s0.22 0.5 0.5 0.5 0.5-0.22 0.5 -0.5-0.22-0.5-0.5-0.5zM6 5c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm15 5.5c0.28 0 0.5-0.22 0.5 -0.5s-0.22-0.5-0.5-0.5-0.5 0.22 -0.5 0.5 0.22 0.5 0.5 0.5 zM14 7c0.55 0 1-0.45 1-1s-0.45-1-1-1-1 0.45-1 1 0.45 1 1 1zm0-3.5c0.28 0 0.5-0.22 0.5 -0.5s-0.22-0.5-0.5-0.5-0.5 0.22 -0.5 0.5 0.22 0.5 0.5 0.5 zm-11 10c-0.28 0-0.5 0.22 -0.5 0.5 s0.22 0.5 0.5 0.5 0.5-0.22 0.5 -0.5-0.22-0.5-0.5-0.5zm7 7c-0.28 0-0.5 0.22 -0.5 0.5 s0.22 0.5 0.5 0.5 0.5-0.22 0.5 -0.5-0.22-0.5-0.5-0.5zm0-17c0.28 0 0.5-0.22 0.5 -0.5s-0.22-0.5-0.5-0.5-0.5 0.22 -0.5 0.5 0.22 0.5 0.5 0.5 zM10 7c0.55 0 1-0.45 1-1s-0.45-1-1-1-1 0.45-1 1 0.45 1 1 1zm0 5.5c-0.83 0-1.5 0.67 -1.5 1.5s0.67 1.5 1.5 1.5 1.5-0.67 1.5-1.5-0.67-1.5-1.5-1.5zm8 0.5c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm0 4c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm0-8c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm0-4c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm3 8.5c-0.28 0-0.5 0.22 -0.5 0.5 s0.22 0.5 0.5 0.5 0.5-0.22 0.5 -0.5-0.22-0.5-0.5-0.5zM14 17c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm0 3.5c-0.28 0-0.5 0.22 -0.5 0.5 s0.22 0.5 0.5 0.5 0.5-0.22 0.5 -0.5-0.22-0.5-0.5-0.5zm-4-12c-0.83 0-1.5 0.67 -1.5 1.5s0.67 1.5 1.5 1.5 1.5-0.67 1.5-1.5-0.67-1.5-1.5-1.5zm0 8.5c-0.55 0-1 0.45-1 1s0.45 1 1 1 1-0.45 1-1-0.45-1-1-1zm4-4.5c-0.83 0-1.5 0.67 -1.5 1.5s0.67 1.5 1.5 1.5 1.5-0.67 1.5-1.5-0.67-1.5-1.5-1.5zm0-4c-0.83 0-1.5 0.67 -1.5 1.5s0.67 1.5 1.5 1.5 1.5-0.67 1.5-1.5-0.67-1.5-1.5-1.5z" />
|
||||
</vector>
|
24
app/src/main/res/drawable/ic_cellphone_lock_white_24dp.xml
Normal file
24
app/src/main/res/drawable/ic_cellphone_lock_white_24dp.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<!-- drawable/cellphone_lock.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M17,1H7A2,2 0 0,0 5,3V6H7V4H17V20H7V18H5V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3A2,2 0 0,0 17,1M8.8,11V9.5C8.8,8.1 7.4,7 6,7C4.6,7 3.2,8.1 3.2,9.5V11C2.6,11 2,11.6 2,12.2V15.7C2,16.4 2.6,17 3.2,17H8.7C9.4,17 10,16.4 10,15.8V12.3C10,11.6 9.4,11 8.8,11M7.5,11H4.5V9.5C4.5,8.7 5.2,8.2 6,8.2C6.8,8.2 7.5,8.7 7.5,9.5V11Z" />
|
||||
</vector>
|
24
app/src/main/res/drawable/ic_cellphone_white_24dp.xml
Normal file
24
app/src/main/res/drawable/ic_cellphone_white_24dp.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<!-- drawable/cellphone.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M17,19H7V5H17M17,1H7C5.89,1 5,1.89 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3C19,1.89 18.1,1 17,1Z" />
|
||||
</vector>
|
36
app/src/main/res/drawable/ic_color_lens_white_24dp.xml
Normal file
36
app/src/main/res/drawable/ic_color_lens_white_24dp.xml
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-0.28 0-0.5 0.22 -0.5 0.5 0 0.12 0.05 0.23 0.13 0.33 0.41 0.47 0.64 1.06 0.64 1.67 0 1.38-1.12 2.5-2.5 2.5zm0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c0.28 0 0.5-0.22 0.5 -0.5 0-0.16-0.08-0.28-0.14-0.35-0.41-0.46-0.63-1.05-0.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7z" />
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M 6.5 10 C 7.32842712475 10 8 10.6715728753 8 11.5 C 8 12.3284271247 7.32842712475 13 6.5 13 C 5.67157287525 13 5 12.3284271247 5 11.5 C 5 10.6715728753 5.67157287525 10 6.5 10 Z" />
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M 9.5 6 C 10.3284271247 6 11 6.67157287525 11 7.5 C 11 8.32842712475 10.3284271247 9 9.5 9 C 8.67157287525 9 8 8.32842712475 8 7.5 C 8 6.67157287525 8.67157287525 6 9.5 6 Z" />
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M 14.5 6 C 15.3284271247 6 16 6.67157287525 16 7.5 C 16 8.32842712475 15.3284271247 9 14.5 9 C 13.6715728753 9 13 8.32842712475 13 7.5 C 13 6.67157287525 13.6715728753 6 14.5 6 Z" />
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M 17.5 10 C 18.3284271247 10 19 10.6715728753 19 11.5 C 19 12.3284271247 18.3284271247 13 17.5 13 C 16.6715728753 13 16 12.3284271247 16 11.5 C 16 10.6715728753 16.6715728753 10 17.5 10 Z" />
|
||||
</vector>
|
25
app/src/main/res/drawable/ic_colorize_white_24dp.xml
Normal file
25
app/src/main/res/drawable/ic_colorize_white_24dp.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path android:pathData="M0 0h24v24H0V0z" />
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M17.66 5.41l0.92 0.92 -2.69 2.69-0.92-0.92 2.69-2.69M17.67 3c-0.26 0-0.51 0.1 -0.71 0.29 l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c0.4-0.4 0.4 -1.03 0.01 -1.42l-2.34-2.34c-0.2-0.19-0.45-0.29-0.7-0.29zM6.92 19L5 17.08l8.06-8.06 1.92 1.92L6.92 19z" />
|
||||
</vector>
|
26
app/src/main/res/drawable/ic_diamond_stone_white_24dp.xml
Normal file
26
app/src/main/res/drawable/ic_diamond_stone_white_24dp.xml
Normal file
|
@ -0,0 +1,26 @@
|
|||
<!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<!-- drawable/diamond_stone.xml -->
|
||||
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M16,9H19L14,16M10,9H14L12,17M5,9H8L10,16M15,4H17L19,7H16M11,4H13L14,7H10M7,4H9L8,7H5M6,2L2,8L12,22L22,8L18,2H6Z" />
|
||||
</vector>
|
|
@ -1,8 +1,22 @@
|
|||
<!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M9,16A2,2 0 0,0 7,18A2,2 0 0,0 9,20A2,2 0 0,0 11,18V13H14V11H10V16.27C9.71,16.1 9.36,16 9,16Z" />
|
||||
|
|
24
app/src/main/res/drawable/ic_filter_song_white_24dp.xml
Normal file
24
app/src/main/res/drawable/ic_filter_song_white_24dp.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<!-- drawable/contain.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M2,3H8V5H4V19H8V21H2V3M7,17V15H9V17H7M11,17V15H13V17H11M15,17V15H17V17H15M22,3V21H16V19H20V5H16V3H22Z" />
|
||||
</vector>
|
|
@ -4,8 +4,7 @@
|
|||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M9 11.75c-0.69 0-1.25 0.56 -1.25 1.25s0.56 1.25 1.25 1.25 1.25-0.56 1.25-1.25-0.56-1.25-1.25-1.25zm6 0c-0.69 0-1.25 0.56 -1.25 1.25s0.56 1.25 1.25 1.25 1.25-0.56 1.25-1.25-0.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-0.29 0.02 -0.58 0.05 -0.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c0.78 0 1.53-0.09 2.25-0.26 0.21 0.71 0.33 1.47 0.33 2.26 0 4.41-3.59 8-8 8z" />
|
||||
android:pathData="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" />
|
||||
</vector>
|
|
@ -6,5 +6,5 @@
|
|||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M10.25 13c0 0.69-0.56 1.25-1.25 1.25S7.75 13.69 7.75 13s0.56-1.25 1.25-1.25 1.25 0.56 1.25 1.25zM15 11.75c-0.69 0-1.25 0.56 -1.25 1.25s0.56 1.25 1.25 1.25 1.25-0.56 1.25-1.25-0.56-1.25-1.25-1.25zm7 0.25c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zM10.66 4.12C12.06 6.44 14.6 8 17.5 8c0.46 0 0.91-0.05 1.34-0.12C17.44 5.56 14.9 4 12 4c-0.46 0-0.91 0.05 -1.34 0.12 zM4.42 9.47c1.71-0.97 3.03-2.55 3.66-4.44C6.37 6 5.05 7.58 4.42 9.47zM20 12c0-0.78-0.12-1.53-0.33-2.24-0.7 0.15 -1.42 0.24 -2.17 0.24 -3.13 0-5.92-1.44-7.76-3.69C8.69 8.87 6.6 10.88 4 11.86c0.01 0.04 0 0.09 0 0.14 0 4.41 3.59 8 8 8s8-3.59 8-8z" />
|
||||
android:pathData="M12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3L2 12h3v8h6v-6h2v6h6v-8h3L12 3z" />
|
||||
</vector>
|
24
app/src/main/res/drawable/ic_music_note_off_white_24dp.xml
Normal file
24
app/src/main/res/drawable/ic_music_note_off_white_24dp.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<!-- drawable/music_note_off.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M12,3V8.68L15,11.68V6H19V3H12M5.28,4.5L4,5.77L10.26,12.03C7.89,12.15 6,14.1 6,16.5C6,19 8,21 10.5,21C12.9,21 14.85,19.11 14.97,16.74L19.68,21.45L20.96,20.18L15,14.22L12,11.22L5.28,4.5Z" />
|
||||
</vector>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="@dimen/icon_notification_dimen"
|
||||
android:height="@dimen/icon_notification_dimen"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
|
|
25
app/src/main/res/drawable/ic_play_arrow_white_32dp.xml
Normal file
25
app/src/main/res/drawable/ic_play_arrow_white_32dp.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="@dimen/icon_notification_dimen"
|
||||
android:height="@dimen/icon_notification_dimen"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M10 8.64L15.27 12 10 15.36V8.64M8 5v14l11-7L8 5z" />
|
||||
</vector>
|
|
@ -2,8 +2,8 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M19,19H21V21H19V19M19,17H21V15H19V17M3,13H5V11H3V13M3,17H5V15H3V17M3,9H5V7H3V9M3,5H5V3H3V5M7,5H9V3H7V5M15,21H17V19H15V21M11,21H13V19H11V21M15,21H17V19H15V21M7,21H9V19H7V21M3,21H5V19H3V21M21,8A5,5 0 0,0 16,3H11V5H16A3,3 0 0,1 19,8V13H21V8Z" />
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M21 3H3c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h18c1.1 0 2-0.9 2-2V5c0-1.1-0.9-2-2-2zm0 16.01H3V4.99h18v14.02zM8 16h2.5l1.5 1.5 1.5-1.5H16v-2.5l1.5-1.5-1.5-1.5V8h-2.5L12 6.5 10.5 8H8v2.5L6.5 12 8 13.5V16zm4-7c1.66 0 3 1.34 3 3s-1.34 3-3 3V9z" />
|
||||
</vector>
|
BIN
app/src/main/res/drawable/promotional.webp
Normal file
BIN
app/src/main/res/drawable/promotional.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
|
@ -7,7 +7,7 @@
|
|||
<font
|
||||
android:font="@font/circular_std_medium"
|
||||
android:fontStyle="normal"
|
||||
android:fontWeight="700" />
|
||||
android:fontWeight="600" />
|
||||
|
||||
<font
|
||||
android:font="@font/circular_std_black"
|
||||
|
|
|
@ -96,16 +96,5 @@
|
|||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/actionShuffleAll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:text="@string/action_shuffle_all"
|
||||
app:icon="@drawable/ic_clear_all_black_24dp" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue