Migrate to non transitive R class
This commit is contained in:
parent
5721ccf615
commit
59b3e60832
38 changed files with 136 additions and 124 deletions
|
@ -64,7 +64,11 @@ class AlbumsActivity : SimpleMusicActivity() {
|
|||
val startIndex = albumTracks.indexOf(it as Track)
|
||||
prepareAndPlay(albumTracks, startIndex)
|
||||
} else {
|
||||
PermissionRequiredDialog(this, R.string.allow_notifications_music_player, { openNotificationSettings() })
|
||||
PermissionRequiredDialog(
|
||||
this,
|
||||
com.simplemobiletools.commons.R.string.allow_notifications_music_player,
|
||||
{ openNotificationSettings() }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ import com.simplemobiletools.commons.helpers.DARK_GREY
|
|||
import com.simplemobiletools.commons.helpers.NavigationIcon
|
||||
import com.simplemobiletools.commons.models.RadioItem
|
||||
import com.simplemobiletools.commons.views.MySeekBar
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.databinding.ActivityEqualizerBinding
|
||||
import com.simplemobiletools.musicplayer.databinding.EqualizerBandBinding
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
|
@ -122,7 +121,7 @@ class EqualizerActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun draggingStarted(equalizer: Equalizer) {
|
||||
binding.equalizerPreset.text = getString(R.string.custom)
|
||||
binding.equalizerPreset.text = getString(com.simplemobiletools.commons.R.string.custom)
|
||||
config.equalizerPreset = EQUALIZER_PRESET_CUSTOM
|
||||
for (band in 0 until equalizer.numberOfBands) {
|
||||
bands[band.toShort()] = bandSeekBars[band].progress
|
||||
|
@ -143,7 +142,7 @@ class EqualizerActivity : SimpleActivity() {
|
|||
RadioItem(it, equalizer.getPresetName(it.toShort()))
|
||||
}
|
||||
|
||||
items.add(RadioItem(EQUALIZER_PRESET_CUSTOM, getString(R.string.custom)))
|
||||
items.add(RadioItem(EQUALIZER_PRESET_CUSTOM, getString(com.simplemobiletools.commons.R.string.custom)))
|
||||
RadioGroupDialog(this, items, config.equalizerPreset) { presetId ->
|
||||
try {
|
||||
config.equalizerPreset = presetId as Int
|
||||
|
@ -158,7 +157,7 @@ class EqualizerActivity : SimpleActivity() {
|
|||
|
||||
private fun presetChanged(presetId: Int, equalizer: Equalizer) {
|
||||
if (presetId == EQUALIZER_PRESET_CUSTOM) {
|
||||
binding.equalizerPreset.text = getString(R.string.custom)
|
||||
binding.equalizerPreset.text = getString(com.simplemobiletools.commons.R.string.custom)
|
||||
|
||||
for (band in 0 until equalizer.numberOfBands) {
|
||||
val minValue = equalizer.bandLevelRange[0]
|
||||
|
@ -177,7 +176,7 @@ class EqualizerActivity : SimpleActivity() {
|
|||
val presetName = equalizer.getPresetName(presetId.toShort())
|
||||
if (presetName.isEmpty()) {
|
||||
config.equalizerPreset = EQUALIZER_PRESET_CUSTOM
|
||||
binding.equalizerPreset.text = getString(R.string.custom)
|
||||
binding.equalizerPreset.text = getString(com.simplemobiletools.commons.R.string.custom)
|
||||
} else {
|
||||
binding.equalizerPreset.text = presetName
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class MainActivity : SimpleMusicActivity() {
|
|||
if (it) {
|
||||
initActivity()
|
||||
} else {
|
||||
toast(R.string.no_storage_permissions)
|
||||
toast(com.simplemobiletools.commons.R.string.no_storage_permissions)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ class MainActivity : SimpleMusicActivity() {
|
|||
private fun setupTabs() {
|
||||
binding.mainTabsHolder.removeAllTabs()
|
||||
getVisibleTabs().forEach { value ->
|
||||
binding.mainTabsHolder.newTab().setCustomView(R.layout.bottom_tablayout_item).apply {
|
||||
binding.mainTabsHolder.newTab().setCustomView(com.simplemobiletools.commons.R.layout.bottom_tablayout_item).apply {
|
||||
val tabItemBinding = BottomTablayoutItemBinding.bind(customView!!)
|
||||
tabItemBinding.tabItemIcon.setImageDrawable(getTabIcon(value))
|
||||
tabItemBinding.tabItemLabel.text = getTabLabel(value)
|
||||
|
@ -282,7 +282,7 @@ class MainActivity : SimpleMusicActivity() {
|
|||
val drawableId = when (position) {
|
||||
TAB_PLAYLISTS -> R.drawable.ic_playlist_vector
|
||||
TAB_FOLDERS -> R.drawable.ic_folders_vector
|
||||
TAB_ARTISTS -> R.drawable.ic_person_vector
|
||||
TAB_ARTISTS -> com.simplemobiletools.commons.R.drawable.ic_person_vector
|
||||
TAB_ALBUMS -> R.drawable.ic_album_vector
|
||||
TAB_GENRES -> R.drawable.ic_genre_vector
|
||||
else -> R.drawable.ic_music_note_vector
|
||||
|
@ -352,7 +352,7 @@ class MainActivity : SimpleMusicActivity() {
|
|||
uri.scheme == "content" -> {
|
||||
val tempFile = getTempFile("imports", uri.path!!.getFilenameFromPath())
|
||||
if (tempFile == null) {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -367,7 +367,7 @@ class MainActivity : SimpleMusicActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
else -> toast(R.string.invalid_file_format)
|
||||
else -> toast(com.simplemobiletools.commons.R.string.invalid_file_format)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,7 @@ class MainActivity : SimpleMusicActivity() {
|
|||
try {
|
||||
startActivityForResult(this, PICK_IMPORT_SOURCE_INTENT)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
toast(R.string.system_service_disabled, Toast.LENGTH_LONG)
|
||||
toast(com.simplemobiletools.commons.R.string.system_service_disabled, Toast.LENGTH_LONG)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
|
@ -415,9 +415,9 @@ class MainActivity : SimpleMusicActivity() {
|
|||
runOnUiThread {
|
||||
toast(
|
||||
when (result) {
|
||||
ImportResult.IMPORT_OK -> R.string.importing_successful
|
||||
ImportResult.IMPORT_PARTIAL -> R.string.importing_some_entries_failed
|
||||
else -> R.string.importing_failed
|
||||
ImportResult.IMPORT_OK -> com.simplemobiletools.commons.R.string.importing_successful
|
||||
ImportResult.IMPORT_PARTIAL -> com.simplemobiletools.commons.R.string.importing_some_entries_failed
|
||||
else -> com.simplemobiletools.commons.R.string.importing_failed
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -428,8 +428,8 @@ class MainActivity : SimpleMusicActivity() {
|
|||
}
|
||||
|
||||
private fun showSleepTimer() {
|
||||
val minutes = getString(R.string.minutes_raw)
|
||||
val hour = resources.getQuantityString(R.plurals.hours, 1, 1)
|
||||
val minutes = getString(com.simplemobiletools.commons.R.string.minutes_raw)
|
||||
val hour = resources.getQuantityString(com.simplemobiletools.commons.R.plurals.hours, 1, 1)
|
||||
|
||||
val items = arrayListOf(
|
||||
RadioItem(5 * 60, "5 $minutes"),
|
||||
|
@ -441,12 +441,12 @@ class MainActivity : SimpleMusicActivity() {
|
|||
|
||||
if (items.none { it.id == config.lastSleepTimerSeconds }) {
|
||||
val lastSleepTimerMinutes = config.lastSleepTimerSeconds / 60
|
||||
val text = resources.getQuantityString(R.plurals.minutes, lastSleepTimerMinutes, lastSleepTimerMinutes)
|
||||
val text = resources.getQuantityString(com.simplemobiletools.commons.R.plurals.minutes, lastSleepTimerMinutes, lastSleepTimerMinutes)
|
||||
items.add(RadioItem(config.lastSleepTimerSeconds, text))
|
||||
}
|
||||
|
||||
items.sortBy { it.id }
|
||||
items.add(RadioItem(-1, getString(R.string.custom)))
|
||||
items.add(RadioItem(-1, getString(com.simplemobiletools.commons.R.string.custom)))
|
||||
|
||||
RadioGroupDialog(this, items, config.lastSleepTimerSeconds) {
|
||||
if (it as Int == -1) {
|
||||
|
@ -527,14 +527,14 @@ class MainActivity : SimpleMusicActivity() {
|
|||
|
||||
val faqItems = arrayListOf(
|
||||
FAQItem(R.string.faq_1_title, R.string.faq_1_text),
|
||||
FAQItem(R.string.faq_1_title_commons, R.string.faq_1_text_commons),
|
||||
FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons),
|
||||
FAQItem(R.string.faq_9_title_commons, R.string.faq_9_text_commons)
|
||||
FAQItem(com.simplemobiletools.commons.R.string.faq_1_title_commons, com.simplemobiletools.commons.R.string.faq_1_text_commons),
|
||||
FAQItem(com.simplemobiletools.commons.R.string.faq_4_title_commons, com.simplemobiletools.commons.R.string.faq_4_text_commons),
|
||||
FAQItem(com.simplemobiletools.commons.R.string.faq_9_title_commons, com.simplemobiletools.commons.R.string.faq_9_text_commons)
|
||||
)
|
||||
|
||||
if (!resources.getBoolean(R.bool.hide_google_relations)) {
|
||||
faqItems.add(FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons))
|
||||
faqItems.add(FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons))
|
||||
faqItems.add(FAQItem(com.simplemobiletools.commons.R.string.faq_2_title_commons, com.simplemobiletools.commons.R.string.faq_2_text_commons))
|
||||
faqItems.add(FAQItem(com.simplemobiletools.commons.R.string.faq_6_title_commons, com.simplemobiletools.commons.R.string.faq_6_text_commons))
|
||||
}
|
||||
|
||||
startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true)
|
||||
|
|
|
@ -107,9 +107,9 @@ class SettingsActivity : SimpleControllerActivity() {
|
|||
settingsShowFilename.text = getReplaceTitleText()
|
||||
settingsShowFilenameHolder.setOnClickListener {
|
||||
val items = arrayListOf(
|
||||
RadioItem(SHOW_FILENAME_NEVER, getString(R.string.never)),
|
||||
RadioItem(SHOW_FILENAME_NEVER, getString(com.simplemobiletools.commons.R.string.never)),
|
||||
RadioItem(SHOW_FILENAME_IF_UNAVAILABLE, getString(R.string.title_is_not_available)),
|
||||
RadioItem(SHOW_FILENAME_ALWAYS, getString(R.string.always))
|
||||
RadioItem(SHOW_FILENAME_ALWAYS, getString(com.simplemobiletools.commons.R.string.always))
|
||||
)
|
||||
|
||||
RadioGroupDialog(this@SettingsActivity, items, config.showFilename) {
|
||||
|
@ -122,9 +122,9 @@ class SettingsActivity : SimpleControllerActivity() {
|
|||
|
||||
private fun getReplaceTitleText() = getString(
|
||||
when (config.showFilename) {
|
||||
SHOW_FILENAME_NEVER -> R.string.never
|
||||
SHOW_FILENAME_NEVER -> com.simplemobiletools.commons.R.string.never
|
||||
SHOW_FILENAME_IF_UNAVAILABLE -> R.string.title_is_not_available
|
||||
else -> R.string.always
|
||||
else -> com.simplemobiletools.commons.R.string.always
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import androidx.media3.session.MediaController
|
|||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import com.simplemobiletools.commons.helpers.isRPlus
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.extensions.*
|
||||
import com.simplemobiletools.musicplayer.helpers.EXTRA_NEXT_MEDIA_ID
|
||||
import com.simplemobiletools.musicplayer.helpers.SimpleMediaController
|
||||
|
@ -117,7 +116,7 @@ abstract class SimpleControllerActivity : SimpleActivity(), Player.Listener {
|
|||
EventBus.getDefault().post(Events.RefreshFragments())
|
||||
callback()
|
||||
} else {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -7,7 +7,6 @@ import androidx.media3.common.Player
|
|||
import com.simplemobiletools.commons.dialogs.PermissionRequiredDialog
|
||||
import com.simplemobiletools.commons.extensions.hideKeyboard
|
||||
import com.simplemobiletools.commons.extensions.openNotificationSettings
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.extensions.isReallyPlaying
|
||||
import com.simplemobiletools.musicplayer.extensions.togglePlayback
|
||||
import com.simplemobiletools.musicplayer.views.CurrentTrackBar
|
||||
|
@ -34,7 +33,7 @@ abstract class SimpleMusicActivity : SimpleControllerActivity(), Player.Listener
|
|||
startActivity(this)
|
||||
}
|
||||
} else {
|
||||
PermissionRequiredDialog(this, R.string.allow_notifications_music_player, { openNotificationSettings() })
|
||||
PermissionRequiredDialog(this, com.simplemobiletools.commons.R.string.allow_notifications_music_player, { openNotificationSettings() })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ class TrackActivity : SimpleControllerActivity(), PlaybackSpeedListener {
|
|||
if (track != null) {
|
||||
prepareAndPlay(listOf(track), startActivity = false)
|
||||
} else {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ class TrackActivity : SimpleControllerActivity(), PlaybackSpeedListener {
|
|||
binding.nextTrackLabel.text = "${getString(R.string.next_track)} ${track.title}$artist"
|
||||
|
||||
getTrackCoverArt(track) { coverArt ->
|
||||
val cornerRadius = resources.getDimension(R.dimen.rounded_corner_radius_small).toInt()
|
||||
val cornerRadius = resources.getDimension(com.simplemobiletools.commons.R.dimen.rounded_corner_radius_small).toInt()
|
||||
val wantedSize = resources.getDimension(R.dimen.song_image_size).toInt()
|
||||
|
||||
// change cover image manually only once loaded successfully to avoid blinking at fails and placeholders
|
||||
|
@ -252,7 +252,7 @@ class TrackActivity : SimpleControllerActivity(), PlaybackSpeedListener {
|
|||
if (velocityY > 0 && velocityY > velocityX && e2.y - e1.y > SWIPE_DOWN_THRESHOLD) {
|
||||
finish()
|
||||
binding.activityTrackTopShadow.animate().alpha(0f).start()
|
||||
overridePendingTransition(0, R.anim.slide_down)
|
||||
overridePendingTransition(0, com.simplemobiletools.commons.R.anim.slide_down)
|
||||
}
|
||||
}
|
||||
return super.onFling(e1, e2, velocityX, velocityY)
|
||||
|
|
|
@ -292,7 +292,7 @@ class TracksActivity : SimpleMusicActivity() {
|
|||
if (path.isAudioFast()) {
|
||||
addTrackFromPath(path, true)
|
||||
} else {
|
||||
toast(R.string.invalid_file_format)
|
||||
toast(com.simplemobiletools.commons.R.string.invalid_file_format)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ class TracksActivity : SimpleMusicActivity() {
|
|||
addTrackFromPath(path, false)
|
||||
}
|
||||
} else {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
|
||||
}
|
||||
} else {
|
||||
var track = audioHelper.getTrack(mediaStoreId)
|
||||
|
@ -377,7 +377,7 @@ class TracksActivity : SimpleMusicActivity() {
|
|||
val startIndex = tracks.indexOf(track)
|
||||
prepareAndPlay(tracks, startIndex)
|
||||
} else {
|
||||
PermissionRequiredDialog(this, R.string.allow_notifications_music_player, { openNotificationSettings() })
|
||||
PermissionRequiredDialog(this, com.simplemobiletools.commons.R.string.allow_notifications_music_player, { openNotificationSettings() })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ class TracksActivity : SimpleMusicActivity() {
|
|||
try {
|
||||
startActivityForResult(this, PICK_EXPORT_FILE_INTENT)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
toast(R.string.system_service_disabled, Toast.LENGTH_LONG)
|
||||
toast(com.simplemobiletools.commons.R.string.system_service_disabled, Toast.LENGTH_LONG)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
|
@ -415,16 +415,16 @@ class TracksActivity : SimpleMusicActivity() {
|
|||
private fun exportPlaylistTo(outputStream: OutputStream?) {
|
||||
val tracks = getTracksAdapter()?.items
|
||||
if (tracks.isNullOrEmpty()) {
|
||||
toast(R.string.no_entries_for_exporting)
|
||||
toast(com.simplemobiletools.commons.R.string.no_entries_for_exporting)
|
||||
return
|
||||
}
|
||||
|
||||
M3uExporter(this).exportPlaylist(outputStream, tracks) { result ->
|
||||
toast(
|
||||
when (result) {
|
||||
ExportResult.EXPORT_OK -> R.string.exporting_successful
|
||||
ExportResult.EXPORT_PARTIAL -> R.string.exporting_some_entries_failed
|
||||
else -> R.string.exporting_failed
|
||||
ExportResult.EXPORT_OK -> com.simplemobiletools.commons.R.string.exporting_successful
|
||||
ExportResult.EXPORT_PARTIAL -> com.simplemobiletools.commons.R.string.exporting_some_entries_failed
|
||||
else -> com.simplemobiletools.commons.R.string.exporting_failed
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
@ -53,8 +53,8 @@ class WidgetConfigureActivity : SimpleActivity() {
|
|||
songInfoTitle.text = currSong.title
|
||||
songInfoArtist.text = currSong.artist
|
||||
} else {
|
||||
songInfoTitle.text = getString(R.string.artist)
|
||||
songInfoArtist.text = getString(R.string.song_title)
|
||||
songInfoTitle.text = getString(com.simplemobiletools.commons.R.string.artist)
|
||||
songInfoArtist.text = getString(com.simplemobiletools.commons.R.string.song_title)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,8 +87,8 @@ class WidgetConfigureActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
mTextColor = config.widgetTextColor
|
||||
if (mTextColor == resources.getColor(R.color.default_widget_text_color) && config.isUsingSystemTheme) {
|
||||
mTextColor = resources.getColor(R.color.you_primary_color, theme)
|
||||
if (mTextColor == resources.getColor(com.simplemobiletools.commons.R.color.default_widget_text_color) && config.isUsingSystemTheme) {
|
||||
mTextColor = resources.getColor(com.simplemobiletools.commons.R.color.you_primary_color, theme)
|
||||
}
|
||||
|
||||
updateTextColor()
|
||||
|
|
|
@ -12,7 +12,6 @@ import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
|||
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.activities.SimpleControllerActivity
|
||||
import com.simplemobiletools.musicplayer.extensions.*
|
||||
import com.simplemobiletools.musicplayer.helpers.TagHelper
|
||||
|
@ -32,7 +31,7 @@ abstract class BaseMusicAdapter<Type>(
|
|||
val tagHelper by lazy { TagHelper(ctx) }
|
||||
val placeholder by lazy { resources.getSmallPlaceholder(textColor) }
|
||||
val placeholderBig by lazy { resources.getBiggerPlaceholder(textColor) }
|
||||
open val cornerRadius by lazy { resources.getDimension(R.dimen.rounded_corner_radius_small).toInt() }
|
||||
open val cornerRadius by lazy { resources.getDimension(com.simplemobiletools.commons.R.dimen.rounded_corner_radius_small).toInt() }
|
||||
|
||||
override fun getItemCount() = items.size
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import com.simplemobiletools.commons.extensions.humanizePath
|
|||
import com.simplemobiletools.commons.extensions.setupViewBackground
|
||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.databinding.ItemExcludedFolderBinding
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
|
||||
|
@ -25,13 +24,13 @@ class ExcludedFoldersAdapter(
|
|||
|
||||
private val config = activity.config
|
||||
|
||||
override fun getActionMenuId() = R.menu.cab_remove_only
|
||||
override fun getActionMenuId() = com.simplemobiletools.commons.R.menu.cab_remove_only
|
||||
|
||||
override fun prepareActionMode(menu: Menu) {}
|
||||
|
||||
override fun actionItemPressed(id: Int) {
|
||||
when (id) {
|
||||
R.id.cab_remove -> removeSelection()
|
||||
com.simplemobiletools.commons.R.id.cab_remove -> removeSelection()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,7 +94,7 @@ class ExcludedFoldersAdapter(
|
|||
setOnMenuItemClickListener { item ->
|
||||
val eventTypeId = folder.hashCode()
|
||||
when (item.itemId) {
|
||||
R.id.cab_remove -> {
|
||||
com.simplemobiletools.commons.R.id.cab_remove -> {
|
||||
executeItemMenuOperation(eventTypeId) {
|
||||
removeSelection()
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class QueueAdapter(activity: SimpleActivity, items: ArrayList<Track>, var curren
|
|||
}
|
||||
|
||||
private fun deleteTracks() {
|
||||
ConfirmationDialog(ctx, "", R.string.delete_song_warning, R.string.ok, R.string.cancel) {
|
||||
ConfirmationDialog(ctx, "", R.string.delete_song_warning, com.simplemobiletools.commons.R.string.ok, com.simplemobiletools.commons.R.string.cancel) {
|
||||
val positions = ArrayList<Int>()
|
||||
val selectedTracks = getSelectedTracks()
|
||||
selectedTracks.forEach { track ->
|
||||
|
|
|
@ -28,7 +28,7 @@ class TracksHeaderAdapter(activity: SimpleActivity, items: ArrayList<ListItem>,
|
|||
private val ITEM_HEADER = 0
|
||||
private val ITEM_TRACK = 1
|
||||
|
||||
override val cornerRadius = resources.getDimension(R.dimen.rounded_corner_radius_big).toInt()
|
||||
override val cornerRadius = resources.getDimension(com.simplemobiletools.commons.R.dimen.rounded_corner_radius_big).toInt()
|
||||
|
||||
override fun getActionMenuId() = R.menu.cab_tracks_header
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class ChangeSortingDialog(val activity: Activity, val location: Int, val playlis
|
|||
if (playlist != null) {
|
||||
sortingDialogUseForThisOnly.isChecked = config.hasCustomPlaylistSorting(playlist.id)
|
||||
} else if (path != null) {
|
||||
sortingDialogUseForThisOnly.text = activity.getString(R.string.use_for_this_folder)
|
||||
sortingDialogUseForThisOnly.text = activity.getString(com.simplemobiletools.commons.R.string.use_for_this_folder)
|
||||
sortingDialogUseForThisOnly.isChecked = config.hasCustomSorting(path)
|
||||
}
|
||||
}
|
||||
|
@ -54,10 +54,10 @@ class ChangeSortingDialog(val activity: Activity, val location: Int, val playlis
|
|||
setupOrderRadio()
|
||||
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok) { _, _ -> dialogConfirmed() }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(com.simplemobiletools.commons.R.string.ok) { _, _ -> dialogConfirmed() }
|
||||
.setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(binding.root, this, R.string.sort_by)
|
||||
activity.setupDialogStuff(binding.root, this, com.simplemobiletools.commons.R.string.sort_by)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,45 +65,45 @@ class ChangeSortingDialog(val activity: Activity, val location: Int, val playlis
|
|||
val radioItems = ArrayList<RadioItem>()
|
||||
when (location) {
|
||||
TAB_PLAYLISTS, TAB_FOLDERS -> {
|
||||
radioItems.add(RadioItem(0, activity.getString(R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(0, activity.getString(com.simplemobiletools.commons.R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(1, activity.getString(R.string.track_count), PLAYER_SORT_BY_TRACK_COUNT))
|
||||
}
|
||||
|
||||
TAB_ARTISTS -> {
|
||||
radioItems.add(RadioItem(0, activity.getString(R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(0, activity.getString(com.simplemobiletools.commons.R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(1, activity.getString(R.string.album_count), PLAYER_SORT_BY_ALBUM_COUNT))
|
||||
radioItems.add(RadioItem(2, activity.getString(R.string.track_count), PLAYER_SORT_BY_TRACK_COUNT))
|
||||
}
|
||||
|
||||
TAB_ALBUMS -> {
|
||||
radioItems.add(RadioItem(0, activity.getString(R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(0, activity.getString(com.simplemobiletools.commons.R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(1, activity.getString(R.string.artist_name), PLAYER_SORT_BY_ARTIST_TITLE))
|
||||
radioItems.add(RadioItem(2, activity.getString(R.string.year), PLAYER_SORT_BY_YEAR))
|
||||
radioItems.add(RadioItem(4, activity.getString(R.string.date_added), PLAYER_SORT_BY_DATE_ADDED))
|
||||
radioItems.add(RadioItem(4, activity.getString(com.simplemobiletools.commons.R.string.date_added), PLAYER_SORT_BY_DATE_ADDED))
|
||||
}
|
||||
|
||||
TAB_TRACKS -> {
|
||||
radioItems.add(RadioItem(0, activity.getString(R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(1, activity.getString(R.string.artist), PLAYER_SORT_BY_ARTIST_TITLE))
|
||||
radioItems.add(RadioItem(2, activity.getString(R.string.duration), PLAYER_SORT_BY_DURATION))
|
||||
radioItems.add(RadioItem(0, activity.getString(com.simplemobiletools.commons.R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(1, activity.getString(com.simplemobiletools.commons.R.string.artist), PLAYER_SORT_BY_ARTIST_TITLE))
|
||||
radioItems.add(RadioItem(2, activity.getString(com.simplemobiletools.commons.R.string.duration), PLAYER_SORT_BY_DURATION))
|
||||
radioItems.add(RadioItem(3, activity.getString(R.string.track_number), PLAYER_SORT_BY_TRACK_ID))
|
||||
radioItems.add(RadioItem(4, activity.getString(R.string.date_added), PLAYER_SORT_BY_DATE_ADDED))
|
||||
radioItems.add(RadioItem(4, activity.getString(com.simplemobiletools.commons.R.string.date_added), PLAYER_SORT_BY_DATE_ADDED))
|
||||
}
|
||||
|
||||
TAB_GENRES -> {
|
||||
radioItems.add(RadioItem(0, activity.getString(R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(0, activity.getString(com.simplemobiletools.commons.R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(2, activity.getString(R.string.track_count), PLAYER_SORT_BY_TRACK_COUNT))
|
||||
}
|
||||
|
||||
ACTIVITY_PLAYLIST_FOLDER -> {
|
||||
radioItems.add(RadioItem(0, activity.getString(R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(1, activity.getString(R.string.artist), PLAYER_SORT_BY_ARTIST_TITLE))
|
||||
radioItems.add(RadioItem(2, activity.getString(R.string.duration), PLAYER_SORT_BY_DURATION))
|
||||
radioItems.add(RadioItem(0, activity.getString(com.simplemobiletools.commons.R.string.title), PLAYER_SORT_BY_TITLE))
|
||||
radioItems.add(RadioItem(1, activity.getString(com.simplemobiletools.commons.R.string.artist), PLAYER_SORT_BY_ARTIST_TITLE))
|
||||
radioItems.add(RadioItem(2, activity.getString(com.simplemobiletools.commons.R.string.duration), PLAYER_SORT_BY_DURATION))
|
||||
radioItems.add(RadioItem(3, activity.getString(R.string.track_number), PLAYER_SORT_BY_TRACK_ID))
|
||||
radioItems.add(RadioItem(4, activity.getString(R.string.date_added), PLAYER_SORT_BY_DATE_ADDED))
|
||||
radioItems.add(RadioItem(4, activity.getString(com.simplemobiletools.commons.R.string.date_added), PLAYER_SORT_BY_DATE_ADDED))
|
||||
|
||||
if (playlist != null) {
|
||||
radioItems.add(RadioItem(4, activity.getString(R.string.custom), PLAYER_SORT_BY_CUSTOM))
|
||||
radioItems.add(RadioItem(4, activity.getString(com.simplemobiletools.commons.R.string.custom), PLAYER_SORT_BY_CUSTOM))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac
|
|||
}
|
||||
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(com.simplemobiletools.commons.R.string.ok, null)
|
||||
.setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(binding.root, this, R.string.rename_song) { alertDialog ->
|
||||
alertDialog.showKeyboard(binding.title)
|
||||
|
@ -105,7 +105,7 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac
|
|||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
activity.toast(R.string.unknown_error_occurred)
|
||||
activity.toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,18 +42,18 @@ class ExportPlaylistDialog(
|
|||
}
|
||||
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(com.simplemobiletools.commons.R.string.ok, null)
|
||||
.setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(binding.root, this, R.string.export_playlist) { alertDialog ->
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||
val filename = binding.exportPlaylistFilename.value
|
||||
when {
|
||||
filename.isEmpty() -> activity.toast(R.string.empty_name)
|
||||
filename.isEmpty() -> activity.toast(com.simplemobiletools.commons.R.string.empty_name)
|
||||
filename.isAValidFilename() -> {
|
||||
val file = File(realPath, "$filename.m3u")
|
||||
if (!hidePath && file.exists()) {
|
||||
activity.toast(R.string.name_taken)
|
||||
activity.toast(com.simplemobiletools.commons.R.string.name_taken)
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ class ExportPlaylistDialog(
|
|||
}
|
||||
}
|
||||
|
||||
else -> activity.toast(R.string.invalid_name)
|
||||
else -> activity.toast(com.simplemobiletools.commons.R.string.invalid_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.simplemobiletools.commons.extensions.setupDialogStuff
|
|||
import com.simplemobiletools.commons.extensions.viewBinding
|
||||
import com.simplemobiletools.commons.helpers.isQPlus
|
||||
import com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.databinding.DialogManageVisibleTabsBinding
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.helpers.*
|
||||
|
@ -37,8 +36,8 @@ class ManageVisibleTabsDialog(val activity: BaseSimpleActivity, val callback: (r
|
|||
}
|
||||
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok) { _, _ -> dialogConfirmed() }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(com.simplemobiletools.commons.R.string.ok) { _, _ -> dialogConfirmed() }
|
||||
.setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(binding.root, this)
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ class NewPlaylistDialog(val activity: Activity, var playlist: Playlist? = null,
|
|||
|
||||
binding.newPlaylistTitle.setText(playlist!!.title)
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(com.simplemobiletools.commons.R.string.ok, null)
|
||||
.setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null)
|
||||
.apply {
|
||||
val dialogTitle = if (isNewPlaylist) R.string.create_new_playlist else R.string.rename_playlist
|
||||
activity.setupDialogStuff(binding.root, this, dialogTitle) { alertDialog ->
|
||||
|
@ -38,7 +38,7 @@ class NewPlaylistDialog(val activity: Activity, var playlist: Playlist? = null,
|
|||
}
|
||||
|
||||
if (title.isEmpty()) {
|
||||
activity.toast(R.string.empty_name)
|
||||
activity.toast(com.simplemobiletools.commons.R.string.empty_name)
|
||||
return@ensureBackgroundThread
|
||||
} else if (isPlaylistTitleTaken) {
|
||||
activity.toast(R.string.playlist_name_exists)
|
||||
|
@ -58,7 +58,7 @@ class NewPlaylistDialog(val activity: Activity, var playlist: Playlist? = null,
|
|||
alertDialog.dismiss()
|
||||
callback(eventTypeId)
|
||||
} else {
|
||||
activity.toast(R.string.unknown_error_occurred)
|
||||
activity.toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ class RemovePlaylistDialog(val activity: Activity, val playlist: Playlist? = nul
|
|||
init {
|
||||
binding.removePlaylistDescription.text = getDescriptionText()
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok) { _, _ -> callback(binding.removePlaylistCheckbox.isChecked) }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(com.simplemobiletools.commons.R.string.ok) { _, _ -> callback(binding.removePlaylistCheckbox.isChecked) }
|
||||
.setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(binding.root, this, R.string.remove_playlist)
|
||||
}
|
||||
|
|
|
@ -11,10 +11,10 @@ class SleepTimerCustomDialog(val activity: Activity, val callback: (seconds: Int
|
|||
private val binding by activity.viewBinding(DialogCustomSleepTimerPickerBinding::inflate)
|
||||
|
||||
init {
|
||||
binding.minutesHint.hint = activity.getString(R.string.minutes_raw).replaceFirstChar { it.uppercaseChar() }
|
||||
binding.minutesHint.hint = activity.getString(com.simplemobiletools.commons.R.string.minutes_raw).replaceFirstChar { it.uppercaseChar() }
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok) { _, _ -> dialogConfirmed() }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(com.simplemobiletools.commons.R.string.ok) { _, _ -> dialogConfirmed() }
|
||||
.setNegativeButton(com.simplemobiletools.commons.R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(binding.root, this, R.string.sleep_timer) { alertDialog ->
|
||||
dialog = alertDialog
|
||||
|
|
|
@ -47,7 +47,7 @@ class AlbumsFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||
binding.albumsPlaceholder.text = if (scanning) {
|
||||
context.getString(R.string.loading_files)
|
||||
} else {
|
||||
context.getString(R.string.no_items_found)
|
||||
context.getString(com.simplemobiletools.commons.R.string.no_items_found)
|
||||
}
|
||||
binding.albumsPlaceholder.beVisibleIf(albums.isEmpty())
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class ArtistsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
|||
binding.artistsPlaceholder.text = if (scanning) {
|
||||
context.getString(R.string.loading_files)
|
||||
} else {
|
||||
context.getString(R.string.no_items_found)
|
||||
context.getString(com.simplemobiletools.commons.R.string.no_items_found)
|
||||
}
|
||||
binding.artistsPlaceholder.beVisibleIf(artists.isEmpty())
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class FoldersFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
|||
binding.foldersPlaceholder.text = if (scanning) {
|
||||
context.getString(R.string.loading_files)
|
||||
} else {
|
||||
context.getString(R.string.no_items_found)
|
||||
context.getString(com.simplemobiletools.commons.R.string.no_items_found)
|
||||
}
|
||||
binding.foldersPlaceholder.beVisibleIf(folders.isEmpty())
|
||||
binding.foldersFastscroller.beGoneIf(binding.foldersPlaceholder.isVisible())
|
||||
|
|
|
@ -45,7 +45,7 @@ class GenresFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||
binding.genresPlaceholder.text = if (scanning) {
|
||||
context.getString(R.string.loading_files)
|
||||
} else {
|
||||
context.getString(R.string.no_items_found)
|
||||
context.getString(com.simplemobiletools.commons.R.string.no_items_found)
|
||||
}
|
||||
|
||||
binding.genresPlaceholder.beVisibleIf(genres.isEmpty())
|
||||
|
|
|
@ -34,8 +34,9 @@ class PlaybackSpeedFragment : BottomSheetDialogFragment() {
|
|||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
val config = requireContext().config
|
||||
val binding = FragmentPlaybackSpeedBinding.inflate(inflater, container, false)
|
||||
val background = ResourcesCompat.getDrawable(resources, R.drawable.bottom_sheet_bg, requireContext().theme)
|
||||
(background as LayerDrawable).findDrawableByLayerId(R.id.bottom_sheet_background).applyColorFilter(requireContext().getProperBackgroundColor())
|
||||
val background = ResourcesCompat.getDrawable(resources, com.simplemobiletools.commons.R.drawable.bottom_sheet_bg, requireContext().theme)
|
||||
(background as LayerDrawable).findDrawableByLayerId(com.simplemobiletools.commons.R.id.bottom_sheet_background)
|
||||
.applyColorFilter(requireContext().getProperBackgroundColor())
|
||||
|
||||
binding.apply {
|
||||
seekBar = playbackSpeedSeekbar
|
||||
|
|
|
@ -52,7 +52,7 @@ class PlaylistsFragment(context: Context, attributeSet: AttributeSet) : MyViewPa
|
|||
binding.playlistsPlaceholder.text = if (scanning) {
|
||||
context.getString(R.string.loading_files)
|
||||
} else {
|
||||
context.getString(R.string.no_items_found)
|
||||
context.getString(com.simplemobiletools.commons.R.string.no_items_found)
|
||||
}
|
||||
binding.playlistsPlaceholder.beVisibleIf(playlists.isEmpty())
|
||||
binding.playlistsPlaceholder2.beVisibleIf(playlists.isEmpty() && !scanning)
|
||||
|
|
|
@ -5,7 +5,12 @@ import android.content.Context
|
|||
import android.util.AttributeSet
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.dialogs.PermissionRequiredDialog
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.extensions.areSystemAnimationsEnabled
|
||||
import com.simplemobiletools.commons.extensions.beGoneIf
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.extensions.getParentPath
|
||||
import com.simplemobiletools.commons.extensions.hideKeyboard
|
||||
import com.simplemobiletools.commons.extensions.openNotificationSettings
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.activities.SimpleActivity
|
||||
|
@ -39,7 +44,7 @@ class TracksFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||
binding.tracksPlaceholder.text = if (scanning) {
|
||||
context.getString(R.string.loading_files)
|
||||
} else {
|
||||
context.getString(R.string.no_items_found)
|
||||
context.getString(com.simplemobiletools.commons.R.string.no_items_found)
|
||||
}
|
||||
binding.tracksPlaceholder.beVisibleIf(tracks.isEmpty())
|
||||
val adapter = binding.tracksList.adapter
|
||||
|
@ -52,7 +57,11 @@ class TracksFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||
prepareAndPlay(tracks, startIndex)
|
||||
} else {
|
||||
if (context is Activity) {
|
||||
PermissionRequiredDialog(activity, R.string.allow_notifications_music_player, { activity.openNotificationSettings() })
|
||||
PermissionRequiredDialog(
|
||||
activity,
|
||||
com.simplemobiletools.commons.R.string.allow_notifications_music_player,
|
||||
{ activity.openNotificationSettings() }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
|||
import com.simplemobiletools.commons.extensions.showErrorToast
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.extensions.writeLn
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.models.Track
|
||||
import java.io.OutputStream
|
||||
|
||||
|
@ -26,7 +25,7 @@ class M3uExporter(val activity: BaseSimpleActivity) {
|
|||
return
|
||||
}
|
||||
|
||||
activity.toast(R.string.exporting)
|
||||
activity.toast(com.simplemobiletools.commons.R.string.exporting)
|
||||
|
||||
try {
|
||||
outputStream.bufferedWriter().use { out ->
|
||||
|
|
|
@ -105,7 +105,7 @@ class MyWidgetProvider : AppWidgetProvider() {
|
|||
}
|
||||
|
||||
private fun updatePlayPauseButton(context: Context, views: RemoteViews, isPlaying: Boolean) {
|
||||
val drawableId = if (isPlaying) R.drawable.ic_pause_vector else R.drawable.ic_play_vector
|
||||
val drawableId = if (isPlaying) com.simplemobiletools.commons.R.drawable.ic_pause_vector else com.simplemobiletools.commons.R.drawable.ic_play_vector
|
||||
val widgetTextColor = context.config.widgetTextColor
|
||||
val icon = context.resources.getColoredBitmap(drawableId, widgetTextColor)
|
||||
views.setImageViewBitmap(R.id.play_pause_btn, icon)
|
||||
|
@ -120,8 +120,14 @@ class MyWidgetProvider : AppWidgetProvider() {
|
|||
applyColorFilter(R.id.widget_background, widgetBgColor)
|
||||
setTextColor(R.id.song_info_title, widgetTextColor)
|
||||
setTextColor(R.id.song_info_artist, widgetTextColor)
|
||||
setImageViewBitmap(R.id.previous_btn, context.resources.getColoredBitmap(R.drawable.ic_previous_vector, widgetTextColor))
|
||||
setImageViewBitmap(R.id.next_btn, context.resources.getColoredBitmap(R.drawable.ic_next_vector, widgetTextColor))
|
||||
setImageViewBitmap(
|
||||
R.id.previous_btn,
|
||||
context.resources.getColoredBitmap(
|
||||
com.simplemobiletools.commons.R.drawable.ic_previous_vector,
|
||||
widgetTextColor
|
||||
)
|
||||
)
|
||||
setImageViewBitmap(R.id.next_btn, context.resources.getColoredBitmap(com.simplemobiletools.commons.R.drawable.ic_next_vector, widgetTextColor))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class NotificationHelper(private val context: Context) {
|
|||
|
||||
fun createNoPermissionNotification(): Notification {
|
||||
return NotificationCompat.Builder(context, NOTIFICATION_CHANNEL)
|
||||
.setContentTitle(context.getString(R.string.no_storage_permissions))
|
||||
.setContentTitle(context.getString(com.simplemobiletools.commons.R.string.no_storage_permissions))
|
||||
.setSmallIcon(R.drawable.ic_headset_small)
|
||||
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
||||
.setPriority(NotificationCompat.PRIORITY_MAX)
|
||||
|
@ -34,7 +34,7 @@ class NotificationHelper(private val context: Context) {
|
|||
}
|
||||
|
||||
fun createMediaScannerNotification(contentText: String, progress: Int, max: Int): Notification {
|
||||
val title = context.getString(R.string.scanning)
|
||||
val title = context.getString(com.simplemobiletools.commons.R.string.scanning)
|
||||
return NotificationCompat.Builder(context, NOTIFICATION_CHANNEL)
|
||||
.setContentTitle(title)
|
||||
.setSmallIcon(R.drawable.ic_headset_small)
|
||||
|
|
|
@ -71,7 +71,7 @@ class SimpleMediaScanner(private val context: Application) {
|
|||
} catch (ignored: Exception) {
|
||||
} finally {
|
||||
if (showProgress && newTracks.isEmpty()) {
|
||||
context.toast(R.string.no_items_found)
|
||||
context.toast(com.simplemobiletools.commons.R.string.no_items_found)
|
||||
}
|
||||
|
||||
newTracks.clear()
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.content.Context
|
|||
import android.os.Bundle
|
||||
import androidx.media3.session.CommandButton
|
||||
import androidx.media3.session.SessionCommand
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.helpers.PATH
|
||||
|
||||
/**
|
||||
|
@ -32,9 +31,9 @@ internal val customCommands = CustomCommands.values().map { it.sessionCommand }
|
|||
internal fun Context.getCustomLayout(): List<CommandButton> {
|
||||
return listOf(
|
||||
CommandButton.Builder()
|
||||
.setDisplayName(getString(R.string.close))
|
||||
.setDisplayName(getString(com.simplemobiletools.commons.R.string.close))
|
||||
.setSessionCommand(CustomCommands.CLOSE_PLAYER.sessionCommand)
|
||||
.setIconResId(R.drawable.ic_cross_vector)
|
||||
.setIconResId(com.simplemobiletools.commons.R.drawable.ic_cross_vector)
|
||||
.build()
|
||||
)
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import androidx.media3.common.util.UnstableApi
|
|||
import androidx.media3.session.*
|
||||
import com.simplemobiletools.commons.extensions.hasPermission
|
||||
import com.simplemobiletools.commons.extensions.showErrorToast
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.extensions.*
|
||||
import com.simplemobiletools.musicplayer.helpers.NotificationHelper
|
||||
import com.simplemobiletools.musicplayer.helpers.getPermissionToRequest
|
||||
|
@ -92,7 +91,7 @@ class PlaybackService : MediaLibraryService(), MediaSessionService.Listener {
|
|||
* background.
|
||||
*/
|
||||
override fun onForegroundServiceStartNotAllowedException() {
|
||||
showErrorToast(getString(R.string.unknown_error_occurred))
|
||||
showErrorToast(getString(com.simplemobiletools.commons.R.string.unknown_error_occurred))
|
||||
// todo: show a notification instead.
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import androidx.media3.common.util.UnstableApi
|
|||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.helpers.EQUALIZER_PRESET_CUSTOM
|
||||
import com.simplemobiletools.musicplayer.playback.player.SimpleMusicPlayer
|
||||
|
@ -39,7 +38,7 @@ object SimpleEqualizer {
|
|||
}
|
||||
}
|
||||
} catch (ignored: Exception) {
|
||||
context.toast(R.string.unknown_error_occurred)
|
||||
context.toast(com.simplemobiletools.commons.R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -155,7 +155,11 @@ internal class MediaItemProvider(private val context: Context) {
|
|||
state = STATE_INITIALIZING
|
||||
|
||||
ensureBackgroundThread {
|
||||
val root = buildMediaItem(title = context.getString(R.string.root), mediaId = SMP_ROOT_ID, mediaType = MediaMetadata.MEDIA_TYPE_FOLDER_MIXED)
|
||||
val root = buildMediaItem(
|
||||
title = context.getString(com.simplemobiletools.commons.R.string.root),
|
||||
mediaId = SMP_ROOT_ID,
|
||||
mediaType = MediaMetadata.MEDIA_TYPE_FOLDER_MIXED
|
||||
)
|
||||
val rootChildren = RootCategories.buildRootChildren(context)
|
||||
addNodeAndChildren(item = root, children = rootChildren)
|
||||
|
||||
|
@ -233,7 +237,7 @@ internal class MediaItemProvider(private val context: Context) {
|
|||
private enum class RootCategories(@StringRes val titleRes: Int, @DrawableRes val drawableRes: Int, val mediaId: String, val mediaType: @MediaType Int) {
|
||||
PLAYLISTS(R.string.playlists, R.drawable.ic_playlist_vector, SMP_PLAYLISTS_ROOT_ID, MediaMetadata.MEDIA_TYPE_FOLDER_PLAYLISTS),
|
||||
FOLDERS(R.string.folders, R.drawable.ic_folders_vector, SMP_FOLDERS_ROOT_ID, MediaMetadata.MEDIA_TYPE_FOLDER_PLAYLISTS),
|
||||
ARTISTS(R.string.artists, R.drawable.ic_person_vector, SMP_ARTISTS_ROOT_ID, MediaMetadata.MEDIA_TYPE_FOLDER_ARTISTS),
|
||||
ARTISTS(R.string.artists, com.simplemobiletools.commons.R.drawable.ic_person_vector, SMP_ARTISTS_ROOT_ID, MediaMetadata.MEDIA_TYPE_FOLDER_ARTISTS),
|
||||
ALBUMS(R.string.albums, R.drawable.ic_album_vector, SMP_ALBUMS_ROOT_ID, MediaMetadata.MEDIA_TYPE_FOLDER_ALBUMS),
|
||||
TRACKS(R.string.tracks, R.drawable.ic_music_note_vector, SMP_TRACKS_ROOT_ID, MediaMetadata.MEDIA_TYPE_PLAYLIST),
|
||||
GENRES(R.string.genres, R.drawable.ic_genre_vector, SMP_GENRES_ROOT_ID, MediaMetadata.MEDIA_TYPE_FOLDER_GENRES);
|
||||
|
|
|
@ -6,7 +6,6 @@ import androidx.media3.common.PlaybackException
|
|||
import androidx.media3.common.Player
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.extensions.getPlaybackSetting
|
||||
import com.simplemobiletools.musicplayer.helpers.PlaybackSetting
|
||||
|
@ -15,7 +14,7 @@ import com.simplemobiletools.musicplayer.playback.PlaybackService
|
|||
@UnstableApi
|
||||
internal fun PlaybackService.getPlayerListener() = object : Player.Listener {
|
||||
|
||||
override fun onPlayerError(error: PlaybackException) = toast(R.string.unknown_error_occurred, Toast.LENGTH_LONG)
|
||||
override fun onPlayerError(error: PlaybackException) = toast(com.simplemobiletools.commons.R.string.unknown_error_occurred, Toast.LENGTH_LONG)
|
||||
|
||||
override fun onEvents(player: Player, events: Player.Events) {
|
||||
if (
|
||||
|
|
|
@ -48,7 +48,7 @@ class CurrentTrackBar(context: Context, attributeSet: AttributeSet) : RelativeLa
|
|||
|
||||
@SuppressLint("SetTextI18n")
|
||||
binding.currentTrackLabel.text = "${track.title}$artist"
|
||||
val cornerRadius = resources.getDimension(R.dimen.rounded_corner_radius_small).toInt()
|
||||
val cornerRadius = resources.getDimension(com.simplemobiletools.commons.R.dimen.rounded_corner_radius_small).toInt()
|
||||
val currentTrackPlaceholder = resources.getColoredDrawableWithColor(R.drawable.ic_headset, context.getProperTextColor())
|
||||
val options = RequestOptions()
|
||||
.error(currentTrackPlaceholder)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
org.gradle.jvmargs=-Xmx8192m
|
||||
android.nonTransitiveRClass=false
|
||||
|
|
Loading…
Reference in a new issue