Refactor
This commit is contained in:
parent
63c417cd61
commit
a81536ab9a
96 changed files with 729 additions and 724 deletions
.gitignore
app
build.gradle
src/main
assets
java/code/name/monkey/retromusic
dialogs
DeletePlaylistDialog.ktDeleteSongsDialog.ktOptionsSheetDialogFragment.ktRemoveFromPlaylistDialog.ktRenamePlaylistDialog.ktSleepTimerDialog.ktSongShareDialog.kt
loaders
model
mvp
providers
ui
activities
adapter
fragments
util
views
res
drawable
layout-land
layout-xlarge-land
layout-xlarge
abs_playlists.xmlactivity_artist_content.xmlfragment_banner_home.xmlfragment_home.xmlfragment_mini_player.xml
layout
abs_playlists.xmlactivity_artist_content.xmlactivity_pro_version.xmldialog_delete.xmldialog_playlist.xmldialog_remove_from_playlist.xmldialog_sleep_timer.xmlfragment_adaptive_player.xmlfragment_album_cover.xmlfragment_album_material_cover.xmlfragment_banner_home.xmlfragment_main_options.xmlfragment_mini_player.xmlfragment_player_playback_controls.xmlimage.xmlitem_list.xmlitem_song.xml
values
appthemehelper/src/main/java/code/name/monkey/appthemehelper
build.gradlegradle.propertiesgradle/wrapper
models/src/main
settings.gradle
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -35,4 +35,6 @@ build/
|
|||
#NDK
|
||||
obj/
|
||||
|
||||
captures
|
||||
captures
|
||||
app/normal/release/
|
||||
/models/
|
||||
|
|
|
@ -32,8 +32,8 @@ android {
|
|||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
applicationId "code.name.monkey.retromusic"
|
||||
versionCode 281
|
||||
versionName '3.0.540'
|
||||
versionCode 283
|
||||
versionName '3.0.550'
|
||||
|
||||
multiDexEnabled true
|
||||
|
||||
|
@ -132,7 +132,7 @@ dependencies {
|
|||
|
||||
implementation "com.squareup.retrofit2:retrofit:2.5.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:commons:$materialDialog"
|
||||
|
|
|
@ -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>
|
|
@ -5,12 +5,14 @@ import android.text.Html
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.model.Playlist
|
||||
import code.name.monkey.retromusic.util.PlaylistsUtil
|
||||
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.*
|
||||
|
||||
|
||||
|
@ -18,7 +20,7 @@ class DeletePlaylistDialog : RoundedBottomSheetDialogFragment() {
|
|||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
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?) {
|
||||
|
@ -32,17 +34,22 @@ class DeletePlaylistDialog : RoundedBottomSheetDialogFragment() {
|
|||
} else {
|
||||
Html.fromHtml(getString(R.string.delete_playlist_x, playlists[0].name))
|
||||
}
|
||||
bannerTitle.text = content
|
||||
bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
dialogTitle.text = content
|
||||
dialogTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
|
||||
actionRemove.setText(R.string.action_delete)
|
||||
actionRemove.setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
actionCancel.setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
|
||||
actionCancel.setOnClickListener { dismiss() }
|
||||
actionRemove.setOnClickListener {
|
||||
PlaylistsUtil.deletePlaylists(activity!!, playlists)
|
||||
dismiss()
|
||||
actionDelete.apply {
|
||||
setText(R.string.action_delete)
|
||||
setOnClickListener {
|
||||
PlaylistsUtil.deletePlaylists(context, playlists)
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.text.Html
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
|
@ -19,28 +20,33 @@ class DeleteSongsDialog : RoundedBottomSheetDialogFragment() {
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
title.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
MaterialUtil.setTint(actionDelete)
|
||||
MaterialUtil.setTint(actionCancel)
|
||||
|
||||
dialogTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
//noinspection unchecked,ConstantConditions
|
||||
val songs = arguments!!.getParcelableArrayList<Song>("songs")
|
||||
val content: CharSequence
|
||||
if (songs != null) {
|
||||
content = if (songs.size > 1) {
|
||||
Html.fromHtml(getString(R.string.delete_x_songs, songs.size))
|
||||
getString(R.string.delete_x_songs, songs.size)
|
||||
} 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 {
|
||||
if (songs != null) {
|
||||
MusicUtil.deleteTracks(activity!!, songs)
|
||||
actionDelete.apply {
|
||||
setOnClickListener {
|
||||
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() }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -58,11 +58,7 @@ class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnCl
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
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!!))
|
||||
titleWelcome!!.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
titleWelcome!!.text = String.format("%s %s!", timeOfTheDay, PreferenceUtil.getInstance().userName)
|
||||
|
@ -76,8 +72,14 @@ class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnCl
|
|||
actionFolders.setOnClickListener(this)
|
||||
actionRate.setOnClickListener(this)
|
||||
actionShare.setOnClickListener(this)
|
||||
actionBuyPro.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.actionBugReport -> prepareBugReport()
|
||||
R.id.actionEqualizer -> NavigationUtil.openEqualizer(mainActivity)
|
||||
R.id.actionBuyPro -> NavigationUtil.goToProVersion(mainActivity)
|
||||
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.view.ViewGroup
|
|||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.retromusic.R
|
||||
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.views.RoundedBottomSheetDialogFragment
|
||||
import kotlinx.android.synthetic.main.dialog_remove_from_playlist.*
|
||||
|
@ -40,18 +39,23 @@ class RemoveFromPlaylistDialog : RoundedBottomSheetDialogFragment() {
|
|||
title = R.string.remove_song_from_playlist_title
|
||||
content = Html.fromHtml(getString(R.string.remove_song_x_from_playlist, songs[0].title))
|
||||
}
|
||||
actionRemove.text = content
|
||||
bannerTitle.setText(title)
|
||||
|
||||
bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
actionRemove.setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
actionCancel.setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
|
||||
actionRemove.setOnClickListener {
|
||||
PlaylistsUtil.removeFromPlaylist(activity!!, songs)
|
||||
dismiss()
|
||||
actionDelete.apply {
|
||||
text = content
|
||||
setTextColor(ThemeStore.textColorSecondary(context))
|
||||
setOnClickListener {
|
||||
PlaylistsUtil.removeFromPlaylist(activity!!, songs)
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
bannerTitle.apply {
|
||||
setText(title)
|
||||
setTextColor(ThemeStore.textColorPrimary(context))
|
||||
}
|
||||
|
||||
actionCancel.apply {
|
||||
setTextColor(ThemeStore.textColorSecondary(context))
|
||||
setOnClickListener { dismiss() }
|
||||
}
|
||||
actionCancel.setOnClickListener { dismiss() }
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.os.Bundle
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
|
@ -23,10 +24,8 @@ class RenamePlaylistDialog : RoundedBottomSheetDialogFragment() {
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
val accentColor = ThemeStore.accentColor(context!!)
|
||||
actionCreate.setText(R.string.action_rename)
|
||||
|
||||
MaterialUtil.setTint(actionCreate, true)
|
||||
MaterialUtil.setTint(actionCancel, false)
|
||||
|
||||
MaterialUtil.setTint(actionNewPlaylistContainer, false)
|
||||
|
||||
actionNewPlaylist.apply {
|
||||
|
@ -41,12 +40,22 @@ class RenamePlaylistDialog : RoundedBottomSheetDialogFragment() {
|
|||
|
||||
bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
bannerTitle.setText(R.string.rename_playlist_title)
|
||||
actionCancel.setOnClickListener { dismiss() }
|
||||
actionCreate.setOnClickListener {
|
||||
if (actionNewPlaylist.toString().trim { it <= ' ' } != "") {
|
||||
val playlistId = arguments!!.getLong("playlist_id")
|
||||
PlaylistsUtil.renamePlaylist(context!!, playlistId, actionNewPlaylist.text!!.toString())
|
||||
actionCancel.apply {
|
||||
MaterialUtil.setTint(actionCancel, false)
|
||||
setOnClickListener { dismiss() }
|
||||
icon = ContextCompat.getDrawable(context, R.drawable.ic_close_white_24dp)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.widget.SeekBar
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.ContextCompat
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
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? {
|
||||
|
||||
return inflater.inflate(R.layout.dialog_sleep_timer, container, false)
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ class SleepTimerDialog : RoundedBottomSheetDialogFragment() {
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
MaterialUtil.setTint(actionSet, true)
|
||||
|
||||
MaterialUtil.setTint(actionCancel, false)
|
||||
|
||||
title.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
|
@ -88,26 +88,32 @@ class SleepTimerDialog : RoundedBottomSheetDialogFragment() {
|
|||
}
|
||||
})
|
||||
|
||||
actionCancel.setOnClickListener {
|
||||
|
||||
val previous = makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE)
|
||||
if (previous != null) {
|
||||
val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
am.cancel(previous)
|
||||
previous.cancel()
|
||||
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_canceled), Toast.LENGTH_SHORT).show()
|
||||
actionCancel.apply {
|
||||
icon = ContextCompat.getDrawable(context, R.drawable.ic_close_white_24dp)
|
||||
setOnClickListener {
|
||||
val previous = makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE)
|
||||
if (previous != null) {
|
||||
val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
am.cancel(previous)
|
||||
previous.cancel()
|
||||
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_canceled), Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
actionSet.setOnClickListener {
|
||||
val minutes = seekArcProgress
|
||||
val pi = makeTimerPendingIntent(PendingIntent.FLAG_CANCEL_CURRENT)
|
||||
val nextSleepTimerElapsedTime = SystemClock.elapsedRealtime() + minutes * 60 * 1000
|
||||
PreferenceUtil.getInstance().setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime)
|
||||
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()
|
||||
actionSet.apply {
|
||||
icon = ContextCompat.getDrawable(context, R.drawable.ic_time_lapse_white_24dp)
|
||||
MaterialUtil.setTint(actionSet)
|
||||
setOnClickListener {
|
||||
val minutes = seekArcProgress
|
||||
val pi = makeTimerPendingIntent(PendingIntent.FLAG_CANCEL_CURRENT)
|
||||
val nextSleepTimerElapsedTime = SystemClock.elapsedRealtime() + minutes * 60 * 1000
|
||||
PreferenceUtil.getInstance().setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime)
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,41 +6,50 @@ import android.os.Bundle
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
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() {
|
||||
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")
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
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)
|
||||
audioFile.setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
audioText.setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
title.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
|
||||
audioFile.setOnClickListener {
|
||||
MusicUtil.createShareSongFileIntent(song, context)
|
||||
dismiss()
|
||||
}
|
||||
audioText.setOnClickListener {
|
||||
val currentlyListening = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName)
|
||||
activity!!.startActivity(Intent.createChooser(Intent().setAction(Intent.ACTION_SEND)
|
||||
.putExtra(Intent.EXTRA_TEXT, currentlyListening)
|
||||
.setType("text/plain"), null))
|
||||
dismiss()
|
||||
actionDelete.apply {
|
||||
text = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName)
|
||||
setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
setOnClickListener {
|
||||
val currentlyListening = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName)
|
||||
activity!!.startActivity(Intent.createChooser(Intent().setAction(Intent.ACTION_SEND)
|
||||
.putExtra(Intent.EXTRA_TEXT, currentlyListening)
|
||||
.setType("text/plain"), null))
|
||||
dismiss()
|
||||
}
|
||||
icon = ContextCompat.getDrawable(context, R.drawable.ic_text_fields_black_24dp)
|
||||
MaterialUtil.setTint(this)
|
||||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -2,13 +2,13 @@ package code.name.monkey.retromusic.loaders
|
|||
|
||||
import android.content.Context
|
||||
import android.provider.MediaStore.Audio.AudioColumns
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
import code.name.monkey.retromusic.model.Album
|
||||
import code.name.monkey.retromusic.model.Artist
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import io.reactivex.Observable
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
object ArtistLoader {
|
||||
private fun getSongLoaderSortOrder(): String {
|
||||
|
@ -20,9 +20,7 @@ object ArtistLoader {
|
|||
|
||||
fun getArtist(context: Context, artistId: Int): Observable<Artist> {
|
||||
return Observable.create { e ->
|
||||
SongLoader.getSongs(SongLoader.makeSongCursor(
|
||||
context,
|
||||
AudioColumns.ARTIST_ID + "=?",
|
||||
SongLoader.getSongs(SongLoader.makeSongCursor(context, AudioColumns.ARTIST_ID + "=?",
|
||||
arrayOf(artistId.toString()),
|
||||
getSongLoaderSortOrder()))
|
||||
.subscribe { songs ->
|
||||
|
|
|
@ -2,16 +2,13 @@ package code.name.monkey.retromusic.loaders
|
|||
|
||||
import android.content.Context
|
||||
import android.database.Cursor
|
||||
import android.net.Uri
|
||||
import android.provider.BaseColumns
|
||||
import android.provider.MediaStore
|
||||
import android.provider.MediaStore.Audio.PlaylistsColumns
|
||||
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.model.Playlist
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
import io.reactivex.Observable
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by hemanths on 16/08/17.
|
||||
|
@ -92,6 +89,13 @@ object PlaylistLoader {
|
|||
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) {
|
||||
val localUri = MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI
|
||||
val localStringBuilder = StringBuilder()
|
||||
|
|
|
@ -81,6 +81,5 @@ object PlaylistSongsLoader {
|
|||
} catch (e: SecurityException) {
|
||||
return null
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,8 @@ object SongLoader {
|
|||
val artistId = cursor.getInt(9)
|
||||
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)
|
||||
}
|
||||
|
||||
|
@ -138,31 +139,10 @@ object SongLoader {
|
|||
.flatMap {
|
||||
val list = ArrayList<Song>()
|
||||
ShuffleHelper.makeShuffleList(it, -1)
|
||||
if (it.size > 9) {
|
||||
list.addAll(it.subList(0, 9))
|
||||
if (it.size >= 7) {
|
||||
list.addAll(it.subList(0, 7))
|
||||
}
|
||||
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;
|
||||
});*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import android.os.Parcel;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import code.name.monkey.models.Song;
|
||||
import io.reactivex.Observable;
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package code.name.monkey.models
|
||||
package code.name.monkey.retromusic.model
|
||||
|
||||
import java.util.*
|
||||
|
||||
|
||||
class Album {
|
||||
val songs: ArrayList<code.name.monkey.models.Song>?
|
||||
val songs: ArrayList<Song>?
|
||||
|
||||
val id: Int
|
||||
get() = safeGetFirstSong().albumId
|
||||
|
@ -27,7 +27,7 @@ class Album {
|
|||
val songCount: Int
|
||||
get() = songs!!.size
|
||||
|
||||
constructor(songs: ArrayList<code.name.monkey.models.Song>) {
|
||||
constructor(songs: ArrayList<Song>) {
|
||||
this.songs = songs
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ class Album {
|
|||
this.songs = ArrayList()
|
||||
}
|
||||
|
||||
fun safeGetFirstSong(): code.name.monkey.models.Song {
|
||||
return if (songs!!.isEmpty()) code.name.monkey.models.Song.EMPTY_SONG else songs[0]
|
||||
fun safeGetFirstSong(): Song {
|
||||
return if (songs!!.isEmpty()) Song.EMPTY_SONG else songs[0]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,9 +30,9 @@ class Artist {
|
|||
val albumCount: Int
|
||||
get() = albums!!.size
|
||||
|
||||
val songs: ArrayList<code.name.monkey.models.Song>
|
||||
val songs: ArrayList<Song>
|
||||
get() {
|
||||
val songs = ArrayList<code.name.monkey.models.Song>()
|
||||
val songs = ArrayList<Song>()
|
||||
for (album in albums!!) {
|
||||
songs.addAll(album.songs!!)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package code.name.monkey.models;
|
||||
package code.name.monkey.retromusic.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
|
|
@ -2,8 +2,6 @@ package code.name.monkey.retromusic.model;
|
|||
|
||||
import android.os.Parcel;
|
||||
|
||||
import code.name.monkey.models.Song;
|
||||
|
||||
public class PlaylistSong extends Song {
|
||||
public static PlaylistSong EMPTY_PLAYLIST_SONG = new PlaylistSong(-1, "", -1, -1, -1, "", -1, -1, "", -1, "", -1, -1);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package code.name.monkey.models.smartplaylist;
|
||||
package code.name.monkey.retromusic.model.smartplaylist;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
|
|
@ -7,10 +7,9 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import code.name.monkey.models.Song;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.loaders.TopAndRecentlyPlayedTracksLoader;
|
||||
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
import code.name.monkey.retromusic.providers.HistoryStore;
|
||||
import io.reactivex.Observable;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.loaders.LastAddedSongsLoader;
|
||||
import code.name.monkey.models.Song;
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import code.name.monkey.retromusic.R;
|
||||
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 java.util.ArrayList;
|
||||
|
|
|
@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.loaders.SongLoader;
|
||||
import code.name.monkey.models.Song;
|
||||
import code.name.monkey.retromusic.model.Song;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
|
|
@ -1,43 +1,15 @@
|
|||
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.BaseView
|
||||
|
||||
interface HomeContract {
|
||||
|
||||
interface HomeView : BaseView<ArrayList<Any>> {
|
||||
|
||||
/*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 HomeView : BaseView<ArrayList<Home>>
|
||||
|
||||
interface HomePresenter : BasePresenter<HomeView> {
|
||||
|
||||
/*fun loadRecentAlbums()
|
||||
|
||||
fun loadTopAlbums()
|
||||
|
||||
fun loadRecentArtists()
|
||||
|
||||
fun loadTopArtists()
|
||||
|
||||
fun loadSuggestions()
|
||||
|
||||
fun loadGenres()*/
|
||||
fun loadAll();
|
||||
fun homeSections();
|
||||
}
|
||||
}
|
|
@ -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.TOP_ALBUMS
|
||||
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.disposables.CompositeDisposable
|
||||
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 {
|
||||
override fun loadAll() {
|
||||
override fun homeSections() {
|
||||
disposable += Observable.combineLatest(repository.suggestionSongs, repository.recentAlbums,
|
||||
repository.topAlbums, repository.recentArtists, repository.topArtists,
|
||||
repository.allGenres, repository.allPlaylists,
|
||||
repository.allGenres, repository.favoritePlaylist,
|
||||
Function7<ArrayList<Song>, ArrayList<Album>, ArrayList<Album>, ArrayList<Artist>,
|
||||
ArrayList<Artist>, ArrayList<Genre>, ArrayList<Playlist>, List<Home>>
|
||||
{ suggestions: ArrayList<Song>, recentAlbums: ArrayList<Album>,
|
||||
topAlbums: ArrayList<Album>, recentArtists: ArrayList<Artist>,
|
||||
topArtists: ArrayList<Artist>, genres: ArrayList<Genre>,
|
||||
playlists: ArrayList<Playlist> ->
|
||||
favoritePlaylist: ArrayList<Playlist> ->
|
||||
val homes: ArrayList<Home> = ArrayList()
|
||||
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 (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 (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 (playlists.isNotEmpty()) homes.add(Home(R.string.playlists, 0, playlists, PLAYLISTS))
|
||||
if (favoritePlaylist.isNotEmpty()) homes.add(Home(R.string.favorites, 0, favoritePlaylist, PLAYLISTS))
|
||||
if (genres.isNotEmpty() && PreferenceUtil.getInstance().isGenreShown) homes.add(Home(R.string.genres, 0, genres, GENRES))
|
||||
homes
|
||||
}).subscribe { homes ->
|
||||
if (homes.isNotEmpty()) {
|
||||
view.loadHomes(homes as ArrayList<Home>)
|
||||
view.showData(homes as ArrayList<Home>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun subscribe() {
|
||||
loadAll()
|
||||
/*loadRecentAlbums()
|
||||
loadRecentArtists()
|
||||
loadTopAlbums()
|
||||
loadTopArtists()
|
||||
loadSuggestions()*/
|
||||
|
||||
/*if (PreferenceUtil.getInstance().isGenreShown) loadGenres()*/
|
||||
|
||||
homeSections()
|
||||
}
|
||||
|
||||
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() })
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -8,27 +8,14 @@ import android.database.sqlite.SQLiteDatabase;
|
|||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.os.Environment;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import code.name.monkey.retromusic.App;
|
||||
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 androidx.annotation.NonNull;
|
||||
import code.name.monkey.retromusic.util.FileUtil;
|
||||
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.ui.adapter.HomeAdapter.RECENT_ALBUMS;
|
||||
import static code.name.monkey.retromusic.ui.adapter.HomeAdapter.SUGGESTIONS;
|
||||
|
||||
public class BlacklistStore extends SQLiteOpenHelper {
|
||||
public static final String DATABASE_NAME = "blacklist.db";
|
||||
|
@ -160,45 +147,6 @@ public class BlacklistStore extends SQLiteOpenHelper {
|
|||
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 {
|
||||
String NAME = "blacklist";
|
||||
|
||||
|
|
|
@ -7,9 +7,11 @@ import code.name.monkey.retromusic.model.*
|
|||
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist
|
||||
import code.name.monkey.retromusic.providers.interfaces.Repository
|
||||
import io.reactivex.Observable
|
||||
import java.util.*
|
||||
|
||||
class RepositoryImpl(private val context: Context) : Repository {
|
||||
override val favoritePlaylist: Observable<ArrayList<Playlist>>
|
||||
get() = PlaylistLoader.getFavoritePlaylist(context)
|
||||
|
||||
|
||||
override val allSongs: Observable<ArrayList<Song>>
|
||||
get() = SongLoader.getAllSongs(context)
|
||||
|
|
|
@ -4,6 +4,7 @@ import code.name.monkey.retromusic.model.*
|
|||
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist
|
||||
import io.reactivex.Observable
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
/**
|
||||
* Created by hemanths on 11/08/17.
|
||||
|
@ -47,5 +48,6 @@ interface Repository {
|
|||
|
||||
fun getGenre(genreId: Int): Observable<ArrayList<Song>>
|
||||
|
||||
val favoritePlaylist: Observable<ArrayList<Playlist>>
|
||||
|
||||
}
|
|
@ -132,7 +132,6 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp)
|
||||
|
||||
if (toolbar != null && !PreferenceUtil.getInstance().fullScreenMode) {
|
||||
|
@ -218,6 +217,7 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
|
|||
})
|
||||
return@map it.albums!!
|
||||
}
|
||||
|
||||
.subscribe {
|
||||
|
||||
it.remove(album)
|
||||
|
|
|
@ -27,7 +27,9 @@ import code.name.monkey.retromusic.glide.RetroGlideExtension
|
|||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.misc.AppBarStateChangeListener
|
||||
import code.name.monkey.retromusic.model.Album
|
||||
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.presenter.ArtistDetailsPresenter
|
||||
import code.name.monkey.retromusic.rest.LastFMRestClient
|
||||
|
@ -44,6 +46,7 @@ import retrofit2.Call
|
|||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContract.ArtistsDetailsView {
|
||||
|
||||
|
@ -51,8 +54,8 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
private var artist: Artist? = null
|
||||
private var lastFMRestClient: LastFMRestClient? = null
|
||||
private var artistDetailsPresenter: ArtistDetailsPresenter? = null
|
||||
private var songAdapter: SimpleSongAdapter? = null
|
||||
private var albumAdapter: AlbumAdapter? = null
|
||||
private lateinit var songAdapter: SimpleSongAdapter
|
||||
private lateinit var albumAdapter: AlbumAdapter
|
||||
private var forceDownload: Boolean = false
|
||||
|
||||
private fun setupWindowTransitions() {
|
||||
|
@ -225,9 +228,11 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
|||
artistTitle.text = artist.name
|
||||
text.text = String.format("%s • %s", MusicUtil.getArtistInfoString(this, artist), MusicUtil
|
||||
.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)
|
||||
albumAdapter!!.swapDataSet(artist.albums!!)
|
||||
//val albums = artist.albums?.sortedWith(compareBy { it.artistName }) as ArrayList<Album>
|
||||
albumAdapter.swapDataSet(artist.albums!!)
|
||||
}
|
||||
|
||||
private fun loadBiography(lang: String? = Locale.getDefault().language) {
|
||||
|
|
|
@ -79,9 +79,9 @@ class MainActivity : AbsSlidingMusicPanelActivity(), SharedPreferences.OnSharedP
|
|||
|
||||
checkShowChangelog()
|
||||
|
||||
if (!App.isProVersion && !PreferenceManager.getDefaultSharedPreferences(this).getBoolean("shown", false)) {
|
||||
/*if (!App.isProVersion && !PreferenceManager.getDefaultSharedPreferences(this).getBoolean("shown", false)) {
|
||||
showPromotionalOffer()
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private fun checkShowChangelog() {
|
||||
|
|
|
@ -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.TransactionDetails
|
||||
import kotlinx.android.synthetic.main.activity_pro_version.*
|
||||
import kotlinx.android.synthetic.main.activity_pro_version_content.*
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.view.WindowManager
|
|||
import androidx.annotation.ColorInt
|
||||
import androidx.core.content.ContextCompat
|
||||
import code.name.monkey.appthemehelper.ATH
|
||||
import code.name.monkey.appthemehelper.ATHActivity
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.*
|
||||
import code.name.monkey.retromusic.R
|
||||
|
@ -144,7 +143,7 @@ abstract class AbsThemeActivity : AbsCrashCollector(), Runnable {
|
|||
}
|
||||
|
||||
open fun setLightNavigationBar(enabled: Boolean) {
|
||||
if (!ATHUtil.isWindowBackgroundDark(this) && ThemeStore.coloredNavigationBar(this)) {
|
||||
if (!ATHUtil.isWindowBackgroundDark(this) and ThemeStore.coloredNavigationBar(this)) {
|
||||
ATH.setLightNavigationbar(this, enabled)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,11 @@ import code.name.monkey.retromusic.glide.GlideApp
|
|||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.loaders.PlaylistSongsLoader
|
||||
import code.name.monkey.retromusic.model.*
|
||||
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.song.SongAdapter
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.views.MetalRecyclerViewPager
|
||||
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))
|
||||
RECENT_ARTISTS, TOP_ARTISTS -> ArtistViewHolder(layout)
|
||||
GENRES -> GenreViewHolder(layout)
|
||||
PLAYLISTS -> PlaylistViewHolder(layout)
|
||||
else -> {
|
||||
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
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
}
|
|
@ -146,7 +146,6 @@ class AlbumCoverPagerAdapter(fm: FragmentManager, private val dataSet: ArrayList
|
|||
}
|
||||
|
||||
interface ColorReceiver {
|
||||
|
||||
fun onColorReady(color: Int, request: Int)
|
||||
}
|
||||
|
||||
|
|
|
@ -66,11 +66,7 @@ class HorizontalAlbumAdapter(activity: AppCompatActivity, dataSet: ArrayList<Alb
|
|||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return when {
|
||||
dataSet.size < 5 -> dataSet.size
|
||||
dataSet.size >= 5 -> 5
|
||||
else -> super.getItemCount()
|
||||
}
|
||||
return dataSet.size
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -120,8 +120,7 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL
|
|||
return playlist.name
|
||||
}
|
||||
|
||||
override fun onMultipleItemAction(menuItem: MenuItem,
|
||||
selection: ArrayList<Playlist>) {
|
||||
override fun onMultipleItemAction(menuItem: MenuItem, selection: ArrayList<Playlist>) {
|
||||
when (menuItem.itemId) {
|
||||
R.id.action_delete_playlist -> {
|
||||
var i = 0
|
||||
|
@ -172,39 +171,39 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL
|
|||
|
||||
inner class ViewHolder(itemView: View) : MediaEntryViewHolder(itemView) {
|
||||
init {
|
||||
if (image != null) {
|
||||
val iconPadding = activity.resources
|
||||
.getDimensionPixelSize(R.dimen.list_item_image_icon_padding)
|
||||
image!!.setPadding(iconPadding, iconPadding, iconPadding, iconPadding)
|
||||
image!!.setColorFilter(ATHUtil.resolveColor(activity, R.attr.iconColor),
|
||||
PorterDuff.Mode.SRC_IN)
|
||||
|
||||
image?.apply {
|
||||
val iconPadding = activity.resources.getDimensionPixelSize(R.dimen.list_item_image_icon_padding)
|
||||
setPadding(iconPadding, iconPadding, iconPadding, iconPadding)
|
||||
setColorFilter(ATHUtil.resolveColor(activity, R.attr.iconColor), PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
if (menu != null) {
|
||||
menu!!.setOnClickListener { view ->
|
||||
val playlist = dataSet[adapterPosition]
|
||||
val popupMenu = PopupMenu(activity, view)
|
||||
popupMenu.inflate(if (getItemViewType() == SMART_PLAYLIST)
|
||||
R.menu.menu_item_smart_playlist
|
||||
else
|
||||
R.menu.menu_item_playlist)
|
||||
if (playlist is LastAddedPlaylist) {
|
||||
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()
|
||||
|
||||
menu?.setOnClickListener { view ->
|
||||
val playlist = dataSet[adapterPosition]
|
||||
val popupMenu = PopupMenu(activity, view)
|
||||
popupMenu.inflate(if (itemViewType == SMART_PLAYLIST)
|
||||
R.menu.menu_item_smart_playlist
|
||||
else
|
||||
R.menu.menu_item_playlist)
|
||||
if (playlist is LastAddedPlaylist) {
|
||||
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()
|
||||
}
|
||||
|
||||
imageTextContainer?.cardElevation = 0f
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
|
|
|
@ -58,7 +58,7 @@ class OrderablePlaylistSongAdapter(activity: AppCompatActivity,
|
|||
|
||||
override fun onCheckCanStartDrag(holder: ViewHolder, position: Int, x: Int, y: Int): Boolean {
|
||||
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 {
|
||||
|
|
|
@ -127,7 +127,7 @@ class PlayingQueueAdapter : SongAdapter, DraggableItemAdapter<PlayingQueueAdapte
|
|||
}
|
||||
|
||||
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? {
|
||||
|
|
|
@ -135,7 +135,7 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
|
|||
|
||||
class FlingPlayBackController(context: Context) : View.OnTouchListener {
|
||||
|
||||
var flingPlayBackController: GestureDetector
|
||||
private var flingPlayBackController: GestureDetector
|
||||
|
||||
init {
|
||||
flingPlayBackController = GestureDetector(context,
|
||||
|
|
|
@ -36,7 +36,7 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
|
|||
|
||||
private fun setUpRecyclerView() {
|
||||
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.adapter = adapter
|
||||
|
|
|
@ -253,7 +253,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
|||
|
||||
private void setUpRecyclerView() {
|
||||
//noinspection ConstantConditions
|
||||
ViewUtil.setUpFastScrollRecyclerViewColor(getActivity(), recyclerView,
|
||||
ViewUtil.INSTANCE.setUpFastScrollRecyclerViewColor(getActivity(), recyclerView,
|
||||
ThemeStore.Companion.accentColor(getActivity()));
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
appBarLayout.addOnOffsetChangedListener(this);
|
||||
|
|
|
@ -40,13 +40,6 @@ import java.io.File
|
|||
import java.util.*
|
||||
|
||||
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()
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
private val displayMetrics: DisplayMetrics
|
||||
get() {
|
||||
val display = mainActivity.windowManager.defaultDisplay
|
||||
|
@ -205,77 +197,14 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
|
||||
}
|
||||
|
||||
override fun showData(list: ArrayList<Any>) {
|
||||
//homeAdapter.swapDataSet(homes);
|
||||
}
|
||||
|
||||
/*override fun recentArtist(artists: ArrayList<Artist>) {
|
||||
*//* 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 showData(list: ArrayList<Home>) {
|
||||
recyclerView.apply {
|
||||
val homeAdapter = HomeAdapter(mainActivity, list, displayMetrics)
|
||||
layoutManager = LinearLayoutManager(mainActivity)
|
||||
adapter = homeAdapter
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
const val TAG: String = "BannerHomeFragment"
|
||||
|
|
|
@ -44,8 +44,8 @@ class PlayerAlbumCoverFragment : AbsMusicServiceFragment(), ViewPager.OnPageChan
|
|||
viewPager.addOnPageChangeListener(this)
|
||||
//noinspection ConstantConditions
|
||||
if (PreferenceUtil.getInstance().carouselEffect() &&
|
||||
!((PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FULL)
|
||||
|| (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.ADAPTIVE)
|
||||
!((PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FULL) ||
|
||||
(PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.ADAPTIVE)
|
||||
|| (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FIT))) {
|
||||
viewPager.clipToPadding = false
|
||||
viewPager.setPadding(96, 0, 96, 0)
|
||||
|
|
|
@ -38,7 +38,8 @@ class AdaptiveFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks
|
|||
val playerAlbumCoverFragment = childFragmentManager.findFragmentById(R.id.playerAlbumCoverFragment) as PlayerAlbumCoverFragment
|
||||
playerAlbumCoverFragment.apply {
|
||||
removeSlideEffect()
|
||||
}.setCallbacks(this)
|
||||
setCallbacks(this@AdaptiveFragment)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setUpPlayerToolbar() {
|
||||
|
@ -50,7 +51,8 @@ class AdaptiveFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks
|
|||
ToolbarContentTintHelper.colorizeToolbar(this, primaryColor, activity)
|
||||
setTitleTextColor(primaryColor)
|
||||
setSubtitleTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
}.setOnMenuItemClickListener(this)
|
||||
setOnMenuItemClickListener(this@AdaptiveFragment)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onServiceConnected() {
|
||||
|
|
|
@ -3,8 +3,6 @@ package code.name.monkey.retromusic.ui.fragments.player.blur
|
|||
import android.animation.ObjectAnimator
|
||||
import android.graphics.Color
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.drawable.ClipDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
@ -14,7 +12,6 @@ import android.view.animation.DecelerateInterpolator
|
|||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.SeekBar
|
||||
import androidx.core.content.ContextCompat
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
|
@ -24,14 +21,13 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
|||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
||||
import code.name.monkey.retromusic.service.MusicService
|
||||
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
|
||||
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
|
||||
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.media_button.*
|
||||
import kotlinx.android.synthetic.main.player_time.*
|
||||
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
|
||||
|
||||
|
||||
|
||||
|
||||
class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||
|
@ -108,7 +104,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
|
||||
override fun setDark(color: Int) {
|
||||
lastPlaybackControlsColor = Color.WHITE
|
||||
lastDisabledPlaybackControlsColor = ContextCompat.getColor(context!!, R.color.md_grey_500)
|
||||
lastDisabledPlaybackControlsColor = ContextCompat.getColor(context!!, R.color.md_grey_200)
|
||||
|
||||
title.setTextColor(lastPlaybackControlsColor)
|
||||
text.setTextColor(lastDisabledPlaybackControlsColor)
|
||||
|
@ -129,13 +125,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
}
|
||||
|
||||
private fun setProgressBarColor(newColor: Int) {
|
||||
val ld = progressSlider.progressDrawable as LayerDrawable
|
||||
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)
|
||||
|
||||
ViewUtil.setProgressDrawable(progressSlider, newColor)
|
||||
}
|
||||
|
||||
private fun setUpPlayPauseFab() {
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.animation.ObjectAnimator
|
|||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.drawable.ClipDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
|
@ -121,7 +120,7 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
progressSlider.thumbTintList = ColorStateList.valueOf(c1)
|
||||
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)
|
||||
|
||||
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
|
||||
|
|
|
@ -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.util.MusicUtil
|
||||
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.player_time.*
|
||||
import kotlinx.android.synthetic.main.volume_controls.*
|
||||
|
@ -114,7 +115,7 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
|
|||
}
|
||||
|
||||
private fun setProgressBarColor(dark: Int) {
|
||||
TintHelper.setTintAuto(progressSlider!!, dark, false)
|
||||
ViewUtil.setProgressDrawable(progressSlider, dark)
|
||||
}
|
||||
|
||||
private fun updateTextColors(color: Int) {
|
||||
|
|
|
@ -3,8 +3,6 @@ package code.name.monkey.retromusic.ui.fragments.player.full
|
|||
import android.animation.ObjectAnimator
|
||||
import android.graphics.Color
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.drawable.ClipDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
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.util.MusicUtil
|
||||
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.player_time.*
|
||||
|
||||
|
@ -117,9 +116,7 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
}
|
||||
|
||||
private fun setProgressBarColor(dark: Int) {
|
||||
val ld = progressSlider!!.progressDrawable as LayerDrawable
|
||||
val clipDrawable = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
|
||||
clipDrawable.setColorFilter(dark, PorterDuff.Mode.SRC_IN)
|
||||
ViewUtil.setProgressDrawable(progressSlider, dark)
|
||||
}
|
||||
|
||||
override fun onServiceConnected() {
|
||||
|
|
|
@ -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.util.MusicUtil
|
||||
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.media_button.*
|
||||
import kotlinx.android.synthetic.main.player_time.*
|
||||
|
@ -128,13 +129,7 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
|
||||
|
||||
private fun setProgressBarColor(newColor: Int) {
|
||||
val ld = progressSlider.progressDrawable as LayerDrawable
|
||||
|
||||
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)
|
||||
ViewUtil.setProgressDrawable(progressSlider, newColor)
|
||||
}
|
||||
|
||||
private fun setUpPlayPauseFab() {
|
||||
|
|
|
@ -3,8 +3,6 @@ package code.name.monkey.retromusic.ui.fragments.player.plain
|
|||
import android.animation.ObjectAnimator
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.drawable.ClipDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
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.util.MusicUtil
|
||||
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.media_button.*
|
||||
import kotlinx.android.synthetic.main.player_time.*
|
||||
|
@ -139,9 +138,7 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
|
||||
private fun setProgressBarColor(newColor: Int) {
|
||||
progressSlider.thumbTintList = ColorStateList.valueOf(newColor)
|
||||
val ld = progressSlider.progressDrawable as LayerDrawable
|
||||
val clipDrawable = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
|
||||
clipDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
|
||||
ViewUtil.setProgressDrawable(progressSlider, newColor)
|
||||
}
|
||||
|
||||
private fun setUpShuffleButton() {
|
||||
|
|
|
@ -2,6 +2,7 @@ package code.name.monkey.retromusic.util;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.audiofx.AudioEffect;
|
||||
import android.widget.Toast;
|
||||
|
@ -104,8 +105,8 @@ public class NavigationUtil {
|
|||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
public static void goToProVersion(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, PurchaseActivity.class), null);
|
||||
public static void goToProVersion(@NonNull Context context) {
|
||||
ActivityCompat.startActivity(context, new Intent(context, PurchaseActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToSettings(@NonNull Activity activity) {
|
||||
|
|
|
@ -63,26 +63,6 @@ public class RetroUtil {
|
|||
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() {
|
||||
return App.Companion.getContext().getResources().getConfiguration().smallestScreenWidthDp >= 600;
|
||||
}
|
||||
|
|
|
@ -7,31 +7,38 @@ import android.content.Context
|
|||
import android.content.res.Resources
|
||||
import android.graphics.Color
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.os.Build
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.PathInterpolator
|
||||
import android.widget.SeekBar
|
||||
import android.widget.TextView
|
||||
|
||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.core.view.ViewCompat
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||
|
||||
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 {
|
||||
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 {
|
||||
val animator: ObjectAnimator
|
||||
|
@ -89,8 +96,4 @@ object ViewUtil {
|
|||
val metrics = resources.displayMetrics
|
||||
return dp * metrics.density
|
||||
}
|
||||
|
||||
fun createBackgroundColorTransition(colorGradientBackground: View?, lastColor: Int, newColor: Int): Animator {
|
||||
return null
|
||||
}
|
||||
}
|
|
@ -59,20 +59,21 @@ class MetalRecyclerViewPager : RecyclerView {
|
|||
fun updateDisplayMetrics() {
|
||||
itemWidth = if (RetroUtil.isTablet()) {
|
||||
displayMetrics.widthPixels / 2 - itemMargin * 3
|
||||
} else if (RetroUtil.isLandscape()) {
|
||||
((displayMetrics.widthPixels / 1.5f) - itemMargin).toInt()
|
||||
} else {
|
||||
displayMetrics.widthPixels - itemMargin
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: VH, position: Int) {
|
||||
var currentItemWidth = itemWidth
|
||||
|
||||
val currentItemWidth = itemWidth
|
||||
if (position == 0) {
|
||||
currentItemWidth += itemMargin
|
||||
holder.rootLayout.setPadding(0, 0, 0, 0)
|
||||
//currentItemWidth += itemMargin;
|
||||
holder.rootLayout.setPadding(0, 0, 0, 0);
|
||||
} else if (position == itemCount - 1) {
|
||||
currentItemWidth += itemMargin
|
||||
holder.rootLayout.setPadding(0, 0, 0, 0)
|
||||
//currentItemWidth += itemMargin;
|
||||
holder.rootLayout.setPadding(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
val height = holder.rootLayout.layoutParams.height
|
||||
|
|
|
@ -1,26 +1,17 @@
|
|||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<shape>
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="@color/md_grey_200" />
|
||||
<solid android:color="?android:colorButtonNormal" />
|
||||
</shape>
|
||||
</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">
|
||||
<clip>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/md_green_A700" />
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="@color/md_red_400" />
|
||||
</shape>
|
||||
</clip>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -4,6 +4,6 @@
|
|||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<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"/>
|
||||
</vector>
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
<?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 ![]() (image error) Size: 5.5 KiB After ![]() (image error) Size: 28 KiB ![]() ![]() |
|
@ -67,7 +67,10 @@
|
|||
<TextView
|
||||
android:id="@+id/bannerTitle"
|
||||
style="@style/BigTitleTextAppearanceToolbar"
|
||||
android:shadowColor="@color/md_black_1000"
|
||||
android:shadowRadius="2"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/md_white_1000"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<code.name.monkey.retromusic.views.CircularImageView
|
||||
|
@ -108,7 +111,11 @@
|
|||
|
||||
<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>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
|
|
@ -68,7 +68,11 @@
|
|||
|
||||
<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>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="256dp"
|
||||
android:layout_height="156dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
|
|
|
@ -69,7 +69,10 @@
|
|||
<TextView
|
||||
android:id="@+id/bannerTitle"
|
||||
style="@style/BigTitleTextAppearanceToolbar"
|
||||
android:shadowColor="@color/md_black_1000"
|
||||
android:shadowRadius="2"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/md_white_1000"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<code.name.monkey.retromusic.views.CircularImageView
|
||||
|
@ -108,7 +111,11 @@
|
|||
|
||||
<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>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
|
|
@ -70,7 +70,11 @@
|
|||
|
||||
<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>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:text="@string/for_you" />
|
||||
android:text="@string/for_you"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
android:id="@+id/biographyTitle"
|
||||
android:textStyle="bold"
|
||||
style="@style/TextAppearance.MaterialComponents.Subtitle2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="24dp"
|
||||
|
@ -15,12 +15,12 @@
|
|||
android:paddingEnd="24dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:text="@string/biography"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
android:id="@+id/biographyText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -28,11 +28,12 @@
|
|||
android:maxLines="4"
|
||||
android:padding="16dp"
|
||||
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:textStyle="bold"
|
||||
style="@style/TextAppearance.MaterialComponents.Subtitle2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="24dp"
|
||||
|
@ -40,8 +41,8 @@
|
|||
android:paddingEnd="24dp"
|
||||
android:paddingBottom="12dp"
|
||||
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
|
||||
android:id="@+id/albumRecyclerView"
|
||||
|
@ -49,9 +50,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
android:id="@+id/songTitle"
|
||||
android:textStyle="bold"
|
||||
style="@style/TextAppearance.MaterialComponents.Subtitle2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="24dp"
|
||||
|
@ -59,8 +60,8 @@
|
|||
android:paddingEnd="24dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:text="@string/songs"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
|
|
@ -77,7 +77,10 @@
|
|||
<TextView
|
||||
android:id="@+id/bannerTitle"
|
||||
style="@style/BigTitleTextAppearanceToolbar"
|
||||
android:shadowColor="@color/md_black_1000"
|
||||
android:shadowRadius="2"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/md_white_1000"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<code.name.monkey.retromusic.views.CircularImageView
|
||||
|
@ -116,7 +119,11 @@
|
|||
|
||||
<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>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
|
|
@ -72,7 +72,11 @@
|
|||
|
||||
<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>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -80,14 +80,12 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:progress="20"
|
||||
app:mpb_progressStyle="horizontal"
|
||||
app:mpb_showProgressBackground="false"
|
||||
app:mpb_useIntrinsicPadding="false" />
|
||||
android:progressDrawable="@drawable/color_progress_seek" />
|
||||
|
||||
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/for_you" />
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -11,25 +11,26 @@
|
|||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
android:id="@+id/biographyTitle"
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:text="@string/biography"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
android:id="@+id/biographyText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="4"
|
||||
android:lineSpacingExtra="5dp"
|
||||
android:padding="16dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
style="@style/TextAppearance.MaterialComponents.Body1"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
android:id="@+id/albumTitle"
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:text="@string/albums" />
|
||||
|
@ -40,7 +41,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
android:id="@+id/songTitle"
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:text="@string/songs" />
|
||||
|
|
|
@ -55,21 +55,168 @@
|
|||
android:background="?dividerColor" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<include layout="@layout/activity_pro_version_content" />
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
<LinearLayout
|
||||
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>
|
||||
|
||||
|
||||
<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>
|
|
@ -1,35 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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_height="match_parent"
|
||||
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||
android:id="@+id/title"
|
||||
android:id="@+id/dialogTitle"
|
||||
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
|
||||
android:id="@+id/actionDelete"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:paddingTop="14dp"
|
||||
android:paddingBottom="14dp"
|
||||
android:text="@string/remove_action"
|
||||
android:textAllCaps="false" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/actionCancel"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:paddingTop="14dp"
|
||||
android:paddingBottom="14dp"
|
||||
android:text="@android:string/cancel"
|
||||
android:textAllCaps="false" />
|
||||
android:textAllCaps="false"
|
||||
app:strokeWidth="2dp" />
|
||||
|
||||
</LinearLayout>
|
|
@ -39,28 +39,33 @@
|
|||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
</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_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:padding="12dp">
|
||||
android:layout_marginStart="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>
|
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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_height="match_parent"
|
||||
android:paddingTop="8dp"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||
android:id="@+id/bannerTitle"
|
||||
|
@ -11,20 +12,31 @@
|
|||
android:padding="12dp"
|
||||
android:text="@string/remove_song_from_playlist_title" />
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||
android:id="@+id/actionRemove"
|
||||
style="@style/TextAppearance.AppCompat.Subhead"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/actionDelete"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp"
|
||||
android:text="@string/remove_action" />
|
||||
android:layout_marginStart="8dp"
|
||||
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"
|
||||
style="@style/TextAppearance.AppCompat.Subhead"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp"
|
||||
android:text="@android:string/cancel" />
|
||||
android:layout_marginStart="8dp"
|
||||
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>
|
|
@ -41,34 +41,34 @@
|
|||
android:thumb="@drawable/switch_thumb_material"
|
||||
tools:progress="20" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/actionSet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
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
|
||||
android:id="@+id/actionSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center"
|
||||
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.OutlinedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:text="@android:string/cancel"
|
||||
app:strokeWidth="2dp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
|
@ -47,13 +47,10 @@
|
|||
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="8dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
android:layout_weight="1">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/playerAlbumCoverFragment"
|
||||
|
@ -61,7 +58,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
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
|
||||
android:id="@+id/player_album_art_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="16dp"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
|
|
|
@ -60,10 +60,13 @@
|
|||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||
<TextView
|
||||
android:id="@+id/bannerTitle"
|
||||
style="@style/BigTitleTextAppearanceToolbar"
|
||||
android:shadowColor="@color/md_black_1000"
|
||||
android:shadowRadius="2"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/md_white_1000"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<code.name.monkey.retromusic.views.CircularImageView
|
||||
|
|
|
@ -62,6 +62,53 @@
|
|||
app:srcCompat="@drawable/ic_settings_white_24dp" />
|
||||
</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
|
||||
android:id="@+id/actionFolders"
|
||||
style="@style/OptionButtonsStyle"
|
||||
|
@ -104,10 +151,6 @@
|
|||
android:text="@string/rate_app"
|
||||
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>
|
|
@ -83,13 +83,11 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:progress="20"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
app:mpb_progressStyle="horizontal"
|
||||
app:mpb_useIntrinsicPadding="false" />
|
||||
android:progressDrawable="@drawable/color_progress_seek" />
|
||||
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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"
|
||||
android:id="@+id/playback_controls"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<code.name.monkey.retromusic.views.WidthFitSquareLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/image_container"
|
||||
android:layout_width="196dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
|
|
@ -38,8 +38,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:cardCornerRadius="6dp"
|
||||
app:cardElevation="0dp">
|
||||
app:cardCornerRadius="6dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/image"
|
||||
|
@ -83,7 +82,7 @@
|
|||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp" />
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||
android:id="@+id/text"
|
||||
|
|
|
@ -13,18 +13,18 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
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"
|
||||
style="@style/TextAppearance.MaterialComponents.Subtitle2"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
android:fontFamily="sans-serif"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:minHeight="40dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
android:minHeight="40dp" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
|
@ -33,37 +33,35 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_weight="1.0"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingStart="16dp">
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
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"
|
||||
style="@style/TextAppearance.MaterialComponents.Body1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
tools:text="Song title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||
android:id="@+id/time"
|
||||
style="@style/TextAppearance.MaterialComponents.Caption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:padding="4dp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="22:00" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
@ -129,6 +129,8 @@
|
|||
<item name="iconTint">?iconColor</item>
|
||||
<item name="rippleColor">?iconColor</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingBottom">12dp</item>
|
||||
<item name="android:paddingTop">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ErrorHandlingTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
|
|
|
@ -56,10 +56,10 @@ object ATH {
|
|||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val decorView = activity.window.decorView
|
||||
var systemUiVisibility = decorView.systemUiVisibility
|
||||
if (enabled) {
|
||||
systemUiVisibility = systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
|
||||
systemUiVisibility = if (enabled) {
|
||||
systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
|
||||
} else {
|
||||
systemUiVisibility = systemUiVisibility and SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
|
||||
systemUiVisibility and SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
|
||||
}
|
||||
decorView.systemUiVisibility = systemUiVisibility
|
||||
}
|
||||
|
|
|
@ -1,28 +1,16 @@
|
|||
package code.name.monkey.appthemehelper.util
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
|
||||
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
|
||||
fun setTint(button: MaterialButton, background: Boolean, color: Int = ThemeStore.accentColor(button.context)) {
|
||||
//button.setPadding(48, 48, 48, 48);
|
||||
fun setTint(button: MaterialButton, background: Boolean = true,
|
||||
color: Int = ThemeStore.accentColor(button.context)) {
|
||||
|
||||
button.isAllCaps = false
|
||||
val context = button.context
|
||||
val colorState = ColorStateList.valueOf(color)
|
||||
|
@ -34,7 +22,6 @@ object MaterialUtil {
|
|||
button.setTextColor(textColor)
|
||||
button.iconTint = textColor
|
||||
} else {
|
||||
button.strokeColor = colorState
|
||||
button.setTextColor(colorState)
|
||||
button.iconTint = colorState
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ buildscript {
|
|||
google()
|
||||
}
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,4 +17,5 @@ jvmArgs='-Xmx2048m'
|
|||
android.useAndroidX=true
|
||||
android.enabelR8=true
|
||||
#android.enableR8.fullMode=true
|
||||
android.enableJetifier=true
|
||||
android.enableJetifier=true
|
||||
android.debug.obsoleteApi=true
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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
|
|
@ -1,2 +1 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="code.name.monkey.models" />
|
||||
<manifest package="code.name.monkey.models" />
|
||||
|
|
|
@ -1 +1 @@
|
|||
include ':app', ':appthemehelper'
|
||||
include ':app', ':appthemehelper', ':models'
|
Loading…
Reference in a new issue