main
h4h13 2019-01-28 16:15:51 +05:30
parent 63c417cd61
commit a81536ab9a
96 changed files with 729 additions and 724 deletions

4
.gitignore vendored
View File

@ -35,4 +35,6 @@ build/
#NDK #NDK
obj/ obj/
captures captures
app/normal/release/
/models/

View File

@ -32,8 +32,8 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"
versionCode 281 versionCode 283
versionName '3.0.540' versionName '3.0.550'
multiDexEnabled true multiDexEnabled true
@ -132,7 +132,7 @@ dependencies {
implementation "com.squareup.retrofit2:retrofit:2.5.0" implementation "com.squareup.retrofit2:retrofit:2.5.0"
implementation "com.squareup.retrofit2:converter-gson:2.4.0" implementation "com.squareup.retrofit2:converter-gson:2.4.0"
implementation "com.squareup.retrofit2:adapter-rxjava2:2.4.0" implementation "com.squareup.retrofit2:adapter-rxjava2:2.5.0"
implementation "com.afollestad.material-dialogs:core:$materialDialog" implementation "com.afollestad.material-dialogs:core:$materialDialog"
implementation "com.afollestad.material-dialogs:commons:$materialDialog" implementation "com.afollestad.material-dialogs:commons:$materialDialog"

View File

@ -1 +1 @@
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h4>v3.0.540</h4> <h3>Highlights</h3> <ul style="line-height=150%"> <li>Kotlin conversion from Good old Java</li> <li>Outline style system icons</li> <li>New Material Design principles and Guide lines</li> <li>Holiday Theme</li> </ul> <h3>Changelog</h3> <ul style="line-height:150%"> <li>Fixed app clear data when crash happens</li> <li>Updated translations</li> <li>By default theme will be dark</li> <li>Now you can add search app shortcut in home screen</li> <li>Last selected Lyrics options saved</li> <li>Fonts are removed to make it fast loading</li> <li>Now you can add plain text home screen widget</li> <li>Good old side navigation bar for options</li> <li>Bug report for better tracking with milestones</li> <li>Snow fall effect can be enable from other settings(Works only one normal theme)</li> <li>Click new music mix to play songs</li> <li>Gradient image option for gird list</li> <li>Clear button for playing queue</li> <li>Folder list back button</li> <li>New theme Fit</li> <li>On library click on toolbar for accessing main menu </li> <li>On home click on toolbar for accessing search </li> <li>BottomSheetDialogue is now adaptable to screens, background colour and text size consistency. </li> <li>Removed coloured navigation bar option to making app adapt the primary colour</li> <li>Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes. </li> <li>Improved tablet UI and home screen by adding suggestions toggle banner issues.</li> <li>Improving lyrics page</li> <li>Updated image loading libraries(might loose your current artist images)</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body> <html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h4>v3.0.550</h4> <h3>Highlights</h3> <ul style="line-height=150%"> <li>Kotlin conversion from Good old Java</li> <li>Outline style system icons</li> <li>New Material Design principles and Guide lines</li> <li>Holiday Theme</li> </ul> <h3>Changelog</h3> <ul style="line-height:150%"> <li>Added favorite songs in home section</li> <li>Combined home sections to single Recycler View to make load faster</li> <li>Fixed app clear data when crash happens</li> <li>Updated translations</li> <li>By default theme will be dark</li> <li>Now you can add search app shortcut in home screen</li> <li>Last selected Lyrics options saved</li> <li>Fonts are removed to make it fast loading</li> <li>Now you can add plain text home screen widget</li> <li>Good old side navigation bar for options</li> <li>Bug report for better tracking with milestones</li> <li>Snow fall effect can be enable from other settings(Works only one normal theme)</li> <li>Click new music mix to play songs</li> <li>Gradient image option for gird list</li> <li>Clear button for playing queue</li> <li>Folder list back button</li> <li>New theme Fit</li> <li>On library click on toolbar for accessing main menu </li> <li>On home click on toolbar for accessing search </li> <li>BottomSheetDialogue is now adaptable to screens, background colour and text size consistency. </li> <li>Removed coloured navigation bar option to making app adapt the primary colour</li> <li>Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes. </li> <li>Improved tablet UI and home screen by adding suggestions toggle banner issues.</li> <li>Improving lyrics page</li> <li>Updated image loading libraries(might loose your current artist images)</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body>

View File

@ -5,12 +5,14 @@ import android.text.Html
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.model.Playlist import code.name.monkey.retromusic.model.Playlist
import code.name.monkey.retromusic.util.PlaylistsUtil import code.name.monkey.retromusic.util.PlaylistsUtil
import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment
import kotlinx.android.synthetic.main.dialog_remove_from_playlist.* import kotlinx.android.synthetic.main.dialog_delete.*
import java.util.* import java.util.*
@ -18,7 +20,7 @@ class DeletePlaylistDialog : RoundedBottomSheetDialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? { savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.dialog_remove_from_playlist, container, false) return inflater.inflate(R.layout.dialog_delete, container, false)
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -32,17 +34,22 @@ class DeletePlaylistDialog : RoundedBottomSheetDialogFragment() {
} else { } else {
Html.fromHtml(getString(R.string.delete_playlist_x, playlists[0].name)) Html.fromHtml(getString(R.string.delete_playlist_x, playlists[0].name))
} }
bannerTitle.text = content dialogTitle.text = content
bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!)) dialogTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
actionRemove.setText(R.string.action_delete) actionDelete.apply {
actionRemove.setTextColor(ThemeStore.textColorSecondary(context!!)) setText(R.string.action_delete)
actionCancel.setTextColor(ThemeStore.textColorSecondary(context!!)) setOnClickListener {
PlaylistsUtil.deletePlaylists(context, playlists)
actionCancel.setOnClickListener { dismiss() } dismiss()
actionRemove.setOnClickListener { }
PlaylistsUtil.deletePlaylists(activity!!, playlists) MaterialUtil.setTint(this)
dismiss() icon = ContextCompat.getDrawable(context, R.drawable.ic_delete_white_24dp)
}
actionCancel.apply {
MaterialUtil.setTint(this, false)
setOnClickListener { dismiss() }
icon = ContextCompat.getDrawable(context, R.drawable.ic_close_white_24dp)
} }
} }

View File

@ -5,6 +5,7 @@ import android.text.Html
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.MaterialUtil import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
@ -19,28 +20,33 @@ class DeleteSongsDialog : RoundedBottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
title.setTextColor(ThemeStore.textColorPrimary(context!!)) dialogTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
MaterialUtil.setTint(actionDelete)
MaterialUtil.setTint(actionCancel)
//noinspection unchecked,ConstantConditions //noinspection unchecked,ConstantConditions
val songs = arguments!!.getParcelableArrayList<Song>("songs") val songs = arguments!!.getParcelableArrayList<Song>("songs")
val content: CharSequence val content: CharSequence
if (songs != null) { if (songs != null) {
content = if (songs.size > 1) { content = if (songs.size > 1) {
Html.fromHtml(getString(R.string.delete_x_songs, songs.size)) getString(R.string.delete_x_songs, songs.size)
} else { } else {
Html.fromHtml(getString(R.string.delete_song_x, songs[0].title)) getString(R.string.delete_song_x, songs[0].title)
} }
this.title.text = content dialogTitle.text = content
} }
actionDelete.setOnClickListener { actionDelete.apply {
if (songs != null) { setOnClickListener {
MusicUtil.deleteTracks(activity!!, songs) if (songs != null) {
MusicUtil.deleteTracks(activity!!, songs)
}
dismiss()
} }
dismiss() MaterialUtil.setTint(this)
icon = ContextCompat.getDrawable(context, R.drawable.ic_delete_white_24dp)
}
actionCancel.apply {
MaterialUtil.setTint(this, false)
setOnClickListener { dismiss() }
icon = ContextCompat.getDrawable(context, R.drawable.ic_close_white_24dp)
} }
actionCancel.setOnClickListener { dismiss() }
} }

View File

@ -58,11 +58,7 @@ class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnCl
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
actionBuyPro.let {
it.visibility = if (!App.isProVersion) View.VISIBLE else View.GONE
it.iconTint = ColorStateList.valueOf(ThemeStore.accentColor(it.context))
it.setTextColor(ColorStateList.valueOf(ThemeStore.accentColor(it.context)))
}
text!!.setTextColor(ThemeStore.textColorSecondary(context!!)) text!!.setTextColor(ThemeStore.textColorSecondary(context!!))
titleWelcome!!.setTextColor(ThemeStore.textColorPrimary(context!!)) titleWelcome!!.setTextColor(ThemeStore.textColorPrimary(context!!))
titleWelcome!!.text = String.format("%s %s!", timeOfTheDay, PreferenceUtil.getInstance().userName) titleWelcome!!.text = String.format("%s %s!", timeOfTheDay, PreferenceUtil.getInstance().userName)
@ -76,8 +72,14 @@ class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnCl
actionFolders.setOnClickListener(this) actionFolders.setOnClickListener(this)
actionRate.setOnClickListener(this) actionRate.setOnClickListener(this)
actionShare.setOnClickListener(this) actionShare.setOnClickListener(this)
actionBuyPro.setOnClickListener(this)
actionBugReport.setOnClickListener(this) actionBugReport.setOnClickListener(this)
buyProContainer.apply {
setCardBackgroundColor(ThemeStore.accentColor(context!!))
visibility = if (!App.isProVersion) View.VISIBLE else View.GONE
setOnClickListener {
NavigationUtil.goToProVersion(context)
}
}
} }
@ -97,7 +99,7 @@ class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnCl
R.id.actionShare -> shareApp() R.id.actionShare -> shareApp()
R.id.actionBugReport -> prepareBugReport() R.id.actionBugReport -> prepareBugReport()
R.id.actionEqualizer -> NavigationUtil.openEqualizer(mainActivity) R.id.actionEqualizer -> NavigationUtil.openEqualizer(mainActivity)
R.id.actionBuyPro -> NavigationUtil.goToProVersion(mainActivity)
} }
dismiss() dismiss()
} }

View File

