updating commons with materialish elements

This commit is contained in:
tibbi 2022-07-08 23:31:17 +02:00
parent 541d6430d4
commit 33be4cb97d
21 changed files with 691 additions and 536 deletions

View file

@ -70,12 +70,12 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:7f3e880dc5'
implementation 'com.github.SimpleMobileTools:Simple-Commons:4991e30130'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.airbnb.android:lottie:3.6.1'
implementation 'com.github.bjoernpetersen:m3u-parser:1.3.0'
implementation 'me.grantland:autofittextview:0.2.1'

View file

@ -2,13 +2,13 @@ package com.simplemobiletools.musicplayer.activities
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.simplemobiletools.commons.extensions.areSystemAnimationsEnabled
import com.simplemobiletools.commons.extensions.getFormattedDuration
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
import com.simplemobiletools.commons.extensions.hideKeyboard
import com.simplemobiletools.commons.helpers.NavigationIcon
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.adapters.AlbumsTracksAdapter
import com.simplemobiletools.musicplayer.extensions.getAlbumTracksSync
@ -101,6 +101,7 @@ class AlbumsActivity : SimpleActivity() {
override fun onResume() {
super.onResume()
updateCurrentTrackBar()
setupToolbar(albums_toolbar, NavigationIcon.Arrow)
}
override fun onDestroy() {
@ -108,11 +109,6 @@ class AlbumsActivity : SimpleActivity() {
bus?.unregister(this)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
updateMenuItemColors(menu)
return super.onCreateOptionsMenu(menu)
}
private fun updateCurrentTrackBar() {
current_track_bar.updateColors()
current_track_bar.updateCurrentTrack(MusicService.mCurrTrack)

View file

@ -4,12 +4,12 @@ import android.annotation.SuppressLint
import android.media.MediaPlayer
import android.media.audiofx.Equalizer
import android.os.Bundle
import android.view.Menu
import android.widget.SeekBar
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.NavigationIcon
import com.simplemobiletools.commons.models.RadioItem
import com.simplemobiletools.commons.views.MySeekBar
import com.simplemobiletools.musicplayer.R
@ -19,7 +19,6 @@ import com.simplemobiletools.musicplayer.services.MusicService
import kotlinx.android.synthetic.main.activity_equalizer.*
import kotlinx.android.synthetic.main.equalizer_band.view.*
import java.text.DecimalFormat
import java.util.*
class EqualizerActivity : SimpleActivity() {
private var bands = HashMap<Short, Int>()
@ -31,9 +30,9 @@ class EqualizerActivity : SimpleActivity() {
initMediaPlayer()
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
updateMenuItemColors(menu)
return super.onCreateOptionsMenu(menu)
override fun onResume() {
super.onResume()
setupToolbar(equalizer_toolbar, NavigationIcon.Arrow)
}
@SuppressLint("SetTextI18n")

View file

@ -62,6 +62,8 @@ class MainActivity : SimpleActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
appLaunched(BuildConfig.APPLICATION_ID)
setupOptionsMenu()
refreshMenuItems()
storeStateVariables()
setupTabs()
@ -88,6 +90,7 @@ class MainActivity : SimpleActivity() {
override fun onResume() {
super.onResume()
setupToolbar(main_toolbar)
if (storedShowTabs != config.showTabs) {
config.lastUsedViewPagerPage = 0
System.exit(0)
@ -116,36 +119,30 @@ class MainActivity : SimpleActivity() {
bus?.unregister(this)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_main, menu)
setupSearch(menu)
updateMenuItemColors(menu)
return true
}
override fun onPrepareOptionsMenu(menu: Menu): Boolean {
menu.apply {
private fun refreshMenuItems() {
main_toolbar.menu.apply {
findItem(R.id.create_new_playlist).isVisible = getCurrentFragment() == playlists_fragment_holder
findItem(R.id.create_playlist_from_folder).isVisible = getCurrentFragment() == playlists_fragment_holder
findItem(R.id.import_playlist).isVisible = getCurrentFragment() == playlists_fragment_holder && isOreoPlus()
}
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.sort -> showSortingDialog()
R.id.sleep_timer -> showSleepTimer()
R.id.create_new_playlist -> createNewPlaylist()
R.id.create_playlist_from_folder -> createPlaylistFromFolder()
R.id.import_playlist -> tryImportPlaylist()
R.id.equalizer -> launchEqualizer()
R.id.settings -> launchSettings()
R.id.about -> launchAbout()
else -> return super.onOptionsItemSelected(item)
private fun setupOptionsMenu() {
setupSearch(main_toolbar.menu)
main_toolbar.setOnMenuItemClickListener { menuItem ->
when (menuItem.itemId) {
R.id.sort -> showSortingDialog()
R.id.sleep_timer -> showSleepTimer()
R.id.create_new_playlist -> createNewPlaylist()
R.id.create_playlist_from_folder -> createPlaylistFromFolder()
R.id.import_playlist -> tryImportPlaylist()
R.id.equalizer -> launchEqualizer()
R.id.settings -> launchSettings()
R.id.about -> launchAbout()
else -> return@setOnMenuItemClickListener false
}
return@setOnMenuItemClickListener true
}
return true
}
private fun storeStateVariables() {
@ -217,7 +214,6 @@ class MainActivity : SimpleActivity() {
private fun initFragments() {
view_pager.adapter = ViewPagerAdapter(this)
view_pager.offscreenPageLimit = tabsList.size - 1
view_pager.currentItem = config.lastUsedViewPagerPage
view_pager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrollStateChanged(state: Int) {}
@ -228,9 +224,10 @@ class MainActivity : SimpleActivity() {
getAllFragments().forEach {
it?.finishActMode()
}
invalidateOptionsMenu()
refreshMenuItems()
}
})
view_pager.currentItem = config.lastUsedViewPagerPage
}
private fun setupTabs() {
@ -269,7 +266,7 @@ class MainActivity : SimpleActivity() {
updateBottomTabItemColors(inactiveView, false)
}
val bottomBarColor = getBottomTabsBackgroundColor()
val bottomBarColor = getBottomNavigationBackgroundColor()
main_tabs_holder.setBackgroundColor(bottomBarColor)
updateNavigationBarColor(bottomBarColor)
}

View file

@ -2,10 +2,9 @@ package com.simplemobiletools.musicplayer.activities
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import com.simplemobiletools.commons.extensions.areSystemAnimationsEnabled
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
import com.simplemobiletools.commons.helpers.NavigationIcon
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.adapters.QueueAdapter
@ -21,7 +20,6 @@ import kotlinx.android.synthetic.main.activity_queue.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.util.*
class QueueActivity : SimpleActivity() {
private var bus: EventBus? = null
@ -29,29 +27,32 @@ class QueueActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_queue)
setupOptionsMenu()
bus = EventBus.getDefault()
bus!!.register(this)
setupAdapter()
queue_fastscroller.updateColors(getProperPrimaryColor())
}
override fun onResume() {
super.onResume()
setupToolbar(queue_toolbar, NavigationIcon.Arrow)
}
override fun onDestroy() {
super.onDestroy()
bus?.unregister(this)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_queue, menu)
updateMenuItemColors(menu)
return super.onCreateOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.create_playlist_from_queue -> createPlaylistFromQueue()
else -> return super.onOptionsItemSelected(item)
private fun setupOptionsMenu() {
queue_toolbar.setOnMenuItemClickListener { menuItem ->
when (menuItem.itemId) {
R.id.create_playlist_from_queue -> createPlaylistFromQueue()
else -> return@setOnMenuItemClickListener false
}
return@setOnMenuItemClickListener true
}
return true
}
private fun setupAdapter() {

View file

@ -2,10 +2,10 @@ package com.simplemobiletools.musicplayer.activities
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
import com.simplemobiletools.commons.helpers.NavigationIcon
import com.simplemobiletools.commons.models.RadioItem
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.dialogs.ManageVisibleTabsDialog
@ -26,6 +26,7 @@ class SettingsActivity : SimpleActivity() {
override fun onResume() {
super.onResume()
setupToolbar(settings_toolbar, NavigationIcon.Arrow)
setupPurchaseThankYou()
setupCustomizeColors()
@ -34,8 +35,7 @@ class SettingsActivity : SimpleActivity() {
setupSwapPrevNext()
setupReplaceTitle()
setupManageShownTabs()
updateTextColors(settings_scrollview)
invalidateOptionsMenu()
updateTextColors(settings_nested_scrollview)
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
it.setTextColor(getProperPrimaryColor())
@ -46,11 +46,6 @@ class SettingsActivity : SimpleActivity() {
}
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
updateMenuItemColors(menu)
return super.onCreateOptionsMenu(menu)
}
private fun setupPurchaseThankYou() {
settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled())

View file

@ -16,10 +16,7 @@ import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.simplemobiletools.commons.dialogs.FilePickerDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.commons.helpers.isOreoPlus
import com.simplemobiletools.commons.helpers.isQPlus
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.adapters.TracksAdapter
import com.simplemobiletools.musicplayer.adapters.TracksHeaderAdapter
@ -57,6 +54,9 @@ class TracksActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_tracks)
setupOptionsMenu()
refreshMenuItems()
bus = EventBus.getDefault()
bus!!.register(this)
@ -80,7 +80,7 @@ class TracksActivity : SimpleActivity() {
}
val titleToUse = playlist?.title ?: album?.title ?: folder ?: ""
title = titleToUse.replace("<", "&lt;")
tracks_toolbar.title = titleToUse.replace("<", "&lt;")
val properPrimaryColor = getProperPrimaryColor()
tracks_fastscroller.updateColors(properPrimaryColor)
@ -172,6 +172,7 @@ class TracksActivity : SimpleActivity() {
override fun onResume() {
super.onResume()
updateCurrentTrackBar()
setupToolbar(tracks_toolbar, NavigationIcon.Arrow)
}
override fun onDestroy() {
@ -179,31 +180,28 @@ class TracksActivity : SimpleActivity() {
bus?.unregister(this)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_playlist, menu)
menu.apply {
private fun refreshMenuItems() {
tracks_toolbar.menu.apply {
findItem(R.id.search).isVisible = tracksType != TYPE_ALBUM
findItem(R.id.sort).isVisible = tracksType != TYPE_ALBUM
findItem(R.id.add_file_to_playlist).isVisible = tracksType == TYPE_PLAYLIST
findItem(R.id.add_folder_to_playlist).isVisible = tracksType == TYPE_PLAYLIST
findItem(R.id.export_playlist).isVisible = tracksType == TYPE_PLAYLIST && isOreoPlus()
}
setupSearch(menu)
updateMenuItemColors(menu)
return super.onCreateOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.sort -> showSortingDialog()
R.id.add_file_to_playlist -> addFileToPlaylist()
R.id.add_folder_to_playlist -> addFolderToPlaylist()
R.id.export_playlist -> tryExportPlaylist()
else -> return super.onOptionsItemSelected(item)
private fun setupOptionsMenu() {
setupSearch(tracks_toolbar.menu)
tracks_toolbar.setOnMenuItemClickListener { menuItem ->
when (menuItem.itemId) {
R.id.sort -> showSortingDialog()
R.id.add_file_to_playlist -> addFileToPlaylist()
R.id.add_folder_to_playlist -> addFolderToPlaylist()
R.id.export_playlist -> tryExportPlaylist()
else -> return@setOnMenuItemClickListener false
}
return@setOnMenuItemClickListener true
}
return true
}
private fun setupSearch(menu: Menu) {

View file

@ -4,7 +4,7 @@ import android.app.Activity
import android.view.View
import android.view.ViewGroup
import android.widget.RadioGroup
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
import com.simplemobiletools.commons.models.RadioItem
@ -32,10 +32,10 @@ class ChangeSortingDialog(val activity: Activity, val location: Int, val callbac
setupSortRadio()
setupOrderRadio()
AlertDialog.Builder(activity)
activity.getAlertDialogBuilder()
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
.setNegativeButton(R.string.cancel, null)
.create().apply {
.apply {
activity.setupDialogStuff(view, this, R.string.sort_by)
}
}
@ -72,7 +72,10 @@ class ChangeSortingDialog(val activity: Activity, val location: Int, val callbac
id = radioItem.value as Int
}
view.sorting_dialog_radio_sorting.addView(this, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
view.sorting_dialog_radio_sorting.addView(
this,
RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
)
}
}
}

View file

@ -9,7 +9,6 @@ import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.extensions.tracksDAO
import com.simplemobiletools.musicplayer.helpers.TagHelper
import com.simplemobiletools.musicplayer.models.Track
import kotlinx.android.synthetic.main.dialog_rename_song.*
import kotlinx.android.synthetic.main.dialog_rename_song.view.*
class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callback: (track: Track) -> Unit) {
@ -30,13 +29,13 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac
}
}
AlertDialog.Builder(activity)
activity.getAlertDialogBuilder()
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.rename_song) {
showKeyboard(song_title)
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
.apply {
activity.setupDialogStuff(view, this, R.string.rename_song) { alertDialog ->
alertDialog.showKeyboard(view.song_title)
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
val newTitle = view.song_title.value
val newArtist = view.song_artist.value
val newAlbum = view.song_album.value
@ -58,7 +57,7 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac
if (oldPath == newPath) {
storeEditedSong(track, oldPath, newPath)
callback(track)
dismiss()
alertDialog.dismiss()
return@updateContentResolver
}
@ -71,12 +70,12 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac
} else {
activity.toast(R.string.rename_song_error)
}
dismiss()
alertDialog.dismiss()
}
}
}
} else {
dismiss()
alertDialog.dismiss()
}
}
}

View file

@ -39,15 +39,14 @@ class ExportPlaylistDialog(
}
}
}
}
AlertDialog.Builder(activity)
activity.getAlertDialogBuilder()
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.export_playlist) {
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
.apply {
activity.setupDialogStuff(view, this, R.string.export_playlist) { alertDialog ->
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
val filename = view.export_playlist_filename.value
when {
filename.isEmpty() -> activity.toast(R.string.empty_name)
@ -62,7 +61,7 @@ class ExportPlaylistDialog(
ensureBackgroundThread {
activity.config.lastExportPath = file.absolutePath.getParentPath()
callback(file)
dismiss()
alertDialog.dismiss()
}
}
else -> activity.toast(R.string.invalid_name)

View file

@ -1,8 +1,8 @@
package com.simplemobiletools.musicplayer.dialogs
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.beGone
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.helpers.isQPlus
import com.simplemobiletools.commons.views.MyAppCompatCheckbox
@ -34,10 +34,10 @@ class ManageVisibleTabsDialog(val activity: BaseSimpleActivity) {
view.findViewById<MyAppCompatCheckbox>(value).isChecked = showTabs and key != 0
}
AlertDialog.Builder(activity)
activity.getAlertDialogBuilder()
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
.setNegativeButton(R.string.cancel, null)
.create().apply {
.apply {
activity.setupDialogStuff(view, this)
}
}

View file

@ -2,10 +2,7 @@ package com.simplemobiletools.musicplayer.dialogs
import android.app.Activity
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.showKeyboard
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.value
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.extensions.getPlaylistIdWithTitle
@ -25,48 +22,48 @@ class NewPlaylistDialog(val activity: Activity, var playlist: Playlist? = null,
new_playlist_title.setText(playlist!!.title)
}
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.create().apply {
val dialogTitle = if (isNewPlaylist) R.string.create_new_playlist else R.string.rename_playlist
activity.setupDialogStuff(view, this, dialogTitle) {
showKeyboard(view.new_playlist_title)
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
val title = view.new_playlist_title.value
ensureBackgroundThread {
val playlistIdWithTitle = activity.getPlaylistIdWithTitle(title)
var isPlaylistTitleTaken = isNewPlaylist && playlistIdWithTitle != -1
if (!isPlaylistTitleTaken) {
isPlaylistTitleTaken = !isNewPlaylist && playlist!!.id != playlistIdWithTitle && playlistIdWithTitle != -1
}
activity.getAlertDialogBuilder()
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.apply {
val dialogTitle = if (isNewPlaylist) R.string.create_new_playlist else R.string.rename_playlist
activity.setupDialogStuff(view, this, dialogTitle) { alertDialog ->
alertDialog.showKeyboard(view.new_playlist_title)
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
val title = view.new_playlist_title.value
ensureBackgroundThread {
val playlistIdWithTitle = activity.getPlaylistIdWithTitle(title)
var isPlaylistTitleTaken = isNewPlaylist && playlistIdWithTitle != -1
if (!isPlaylistTitleTaken) {
isPlaylistTitleTaken = !isNewPlaylist && playlist!!.id != playlistIdWithTitle && playlistIdWithTitle != -1
}
if (title.isEmpty()) {
activity.toast(R.string.empty_name)
return@ensureBackgroundThread
} else if (isPlaylistTitleTaken) {
activity.toast(R.string.playlist_name_exists)
return@ensureBackgroundThread
}
if (title.isEmpty()) {
activity.toast(R.string.empty_name)
return@ensureBackgroundThread
} else if (isPlaylistTitleTaken) {
activity.toast(R.string.playlist_name_exists)
return@ensureBackgroundThread
}
playlist!!.title = title
playlist!!.title = title
val eventTypeId = if (isNewPlaylist) {
activity.playlistDAO.insert(playlist!!).toInt()
} else {
activity.playlistDAO.update(playlist!!)
playlist!!.id
}
val eventTypeId = if (isNewPlaylist) {
activity.playlistDAO.insert(playlist!!).toInt()
} else {
activity.playlistDAO.update(playlist!!)
playlist!!.id
}
if (eventTypeId != -1) {
dismiss()
callback(eventTypeId)
} else {
activity.toast(R.string.unknown_error_occurred)
}
if (eventTypeId != -1) {
alertDialog.dismiss()
callback(eventTypeId)
} else {
activity.toast(R.string.unknown_error_occurred)
}
}
}
}
}
}
}

View file

@ -1,7 +1,7 @@
package com.simplemobiletools.musicplayer.dialogs
import android.app.Activity
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.models.Playlist
@ -13,12 +13,12 @@ class RemovePlaylistDialog(val activity: Activity, val playlist: Playlist? = nul
remove_playlist_description.text = getDescriptionText()
}
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok) { dialog, which -> callback(view.remove_playlist_checkbox.isChecked) }
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.remove_playlist)
}
activity.getAlertDialogBuilder()
.setPositiveButton(R.string.ok) { dialog, which -> callback(view.remove_playlist_checkbox.isChecked) }
.setNegativeButton(R.string.cancel, null)
.apply {
activity.setupDialogStuff(view, this, R.string.remove_playlist)
}
}
private fun getDescriptionText(): String {

View file

@ -5,6 +5,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.RadioGroup
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.musicplayer.R
@ -12,7 +13,6 @@ import com.simplemobiletools.musicplayer.extensions.playlistDAO
import com.simplemobiletools.musicplayer.models.Playlist
import kotlinx.android.synthetic.main.dialog_select_playlist.view.*
import kotlinx.android.synthetic.main.select_playlist_item.view.*
import java.util.*
class SelectPlaylistDialog(val activity: Activity, val callback: (playlistId: Int) -> Unit) {
private var dialog: AlertDialog? = null
@ -51,14 +51,18 @@ class SelectPlaylistDialog(val activity: Activity, val callback: (playlistId: In
}
}
view.dialog_select_playlist_linear.addView(this, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
view.dialog_select_playlist_linear.addView(
this,
RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
)
}
}
dialog = AlertDialog.Builder(activity)
.create().apply {
activity.setupDialogStuff(view, this)
activity.getAlertDialogBuilder().apply {
activity.setupDialogStuff(view, this) { alertDialog ->
dialog = alertDialog
}
}
}
private fun showNewPlaylistDialog() {

View file

@ -2,26 +2,23 @@ package com.simplemobiletools.musicplayer.dialogs
import android.app.Activity
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.commons.extensions.hideKeyboard
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.showKeyboard
import com.simplemobiletools.commons.extensions.value
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.musicplayer.R
import kotlinx.android.synthetic.main.dialog_custom_sleep_timer_picker.view.*
class SleepTimerCustomDialog(val activity: Activity, val callback: (seconds: Int) -> Unit) {
private var dialog: AlertDialog
private var dialog: AlertDialog? = null
private val view = activity.layoutInflater.inflate(R.layout.dialog_custom_sleep_timer_picker, null)
init {
dialog = AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.sleep_timer) {
showKeyboard(view.dialog_custom_sleep_timer_value)
}
activity.getAlertDialogBuilder()
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
.setNegativeButton(R.string.cancel, null)
.apply {
activity.setupDialogStuff(view, this, R.string.sleep_timer) { alertDialog ->
alertDialog.showKeyboard(view.dialog_custom_sleep_timer_value)
}
}
}
private fun dialogConfirmed() {
@ -29,6 +26,6 @@ class SleepTimerCustomDialog(val activity: Activity, val callback: (seconds: Int
val minutes = Integer.valueOf(if (value.isEmpty()) "0" else value)
callback(minutes * 60)
activity.hideKeyboard()
dialog.dismiss()
dialog?.dismiss()
}
}

View file

@ -1,30 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/albums_holder"
android:id="@+id/albums_coordinator"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent">
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/albums_fastscroller"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/albums_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/current_track_bar">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/albums_list"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/albums_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:layoutAnimation="@anim/layout_animation"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:layout_scrollFlags="scroll|enterAlways"
app:menu="@menu/menu_playlist"
app:title="@string/artist"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</com.google.android.material.appbar.AppBarLayout>
<include
layout="@layout/view_current_track_bar"
<androidx.core.widget.NestedScrollView
android:id="@+id/albums_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</RelativeLayout>
<RelativeLayout
android:id="@+id/albums_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/albums_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/current_track_bar">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/albums_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:layoutAnimation="@anim/layout_animation"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
<include
layout="@layout/view_current_track_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,81 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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/equalizer_scrollview"
android:id="@+id/equalizer_coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/equalizer_holder"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/equalizer_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/activity_margin">
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/equalizer_db_labels_holder"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/equalizer_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:title="@string/equalizer"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/equalizer_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/equalizer_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
android:padding="@dimen/activity_margin">
<RelativeLayout
android:id="@+id/equalizer_db_labels_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_label_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="4" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_label_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginStart="@dimen/medium_margin"
android:layout_toEndOf="@+id/equalizer_label_margin"
android:textSize="@dimen/normal_text_size"
tools:text="+15" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_label_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_toStartOf="@+id/equalizer_label_right"
android:layout_toEndOf="@+id/equalizer_label_left"
android:gravity="center_horizontal"
android:textSize="@dimen/normal_text_size"
tools:text="0" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_label_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/activity_margin"
android:textSize="@dimen/normal_text_size"
tools:text="-15" />
</RelativeLayout>
<LinearLayout
android:id="@+id/equalizer_bands_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/equalizer_db_labels_holder" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_label_margin"
android:id="@+id/equalizer_preset"
style="@style/ColoredButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="4" />
android:layout_marginTop="@dimen/normal_margin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/equalizer_bands_holder"
tools:text="@string/custom" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_label_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginStart="@dimen/medium_margin"
android:layout_toEndOf="@+id/equalizer_label_margin"
android:textSize="@dimen/normal_text_size"
tools:text="+15" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_label_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_toStartOf="@+id/equalizer_label_right"
android:layout_toEndOf="@+id/equalizer_label_left"
android:gravity="center_horizontal"
android:textSize="@dimen/normal_text_size"
tools:text="0" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_label_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/activity_margin"
android:textSize="@dimen/normal_text_size"
tools:text="-15" />
</RelativeLayout>
<LinearLayout
android:id="@+id/equalizer_bands_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/equalizer_db_labels_holder" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/equalizer_preset"
style="@style/ColoredButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/normal_margin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/equalizer_bands_holder"
tools:text="@string/custom" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,97 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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/main_holder"
android:id="@+id/main_coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.simplemobiletools.commons.views.MyViewPager
android:id="@+id/view_pager"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/main_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/current_track_bar"
app:layout_constraintTop_toTopOf="parent" />
android:layout_height="wrap_content">
<include
layout="@layout/view_current_track_bar"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:menu="@menu/menu_main"
app:title="@string/app_launcher_name"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/main_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/main_tabs_holder" />
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.google.android.material.tabs.TabLayout
android:id="@+id/main_tabs_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:tabIndicator="@null"
app:tabMinWidth="150dp"
app:tabRippleColor="@null" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/main_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/sleep_timer_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/default_background_color"
android:clickable="true"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/current_track_bar"
app:layout_constraintEnd_toEndOf="parent"
tools:visibility="visible">
<com.simplemobiletools.commons.views.MyViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/current_track_bar"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/sleep_timer_divider_top"
android:layout_width="0dp"
android:layout_height="1px"
android:background="@color/divider_grey"
app:layout_constraintBottom_toTopOf="@+id/sleep_timer_stop"
app:layout_constraintEnd_toEndOf="@+id/sleep_timer_stop"
app:layout_constraintStart_toStartOf="@+id/sleep_timer_label" />
<include
layout="@layout/view_current_track_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/main_tabs_holder" />
<ImageView
android:id="@+id/sleep_timer_divider_start"
android:layout_width="1px"
android:layout_height="0dp"
android:background="@color/divider_grey"
app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_stop"
app:layout_constraintStart_toStartOf="@+id/sleep_timer_label"
app:layout_constraintTop_toTopOf="@+id/sleep_timer_stop" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/main_tabs_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:tabIndicator="@null"
app:tabMinWidth="150dp"
app:tabRippleColor="@null" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/sleep_timer_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingStart="@dimen/normal_margin"
android:paddingEnd="@dimen/normal_margin"
android:text="@string/sleep_timer"
android:textSize="@dimen/big_text_size"
app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_stop"
app:layout_constraintEnd_toStartOf="@+id/sleep_timer_value"
app:layout_constraintTop_toTopOf="@+id/sleep_timer_stop" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/sleep_timer_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/default_background_color"
android:clickable="true"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/current_track_bar"
app:layout_constraintEnd_toEndOf="parent"
tools:visibility="visible">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/sleep_timer_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="00:00"
android:textSize="@dimen/big_text_size"
app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_stop"
app:layout_constraintEnd_toStartOf="@+id/sleep_timer_stop"
app:layout_constraintTop_toTopOf="@+id/sleep_timer_stop"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/sleep_timer_divider_top"
android:layout_width="0dp"
android:layout_height="1px"
android:background="@color/divider_grey"
app:layout_constraintBottom_toTopOf="@+id/sleep_timer_stop"
app:layout_constraintEnd_toEndOf="@+id/sleep_timer_stop"
app:layout_constraintStart_toStartOf="@+id/sleep_timer_label" />
<ImageView
android:id="@+id/sleep_timer_stop"
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
android:layout_marginStart="@dimen/tiny_margin"
android:layout_marginEnd="@dimen/tiny_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_cross_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<ImageView
android:id="@+id/sleep_timer_divider_start"
android:layout_width="1px"
android:layout_height="0dp"
android:background="@color/divider_grey"
app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_stop"
app:layout_constraintStart_toStartOf="@+id/sleep_timer_label"
app:layout_constraintTop_toTopOf="@+id/sleep_timer_stop" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/sleep_timer_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingStart="@dimen/normal_margin"
android:paddingEnd="@dimen/normal_margin"
android:text="@string/sleep_timer"
android:textSize="@dimen/big_text_size"
app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_stop"
app:layout_constraintEnd_toStartOf="@+id/sleep_timer_value"
app:layout_constraintTop_toTopOf="@+id/sleep_timer_stop" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/sleep_timer_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="00:00"
android:textSize="@dimen/big_text_size"
app:layout_constraintBottom_toBottomOf="@+id/sleep_timer_stop"
app:layout_constraintEnd_toStartOf="@+id/sleep_timer_stop"
app:layout_constraintTop_toTopOf="@+id/sleep_timer_stop"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/sleep_timer_stop"
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
android:layout_marginStart="@dimen/tiny_margin"
android:layout_marginEnd="@dimen/tiny_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_cross_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,23 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_queue_holder"
android:id="@+id/queue_coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/queue_fastscroller"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/queue_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/queue_list"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/queue_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:layoutAnimation="@anim/layout_animation"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:layout_scrollFlags="scroll|enterAlways"
app:menu="@menu/menu_queue"
app:title="@string/track_queue"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/queue_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/queue_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/queue_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:layoutAnimation="@anim/layout_animation"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,166 +1,191 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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/settings_scrollview"
android:id="@+id/settings_coordinator"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/settings_holder"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/settings_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_height="wrap_content">
<TextView
android:id="@+id/settings_color_customization_label"
style="@style/SettingsSectionLabelStyle"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/settings_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/color_customization" />
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:title="@string/settings"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/settings_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/settings_color_customization_holder"
android:id="@+id/settings_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/medium_margin"
android:background="@drawable/section_holder_stroke"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/settings_customize_colors_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
<TextView
android:id="@+id/settings_color_customization_label"
style="@style/SettingsSectionLabelStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_top_corners">
android:text="@string/color_customization" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_colors_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/customize_colors" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_customize_widget_colors_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
<LinearLayout
android:id="@+id/settings_color_customization_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_bottom_corners">
android:layout_margin="@dimen/medium_margin"
android:background="@drawable/section_holder_stroke"
android:orientation="vertical">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_widget_colors_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
<RelativeLayout
android:id="@+id/settings_customize_colors_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/customize_widget_colors" />
android:background="@drawable/ripple_top_corners">
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_colors_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/customize_colors" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_customize_widget_colors_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_bottom_corners">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_widget_colors_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/customize_widget_colors" />
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/settings_general_settings_label"
style="@style/SettingsSectionLabelStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/general_settings" />
<LinearLayout
android:id="@+id/settings_general_settings_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/medium_margin"
android:background="@drawable/section_holder_stroke"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/settings_purchase_thank_you_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_top_corners">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_purchase_thank_you"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/purchase_simple_thank_you" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_use_english_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_use_english"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/use_english_language" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_swap_prev_next_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_swap_prev_next"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/swap_prev_next" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_filename_holder"
style="@style/SettingsHolderTextViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_show_filename_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_filename" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_show_filename"
style="@style/SettingsTextValueStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/settings_show_filename_label"
tools:text="@string/title_is_not_available" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_manage_shown_tabs_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_bottom_corners">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_manage_shown_tabs_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/manage_shown_tabs" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/settings_general_settings_label"
style="@style/SettingsSectionLabelStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/general_settings" />
<LinearLayout
android:id="@+id/settings_general_settings_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/medium_margin"
android:background="@drawable/section_holder_stroke"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/settings_purchase_thank_you_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_top_corners">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_purchase_thank_you"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/purchase_simple_thank_you" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_use_english_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_use_english"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/use_english_language" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_swap_prev_next_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_swap_prev_next"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/swap_prev_next" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_filename_holder"
style="@style/SettingsHolderTextViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_show_filename_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_filename" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_show_filename"
style="@style/SettingsTextValueStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/settings_show_filename_label"
tools:text="@string/title_is_not_available" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_manage_shown_tabs_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_bottom_corners">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_manage_shown_tabs_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/manage_shown_tabs" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,58 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tracks_holder"
android:id="@+id/tracks_coordinator"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent">
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/tracks_fastscroller"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/tracks_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/current_track_bar">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/tracks_list"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/tracks_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:layoutAnimation="@anim/layout_animation"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:layout_scrollFlags="scroll|enterAlways"
app:menu="@menu/menu_playlist"
app:title="@string/artist"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</com.google.android.material.appbar.AppBarLayout>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/tracks_placeholder"
<androidx.core.widget.NestedScrollView
android:id="@+id/tracks_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:alpha="0.8"
android:gravity="center"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
android:text="@string/no_items_found"
android:textSize="@dimen/bigger_text_size"
android:textStyle="italic"
android:visibility="gone" />
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/tracks_placeholder_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tracks_placeholder"
android:layout_centerHorizontal="true"
android:background="@drawable/ripple_all_corners"
android:gravity="center"
android:padding="@dimen/activity_margin"
android:text="@string/add_folder_to_playlist"
android:textSize="@dimen/bigger_text_size"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/tracks_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
layout="@layout/view_current_track_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/tracks_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/current_track_bar">
</RelativeLayout>
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/tracks_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:layoutAnimation="@anim/layout_animation"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/tracks_placeholder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:alpha="0.8"
android:gravity="center"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
android:text="@string/no_items_found"
android:textSize="@dimen/bigger_text_size"
android:textStyle="italic"
android:visibility="gone" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/tracks_placeholder_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tracks_placeholder"
android:layout_centerHorizontal="true"
android:background="@drawable/ripple_all_corners"
android:gravity="center"
android:padding="@dimen/activity_margin"
android:text="@string/add_folder_to_playlist"
android:textSize="@dimen/bigger_text_size"
android:visibility="gone" />
<include
layout="@layout/view_current_track_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>