@ -9,7 +9,6 @@ import android.view.ViewGroup
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.model.PlaylistSong import code.name.monkey.retromusic.model.PlaylistSong
import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.util.PlaylistsUtil import code.name.monkey.retromusic.util.PlaylistsUtil
import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment
import kotlinx.android.synthetic.main.dialog_remove_from_playlist.* import kotlinx.android.synthetic.main.dialog_remove_from_playlist.*
@ -40,18 +39,23 @@ class RemoveFromPlaylistDialog : RoundedBottomSheetDialogFragment() {
title = R.string.remove_song_from_playlist_title title = R.string.remove_song_from_playlist_title
content = Html.fromHtml(getString(R.string.remove_song_x_from_playlist, songs[0].title)) content = Html.fromHtml(getString(R.string.remove_song_x_from_playlist, songs[0].title))
} }
actionRemove.text = content actionDelete.apply {
bannerTitle.setText(title) text = content
setTextColor(ThemeStore.textColorSecondary(context))
bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!)) setOnClickListener {
actionRemove.setTextColor(ThemeStore.textColorSecondary(context!!)) PlaylistsUtil.removeFromPlaylist(activity!!, songs)
actionCancel.setTextColor(ThemeStore.textColorSecondary(context!!)) dismiss()
}
actionRemove.setOnClickListener { }
PlaylistsUtil.removeFromPlaylist(activity!!, songs) bannerTitle.apply {
dismiss() setText(title)
setTextColor(ThemeStore.textColorPrimary(context))
}
actionCancel.apply {
setTextColor(ThemeStore.textColorSecondary(context))
setOnClickListener { dismiss() }
} }
actionCancel.setOnClickListener { dismiss() }
} }
companion object { companion object {

View File

@ -5,6 +5,7 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.MaterialUtil import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
@ -23,10 +24,8 @@ class RenamePlaylistDialog : RoundedBottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
val accentColor = ThemeStore.accentColor(context!!) val accentColor = ThemeStore.accentColor(context!!)
actionCreate.setText(R.string.action_rename)
MaterialUtil.setTint(actionCreate, true)
MaterialUtil.setTint(actionCancel, false)
MaterialUtil.setTint(actionNewPlaylistContainer, false) MaterialUtil.setTint(actionNewPlaylistContainer, false)
actionNewPlaylist.apply { actionNewPlaylist.apply {
@ -41,12 +40,22 @@ class RenamePlaylistDialog : RoundedBottomSheetDialogFragment() {
bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!)) bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
bannerTitle.setText(R.string.rename_playlist_title) bannerTitle.setText(R.string.rename_playlist_title)
actionCancel.setOnClickListener { dismiss() } actionCancel.apply {
actionCreate.setOnClickListener { MaterialUtil.setTint(actionCancel, false)
if (actionNewPlaylist.toString().trim { it <= ' ' } != "") { setOnClickListener { dismiss() }
val playlistId = arguments!!.getLong("playlist_id") icon = ContextCompat.getDrawable(context, R.drawable.ic_close_white_24dp)
PlaylistsUtil.renamePlaylist(context!!, playlistId, actionNewPlaylist.text!!.toString()) }
actionCreate.apply {
setText(R.string.action_rename)
setOnClickListener {
if (actionNewPlaylist.toString().trim { it <= ' ' } != "") {
val playlistId = arguments!!.getLong("playlist_id")
PlaylistsUtil.renamePlaylist(context!!, playlistId, actionNewPlaylist.text!!.toString())
}
} }
MaterialUtil.setTint(this)
icon = ContextCompat.getDrawable(context, R.drawable.ic_edit_white_24dp)
} }
} }

View File

@ -16,6 +16,7 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.SeekBar import android.widget.SeekBar
import android.widget.Toast import android.widget.Toast
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.MaterialUtil import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.Constants.ACTION_QUIT import code.name.monkey.retromusic.Constants.ACTION_QUIT
@ -45,7 +46,6 @@ class SleepTimerDialog : RoundedBottomSheetDialogFragment() {
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.dialog_sleep_timer, container, false) return inflater.inflate(R.layout.dialog_sleep_timer, container, false)
} }
@ -57,7 +57,7 @@ class SleepTimerDialog : RoundedBottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
MaterialUtil.setTint(actionSet, true)
MaterialUtil.setTint(actionCancel, false) MaterialUtil.setTint(actionCancel, false)
title.setTextColor(ThemeStore.textColorPrimary(context!!)) title.setTextColor(ThemeStore.textColorPrimary(context!!))
@ -88,26 +88,32 @@ class SleepTimerDialog : RoundedBottomSheetDialogFragment() {
} }
}) })
actionCancel.setOnClickListener { actionCancel.apply {
icon = ContextCompat.getDrawable(context, R.drawable.ic_close_white_24dp)
val previous = makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE) setOnClickListener {
if (previous != null) { val previous = makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE)
val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager if (previous != null) {
am.cancel(previous) val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager
previous.cancel() am.cancel(previous)
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_canceled), Toast.LENGTH_SHORT).show() previous.cancel()
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_canceled), Toast.LENGTH_SHORT).show()
}
dismiss()
} }
dismiss()
} }
actionSet.setOnClickListener { actionSet.apply {
val minutes = seekArcProgress icon = ContextCompat.getDrawable(context, R.drawable.ic_time_lapse_white_24dp)
val pi = makeTimerPendingIntent(PendingIntent.FLAG_CANCEL_CURRENT) MaterialUtil.setTint(actionSet)
val nextSleepTimerElapsedTime = SystemClock.elapsedRealtime() + minutes * 60 * 1000 setOnClickListener {
PreferenceUtil.getInstance().setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime) val minutes = seekArcProgress
val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager val pi = makeTimerPendingIntent(PendingIntent.FLAG_CANCEL_CURRENT)
am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextSleepTimerElapsedTime, pi) val nextSleepTimerElapsedTime = SystemClock.elapsedRealtime() + minutes * 60 * 1000
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_set, minutes), Toast.LENGTH_SHORT).show() PreferenceUtil.getInstance().setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime)
dismiss() val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager
am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextSleepTimerElapsedTime, pi)
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_set, minutes), Toast.LENGTH_SHORT).show()
dismiss()
}
} }
} }

View File

@ -6,41 +6,50 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment
import kotlinx.android.synthetic.main.dialog_file_share.* import kotlinx.android.synthetic.main.dialog_delete.*
class SongShareDialog : RoundedBottomSheetDialogFragment() { class SongShareDialog : RoundedBottomSheetDialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.dialog_file_share, container, false) return inflater.inflate(R.layout.dialog_delete, container, false)
} }
@SuppressLint("StringFormatInvalid") @SuppressLint("StringFormatInvalid")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
val song = arguments!!.getParcelable<Song>("song")!! val song = arguments!!.getParcelable<Song>("song")!!
dialogTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
audioText.text = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName) actionDelete.apply {
audioFile.setTextColor(ThemeStore.textColorSecondary(context!!)) text = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName)
audioText.setTextColor(ThemeStore.textColorSecondary(context!!)) setTextColor(ThemeStore.textColorSecondary(context!!))
title.setTextColor(ThemeStore.textColorPrimary(context!!)) setOnClickListener {
val currentlyListening = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName)
audioFile.setOnClickListener { activity!!.startActivity(Intent.createChooser(Intent().setAction(Intent.ACTION_SEND)
MusicUtil.createShareSongFileIntent(song, context) .putExtra(Intent.EXTRA_TEXT, currentlyListening)
dismiss() .setType("text/plain"), null))
} dismiss()
audioText.setOnClickListener { }
val currentlyListening = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName) icon = ContextCompat.getDrawable(context, R.drawable.ic_text_fields_black_24dp)
activity!!.startActivity(Intent.createChooser(Intent().setAction(Intent.ACTION_SEND) MaterialUtil.setTint(this)
.putExtra(Intent.EXTRA_TEXT, currentlyListening)
.setType("text/plain"), null))
dismiss()
} }
actionCancel.apply {
setTextColor(ThemeStore.textColorSecondary(context!!))
setOnClickListener {
MusicUtil.createShareSongFileIntent(song, context)
dismiss()
}
icon = ContextCompat.getDrawable(context, R.drawable.ic_share_white_24dp)
MaterialUtil.setTint(this, false)
}
} }
companion object { companion object {

View File

@ -2,13 +2,13 @@ package code.name.monkey.retromusic.loaders
import android.content.Context import android.content.Context
import android.provider.MediaStore.Audio.AudioColumns import android.provider.MediaStore.Audio.AudioColumns
import java.util.ArrayList
import code.name.monkey.retromusic.model.Album import code.name.monkey.retromusic.model.Album
import code.name.monkey.retromusic.model.Artist import code.name.monkey.retromusic.model.Artist
import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import io.reactivex.Observable import io.reactivex.Observable
import java.util.*
import kotlin.collections.ArrayList
object ArtistLoader { object ArtistLoader {
private fun getSongLoaderSortOrder(): String { private fun getSongLoaderSortOrder(): String {
@ -20,9 +20,7 @@ object ArtistLoader {
fun getArtist(context: Context, artistId: Int): Observable<Artist> { fun getArtist(context: Context, artistId: Int): Observable<Artist> {
return Observable.create { e -> return Observable.create { e ->
SongLoader.getSongs(SongLoader.makeSongCursor( SongLoader.getSongs(SongLoader.makeSongCursor(context, AudioColumns.ARTIST_ID + "=?",
context,
AudioColumns.ARTIST_ID + "=?",
arrayOf(artistId.toString()), arrayOf(artistId.toString()),
getSongLoaderSortOrder())) getSongLoaderSortOrder()))
.subscribe { songs -> .subscribe { songs ->

View File

@ -2,16 +2,13 @@ package code.name.monkey.retromusic.loaders
import android.content.Context import android.content.Context
import android.database.Cursor import android.database.Cursor
import android.net.Uri
import android.provider.BaseColumns import android.provider.BaseColumns
import android.provider.MediaStore import android.provider.MediaStore
import android.provider.MediaStore.Audio.PlaylistsColumns import android.provider.MediaStore.Audio.PlaylistsColumns
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.model.Playlist import code.name.monkey.retromusic.model.Playlist
import java.util.ArrayList
import io.reactivex.Observable import io.reactivex.Observable
import java.util.*
/** /**
* Created by hemanths on 16/08/17. * Created by hemanths on 16/08/17.
@ -92,6 +89,13 @@ object PlaylistLoader {
return getAllPlaylists(makePlaylistCursor(context, null, null)) return getAllPlaylists(makePlaylistCursor(context, null, null))
} }
fun getFavoritePlaylist(context: Context): Observable<ArrayList<Playlist>> {
return getAllPlaylists(makePlaylistCursor(
context,
PlaylistsColumns.NAME + "=?",
arrayOf(context.getString(R.string.favorites))))
}
fun deletePlaylists(context: Context, playlistId: Long) { fun deletePlaylists(context: Context, playlistId: Long) {
val localUri = MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI val localUri = MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI
val localStringBuilder = StringBuilder() val localStringBuilder = StringBuilder()

View File

@ -81,6 +81,5 @@ object PlaylistSongsLoader {
} catch (e: SecurityException) { } catch (e: SecurityException) {
return null return null
} }
} }
} }

View File

@ -58,7 +58,8 @@ object SongLoader {
val artistId = cursor.getInt(9) val artistId = cursor.getInt(9)
val artistName = cursor.getString(10) val artistName = cursor.getString(10)
return Song(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName?:"", return Song(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName
?: "",
artistId, artistName) artistId, artistName)
} }
@ -138,31 +139,10 @@ object SongLoader {
.flatMap { .flatMap {
val list = ArrayList<Song>() val list = ArrayList<Song>()
ShuffleHelper.makeShuffleList(it, -1) ShuffleHelper.makeShuffleList(it, -1)
if (it.size > 9) { if (it.size >= 7) {
list.addAll(it.subList(0, 9)) list.addAll(it.subList(0, 7))
} }
return@flatMap Observable.just(list) return@flatMap Observable.just(list)
} }
/*.flatMap({ songs ->
val list = ArrayList<Song>()
ShuffleHelper.makeShuffleList(songs, -1)
if (songs.size > 9) {
list.addAll(songs.subList(0, 9))
}
Observable.just(list)
} as Function<ArrayList<Song>, ObservableSource<ArrayList<Song>>>)*/
/*.subscribe(songs -> {
ArrayList<Song> list = new ArrayList<>();
if (songs.isEmpty()) {
return;
}
ShuffleHelper.makeShuffleList(songs, -1);
if (songs.size() > 10) {
list.addAll(songs.subList(0, 10));
} else {
list.addAll(songs);
}
return;
});*/
} }
} }

View File

@ -6,7 +6,6 @@ import android.os.Parcel;
import java.util.ArrayList; import java.util.ArrayList;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import code.name.monkey.models.Song;
import io.reactivex.Observable; import io.reactivex.Observable;

View File

@ -1,10 +1,10 @@
package code.name.monkey.models package code.name.monkey.retromusic.model
import java.util.* import java.util.*
class Album { class Album {
val songs: ArrayList<code.name.monkey.models.Song>? val songs: ArrayList<Song>?
val id: Int val id: Int
get() = safeGetFirstSong().albumId get() = safeGetFirstSong().albumId
@ -27,7 +27,7 @@ class Album {
val songCount: Int val songCount: Int
get() = songs!!.size get() = songs!!.size
constructor(songs: ArrayList<code.name.monkey.models.Song>) { constructor(songs: ArrayList<Song>) {
this.songs = songs this.songs = songs
} }
@ -35,7 +35,7 @@ class Album {
this.songs = ArrayList() this.songs = ArrayList()
} }
fun safeGetFirstSong(): code.name.monkey.models.Song { fun safeGetFirstSong(): Song {
return if (songs!!.isEmpty()) code.name.monkey.models.Song.EMPTY_SONG else songs[0] return if (songs!!.isEmpty()) Song.EMPTY_SONG else songs[0]
} }
} }

View File

@ -30,9 +30,9 @@ class Artist {
val albumCount: Int val albumCount: Int
get() = albums!!.size get() = albums!!.size
val songs: ArrayList<code.name.monkey.models.Song> val songs: ArrayList<Song>
get() { get() {
val songs = ArrayList<code.name.monkey.models.Song>() val songs = ArrayList<Song>()
for (album in albums!!) { for (album in albums!!) {
songs.addAll(album.songs!!) songs.addAll(album.songs!!)
} }

View File

@ -1,4 +1,4 @@
package code.name.monkey.models; package code.name.monkey.retromusic.model;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;

View File

@ -2,8 +2,6 @@ package code.name.monkey.retromusic.model;
import android.os.Parcel; import android.os.Parcel;
import code.name.monkey.models.Song;
public class PlaylistSong extends Song { public class PlaylistSong extends Song {
public static PlaylistSong EMPTY_PLAYLIST_SONG = new PlaylistSong(-1, "", -1, -1, -1, "", -1, -1, "", -1, "", -1, -1); public static PlaylistSong EMPTY_PLAYLIST_SONG = new PlaylistSong(-1, "", -1, -1, -1, "", -1, -1, "", -1, "", -1, -1);

View File

@ -1,7 +1,7 @@
package code.name.monkey.models.lyrics; package code.name.monkey.retromusic.model.lyrics;
import code.name.monkey.models.Song; import code.name.monkey.retromusic.model.Song;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package code.name.monkey.models.smartplaylist; package code.name.monkey.retromusic.model.smartplaylist;
import android.content.Context; import android.content.Context;
import android.os.Parcel; import android.os.Parcel;

View File

@ -7,10 +7,9 @@ import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import code.name.monkey.models.Song;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.loaders.TopAndRecentlyPlayedTracksLoader; import code.name.monkey.retromusic.loaders.TopAndRecentlyPlayedTracksLoader;
import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.providers.HistoryStore; import code.name.monkey.retromusic.providers.HistoryStore;
import io.reactivex.Observable; import io.reactivex.Observable;

View File

@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.loaders.LastAddedSongsLoader; import code.name.monkey.retromusic.loaders.LastAddedSongsLoader;
import code.name.monkey.models.Song; import code.name.monkey.retromusic.model.Song;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.loaders.TopAndRecentlyPlayedTracksLoader; import code.name.monkey.retromusic.loaders.TopAndRecentlyPlayedTracksLoader;
import code.name.monkey.models.Song; import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.providers.SongPlayCountStore; import code.name.monkey.retromusic.providers.SongPlayCountStore;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.loaders.SongLoader; import code.name.monkey.retromusic.loaders.SongLoader;
import code.name.monkey.models.Song; import code.name.monkey.retromusic.model.Song;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,43 +1,15 @@
package code.name.monkey.retromusic.mvp.contract package code.name.monkey.retromusic.mvp.contract
import code.name.monkey.retromusic.model.* import code.name.monkey.retromusic.model.Home
import code.name.monkey.retromusic.mvp.BasePresenter import code.name.monkey.retromusic.mvp.BasePresenter
import code.name.monkey.retromusic.mvp.BaseView import code.name.monkey.retromusic.mvp.BaseView
interface HomeContract { interface HomeContract {
interface HomeView : BaseView<ArrayList<Any>> { interface HomeView : BaseView<ArrayList<Home>>
/*fun recentArtist(artists: ArrayList<Artist>)
fun recentAlbum(albums: ArrayList<Album>)
fun topArtists(artists: ArrayList<Artist>)
fun topAlbums(albums: ArrayList<Album>)
fun suggestions(songs: ArrayList<Song>)
fun playlists(playlists: ArrayList<Playlist>)
fun geners(songs: ArrayList<Genre>)*/
fun loadHomes(homes: ArrayList<Home>)
}
interface HomePresenter : BasePresenter<HomeView> { interface HomePresenter : BasePresenter<HomeView> {
/*fun loadRecentAlbums() fun homeSections();
fun loadTopAlbums()
fun loadRecentArtists()
fun loadTopArtists()
fun loadSuggestions()
fun loadGenres()*/
fun loadAll();
} }
} }

View File

@ -11,6 +11,7 @@ import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.RECENT_ARTIS
import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.SUGGESTIONS import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.SUGGESTIONS
import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.TOP_ALBUMS import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.TOP_ALBUMS
import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.TOP_ARTISTS import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.TOP_ARTISTS
import code.name.monkey.retromusic.util.PreferenceUtil
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
@ -21,128 +22,37 @@ operator fun CompositeDisposable.plusAssign(disposable: Disposable) {
} }
class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), HomeContract.HomePresenter { class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), HomeContract.HomePresenter {
override fun loadAll() { override fun homeSections() {
disposable += Observable.combineLatest(repository.suggestionSongs, repository.recentAlbums, disposable += Observable.combineLatest(repository.suggestionSongs, repository.recentAlbums,
repository.topAlbums, repository.recentArtists, repository.topArtists, repository.topAlbums, repository.recentArtists, repository.topArtists,
repository.allGenres, repository.allPlaylists, repository.allGenres, repository.favoritePlaylist,
Function7<ArrayList<Song>, ArrayList<Album>, ArrayList<Album>, ArrayList<Artist>, Function7<ArrayList<Song>, ArrayList<Album>, ArrayList<Album>, ArrayList<Artist>,
ArrayList<Artist>, ArrayList<Genre>, ArrayList<Playlist>, List<Home>> ArrayList<Artist>, ArrayList<Genre>, ArrayList<Playlist>, List<Home>>
{ suggestions: ArrayList<Song>, recentAlbums: ArrayList<Album>, { suggestions: ArrayList<Song>, recentAlbums: ArrayList<Album>,
topAlbums: ArrayList<Album>, recentArtists: ArrayList<Artist>, topAlbums: ArrayList<Album>, recentArtists: ArrayList<Artist>,
topArtists: ArrayList<Artist>, genres: ArrayList<Genre>, topArtists: ArrayList<Artist>, genres: ArrayList<Genre>,
playlists: ArrayList<Playlist> -> favoritePlaylist: ArrayList<Playlist> ->
val homes: ArrayList<Home> = ArrayList() val homes: ArrayList<Home> = ArrayList()
if (suggestions.isNotEmpty()) homes.add(Home(R.string.suggestion_songs, 0, suggestions, SUGGESTIONS)) if (suggestions.isNotEmpty()) homes.add(Home(R.string.suggestion_songs, 0, suggestions, SUGGESTIONS))
if (recentArtists.isNotEmpty()) homes.add(Home(R.string.recent_artists, 0, recentArtists, RECENT_ARTISTS)) if (recentArtists.isNotEmpty()) homes.add(Home(R.string.recent_artists, 0, recentArtists, RECENT_ARTISTS))
if (recentAlbums.isNotEmpty()) homes.add(Home(R.string.recent_albums, 0, recentAlbums, RECENT_ALBUMS)) if (recentAlbums.isNotEmpty()) homes.add(Home(R.string.recent_albums, 0, recentAlbums, RECENT_ALBUMS))
if (topArtists.isNotEmpty()) homes.add(Home(R.string.top_artists, 0, topArtists, TOP_ARTISTS)) if (topArtists.isNotEmpty()) homes.add(Home(R.string.top_artists, 0, topArtists, TOP_ARTISTS))
if (topAlbums.isNotEmpty()) homes.add(Home(R.string.top_albums, 0, topAlbums, TOP_ALBUMS)) if (topAlbums.isNotEmpty()) homes.add(Home(R.string.top_albums, 0, topAlbums, TOP_ALBUMS))
if (genres.isNotEmpty()) homes.add(Home(R.string.genres, 0, genres, GENRES)) if (favoritePlaylist.isNotEmpty()) homes.add(Home(R.string.favorites, 0, favoritePlaylist, PLAYLISTS))
if (playlists.isNotEmpty()) homes.add(Home(R.string.playlists, 0, playlists, PLAYLISTS)) if (genres.isNotEmpty() && PreferenceUtil.getInstance().isGenreShown) homes.add(Home(R.string.genres, 0, genres, GENRES))
homes homes
}).subscribe { homes -> }).subscribe { homes ->
if (homes.isNotEmpty()) { if (homes.isNotEmpty()) {
view.loadHomes(homes as ArrayList<Home>) view.showData(homes as ArrayList<Home>)
} }
} }
} }
override fun subscribe() { override fun subscribe() {
loadAll() homeSections()
/*loadRecentAlbums()
loadRecentArtists()
loadTopAlbums()
loadTopArtists()
loadSuggestions()*/
/*if (PreferenceUtil.getInstance().isGenreShown) loadGenres()*/
} }
override fun unsubscribe() { override fun unsubscribe() {
if (true) { disposable.dispose()
disposable.dispose()
}
} }
/*fun loadPlaylists() {
disposable += repository.allPlaylists
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.subscribe({ playlist ->
if (!playlist.isEmpty()) {
view.playlists(playlist)
}
}, { view.showEmptyView() }, { view.completed() })
}
override fun loadRecentAlbums() {
disposable += repository.recentAlbums
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
.subscribe({ artists ->
if (!artists.isEmpty()) {
view.recentAlbum(artists)
}
}, { view.showEmptyView() }, { view.completed() })
}
override fun loadTopAlbums() {
disposable += repository.topAlbums
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
.subscribe({ artists ->
if (!artists.isEmpty()) {
view.topAlbums(artists)
}
}, { view.showEmptyView() }, { view.completed() })
}
override fun loadRecentArtists() {
disposable += repository.recentArtists
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
.subscribe({ artists ->
if (!artists.isEmpty()) {
view.recentArtist(artists)
}
}, { view.showEmptyView() }, { view.completed() })
}
override fun loadTopArtists() {
disposable += repository.topArtists
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
.subscribe({ artists ->
if (!artists.isEmpty()) {
view.topArtists(artists)
}
}, { view.showEmptyView() }, { view.completed() })
}
override fun loadSuggestions() {
disposable += repository.suggestionSongs
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
.subscribe({ songs -> view.suggestions(songs) },
{ view.showEmptyView() }, { view.completed() })
}
override fun loadGenres() {
disposable += repository.allGenres
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
.subscribe({ genres ->
if (!genres.isEmpty()) {
view.geners(genres)
}
}, { view.showEmptyView() }, { view.completed() })
}*/
} }

View File

@ -8,27 +8,14 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteOpenHelper;
import android.os.Environment; import android.os.Environment;
import androidx.annotation.NonNull;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import code.name.monkey.retromusic.App; import androidx.annotation.NonNull;
import code.name.monkey.retromusic.model.Album;
import code.name.monkey.retromusic.model.Artist;
import code.name.monkey.retromusic.model.Genre;
import code.name.monkey.retromusic.model.Home;
import code.name.monkey.retromusic.model.Playlist;
import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.util.FileUtil; import code.name.monkey.retromusic.util.FileUtil;
import code.name.monkey.retromusic.util.PreferenceUtil; import code.name.monkey.retromusic.util.PreferenceUtil;
import io.reactivex.Observable;
import io.reactivex.functions.Function7;
import static code.name.monkey.retromusic.Constants.MEDIA_STORE_CHANGED; import static code.name.monkey.retromusic.Constants.MEDIA_STORE_CHANGED;
import static code.name.monkey.retromusic.ui.adapter.HomeAdapter.RECENT_ALBUMS;
import static code.name.monkey.retromusic.ui.adapter.HomeAdapter.SUGGESTIONS;
public class BlacklistStore extends SQLiteOpenHelper { public class BlacklistStore extends SQLiteOpenHelper {
public static final String DATABASE_NAME = "blacklist.db"; public static final String DATABASE_NAME = "blacklist.db";
@ -160,45 +147,6 @@ public class BlacklistStore extends SQLiteOpenHelper {
return paths; return paths;
} }
private void hmm() {
RepositoryImpl repository = new RepositoryImpl(App.Companion.getContext());
Observable.combineLatest(repository.getSuggestionSongs(), repository.getRecentAlbums(),
repository.getTopAlbums(), repository.getRecentArtists(), repository.getTopArtists(),
repository.getAllGenres(), repository.getAllPlaylists(), new Function7<ArrayList<Song>, ArrayList<Album>, ArrayList<Album>, ArrayList<Artist>, ArrayList<Artist>, ArrayList<Genre>, ArrayList<Playlist>, List<Home>>() {
@Override
public List<Home> apply(ArrayList<Song> songs, ArrayList<Album> albums, ArrayList<Album> albums2, ArrayList<Artist> artists, ArrayList<Artist> artists2, ArrayList<Genre> genres, ArrayList<Playlist> playlists) throws Exception {
List<Home> homes = new ArrayList<>();
homes.add(new Home(0, 0, songs, SUGGESTIONS));
homes.add(new Home(0, 0, albums, RECENT_ALBUMS));
return homes;
}
}).subscribe(homes -> {
if (homes.isEmpty()) {
}
});
Observable.combineLatest(
repository.getSuggestionSongs(),
repository.getRecentAlbums(),
repository.getTopAlbums(),
repository.getRecentArtists(),
repository.getTopArtists(),
repository.getAllGenres(),
repository.getAllPlaylists(),
(ArrayList<Song> suggestions, ArrayList<Album> recentAlbums, ArrayList<Album> topAlbums,
ArrayList<Artist> recentArtists, ArrayList<Artist> topArtists,
ArrayList<Genre> genres, ArrayList<Playlist> playlists) -> {
List<Home> homes = new ArrayList<>();
return homes;
}).subscribe();
}
public interface BlacklistStoreColumns { public interface BlacklistStoreColumns {
String NAME = "blacklist"; String NAME = "blacklist";

View File

@ -7,9 +7,11 @@ import code.name.monkey.retromusic.model.*
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist
import code.name.monkey.retromusic.providers.interfaces.Repository import code.name.monkey.retromusic.providers.interfaces.Repository
import io.reactivex.Observable import io.reactivex.Observable
import java.util.*
class RepositoryImpl(private val context: Context) : Repository { class RepositoryImpl(private val context: Context) : Repository {
override val favoritePlaylist: Observable<ArrayList<Playlist>>
get() = PlaylistLoader.getFavoritePlaylist(context)
override val allSongs: Observable<ArrayList<Song>> override val allSongs: Observable<ArrayList<Song>>
get() = SongLoader.getAllSongs(context) get() = SongLoader.getAllSongs(context)

View File

@ -4,6 +4,7 @@ import code.name.monkey.retromusic.model.*
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist
import io.reactivex.Observable import io.reactivex.Observable
import java.util.* import java.util.*
import kotlin.collections.ArrayList
/** /**
* Created by hemanths on 11/08/17. * Created by hemanths on 11/08/17.
@ -47,5 +48,6 @@ interface Repository {
fun getGenre(genreId: Int): Observable<ArrayList<Song>> fun getGenre(genreId: Int): Observable<ArrayList<Song>>
val favoritePlaylist: Observable<ArrayList<Playlist>>
} }

View File

@ -132,7 +132,6 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
} }
} }
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp) toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp)
if (toolbar != null && !PreferenceUtil.getInstance().fullScreenMode) { if (toolbar != null && !PreferenceUtil.getInstance().fullScreenMode) {
@ -218,6 +217,7 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
}) })
return@map it.albums!! return@map it.albums!!
} }
.subscribe { .subscribe {
it.remove(album) it.remove(album)

View File

@ -27,7 +27,9 @@ import code.name.monkey.retromusic.glide.RetroGlideExtension
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.misc.AppBarStateChangeListener import code.name.monkey.retromusic.misc.AppBarStateChangeListener
import code.name.monkey.retromusic.model.Album
import code.name.monkey.retromusic.model.Artist import code.name.monkey.retromusic.model.Artist
import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.mvp.contract.ArtistDetailContract import code.name.monkey.retromusic.mvp.contract.ArtistDetailContract
import code.name.monkey.retromusic.mvp.presenter.ArtistDetailsPresenter import code.name.monkey.retromusic.mvp.presenter.ArtistDetailsPresenter
import code.name.monkey.retromusic.rest.LastFMRestClient import code.name.monkey.retromusic.rest.LastFMRestClient
@ -44,6 +46,7 @@ import retrofit2.Call
import retrofit2.Callback import retrofit2.Callback
import retrofit2.Response import retrofit2.Response
import java.util.* import java.util.*
import kotlin.collections.ArrayList
class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContract.ArtistsDetailsView { class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContract.ArtistsDetailsView {
@ -51,8 +54,8 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
private var artist: Artist? = null private var artist: Artist? = null
private var lastFMRestClient: LastFMRestClient? = null private var lastFMRestClient: LastFMRestClient? = null
private var artistDetailsPresenter: ArtistDetailsPresenter? = null private var artistDetailsPresenter: ArtistDetailsPresenter? = null
private var songAdapter: SimpleSongAdapter? = null private lateinit var songAdapter: SimpleSongAdapter
private var albumAdapter: AlbumAdapter? = null private lateinit var albumAdapter: AlbumAdapter
private var forceDownload: Boolean = false private var forceDownload: Boolean = false
private fun setupWindowTransitions() { private fun setupWindowTransitions() {
@ -225,9 +228,11 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
artistTitle.text = artist.name artistTitle.text = artist.name
text.text = String.format("%s • %s", MusicUtil.getArtistInfoString(this, artist), MusicUtil text.text = String.format("%s • %s", MusicUtil.getArtistInfoString(this, artist), MusicUtil
.getReadableDurationString(MusicUtil.getTotalDuration(this, artist.songs))) .getReadableDurationString(MusicUtil.getTotalDuration(this, artist.songs)))
//val songs = artist.songs.sortedWith(compareBy { it.title }) as ArrayList<Song>
songAdapter.swapDataSet(artist.songs)
songAdapter!!.swapDataSet(artist.songs) //val albums = artist.albums?.sortedWith(compareBy { it.artistName }) as ArrayList<Album>
albumAdapter!!.swapDataSet(artist.albums!!) albumAdapter.swapDataSet(artist.albums!!)
} }
private fun loadBiography(lang: String? = Locale.getDefault().language) { private fun loadBiography(lang: String? = Locale.getDefault().language) {

View File

@ -79,9 +79,9 @@ class MainActivity : AbsSlidingMusicPanelActivity(), SharedPreferences.OnSharedP
checkShowChangelog() checkShowChangelog()
if (!App.isProVersion && !PreferenceManager.getDefaultSharedPreferences(this).getBoolean("shown", false)) { /*if (!App.isProVersion && !PreferenceManager.getDefaultSharedPreferences(this).getBoolean("shown", false)) {
showPromotionalOffer() showPromotionalOffer()
} }*/
} }
private fun checkShowChangelog() { private fun checkShowChangelog() {

View File

@ -16,7 +16,6 @@ import code.name.monkey.retromusic.ui.activities.base.AbsBaseActivity
import com.anjlab.android.iab.v3.BillingProcessor import com.anjlab.android.iab.v3.BillingProcessor
import com.anjlab.android.iab.v3.TransactionDetails import com.anjlab.android.iab.v3.TransactionDetails
import kotlinx.android.synthetic.main.activity_pro_version.* import kotlinx.android.synthetic.main.activity_pro_version.*
import kotlinx.android.synthetic.main.activity_pro_version_content.*
import java.lang.ref.WeakReference import java.lang.ref.WeakReference

View File

@ -10,7 +10,6 @@ import android.view.WindowManager
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ATH import code.name.monkey.appthemehelper.ATH
import code.name.monkey.appthemehelper.ATHActivity
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.*
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
@ -144,7 +143,7 @@ abstract class AbsThemeActivity : AbsCrashCollector(), Runnable {
} }
open fun setLightNavigationBar(enabled: Boolean) { open fun setLightNavigationBar(enabled: Boolean) {
if (!ATHUtil.isWindowBackgroundDark(this) && ThemeStore.coloredNavigationBar(this)) { if (!ATHUtil.isWindowBackgroundDark(this) and ThemeStore.coloredNavigationBar(this)) {
ATH.setLightNavigationbar(this, enabled) ATH.setLightNavigationbar(this, enabled)
} }
} }

View File

@ -20,9 +20,11 @@ import code.name.monkey.retromusic.glide.GlideApp
import code.name.monkey.retromusic.glide.RetroGlideExtension import code.name.monkey.retromusic.glide.RetroGlideExtension
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.loaders.PlaylistSongsLoader
import code.name.monkey.retromusic.model.* import code.name.monkey.retromusic.model.*
import code.name.monkey.retromusic.ui.adapter.album.AlbumFullWidthAdapter import code.name.monkey.retromusic.ui.adapter.album.AlbumFullWidthAdapter
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter
import code.name.monkey.retromusic.ui.adapter.song.SongAdapter
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.views.MetalRecyclerViewPager import code.name.monkey.retromusic.views.MetalRecyclerViewPager
import com.google.android.material.floatingactionbutton.FloatingActionButton import com.google.android.material.floatingactionbutton.FloatingActionButton
@ -41,6 +43,7 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
SUGGESTIONS -> SuggestionViewHolder(LayoutInflater.from(activity).inflate(R.layout.section_item_collage, parent, false)) SUGGESTIONS -> SuggestionViewHolder(LayoutInflater.from(activity).inflate(R.layout.section_item_collage, parent, false))
RECENT_ARTISTS, TOP_ARTISTS -> ArtistViewHolder(layout) RECENT_ARTISTS, TOP_ARTISTS -> ArtistViewHolder(layout)
GENRES -> GenreViewHolder(layout) GENRES -> GenreViewHolder(layout)
PLAYLISTS -> PlaylistViewHolder(layout)
else -> { else -> {
AlbumViewHolder(LayoutInflater.from(activity).inflate(R.layout.metal_section_recycler_view, parent, false)) AlbumViewHolder(LayoutInflater.from(activity).inflate(R.layout.metal_section_recycler_view, parent, false))
} }
@ -66,6 +69,10 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
val viewHolder = holder as GenreViewHolder val viewHolder = holder as GenreViewHolder
viewHolder.bindView(home) viewHolder.bindView(home)
} }
PLAYLISTS -> {
val viewHolder = holder as PlaylistViewHolder
viewHolder.bindView(home)
}
} }
} }
@ -174,4 +181,21 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
val title: TextView = view.findViewById(R.id.sectionTitle) val title: TextView = view.findViewById(R.id.sectionTitle)
} }
private inner class PlaylistViewHolder(view: View) : RecyclerView.ViewHolder(view) {
fun bindView(home: Home) {
val songs = PlaylistSongsLoader.getPlaylistSongList(activity, home.arrayList[0] as Playlist).blockingFirst()
recyclerView.apply {
val songAdapter = SongAdapter(activity, songs, R.layout.item_album_card, false, null)
layoutManager = GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false)
adapter = songAdapter
}
title.text = activity.getString(home.title)
}
val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView)
val title: TextView = view.findViewById(R.id.sectionTitle)
}
} }

View File

@ -146,7 +146,6 @@ class AlbumCoverPagerAdapter(fm: FragmentManager, private val dataSet: ArrayList
} }
interface ColorReceiver { interface ColorReceiver {
fun onColorReady(color: Int, request: Int) fun onColorReady(color: Int, request: Int)
} }

View File

@ -66,11 +66,7 @@ class HorizontalAlbumAdapter(activity: AppCompatActivity, dataSet: ArrayList<Alb
} }
override fun getItemCount(): Int { override fun getItemCount(): Int {
return when { return dataSet.size
dataSet.size < 5 -> dataSet.size
dataSet.size >= 5 -> 5
else -> super.getItemCount()
}
} }
companion object { companion object {

View File

@ -120,8 +120,7 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL
return playlist.name return playlist.name
} }
override fun onMultipleItemAction(menuItem: MenuItem, override fun onMultipleItemAction(menuItem: MenuItem, selection: ArrayList<Playlist>) {
selection: ArrayList<Playlist>) {
when (menuItem.itemId) { when (menuItem.itemId) {
R.id.action_delete_playlist -> { R.id.action_delete_playlist -> {
var i = 0 var i = 0
@ -172,39 +171,39 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL
inner class ViewHolder(itemView: View) : MediaEntryViewHolder(itemView) { inner class ViewHolder(itemView: View) : MediaEntryViewHolder(itemView) {
init { init {
if (image != null) {
val iconPadding = activity.resources image?.apply {
.getDimensionPixelSize(R.dimen.list_item_image_icon_padding) val iconPadding = activity.resources.getDimensionPixelSize(R.dimen.list_item_image_icon_padding)
image!!.setPadding(iconPadding, iconPadding, iconPadding, iconPadding) setPadding(iconPadding, iconPadding, iconPadding, iconPadding)
image!!.setColorFilter(ATHUtil.resolveColor(activity, R.attr.iconColor), setColorFilter(ATHUtil.resolveColor(activity, R.attr.iconColor), PorterDuff.Mode.SRC_IN)
PorterDuff.Mode.SRC_IN)
} }
if (menu != null) {
menu!!.setOnClickListener { view -> menu?.setOnClickListener { view ->
val playlist = dataSet[adapterPosition] val playlist = dataSet[adapterPosition]
val popupMenu = PopupMenu(activity, view) val popupMenu = PopupMenu(activity, view)
popupMenu.inflate(if (getItemViewType() == SMART_PLAYLIST) popupMenu.inflate(if (itemViewType == SMART_PLAYLIST)
R.menu.menu_item_smart_playlist R.menu.menu_item_smart_playlist
else else
R.menu.menu_item_playlist) R.menu.menu_item_playlist)
if (playlist is LastAddedPlaylist) { if (playlist is LastAddedPlaylist) {
popupMenu.menu.findItem(R.id.action_clear_playlist).isVisible = false popupMenu.menu.findItem(R.id.action_clear_playlist).isVisible = false
}
popupMenu.setOnMenuItemClickListener { item ->
if (item.itemId == R.id.action_clear_playlist) {
if (playlist is AbsSmartPlaylist) {
ClearSmartPlaylistDialog.create(playlist)
.show(activity.supportFragmentManager,
"CLEAR_SMART_PLAYLIST_" + playlist.name)
return@setOnMenuItemClickListener true
}
}
PlaylistMenuHelper.handleMenuClick(
activity, dataSet[adapterPosition], item)
}
popupMenu.show()
} }
popupMenu.setOnMenuItemClickListener { item ->
if (item.itemId == R.id.action_clear_playlist) {
if (playlist is AbsSmartPlaylist) {
ClearSmartPlaylistDialog.create(playlist)
.show(activity.supportFragmentManager,
"CLEAR_SMART_PLAYLIST_" + playlist.name)
return@setOnMenuItemClickListener true
}
}
PlaylistMenuHelper.handleMenuClick(
activity, dataSet[adapterPosition], item)
}
popupMenu.show()
} }
imageTextContainer?.cardElevation = 0f
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {

View File

@ -58,7 +58,7 @@ class OrderablePlaylistSongAdapter(activity: AppCompatActivity,
override fun onCheckCanStartDrag(holder: ViewHolder, position: Int, x: Int, y: Int): Boolean { override fun onCheckCanStartDrag(holder: ViewHolder, position: Int, x: Int, y: Int): Boolean {
return onMoveItemListener != null && position > 0 && return onMoveItemListener != null && position > 0 &&
(ViewUtil.hitTest(holder.dragView, x, y) || ViewUtil.hitTest(holder.image, x, y)) (ViewUtil.hitTest(holder.dragView!!, x, y) || ViewUtil.hitTest(holder.image!!, x, y))
} }
override fun onGetItemDraggableRange(holder: ViewHolder, position: Int): ItemDraggableRange { override fun onGetItemDraggableRange(holder: ViewHolder, position: Int): ItemDraggableRange {

View File

@ -127,7 +127,7 @@ class PlayingQueueAdapter : SongAdapter, DraggableItemAdapter<PlayingQueueAdapte
} }
override fun onCheckCanStartDrag(holder: ViewHolder, position: Int, x: Int, y: Int): Boolean { override fun onCheckCanStartDrag(holder: ViewHolder, position: Int, x: Int, y: Int): Boolean {
return ViewUtil.hitTest(holder.imageText, x, y) || ViewUtil.hitTest(holder.dragView, x, y) return ViewUtil.hitTest(holder.imageText!!, x, y) || ViewUtil.hitTest(holder.dragView!!, x, y)
} }
override fun onGetItemDraggableRange(holder: ViewHolder, position: Int): ItemDraggableRange? { override fun onGetItemDraggableRange(holder: ViewHolder, position: Int): ItemDraggableRange? {

View File

@ -135,7 +135,7 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
class FlingPlayBackController(context: Context) : View.OnTouchListener { class FlingPlayBackController(context: Context) : View.OnTouchListener {
var flingPlayBackController: GestureDetector private var flingPlayBackController: GestureDetector
init { init {
flingPlayBackController = GestureDetector(context, flingPlayBackController = GestureDetector(context,

View File

@ -36,7 +36,7 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
private fun setUpRecyclerView() { private fun setUpRecyclerView() {
if (recyclerView is FastScrollRecyclerView) { if (recyclerView is FastScrollRecyclerView) {
ViewUtil.setUpFastScrollRecyclerViewColor(activity, recyclerView as FastScrollRecyclerView, ThemeStore.accentColor(activity!!)) ViewUtil.setUpFastScrollRecyclerViewColor(activity!!, recyclerView as FastScrollRecyclerView, ThemeStore.accentColor(activity!!))
} }
recyclerView.layoutManager = layoutManager recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter recyclerView.adapter = adapter

View File

@ -253,7 +253,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements
private void setUpRecyclerView() { private void setUpRecyclerView() {
//noinspection ConstantConditions //noinspection ConstantConditions
ViewUtil.setUpFastScrollRecyclerViewColor(getActivity(), recyclerView, ViewUtil.INSTANCE.setUpFastScrollRecyclerViewColor(getActivity(), recyclerView,
ThemeStore.Companion.accentColor(getActivity())); ThemeStore.Companion.accentColor(getActivity()));
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
appBarLayout.addOnOffsetChangedListener(this); appBarLayout.addOnOffsetChangedListener(this);

View File

@ -40,13 +40,6 @@ import java.io.File
import java.util.* import java.util.*
class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallbacks, HomeContract.HomeView { class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallbacks, HomeContract.HomeView {
override fun loadHomes(homes: ArrayList<Home>) {
recyclerView.apply {
val homeAdapter = HomeAdapter(mainActivity, homes, displayMetrics)
layoutManager = LinearLayoutManager(mainActivity)
adapter = homeAdapter
}
}
val disposable: CompositeDisposable = CompositeDisposable() val disposable: CompositeDisposable = CompositeDisposable()
private lateinit var homePresenter: HomePresenter private lateinit var homePresenter: HomePresenter
@ -62,7 +55,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
return inflater.inflate(if (PreferenceUtil.getInstance().isHomeBanner) R.layout.fragment_banner_home else R.layout.fragment_home, viewGroup, false) return inflater.inflate(if (PreferenceUtil.getInstance().isHomeBanner) R.layout.fragment_banner_home else R.layout.fragment_home, viewGroup, false)
} }
private val displayMetrics: DisplayMetrics private val displayMetrics: DisplayMetrics
get() { get() {
val display = mainActivity.windowManager.defaultDisplay val display = mainActivity.windowManager.defaultDisplay
@ -205,77 +197,14 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
} }
override fun showData(list: ArrayList<Any>) { override fun showData(list: ArrayList<Home>) {
//homeAdapter.swapDataSet(homes); recyclerView.apply {
} val homeAdapter = HomeAdapter(mainActivity, list, displayMetrics)
layoutManager = LinearLayoutManager(mainActivity)
/*override fun recentArtist(artists: ArrayList<Artist>) { adapter = homeAdapter
*//* recentArtistContainer.visibility = View.VISIBLE
recentArtist.apply {
val artistAdapter = ArtistAdapter(mainActivity, artists, PreferenceUtil.getInstance().getHomeGridStyle(context!!), false, null)
layoutManager = GridLayoutManager(mainActivity, 1, GridLayoutManager.HORIZONTAL, false)
adapter = artistAdapter
}*//*
}
override fun recentAlbum(albums: ArrayList<Album>) {
recentAlbumsContainer.visibility = View.VISIBLE
val artistAdapter = AlbumFullWidthAdapter(mainActivity, albums, displayMetrics)
recentAlbum.adapter = artistAdapter
}
override fun topArtists(artists: ArrayList<Artist>) {
topArtistContainer.visibility = View.VISIBLE
topArtist.apply {
layoutManager = GridLayoutManager(mainActivity, 1, GridLayoutManager.HORIZONTAL, false)
val artistAdapter = ArtistAdapter(mainActivity, artists, PreferenceUtil.getInstance().getHomeGridStyle(context!!), false, null)
adapter = artistAdapter
}
}
override fun topAlbums(albums: ArrayList<Album>) {
topAlbumsContainer.visibility = View.VISIBLE
val artistAdapter = AlbumFullWidthAdapter(mainActivity, albums, displayMetrics)
topAlbum.adapter = artistAdapter
}
override fun suggestions(songs: ArrayList<Song>) {
if (!songs.isEmpty()) {
suggestionContainer.visibility = View.VISIBLE
val artistAdapter = SpanSongsAdapter(mainActivity, songs, R.layout.image, false, null)
val manager = GridLayoutManager(mainActivity, 2, GridLayoutManager.HORIZONTAL, false)
manager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
override fun getSpanSize(position: Int): Int {
return when (position) {
0 -> 2
else -> {
1
}
}
}
}
suggestionSongs.apply {
layoutManager = if (RetroUtil.isTablet()) GridLayoutManager(mainActivity, 2) else manager
adapter = artistAdapter
}
} }
} }
override fun playlists(playlists: ArrayList<Playlist>) {
}
override fun geners(songs: ArrayList<Genre>) {
genreContainer.visibility = View.VISIBLE
genresRecyclerView.apply {
val genreAdapter = GenreAdapter(activity!!, songs, R.layout.item_list)
layoutManager = LinearLayoutManager(context)
adapter = genreAdapter
}
}
*/
companion object { companion object {
const val TAG: String = "BannerHomeFragment" const val TAG: String = "BannerHomeFragment"

View File

@ -44,8 +44,8 @@ class PlayerAlbumCoverFragment : AbsMusicServiceFragment(), ViewPager.OnPageChan
viewPager.addOnPageChangeListener(this) viewPager.addOnPageChangeListener(this)
//noinspection ConstantConditions //noinspection ConstantConditions
if (PreferenceUtil.getInstance().carouselEffect() && if (PreferenceUtil.getInstance().carouselEffect() &&
!((PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FULL) !((PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FULL) ||
|| (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.ADAPTIVE) (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.ADAPTIVE)
|| (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FIT))) { || (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FIT))) {
viewPager.clipToPadding = false viewPager.clipToPadding = false
viewPager.setPadding(96, 0, 96, 0) viewPager.setPadding(96, 0, 96, 0)

View File

@ -38,7 +38,8 @@ class AdaptiveFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks
val playerAlbumCoverFragment = childFragmentManager.findFragmentById(R.id.playerAlbumCoverFragment) as PlayerAlbumCoverFragment val playerAlbumCoverFragment = childFragmentManager.findFragmentById(R.id.playerAlbumCoverFragment) as PlayerAlbumCoverFragment
playerAlbumCoverFragment.apply { playerAlbumCoverFragment.apply {
removeSlideEffect() removeSlideEffect()
}.setCallbacks(this) setCallbacks(this@AdaptiveFragment)
}
} }
private fun setUpPlayerToolbar() { private fun setUpPlayerToolbar() {
@ -50,7 +51,8 @@ class AdaptiveFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks
ToolbarContentTintHelper.colorizeToolbar(this, primaryColor, activity) ToolbarContentTintHelper.colorizeToolbar(this, primaryColor, activity)
setTitleTextColor(primaryColor) setTitleTextColor(primaryColor)
setSubtitleTextColor(ThemeStore.textColorSecondary(context!!)) setSubtitleTextColor(ThemeStore.textColorSecondary(context!!))
}.setOnMenuItemClickListener(this) setOnMenuItemClickListener(this@AdaptiveFragment)
}
} }
override fun onServiceConnected() { override fun onServiceConnected() {

View File

@ -3,8 +3,6 @@ package code.name.monkey.retromusic.ui.fragments.player.blur
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.graphics.Color import android.graphics.Color
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -14,7 +12,6 @@ import android.view.animation.DecelerateInterpolator
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import android.widget.SeekBar import android.widget.SeekBar
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.appthemehelper.util.TintHelper
@ -24,14 +21,13 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
import code.name.monkey.retromusic.service.MusicService import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.* import kotlinx.android.synthetic.main.player_time.*
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() { class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
@ -108,7 +104,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun setDark(color: Int) { override fun setDark(color: Int) {
lastPlaybackControlsColor = Color.WHITE lastPlaybackControlsColor = Color.WHITE
lastDisabledPlaybackControlsColor = ContextCompat.getColor(context!!, R.color.md_grey_500) lastDisabledPlaybackControlsColor = ContextCompat.getColor(context!!, R.color.md_grey_200)
title.setTextColor(lastPlaybackControlsColor) title.setTextColor(lastPlaybackControlsColor)
text.setTextColor(lastDisabledPlaybackControlsColor) text.setTextColor(lastDisabledPlaybackControlsColor)
@ -129,13 +125,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
} }
private fun setProgressBarColor(newColor: Int) { private fun setProgressBarColor(newColor: Int) {
val ld = progressSlider.progressDrawable as LayerDrawable ViewUtil.setProgressDrawable(progressSlider, newColor)
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(context!!, ColorUtil.isColorLight(ThemeStore.primaryColor(context!!))), PorterDuff.Mode.SRC_IN)
} }
private fun setUpPlayPauseFab() { private fun setUpPlayPauseFab() {

View File

@ -4,7 +4,6 @@ import android.animation.ObjectAnimator
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.Color import android.graphics.Color
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable import android.graphics.drawable.LayerDrawable
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
@ -121,7 +120,7 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.thumbTintList = ColorStateList.valueOf(c1) progressSlider.thumbTintList = ColorStateList.valueOf(c1)
val ld = progressSlider.progressDrawable as LayerDrawable val ld = progressSlider.progressDrawable as LayerDrawable
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress)
clipDrawableProgress.setColorFilter(c1, PorterDuff.Mode.SRC_IN) clipDrawableProgress.setColorFilter(c1, PorterDuff.Mode.SRC_IN)
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background) val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)

View File

@ -24,6 +24,7 @@ import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.*
import kotlinx.android.synthetic.main.player_time.* import kotlinx.android.synthetic.main.player_time.*
import kotlinx.android.synthetic.main.volume_controls.* import kotlinx.android.synthetic.main.volume_controls.*
@ -114,7 +115,7 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
} }
private fun setProgressBarColor(dark: Int) { private fun setProgressBarColor(dark: Int) {
TintHelper.setTintAuto(progressSlider!!, dark, false) ViewUtil.setProgressDrawable(progressSlider, dark)
} }
private fun updateTextColors(color: Int) { private fun updateTextColors(color: Int) {

View File

@ -3,8 +3,6 @@ package code.name.monkey.retromusic.ui.fragments.player.full
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.graphics.Color import android.graphics.Color
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -24,6 +22,7 @@ import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_full_player_controls.* import kotlinx.android.synthetic.main.fragment_full_player_controls.*
import kotlinx.android.synthetic.main.player_time.* import kotlinx.android.synthetic.main.player_time.*
@ -117,9 +116,7 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
} }
private fun setProgressBarColor(dark: Int) { private fun setProgressBarColor(dark: Int) {
val ld = progressSlider!!.progressDrawable as LayerDrawable ViewUtil.setProgressDrawable(progressSlider, dark)
val clipDrawable = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawable.setColorFilter(dark, PorterDuff.Mode.SRC_IN)
} }
override fun onServiceConnected() { override fun onServiceConnected() {

View File

@ -25,6 +25,7 @@ import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.* import kotlinx.android.synthetic.main.player_time.*
@ -128,13 +129,7 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
private fun setProgressBarColor(newColor: Int) { private fun setProgressBarColor(newColor: Int) {
val ld = progressSlider.progressDrawable as LayerDrawable ViewUtil.setProgressDrawable(progressSlider, newColor)
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(context!!, ColorUtil.isColorLight(ThemeStore.primaryColor(context!!))), PorterDuff.Mode.SRC_IN)
} }
private fun setUpPlayPauseFab() { private fun setUpPlayPauseFab() {

View File

@ -3,8 +3,6 @@ package code.name.monkey.retromusic.ui.fragments.player.plain
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -26,6 +24,7 @@ import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_plain_controls_fragment.* import kotlinx.android.synthetic.main.fragment_plain_controls_fragment.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.* import kotlinx.android.synthetic.main.player_time.*
@ -139,9 +138,7 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
private fun setProgressBarColor(newColor: Int) { private fun setProgressBarColor(newColor: Int) {
progressSlider.thumbTintList = ColorStateList.valueOf(newColor) progressSlider.thumbTintList = ColorStateList.valueOf(newColor)
val ld = progressSlider.progressDrawable as LayerDrawable ViewUtil.setProgressDrawable(progressSlider, newColor)
val clipDrawable = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
} }
private fun setUpShuffleButton() { private fun setUpShuffleButton() {

View File

@ -2,6 +2,7 @@ package code.name.monkey.retromusic.util;
import android.app.Activity; import android.app.Activity;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.media.audiofx.AudioEffect; import android.media.audiofx.AudioEffect;
import android.widget.Toast; import android.widget.Toast;
@ -104,8 +105,8 @@ public class NavigationUtil {
ActivityCompat.startActivity(activity, intent, null); ActivityCompat.startActivity(activity, intent, null);
} }
public static void goToProVersion(@NonNull Activity activity) { public static void goToProVersion(@NonNull Context context) {
ActivityCompat.startActivity(activity, new Intent(activity, PurchaseActivity.class), null); ActivityCompat.startActivity(context, new Intent(context, PurchaseActivity.class), null);
} }
public static void goToSettings(@NonNull Activity activity) { public static void goToSettings(@NonNull Activity activity) {

View File

@ -63,26 +63,6 @@ public class RetroUtil {
return ContentUris.withAppendedId(Uri.parse("content://media/external/audio/albumart"), paramInt); return ContentUris.withAppendedId(Uri.parse("content://media/external/audio/albumart"), paramInt);
} }
public static String EncodeString(String string) {
return string.replace("%", "%25")
.replace(".", "%2E")
.replace("#", "%23")
.replace("$", "%24")
.replace("/", "%2F")
.replace("[", "%5B")
.replace("]", "%5D");
}
public static String DecodeString(String string) {
return string.replace("%25", "%")
.replace("%2E", ".")
.replace("%23", "#")
.replace("%24", "$")
.replace("%2F", "/")
.replace("%5B", "[")
.replace("%5D", "]");
}
public static boolean isTablet() { public static boolean isTablet() {
return App.Companion.getContext().getResources().getConfiguration().smallestScreenWidthDp >= 600; return App.Companion.getContext().getResources().getConfiguration().smallestScreenWidthDp >= 600;
} }

View File

@ -7,31 +7,38 @@ import android.content.Context
import android.content.res.Resources import android.content.res.Resources
import android.graphics.Color import android.graphics.Color
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.drawable.LayerDrawable
import android.os.Build import android.os.Build
import android.util.DisplayMetrics
import android.view.View import android.view.View
import android.view.ViewGroup
import android.view.animation.PathInterpolator import android.view.animation.PathInterpolator
import android.widget.SeekBar import android.widget.SeekBar
import android.widget.TextView import android.widget.TextView
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper import code.name.monkey.appthemehelper.util.MaterialValueHelper
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
object ViewUtil { object ViewUtil {
val RETRO_MUSIC_ANIM_TIME = 1000 const val RETRO_MUSIC_ANIM_TIME = 1000
fun createTextColorTransition(v: TextView, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator { fun createTextColorTransition(v: TextView, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator {
return createColorAnimator(v, "textColor", startColor, endColor) return createColorAnimator(v, "textColor", startColor, endColor)
} }
fun setProgressDrawable(progressSlider: SeekBar, newColor: Int) {} fun setProgressDrawable(progressSlider: SeekBar, newColor: Int) {
val ld = progressSlider.progressDrawable as LayerDrawable
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress)
clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(progressSlider.context, ColorUtil.isColorLight(ThemeStore.primaryColor(progressSlider.context))), PorterDuff.Mode.SRC_IN)
}
private fun createColorAnimator(target: Any, propertyName: String, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator { private fun createColorAnimator(target: Any, propertyName: String, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator {
val animator: ObjectAnimator val animator: ObjectAnimator
@ -89,8 +96,4 @@ object ViewUtil {
val metrics = resources.displayMetrics val metrics = resources.displayMetrics
return dp * metrics.density return dp * metrics.density
} }
fun createBackgroundColorTransition(colorGradientBackground: View?, lastColor: Int, newColor: Int): Animator {
return null
}
} }

View File

@ -59,20 +59,21 @@ class MetalRecyclerViewPager : RecyclerView {
fun updateDisplayMetrics() { fun updateDisplayMetrics() {
itemWidth = if (RetroUtil.isTablet()) { itemWidth = if (RetroUtil.isTablet()) {
displayMetrics.widthPixels / 2 - itemMargin * 3 displayMetrics.widthPixels / 2 - itemMargin * 3
} else if (RetroUtil.isLandscape()) {
((displayMetrics.widthPixels / 1.5f) - itemMargin).toInt()
} else { } else {
displayMetrics.widthPixels - itemMargin displayMetrics.widthPixels - itemMargin
} }
} }
override fun onBindViewHolder(holder: VH, position: Int) { override fun onBindViewHolder(holder: VH, position: Int) {
var currentItemWidth = itemWidth val currentItemWidth = itemWidth
if (position == 0) { if (position == 0) {
currentItemWidth += itemMargin //currentItemWidth += itemMargin;
holder.rootLayout.setPadding(0, 0, 0, 0) holder.rootLayout.setPadding(0, 0, 0, 0);
} else if (position == itemCount - 1) { } else if (position == itemCount - 1) {
currentItemWidth += itemMargin //currentItemWidth += itemMargin;
holder.rootLayout.setPadding(0, 0, 0, 0) holder.rootLayout.setPadding(0, 0, 0, 0);
} }
val height = holder.rootLayout.layoutParams.height val height = holder.rootLayout.layoutParams.height

View File

@ -1,26 +1,17 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background"> <item android:id="@android:id/background">
<shape android:shape="rectangle"> <shape>
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<solid android:color="@color/md_grey_200" /> <solid android:color="?android:colorButtonNormal" />
</shape> </shape>
</item> </item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape android:shape="rectangle">
<corners android:radius="8dp" />
<solid android:color="@color/md_grey_200" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress"> <item android:id="@android:id/progress">
<clip> <scale android:scaleWidth="100%">
<shape android:shape="rectangle"> <shape>
<solid android:color="@color/md_green_A700" />
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<solid android:color="@color/md_red_400" />
</shape> </shape>
</clip> </scale>
</item> </item>
</layer-list> </layer-list>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0"> android:viewportHeight="24.0">
<path <path
android:fillColor="#FF000000" android:fillColor="@color/md_white_1000"
android:pathData="M2.5,4v3h5v12h3L10.5,7h5L15.5,4h-13zM21.5,9h-9v3h3v7h3v-7h3L21.5,9z"/> android:pathData="M2.5,4v3h5v12h3L10.5,7h5L15.5,4h-13zM21.5,9h-9v3h3v7h3v-7h3L21.5,9z"/>
</vector> </vector>

View File

@ -1,4 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
</selector>
<path
android:fillColor="@color/md_white_1000"
android:pathData="M16.24 7.75c-1.17-1.17-2.7-1.76-4.24-1.76v6l-4.24 4.24c2.34 2.34 6.14 2.34 8.49 0 2.34-2.34 2.34-6.14-0.01-8.48zM12 1.99c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -67,7 +67,10 @@
<TextView <TextView
android:id="@+id/bannerTitle" android:id="@+id/bannerTitle"
style="@style/BigTitleTextAppearanceToolbar" style="@style/BigTitleTextAppearanceToolbar"
android:shadowColor="@color/md_black_1000"
android:shadowRadius="2"
android:text="@string/app_name" android:text="@string/app_name"
android:textColor="@color/md_white_1000"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView <code.name.monkey.retromusic.views.CircularImageView
@ -108,7 +111,11 @@
<include layout="@layout/abs_playlists" /> <include layout="@layout/abs_playlists" />
<include layout="@layout/home_section_content" /> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>

View File

@ -68,7 +68,11 @@
<include layout="@layout/abs_playlists" /> <include layout="@layout/abs_playlists" />
<include layout="@layout/home_section_content" /> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -10,7 +10,7 @@
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/imageContainer" android:id="@+id/imageContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="256dp" android:layout_height="156dp"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">

View File

@ -69,7 +69,10 @@
<TextView <TextView
android:id="@+id/bannerTitle" android:id="@+id/bannerTitle"
style="@style/BigTitleTextAppearanceToolbar" style="@style/BigTitleTextAppearanceToolbar"
android:shadowColor="@color/md_black_1000"
android:shadowRadius="2"
android:text="@string/app_name" android:text="@string/app_name"
android:textColor="@color/md_white_1000"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView <code.name.monkey.retromusic.views.CircularImageView
@ -108,7 +111,11 @@
<include layout="@layout/abs_playlists" /> <include layout="@layout/abs_playlists" />
<include layout="@layout/home_section_content" /> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -70,7 +70,11 @@
<include layout="@layout/abs_playlists" /> <include layout="@layout/abs_playlists" />
<include layout="@layout/home_section_content" /> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -5,9 +5,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/for_you" /> android:text="@string/for_you"
android:textStyle="bold" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -5,9 +5,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/biographyTitle" android:id="@+id/biographyTitle"
android:textStyle="bold" style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="24dp" android:paddingStart="24dp"
@ -15,12 +15,12 @@
android:paddingEnd="24dp" android:paddingEnd="24dp"
android:paddingBottom="12dp" android:paddingBottom="12dp"
android:text="@string/biography" android:text="@string/biography"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
android:visibility="gone" android:visibility="gone"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/biographyText" android:id="@+id/biographyText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -28,11 +28,12 @@
android:maxLines="4" android:maxLines="4"
android:padding="16dp" android:padding="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:visibility="gone" /> android:visibility="gone"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/albumTitle" android:id="@+id/albumTitle"
android:textStyle="bold" style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="24dp" android:paddingStart="24dp"
@ -40,8 +41,8 @@
android:paddingEnd="24dp" android:paddingEnd="24dp"
android:paddingBottom="12dp" android:paddingBottom="12dp"
android:text="@string/albums" android:text="@string/albums"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" android:textColor="?android:attr/textColorPrimary"
android:textColor="?android:attr/textColorPrimary" /> android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/albumRecyclerView" android:id="@+id/albumRecyclerView"
@ -49,9 +50,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" /> android:nestedScrollingEnabled="false" />
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/songTitle" android:id="@+id/songTitle"
android:textStyle="bold" style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="24dp" android:paddingStart="24dp"
@ -59,8 +60,8 @@
android:paddingEnd="24dp" android:paddingEnd="24dp"
android:paddingBottom="12dp" android:paddingBottom="12dp"
android:text="@string/songs" android:text="@string/songs"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView

View File

@ -77,7 +77,10 @@
<TextView <TextView
android:id="@+id/bannerTitle" android:id="@+id/bannerTitle"
style="@style/BigTitleTextAppearanceToolbar" style="@style/BigTitleTextAppearanceToolbar"
android:shadowColor="@color/md_black_1000"
android:shadowRadius="2"
android:text="@string/app_name" android:text="@string/app_name"
android:textColor="@color/md_white_1000"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView <code.name.monkey.retromusic.views.CircularImageView
@ -116,7 +119,11 @@
<include layout="@layout/abs_playlists" /> <include layout="@layout/abs_playlists" />
<include layout="@layout/home_section_content" /> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -72,7 +72,11 @@
<include layout="@layout/abs_playlists" /> <include layout="@layout/abs_playlists" />
<include layout="@layout/home_section_content" /> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -80,14 +80,12 @@
</LinearLayout> </LinearLayout>
<me.zhanghai.android.materialprogressbar.MaterialProgressBar <ProgressBar
android:id="@+id/progressBar" android:id="@+id/progressBar"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="3dp" android:layout_height="3dp"
android:progress="20" android:progress="20"
app:mpb_progressStyle="horizontal" android:progressDrawable="@drawable/color_progress_seek" />
app:mpb_showProgressBackground="false"
app:mpb_useIntrinsicPadding="false" />
</code.name.monkey.retromusic.views.FitSystemWindowsLayout> </code.name.monkey.retromusic.views.FitSystemWindowsLayout>

View File

@ -7,6 +7,7 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:textStyle="bold"
android:text="@string/for_you" /> android:text="@string/for_you" />
<LinearLayout <LinearLayout

View File

@ -11,25 +11,26 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/biographyTitle" android:id="@+id/biographyTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/biography" android:text="@string/biography"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/biographyText" android:id="@+id/biographyText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="4" android:maxLines="4"
android:lineSpacingExtra="5dp"
android:padding="16dp" android:padding="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" style="@style/TextAppearance.MaterialComponents.Body1"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/albumTitle" android:id="@+id/albumTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/albums" /> android:text="@string/albums" />
@ -40,7 +41,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" /> android:nestedScrollingEnabled="false" />
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/songTitle" android:id="@+id/songTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/songs" /> android:text="@string/songs" />

View File

@ -55,21 +55,168 @@
android:background="?dividerColor" /> android:background="?dividerColor" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
<RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/activity_pro_version_content" /> <LinearLayout
</androidx.core.widget.NestedScrollView> android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:tint="@color/md_white_1000"
app:srcCompat="@drawable/ic_format_color_fill" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/base_color_theme"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/md_white_1000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:tint="@color/md_white_1000"
app:srcCompat="@drawable/ic_theme_palette_white_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/now_playing_themes"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/md_white_1000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:tint="@color/md_white_1000"
app:srcCompat="@drawable/ic_view_carousel_black_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/carousal_effect_on_now_playing_screen"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/md_white_1000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:tint="@color/md_white_1000"
app:srcCompat="@drawable/ic_rounded_corner" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/window_corner_edges"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/md_white_1000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:tint="@color/md_white_1000"
app:srcCompat="@drawable/ic_favorite_white_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/support_development"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/md_white_1000" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/content"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/restoreButton"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="@string/restore"
android:textAllCaps="false"
app:strokeWidth="2dp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/purchaseButton"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="@string/purchase"
android:textAllCaps="false" />
</LinearLayout>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:padding="16dp"
android:text="@string/purchase_summary" />
</RelativeLayout> </RelativeLayout>

View File

@ -1,35 +1,42 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:orientation="vertical"> android:paddingTop="8dp">
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/title" android:id="@+id/dialogTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/remove_song_from_playlist_title" /> android:text="@string/remove_song_from_playlist_title"
android:textStyle="bold" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/actionDelete" android:id="@+id/actionDelete"
style="@style/Widget.MaterialComponents.Button.TextButton" style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="@string/remove_action" android:text="@string/remove_action"
android:textAllCaps="false" /> android:textAllCaps="false" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/actionCancel" android:id="@+id/actionCancel"
style="@style/Widget.MaterialComponents.Button.TextButton" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="@android:string/cancel" android:text="@android:string/cancel"
android:textAllCaps="false" /> android:textAllCaps="false"
app:strokeWidth="2dp" />
</LinearLayout> </LinearLayout>

View File

@ -39,28 +39,33 @@
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" /> android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<LinearLayout <com.google.android.material.button.MaterialButton
android:id="@+id/actionCreate"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="end" android:layout_marginStart="12dp"
android:padding="12dp"> android:layout_marginTop="8dp"
android:layout_marginEnd="12dp"
android:gravity="center_vertical"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:text="@string/create_action"
app:backgroundTint="@color/md_pink_A400" />
<com.google.android.material.button.MaterialButton
android:id="@+id/actionCancel"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="12dp"
android:gravity="center_vertical"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:text="@android:string/cancel"
app:strokeWidth="2dp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/actionCancel"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/cancel"
app:strokeColor="@color/md_grey_700"
app:strokeWidth="1dp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/actionCreate"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="@string/create_action"
app:backgroundTint="@color/md_pink_A400" />
</LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="8dp" android:orientation="vertical"
android:orientation="vertical"> android:paddingTop="8dp">
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/bannerTitle" android:id="@+id/bannerTitle"
@ -11,20 +12,31 @@
android:padding="12dp" android:padding="12dp"
android:text="@string/remove_song_from_playlist_title" /> android:text="@string/remove_song_from_playlist_title" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <com.google.android.material.button.MaterialButton
android:id="@+id/actionRemove" android:id="@+id/actionDelete"
style="@style/TextAppearance.AppCompat.Subhead" style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="12dp" android:layout_marginStart="8dp"
android:text="@string/remove_action" /> android:layout_marginEnd="8dp"
android:gravity="start|center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@string/remove_action"
android:textAllCaps="false" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <com.google.android.material.button.MaterialButton
android:id="@+id/actionCancel" android:id="@+id/actionCancel"
style="@style/TextAppearance.AppCompat.Subhead" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="12dp" android:layout_marginStart="8dp"
android:text="@android:string/cancel" /> android:layout_marginEnd="8dp"
android:gravity="start|center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@android:string/cancel"
android:textAllCaps="false"
app:strokeWidth="2dp" />
</LinearLayout> </LinearLayout>

View File

@ -41,34 +41,34 @@
android:thumb="@drawable/switch_thumb_material" android:thumb="@drawable/switch_thumb_material"
tools:progress="20" /> tools:progress="20" />
<com.google.android.material.button.MaterialButton
<LinearLayout android:id="@+id/actionSet"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="12dp" android:layout_marginStart="12dp"
android:gravity="end" android:layout_marginEnd="12dp"
android:orientation="horizontal"> android:gravity="center_vertical"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:text="@string/action_set"
android:textColor="@color/md_white_1000"
app:backgroundTint="@color/md_pink_A400" />
<com.google.android.material.button.MaterialButton
android:id="@+id/actionCancel"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/cancel"
app:strokeColor="@color/md_grey_700"
app:strokeWidth="1dp"
tools:visibility="visible" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/actionSet" android:id="@+id/actionCancel"
android:layout_width="wrap_content" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_marginStart="12dp" android:layout_height="wrap_content"
android:gravity="center" android:layout_marginStart="12dp"
android:text="@string/action_set" android:layout_marginEnd="12dp"
android:textColor="@color/md_white_1000" android:gravity="center_vertical"
app:backgroundTint="@color/md_pink_A400" /> android:paddingTop="12dp"
android:paddingBottom="12dp"
android:text="@android:string/cancel"
app:strokeWidth="2dp"
tools:visibility="visible" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View File

@ -47,13 +47,10 @@
</FrameLayout> </FrameLayout>
<com.google.android.material.card.MaterialCardView <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1">
app:cardCornerRadius="8dp"
app:cardElevation="8dp"
app:cardUseCompatPadding="true">
<fragment <fragment
android:id="@+id/playerAlbumCoverFragment" android:id="@+id/playerAlbumCoverFragment"
@ -61,7 +58,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</com.google.android.material.card.MaterialCardView> </FrameLayout>
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_gravity="center"> android:layout_gravity="center">
<code.name.monkey.retromusic.views.WidthFitSquareLayout <code.name.monkey.retromusic.views.WidthFitSquareLayout

View File

@ -3,12 +3,14 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent"
android:layout_gravity="center">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/player_album_art_frame" android:id="@+id/player_album_art_frame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp" android:layout_margin="16dp"
app:cardCornerRadius="8dp"> app:cardCornerRadius="8dp">

View File

@ -60,10 +60,13 @@
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <TextView
android:id="@+id/bannerTitle" android:id="@+id/bannerTitle"
style="@style/BigTitleTextAppearanceToolbar" style="@style/BigTitleTextAppearanceToolbar"
android:shadowColor="@color/md_black_1000"
android:shadowRadius="2"
android:text="@string/app_name" android:text="@string/app_name"
android:textColor="@color/md_white_1000"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView <code.name.monkey.retromusic.views.CircularImageView

View File

@ -62,6 +62,53 @@
app:srcCompat="@drawable/ic_settings_white_24dp" /> app:srcCompat="@drawable/ic_settings_white_24dp" />
</LinearLayout> </LinearLayout>
<com.google.android.material.card.MaterialCardView
android:id="@+id/buyProContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/md_grey_400"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
app:contentPadding="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
android:textColor="@color/md_grey_200"
style="@style/TextAppearance.MaterialComponents.Overline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:text="Upgrade to premium" />
<TextView
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:textColor="@color/md_white_1000"
android:text="@string/buy_pro" />
</LinearLayout>
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/promotional" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<code.name.monkey.retromusic.views.MaterialButtonTextColor <code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionFolders" android:id="@+id/actionFolders"
style="@style/OptionButtonsStyle" style="@style/OptionButtonsStyle"
@ -104,10 +151,6 @@
android:text="@string/rate_app" android:text="@string/rate_app"
app:icon="@drawable/ic_star_white_24dp" /> app:icon="@drawable/ic_star_white_24dp" />
<code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionBuyPro"
style="@style/OptionButtonsStyle"
android:text="@string/buy_pro"
app:icon="@drawable/ic_card_giftcard_white_24dp" />
</LinearLayout> </LinearLayout>

View File

@ -83,13 +83,11 @@
</LinearLayout> </LinearLayout>
<me.zhanghai.android.materialprogressbar.MaterialProgressBar <ProgressBar
android:id="@+id/progressBar" android:id="@+id/progressBar"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="3dp" android:layout_height="3dp"
android:progress="20" android:progress="20"
android:progressDrawable="@drawable/color_progress_seek" android:progressDrawable="@drawable/color_progress_seek" />
app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false" />
</code.name.monkey.retromusic.views.FitSystemWindowsLayout> </code.name.monkey.retromusic.views.FitSystemWindowsLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/playback_controls" android:id="@+id/playback_controls"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -2,7 +2,7 @@
<code.name.monkey.retromusic.views.WidthFitSquareLayout xmlns:android="http://schemas.android.com/apk/res/android" <code.name.monkey.retromusic.views.WidthFitSquareLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/image_container" android:id="@+id/image_container"
android:layout_width="196dp" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">

View File

@ -38,8 +38,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
app:cardCornerRadius="6dp" app:cardCornerRadius="6dp">
app:cardElevation="0dp">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image" android:id="@+id/image"
@ -83,7 +82,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1" android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textSize="16sp" /> android:textSize="16sp" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/text" android:id="@+id/text"

View File

@ -13,18 +13,18 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0" android:layout_weight="0"
android:paddingEnd="0dp" android:paddingLeft="16dp"
android:paddingLeft="16dp"> android:paddingEnd="0dp">
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/image_text" android:id="@+id/image_text"
style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="36dp" android:layout_width="36dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fontFamily="sans-serif" android:fontFamily="sans-serif"
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
android:minHeight="40dp" android:minHeight="40dp" />
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
</FrameLayout> </FrameLayout>
@ -33,37 +33,35 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginBottom="12dp"
android:layout_marginTop="12dp"
android:layout_weight="1.0" android:layout_weight="1.0"
android:orientation="vertical" android:orientation="vertical"
android:paddingEnd="16dp" android:paddingStart="16dp"
android:paddingStart="16dp"> android:paddingEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingEnd="0dp" android:paddingStart="6dp"
android:paddingStart="6dp"> android:paddingEnd="0dp">
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/title" android:id="@+id/title"
style="@style/TextAppearance.MaterialComponents.Body1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:maxLines="1" android:maxLines="1"
android:textColor="?android:attr/textColorPrimary"
tools:text="Song title" /> tools:text="Song title" />
<androidx.appcompat.widget.AppCompatTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/time" android:id="@+id/time"
style="@style/TextAppearance.MaterialComponents.Caption"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0" android:layout_weight="0"
android:padding="4dp" android:padding="4dp"
android:textColor="?android:attr/textColorSecondary"
tools:text="22:00" /> tools:text="22:00" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View File

@ -129,6 +129,8 @@
<item name="iconTint">?iconColor</item> <item name="iconTint">?iconColor</item>
<item name="rippleColor">?iconColor</item> <item name="rippleColor">?iconColor</item>
<item name="android:gravity">center_vertical</item> <item name="android:gravity">center_vertical</item>
<item name="android:paddingBottom">12dp</item>
<item name="android:paddingTop">12dp</item>
</style> </style>
<style name="ErrorHandlingTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <style name="ErrorHandlingTheme" parent="Theme.MaterialComponents.Light.NoActionBar">

View File

@ -56,10 +56,10 @@ object ATH {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val decorView = activity.window.decorView val decorView = activity.window.decorView
var systemUiVisibility = decorView.systemUiVisibility var systemUiVisibility = decorView.systemUiVisibility
if (enabled) { systemUiVisibility = if (enabled) {
systemUiVisibility = systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
} else { } else {
systemUiVisibility = systemUiVisibility and SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv() systemUiVisibility and SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
} }
decorView.systemUiVisibility = systemUiVisibility decorView.systemUiVisibility = systemUiVisibility
} }

View File

@ -1,28 +1,16 @@
package code.name.monkey.appthemehelper.util package code.name.monkey.appthemehelper.util
import android.content.Context
import android.content.res.ColorStateList import android.content.res.ColorStateList
import code.name.monkey.appthemehelper.ThemeStore
import com.google.android.material.button.MaterialButton import com.google.android.material.button.MaterialButton
import com.google.android.material.textfield.TextInputLayout import com.google.android.material.textfield.TextInputLayout
import code.name.monkey.appthemehelper.ThemeStore
object MaterialUtil { object MaterialUtil {
fun setTint(button: MaterialButton) {
setTint(button, ThemeStore.accentColor(button.context))
}
private fun setTint(button: MaterialButton, accentColor: Int) {
val context = button.context
val textColor = ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(accentColor)))
button.setTextColor(textColor)
}
@JvmOverloads @JvmOverloads
fun setTint(button: MaterialButton, background: Boolean, color: Int = ThemeStore.accentColor(button.context)) { fun setTint(button: MaterialButton, background: Boolean = true,
//button.setPadding(48, 48, 48, 48); color: Int = ThemeStore.accentColor(button.context)) {
button.isAllCaps = false button.isAllCaps = false
val context = button.context val context = button.context
val colorState = ColorStateList.valueOf(color) val colorState = ColorStateList.valueOf(color)
@ -34,7 +22,6 @@ object MaterialUtil {
button.setTextColor(textColor) button.setTextColor(textColor)
button.iconTint = textColor button.iconTint = textColor
} else { } else {
button.strokeColor = colorState
button.setTextColor(colorState) button.setTextColor(colorState)
button.iconTint = colorState button.iconTint = colorState
} }

View File

@ -13,7 +13,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.4.0-alpha10' classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }

View File

@ -17,4 +17,5 @@ jvmArgs='-Xmx2048m'
android.useAndroidX=true android.useAndroidX=true
android.enabelR8=true android.enabelR8=true
#android.enableR8.fullMode=true #android.enableR8.fullMode=true
android.enableJetifier=true android.enableJetifier=true
android.debug.obsoleteApi=true

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-milestone-1-all.zip distributionUrl = https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

View File

@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest package="code.name.monkey.models" />
package="code.name.monkey.models" />

View File

@ -1 +1 @@
include ':app', ':appthemehelper' include ':app', ':appthemehelper', ':models'