Text corrections

This commit is contained in:
h4h13 2020-02-01 23:23:26 +05:30
parent f6ff0f6565
commit c35d86bfd6
28 changed files with 260 additions and 248 deletions

View file

@ -129,10 +129,10 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.fragment:fragment:1.2.0-rc04'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'androidx.fragment:fragment:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.0-alpha03'
implementation 'com.google.android.material:material:1.2.0-alpha04'
implementation 'com.google.android.play:core:1.6.4'
def retrofit_version = "2.6.2"

View file

@ -230,20 +230,22 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
}
override fun aboutAlbum(lastFmAlbum: LastFmAlbum) {
if (lastFmAlbum.album.wiki != null) {
aboutAlbumText.show()
aboutAlbumTitle.show()
aboutAlbumTitle.text = String.format("About %s", lastFmAlbum.album.name)
aboutAlbumText.text = lastFmAlbum.album.wiki.content
}
if (lastFmAlbum.album.listeners.isNotEmpty()) {
listeners.show()
listenersLabel.show()
scrobbles.show()
scrobblesLabel.show()
if (lastFmAlbum.album != null) {
if (lastFmAlbum.album.wiki != null) {
aboutAlbumText.show()
aboutAlbumTitle.show()
aboutAlbumTitle.text = String.format("About %s", lastFmAlbum.album.name)
aboutAlbumText.text = lastFmAlbum.album.wiki.content
}
if (lastFmAlbum.album.listeners.isNotEmpty()) {
listeners.show()
listenersLabel.show()
scrobbles.show()
scrobblesLabel.show()
listeners.text = RetroUtil.formatValue(lastFmAlbum.album.listeners.toFloat())
scrobbles.text = RetroUtil.formatValue(lastFmAlbum.album.playcount.toFloat())
listeners.text = RetroUtil.formatValue(lastFmAlbum.album.listeners.toFloat())
scrobbles.text = RetroUtil.formatValue(lastFmAlbum.album.playcount.toFloat())
}
}
}

View file

@ -26,8 +26,7 @@ import code.name.monkey.retromusic.util.PreferenceUtil
import com.afollestad.materialdialogs.LayoutMode
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
import java.util.*
import java.util.ArrayList
class DeletePlaylistDialog : DialogFragment() {
@ -45,18 +44,18 @@ class DeletePlaylistDialog : DialogFragment() {
}
return MaterialDialog(requireContext(), BottomSheet(LayoutMode.WRAP_CONTENT))
.show {
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
title(title)
message(text = content)
negativeButton(android.R.string.cancel)
positiveButton(R.string.action_delete) {
if (activity == null)
return@positiveButton
PlaylistsUtil.deletePlaylists(activity!!, playlists)
}
negativeButton(android.R.string.cancel)
.show {
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
title(title)
message(text = content)
negativeButton(android.R.string.cancel)
positiveButton(R.string.action_delete) {
if (activity == null)
return@positiveButton
PlaylistsUtil.deletePlaylists(activity!!, playlists)
}
negativeButton(android.R.string.cancel)
}
}
companion object {
@ -75,5 +74,4 @@ class DeletePlaylistDialog : DialogFragment() {
return dialog
}
}
}

View file

@ -19,6 +19,7 @@ import android.os.Bundle
import android.text.Html
import androidx.fragment.app.DialogFragment
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.R.string
import code.name.monkey.retromusic.model.PlaylistSong
import code.name.monkey.retromusic.util.PlaylistsUtil
import code.name.monkey.retromusic.util.PreferenceUtil
@ -26,7 +27,6 @@ import com.afollestad.materialdialogs.LayoutMode
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
class RemoveFromPlaylistDialog : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
@ -37,27 +37,31 @@ class RemoveFromPlaylistDialog : DialogFragment() {
if (songs != null) {
if (songs.size > 1) {
title = R.string.remove_songs_from_playlist_title
content = Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_x_songs_from_playlist, songs.size))
content = Html.fromHtml(getString(string.remove_x_songs_from_playlist, songs.size))
} else {
title = R.string.remove_song_from_playlist_title
content = Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_song_x_from_playlist, songs[0].title))
content = Html.fromHtml(
getString(
code.name.monkey.retromusic.R.string.remove_song_x_from_playlist,
songs[0].title
)
)
}
}
return MaterialDialog(requireContext(), BottomSheet(LayoutMode.WRAP_CONTENT))
.show {
title(title)
message(text = content)
negativeButton(android.R.string.cancel)
positiveButton(R.string.remove_action) {
if (activity == null)
return@positiveButton
PlaylistsUtil.removeFromPlaylist(activity!!, songs as MutableList<PlaylistSong>)
}
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
.show {
title(title)
message(text = content)
negativeButton(android.R.string.cancel)
positiveButton(R.string.remove_action) {
if (activity == null)
return@positiveButton
PlaylistsUtil.removeFromPlaylist(activity!!, songs as MutableList<PlaylistSong>)
}
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
}
}
companion object {

View file

@ -34,25 +34,24 @@ import com.afollestad.materialdialogs.customview.getCustomView
import com.google.android.material.textfield.TextInputEditText
import com.google.android.material.textfield.TextInputLayout
class RenamePlaylistDialog : DialogFragment() {
private lateinit var playlistView: TextInputEditText
private lateinit var actionNewPlaylistContainer: TextInputLayout
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val materialDialog = MaterialDialog(requireContext(), BottomSheet(LayoutMode.WRAP_CONTENT))
.show {
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
title(string.rename_playlist_title)
customView(layout.dialog_playlist)
negativeButton(android.R.string.cancel)
positiveButton(string.action_rename) {
if (playlistView.toString().trim { it <= ' ' } != "") {
val playlistId = arguments!!.getLong(PLAYLIST_ID)
PlaylistsUtil.renamePlaylist(context, playlistId, playlistView.text!!.toString())
}
.show {
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
title(string.rename_playlist_title)
customView(layout.dialog_playlist)
negativeButton(android.R.string.cancel)
positiveButton(string.action_rename) {
if (playlistView.toString().trim { it <= ' ' } != "") {
val playlistId = arguments!!.getLong(PLAYLIST_ID)
PlaylistsUtil.renamePlaylist(context, playlistId, playlistView.text!!.toString())
}
}
}
val dialogView = materialDialog.getCustomView()
playlistView = dialogView.findViewById(R.id.actionNewPlaylist)
@ -61,7 +60,8 @@ class RenamePlaylistDialog : DialogFragment() {
MaterialUtil.setTint(actionNewPlaylistContainer, false)
val playlistId = arguments!!.getLong(PLAYLIST_ID)
playlistView.appHandleColor().setText(PlaylistsUtil.getNameForPlaylist(context!!, playlistId), TextView.BufferType.EDITABLE)
playlistView.appHandleColor()
.setText(PlaylistsUtil.getNameForPlaylist(context!!, playlistId), TextView.BufferType.EDITABLE)
return materialDialog
}

View file

@ -46,7 +46,6 @@ import com.afollestad.materialdialogs.callbacks.onShow
import com.afollestad.materialdialogs.customview.customView
import com.afollestad.materialdialogs.customview.getCustomView
class SleepTimerDialog : DialogFragment() {
private var seekArcProgress: Int = 0
@ -60,48 +59,61 @@ class SleepTimerDialog : DialogFragment() {
timerUpdater = TimerUpdater()
materialDialog = MaterialDialog(requireContext(), BottomSheet(LayoutMode.WRAP_CONTENT))
.title(R.string.action_sleep_timer)
.cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
.positiveButton(R.string.action_set) {
PreferenceUtil.getInstance(requireContext()).sleepTimerFinishMusic = shouldFinishLastSong.isChecked
.title(R.string.action_sleep_timer)
.cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
.positiveButton(R.string.action_set) {
PreferenceUtil.getInstance(requireContext()).sleepTimerFinishMusic = shouldFinishLastSong.isChecked
val minutes = seekArcProgress
val minutes = seekArcProgress
val pi = makeTimerPendingIntent(PendingIntent.FLAG_CANCEL_CURRENT)
val pi = makeTimerPendingIntent(PendingIntent.FLAG_CANCEL_CURRENT)
val nextSleepTimerElapsedTime = SystemClock.elapsedRealtime() + minutes * 60 * 1000
PreferenceUtil.getInstance(requireContext()).setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime)
val nextSleepTimerElapsedTime = SystemClock.elapsedRealtime() + minutes * 60 * 1000
PreferenceUtil.getInstance(requireContext())
.setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime)
val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager
am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextSleepTimerElapsedTime, pi)
Toast.makeText(
activity,
activity!!.resources.getString(R.string.sleep_timer_set, minutes),
Toast.LENGTH_SHORT
).show()
}
.negativeButton(android.R.string.cancel) {
if (activity == null) {
return@negativeButton
}
val previous = makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE)
if (previous != null) {
val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager
am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextSleepTimerElapsedTime, pi)
am.cancel(previous)
previous.cancel()
Toast.makeText(
activity,
activity!!.resources.getString(R.string.sleep_timer_canceled),
Toast.LENGTH_SHORT
).show()
}
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_set, minutes), Toast.LENGTH_SHORT).show()
val musicService = MusicPlayerRemote.musicService
if (musicService != null && musicService.pendingQuit) {
musicService.pendingQuit = false
Toast.makeText(
activity,
activity!!.resources.getString(R.string.sleep_timer_canceled),
Toast.LENGTH_SHORT
).show()
}
.negativeButton(android.R.string.cancel) {
if (activity == null) {
return@negativeButton
}
val previous = makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE)
if (previous != null) {
val am = activity!!.getSystemService(Context.ALARM_SERVICE) as AlarmManager
am.cancel(previous)
previous.cancel()
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_canceled), Toast.LENGTH_SHORT).show()
}
val musicService = MusicPlayerRemote.musicService
if (musicService != null && musicService.pendingQuit) {
musicService.pendingQuit = false
Toast.makeText(activity, activity!!.resources.getString(R.string.sleep_timer_canceled), Toast.LENGTH_SHORT).show()
}
}
.customView(R.layout.dialog_sleep_timer, scrollable = false)
.show {
onShow {
if (makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE) != null) {
timerUpdater.start()
}
}
.customView(R.layout.dialog_sleep_timer, scrollable = false)
.show {
onShow {
if (makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE) != null) {
timerUpdater.start()
}
}
}
if (activity == null || materialDialog.getCustomView() == null) {
return materialDialog
@ -133,7 +145,6 @@ class SleepTimerDialog : DialogFragment() {
}
override fun onStartTrackingTouch(seekBar: SeekBar) {
}
override fun onStopTrackingTouch(seekBar: SeekBar) {
@ -148,7 +159,6 @@ class SleepTimerDialog : DialogFragment() {
timerDisplay.text = "$seekArcProgress min"
}
private fun makeTimerPendingIntent(flag: Int): PendingIntent? {
return PendingIntent.getService(activity, 0, makeTimerIntent(), flag)
}
@ -160,22 +170,27 @@ class SleepTimerDialog : DialogFragment() {
} else intent.setAction(ACTION_QUIT)
}
private fun updateCancelButton() {
val musicService = MusicPlayerRemote.musicService
if (musicService != null && musicService.pendingQuit) {
materialDialog.getActionButton(WhichButton.NEGATIVE).text = materialDialog.context.getString(R.string.cancel_current_timer)
materialDialog.getActionButton(WhichButton.NEGATIVE).text =
materialDialog.context.getString(R.string.cancel_current_timer)
} else {
materialDialog.getActionButton(WhichButton.NEGATIVE).text = null
}
}
private inner class TimerUpdater internal constructor() : CountDownTimer(PreferenceUtil.getInstance(requireContext()).nextSleepTimerElapsedRealTime - SystemClock.elapsedRealtime(), 1000) {
private inner class TimerUpdater internal constructor() : CountDownTimer(
PreferenceUtil.getInstance(requireContext()).nextSleepTimerElapsedRealTime - SystemClock.elapsedRealtime(),
1000
) {
override fun onTick(millisUntilFinished: Long) {
materialDialog.getActionButton(WhichButton.NEGATIVE).text =
String.format("%s %s", materialDialog.context.getString(R.string.cancel_current_timer),
" (" + MusicUtil.getReadableDurationString(millisUntilFinished) + ")")
String.format(
"%s %s", materialDialog.context.getString(R.string.cancel_current_timer),
" (" + MusicUtil.getReadableDurationString(millisUntilFinished) + ")"
)
}
override fun onFinish() {

View file

@ -43,7 +43,6 @@ import org.jaudiotagger.tag.TagException
import java.io.File
import java.io.IOException
inline fun ViewGroup.forEach(action: (View) -> Unit) {
for (i in 0 until childCount) {
action(getChildAt(i))
@ -57,13 +56,15 @@ class SongDetailDialog : DialogFragment() {
val song = arguments!!.getParcelable<Song>("song")
val materialDialog = MaterialDialog(requireContext(), BottomSheet(LayoutMode.WRAP_CONTENT))
.show {
customView(R.layout.dialog_file_details,
scrollable = true)
positiveButton(android.R.string.ok)
title(string.action_details)
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
}
.show {
customView(
R.layout.dialog_file_details,
scrollable = true
)
positiveButton(android.R.string.ok)
title(string.action_details)
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
}
val dialogView = materialDialog.getCustomView()
val fileName: TextView = dialogView.findViewById(R.id.fileName)
@ -86,37 +87,66 @@ class SongDetailDialog : DialogFragment() {
if (songFile.exists()) {
fileName.text = makeTextWithTitle(context, string.label_file_name, songFile.name)
filePath.text = makeTextWithTitle(context, string.label_file_path, songFile.absolutePath)
fileSize.text = makeTextWithTitle(context, string.label_file_size, getFileSizeString(songFile.length()))
fileSize.text =
makeTextWithTitle(context, string.label_file_size, getFileSizeString(songFile.length()))
try {
val audioFile = AudioFileIO.read(songFile)
val audioHeader = audioFile.audioHeader
fileFormat.text = makeTextWithTitle(context, string.label_file_format, audioHeader.format)
trackLength.text = makeTextWithTitle(context, string.label_track_length, MusicUtil.getReadableDurationString((audioHeader.trackLength * 1000).toLong()))
trackLength.text = makeTextWithTitle(
context,
string.label_track_length,
MusicUtil.getReadableDurationString((audioHeader.trackLength * 1000).toLong())
)
bitRate.text = makeTextWithTitle(context, string.label_bit_rate, audioHeader.bitRate + " kb/s")
samplingRate.text = makeTextWithTitle(context, string.label_sampling_rate, audioHeader.sampleRate + " Hz")
samplingRate.text =
makeTextWithTitle(context, string.label_sampling_rate, audioHeader.sampleRate + " Hz")
} catch (@NonNull e: CannotReadException) {
Log.e(TAG, "error while reading the song file", e)
// fallback
trackLength.text = makeTextWithTitle(context, string.label_track_length, MusicUtil.getReadableDurationString(song.duration))
trackLength.text = makeTextWithTitle(
context,
string.label_track_length,
MusicUtil.getReadableDurationString(song.duration)
)
} catch (@NonNull e: IOException) {
Log.e(TAG, "error while reading the song file", e)
trackLength.text = makeTextWithTitle(context, string.label_track_length, MusicUtil.getReadableDurationString(song.duration))
trackLength.text = makeTextWithTitle(
context,
string.label_track_length,
MusicUtil.getReadableDurationString(song.duration)
)
} catch (@NonNull e: TagException) {
Log.e(TAG, "error while reading the song file", e)
trackLength.text = makeTextWithTitle(context, string.label_track_length, MusicUtil.getReadableDurationString(song.duration))
trackLength.text = makeTextWithTitle(
context,
string.label_track_length,
MusicUtil.getReadableDurationString(song.duration)
)
} catch (@NonNull e: ReadOnlyFileException) {
Log.e(TAG, "error while reading the song file", e)
trackLength.text = makeTextWithTitle(context, string.label_track_length, MusicUtil.getReadableDurationString(song.duration))
trackLength.text = makeTextWithTitle(
context,
string.label_track_length,
MusicUtil.getReadableDurationString(song.duration)
)
} catch (@NonNull e: InvalidAudioFrameException) {
Log.e(TAG, "error while reading the song file", e)
trackLength.text = makeTextWithTitle(context, string.label_track_length, MusicUtil.getReadableDurationString(song.duration))
trackLength.text = makeTextWithTitle(
context,
string.label_track_length,
MusicUtil.getReadableDurationString(song.duration)
)
}
} else {
// fallback
fileName.text = makeTextWithTitle(context, string.label_file_name, song.title)
trackLength.text = makeTextWithTitle(context, string.label_track_length, MusicUtil.getReadableDurationString(song.duration))
trackLength.text = makeTextWithTitle(
context,
string.label_track_length,
MusicUtil.getReadableDurationString(song.duration)
)
}
}
@ -127,7 +157,6 @@ class SongDetailDialog : DialogFragment() {
val TAG: String = SongDetailDialog::class.java.simpleName
fun create(song: Song): SongDetailDialog {
val dialog = SongDetailDialog()
val args = Bundle()

View file

@ -27,35 +27,45 @@ import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
import com.afollestad.materialdialogs.list.listItems
class SongShareDialog : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val song: Song? = arguments!!.getParcelable("song")
val currentlyListening: String = getString(R.string.currently_listening_to_x_by_x, song?.title, song?.artistName)
val currentlyListening: String =
getString(R.string.currently_listening_to_x_by_x, song?.title, song?.artistName)
return MaterialDialog(requireContext(), BottomSheet(LayoutMode.WRAP_CONTENT))
.title(R.string.what_do_you_want_to_share)
.show {
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
listItems(items = listOf(getString(code.name.monkey.retromusic.R.string.the_audio_file), "\u201C" + currentlyListening + "\u201D")) { dialog, index, text ->
when (index) {
0 -> {
startActivity(Intent.createChooser(song?.let { MusicUtil.createShareSongFileIntent(it, context) }, null))
}
1 -> {
activity!!.startActivity(
Intent.createChooser(
Intent()
.setAction(Intent.ACTION_SEND)
.putExtra(Intent.EXTRA_TEXT, currentlyListening)
.setType("text/plain"),
null
)
.title(R.string.what_do_you_want_to_share)
.show {
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
listItems(
items = listOf(
getString(code.name.monkey.retromusic.R.string.the_audio_file),
"\u201C" + currentlyListening + "\u201D"
)
) { _, index, _ ->
when (index) {
0 -> {
startActivity(Intent.createChooser(song?.let {
MusicUtil.createShareSongFileIntent(
it,
context
)
}
}, null))
}
1 -> {
activity!!.startActivity(
Intent.createChooser(
Intent()
.setAction(Intent.ACTION_SEND)
.putExtra(Intent.EXTRA_TEXT, currentlyListening)
.setType("text/plain"),
null
)
)
}
}
}
}
}
companion object {

View file

@ -129,7 +129,7 @@ public class PlaylistsUtil {
}
}
public static boolean doPlaylistContains(@NonNull final Context context, final long playlistId,
static boolean doPlaylistContains(@NonNull final Context context, final long playlistId,
final int songId) {
if (playlistId != -1) {
try {
@ -156,12 +156,6 @@ public class PlaylistsUtil {
new String[]{String.valueOf(playlistId)});
}
public static boolean doesPlaylistExist(@NonNull final Context context, final String name) {
return doesPlaylistExist(context,
MediaStore.Audio.PlaylistsColumns.NAME + "=?",
new String[]{name});
}
public static String getNameForPlaylist(@NonNull final Context context, final long id) {
try {
Cursor cursor = context.getContentResolver().query(EXTERNAL_CONTENT_URI,

View file

@ -23,24 +23,20 @@ import com.google.android.material.card.MaterialCardView
* Created by hemanths on 3/18/19
*/
class WidthFitSquareCardView : MaterialCardView {
constructor(context: Context) : super(context) {}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
constructor(
context: Context,
attrs: AttributeSet
) : super(context, attrs)
fun forceSquare(z: Boolean) {
this.forceSquare = z
requestLayout()
constructor(
context: Context, attrs:
AttributeSet, defStyleAttr: Int
) : super(context, attrs, defStyleAttr)
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, widthMeasureSpec)
}
override fun onMeasure(i: Int, i2: Int) {
var width = i2
if (this.forceSquare) {
width = i
}
super.onMeasure(i, width)
}
private var forceSquare = true
}

View file

@ -1,48 +0,0 @@
/*
* Copyright (c) 2019 Hemanth Savarala.
*
* Licensed under the GNU General Public License v3
*
* This is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
package code.name.monkey.retromusic.views;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
public class WidthFitSquareLayout extends FrameLayout {
public WidthFitSquareLayout(@NonNull final Context context) {
super(context);
}
public WidthFitSquareLayout(@NonNull final Context context, @Nullable final AttributeSet attrs) {
super(context, attrs);
}
public WidthFitSquareLayout(@NonNull final Context context, @Nullable final AttributeSet attrs,
final int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public WidthFitSquareLayout(@NonNull final Context context, @Nullable final AttributeSet attrs,
final int defStyleAttr,
final int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, widthMeasureSpec);
}
}

View file

@ -0,0 +1,37 @@
/*
* Copyright (c) 2019 Hemanth Savarala.
*
* Licensed under the GNU General Public License v3
*
* This is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
package code.name.monkey.retromusic.views
import android.content.Context
import android.util.AttributeSet
import android.widget.FrameLayout
class WidthFitSquareLayout : FrameLayout {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(
context: Context, attrs: AttributeSet?,
defStyleAttr: Int
) : super(context, attrs, defStyleAttr)
constructor(
context: Context, attrs: AttributeSet?,
defStyleAttr: Int,
defStyleRes: Int
) : super(context, attrs, defStyleAttr, defStyleRes)
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, widthMeasureSpec)
}
}

View file

@ -55,8 +55,7 @@
<string name="albums">الألبومات</string>
<!-- Android Auto -->
<string name="always">دائما</string>
<string name="app_share">مرحبا القي نظرة على مشغل الموسيقى الرائع هذا في:
https://play.google.com/store/apps/details?id=%s</string>
<string name="app_share">مرحبا القي نظرة على مشغل الموسيقى الرائع هذا في: https://play.google.com/store/apps/details?id=%s</string>
<!-- App Shortcuts -->
<string name="app_shortcut_shuffle_all_short">عشوائي</string>
<string name="app_shortcut_top_tracks_short">المسارات الاكثر شعبية</string>
@ -92,13 +91,10 @@ https://play.google.com/store/apps/details?id=%s</string>
<string name="clear_action">إزالة</string>
<string name="clear_blacklist">إزالة القائمة السوداء</string>
<string name="clear_playlist_title">إزالة قائمة التشغيل</string>
<string name="clear_playlist_x"><![CDATA[\u0625\u0632\u0627\u0644\u0629 \u0645\u0646 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u062a\u0634\u063a\u064a\u0644 <b>%1$s</b>\u061f \u0644\u0627 \u064a\u0645\u0643\u0646 \u0627\u0644\u0642\u064a\u0627\u0645 \u0628\u0630\u0644\u0643!]]></string>
<string name="close_notification">اغلاق</string>
<string name="color">لون</string>
<string name="color_theme_name">لون</string>
<string name="colors">الوان</string>
<string name="could_not_create_playlist">\u0644\u0627\u064a\u0645\u0643\u0646 \u0625\u0646\u0634\u0627\u0621 \u0642\u0627\u0626\u0645\u0629 \u062a\u0634\u063a\u064a\u0644</string>
<string name="could_not_download_album_cover">"\u0644\u0627\u064a\u0645\u0643\u0646 \u062a\u0646\u0632\u064a\u0644 \u063a\u0644\u0627\u0641 \u0627\u0644\u0628\u0648\u0645 \u0645\u062a\u0637\u0627\u0628\u0642."</string>
<string name="could_not_restore_purchase">لايمكن إسترجاع المشتريات</string>
<string name="could_not_scan_files">لايمكن فحص الملفات %d</string>
<string name="create_action">إنشاء</string>
@ -222,7 +218,6 @@ https://play.google.com/store/apps/details?id=%s</string>
<string name="pref_summary_colored_app">تتغير ألوان أزرار الخلفية والتحكم وفقًا لصورة الألبوم من شاشة التشغيل الآن</string>
<string name="pref_summary_colored_app_shortcuts">تلوين اختصارات التطبيق باللون الثانوي . في كل مرة تقوم فيها بتغيير اللون ، يرجى تفعيل هذا الخيار ليتم تطبيق التغييرات</string>
<string name="pref_summary_colored_navigation_bar">تلوين شريط التنقل باللون الاساسي</string>
<string name="pref_summary_colored_notification">"\u062a\u0644\u0648\u064a\u0646 \u0627\u0644\u0625\u0634\u0639\u0627\u0631\u0627\u062a \u0628\u0644\u0648\u0646 \u063a\u0644\u0627\u0641 \u0627\u0644\u0623\u0644\u0628\u0648\u0645 \u0627\u0644\u0648\u0627\u0646 \u0646\u0627\u0628\u0636\u0629"</string>
<string name="pref_summary_dominant_color">سيتم اختيار اللون الأكثر انتشارًا من الألبوم أو غلاف الفنان</string>
<string name="pref_summary_gapless_playback">"يمكن أن يسبب مشاكل في التشغيل على بعض الأجهزة."</string>
<string name="pref_summary_ignore_media_store_artwork">يمكنك أن تزيد من جودة غلاف الألبوم ، لكنه يسبب بطئ في التحميل للصور. قم بتمكين هذا فقط إذا كنت تواجه مشاكل مع صور ألبومات منخفضة الدقة</string>
@ -355,7 +350,6 @@ https://play.google.com/store/apps/details?id=%s</string>
<string name="translate_community">ساعدها لترجمة التطبيق الى لغتك</string>
<string name="twitter_page">تويتر</string>
<string name="twitter_page_summary">شارك تصميمك مع ريترو ميوزك</string>
<string name="unplayable_file">\u0644\u0627\u064a\u0645\u0643\u0646 \u062a\u0634\u063a\u064a\u0644 \u0647\u0630\u0627 \u0627\u0644\u0645\u0644\u0641.</string>
<string name="up_next">التالي</string>
<string name="update_image">تحديث الصورة</string>
<string name="updating">تحديث...</string>

View file

@ -174,7 +174,6 @@
<string name="clear_playing_queue">Изчисти опашката</string>
<string name="clear_playlist_title">Изчисти плейлист</string>
<string name="clear_playlist_x"><![CDATA[\u0418\u0437\u0447\u0438\u0441\u0442\u0438 \u043f\u043b\u0435\u0439\u043b\u0438\u0441\u0442 <b>%1$s</b>? \u0422\u043e\u0432\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0431\u044a\u0434\u0435 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043e!]]></string>
<string name="close_notification">Затвори</string>
@ -186,8 +185,6 @@
<string name="copied_device_info_to_clipboard">Копирана информация за устройството в клипборда.</string>
<string name="could_not_create_playlist">\u041d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u044a\u0437\u0434\u0430\u0432\u0430\u043d\u0435 \u043d\u0430 \u043f\u043b\u0435\u0439\u043b\u0438\u0441\u0442.</string>
<string name="could_not_download_album_cover">"\u041d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0437\u0442\u0435\u0433\u043b\u044f\u043d\u0435 \u043d\u0430 \u043a\u043e\u0440\u0438\u0446\u0430 \u043d\u0430 \u0430\u043b\u0431\u0443\u043c\u0430."</string>
<string name="could_not_restore_purchase">Неуспешно възстановяване на покупката.</string>
<string name="could_not_scan_files">Неуспешно сканиране на %d файлове.</string>
@ -300,6 +297,8 @@
<string name="label_file_path">Местонахождение на файла</string>
<string name="label_file_size">Размер</string>
<string name="label_more_from">More from %s</string>
<string name="label_sampling_rate">Размер на използване</string>
<string name="label_track_length">Дължина</string>
@ -431,7 +430,6 @@
<string name="pref_now_playing_screen_summary">Натисни за или плъзни за без прозрачна навигация на екрана с песен</string>
<string name="pref_now_playing_screen_title">Натисни или плъзни</string>
<string name="pref_snow_fall_title">Ефект на валящ сняг</string>
<string name="pref_summary_album_art_on_lockscreen">Използвай корицата на настоящата песен като фон на заключен екран</string>
@ -698,5 +696,4 @@
<string name="you_will_be_forwarded_to_the_issue_tracker_website">Ще бъдете препратени към сайта на тракера.</string>
<string name="your_account_data_is_only_used_for_authentication">Данните на акаунта Ви се използват единствено за автентификация.</string>
<string name="label_more_from">More from %s</string>
</resources>

View file

@ -85,7 +85,7 @@
<string name="create_action">Vytvořit</string>
<string name="created_playlist_x">"Vytvořený seznam skladeb "</string>
<string name="created_playlist_x">Vytvořený seznam skladeb %1$s.</string>
<string name="currently_listening_to_x_by_x">Aktuálně posloucháš %1$s od %2$s.</string>
@ -221,7 +221,7 @@
<string name="remove_song_from_playlist_title">Smazat skladbu ze seznamu skladeb</string>
<string name="remove_song_x_from_playlist"><![CDATA[Odstranit skladbu <b>%1$s</b> ze seznamu skladeb?]]></string>
<string name="remove_songs_from_playlist_title">Smazat skladby ze seznamu skladeb</string>
<string name="remove_x_songs_from_playlist"><![CDATA[Odstranit <b>%1$s</b> skladby ze seznamu skladeb?]]></string>
<string name="remove_x_songs_from_playlist"><![CDATA[Odstranit <b>%1$d</b> skladby ze seznamu skladeb?]]></string>
<string name="rename_playlist_title">Přejmenovat seznam skladeb</string>

View file

@ -205,11 +205,10 @@
<string name="create_action">Crear</string>
<string name="created_playlist_x">Lista de reproducción creada.</string>
<string name="created_playlist_x">Lista de reproducción creada %1$s.</string>
<string name="credit_title">Miembros y colaboradores</string>
<string name="currently_listening_to_x_by_x">Estás escuchando a</string>
<string name="dark_theme_name">Algo oscuro</string>
@ -221,11 +220,9 @@
<string name="delete_playlists_title">Eliminar listas de reproducción</string>
<string name="delete_song_title">Eliminar canción</string>
<string name="delete_song_x"><![CDATA[¿Eliminar canción?]]></string>
<string name="delete_songs_title">Eliminar canciones</string>
<string name="delete_x_playlists"><![CDATA[¿Eliminar lista de reproducción?]]></string>
<string name="delete_x_songs"><![CDATA[¿Desea eliminar <b>%1$d</b> canciones?]]></string>
<string name="deleted_x_songs">Se han eliminado %1$d canciones.</string>

View file

@ -125,7 +125,7 @@
<string name="could_not_restore_purchase">A vásárlást nem sikerült visszaállítani.</string>
<string name="could_not_scan_files">Nem sikerült beolvasni %d fájlt.</string>
<string name="create_action">Létrehozás</string>
<string name="created_playlist_x">Létrehozott lejátszási lista %1$s</string>
<string name="created_playlist_x">Létrehozott lejátszási lista %1$s.</string>
<string name="credit_title">Tagok és támogatók</string>
<string name="currently_listening_to_x_by_x">Jelenleg hallgat %1$s által %2$s</string>
<string name="dark_theme_name">Kissé sötét</string>

View file

@ -210,7 +210,6 @@ tetap bermasalah, \"Hapus data Aplikasi\"</string>
<string name="credit_title">Member dan kontribusi</string>
<string name="currently_listening_to_x_by_x">Sedang mendengarkan</string>
<string name="dark_theme_name">Agak gelap</string>

View file

@ -190,7 +190,7 @@ https://play.google.com/store/apps/details?id=%s</string>
<string name="clear_playing_queue">Cancella coda</string>
<string name="clear_playlist_title">Cancella playlist</string>
<string name="clear_playlist_x"><![CDATA[Cancella la playlist <b>% 1 $ s </ b>? Questo non pu\u00f2 essere annullato!]]></string>
<string name="clear_playlist_x"><![CDATA[Cancella la playlist <b>%1$s </ b>? Questo non pu\u00f2 essere annullato!]]></string>
<string name="close_notification">Chiudi</string>
@ -211,7 +211,7 @@ https://play.google.com/store/apps/details?id=%s</string>
<string name="create_action">Crea</string>
<string name="created_playlist_x">Playlist creata</string>
<string name="created_playlist_x">Playlist creata %1$s.</string>
<string name="credit_title">Membri e contributori</string>

View file

@ -182,7 +182,6 @@
<string name="clear_playing_queue">キューを削除</string>
<string name="clear_playlist_title">プレイリストを削除</string>
<string name="clear_playlist_x"><![CDATA[\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8 <b>%1$s</b> \u3092\u524a\u9664\u3057\u307e\u3059\u304b? \u3053\u306e\u64cd\u4f5c\u306f\u5fa9\u5143\u3067\u304d\u307e\u305b\u3093!]]></string>
<string name="close_notification">閉じる</string>

View file

@ -124,7 +124,6 @@
<string name="clear_blacklist">블랙리스트 비우기</string>
<string name="clear_playlist_title">재생목록 비우기</string>
<string name="clear_playlist_x"><![CDATA[<b>%1$s</b> \uc7ac\uc0dd\ubaa9\ub85d\uc744 \ube44\uc6b0\uc2dc\uaca0\uc2b5\ub2c8\uae4c? \uc774 \uc791\uc5c5\uc740 \ucde8\uc18c\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4!]]></string>
<string name="color">색상</string>

View file

@ -184,7 +184,6 @@
<string name="clear_playing_queue">Wyczyść kolejkę</string>
<string name="clear_playlist_title">Wyczyść playlistę</string>
<string name="clear_playlist_x"><![CDATA[Wyczy\u015bci\u0107 playlist\u0119 <b>%1$s</b>? Ta czynno\u015b\u0107 nie mo\u017ce zosta\u0107 cofni\u0119ta!]]></string>
<string name="close_notification">Zamknij</string>

View file

@ -113,7 +113,6 @@
<string name="clear_blacklist">Kara listeyi temizle</string>
<string name="clear_playing_queue">Kuyruğu temizle</string>
<string name="clear_playlist_title">Oynatma listesini temizle</string>
<string name="clear_playlist_x"><![CDATA[<B>% 1 $ s </ b> oynatma listesini temizlemek istedi\u011finizden emin misiniz? Bu i\u015flem kal\u0131c\u0131d\u0131r ve geri al\u0131namaz!]]></string>
<string name="close_notification">Kapat</string>
<string name="color">Renk</string>
<string name="color_theme_name">Renk</string>

View file

@ -184,7 +184,6 @@ tiếp tục xảy ra hãy \"Xóa dữ liệu ứng dụng\"</string>
<string name="clear_playing_queue">Xóa hàng đợi</string>
<string name="clear_playlist_title">Xoá danh sách phát</string>
<string name="clear_playlist_x"><![CDATA[Xo\u00e1 danh s\u00e1ch ph\u00e1t <b>%1$s</b>? Thao t\u00e1c kh\u00f4ng th\u1ec3 ho\u00e0n t\u00e1c!]]></string>
<string name="close_notification">Đóng</string>

View file

@ -181,7 +181,6 @@
<string name="clear_playing_queue">清空队列</string>
<string name="clear_playlist_title">清除播放列表</string>
<string name="clear_playlist_x"><![CDATA[\u786e\u8ba4\u6e05\u9664\u64ad\u653e\u5217\u8868 <b>%1$s</b> \u5417\uff1f\u8bf7\u6ce8\u610f\uff0c\u6b64\u64cd\u4f5c\u4e0d\u53ef\u6062\u590d\uff01]]></string>
<string name="close_notification">关闭</string>
@ -217,10 +216,10 @@
<string name="delete_playlists_title">删除播放列表</string>
<string name="delete_song_x"><![CDATA[删除歌曲<b>1 $ s </ b>吗?]]></string>
<string name="delete_song_x"><![CDATA[删除歌曲<b>1$s</b>吗?]]></string>
<string name="delete_x_playlists"><![CDATA[删除播放列表 <b>%1$s</b> 吗?]]></string>
<string name="delete_x_songs"><![CDATA[删除歌曲 <b>%1$s</b> 吗?]]></string>
<string name="delete_x_playlists"><![CDATA[删除播放列表 <b>%1$d</b> 吗?]]></string>
<string name="delete_x_songs"><![CDATA[删除歌曲 <b>%1$d</b> 吗?]]></string>
<string name="deleted_x_songs">已删除 %1$d 首歌曲</string>
<string name="depth">深度</string>

View file

@ -113,15 +113,12 @@
<string name="clear_blacklist">清除黑名單</string>
<string name="clear_playing_queue">清除列表</string>
<string name="clear_playlist_title">清除播放清單</string>
<string name="clear_playlist_x"><![CDATA[\u8981\u6e05\u9664<b>%1$s</b>\u64ad\u653e\u6e05\u55ae\u55ce?\u8acb\u6ce8\u610f\u9019\u4e0d\u80fd\u5fa9\u539f!]]></string>
<string name="close_notification">關閉</string>
<string name="color">彩色</string>
<string name="color_theme_name">彩色</string>
<string name="colors">色彩</string>
<string name="composer">作曲者</string>
<string name="copied_device_info_to_clipboard">已複製裝置內容到剪貼簿</string>
<string name="could_not_create_playlist">\u7121\u6cd5\u5efa\u7acb\u64ad\u653e\u6e05\u55ae\u3002</string>
<string name="could_not_download_album_cover">"\u7121\u6cd5\u4e0b\u8f09\u5408\u9069\u7684\u5c08\u8f2f\u5716\u7247\u3002"</string>
<string name="could_not_restore_purchase">無法恢復購買狀態。</string>
<string name="could_not_scan_files">無法掃描 %d 個檔案。</string>
<string name="create_action">新增</string>

View file

@ -100,19 +100,16 @@
<string name="clear_action">清空</string>
<string name="clear_playlist_title">清空播放清單</string>
<string name="clear_playlist_x"><![CDATA[\u78ba\u5b9a\u8981\u6e05\u9664\u64ad\u653e\u6e05\u55ae <b>%1$s</b> \u55ce\uff1f\u6b64\u64cd\u4f5c\u662f\u7121\u6cd5\u5fa9\u539f\u7684\uff01]]></string>
<string name="colors">主題顏色</string>
<string name="could_not_create_playlist">\u7121\u6cd5\u65b0\u589e\u64ad\u653e\u6e05\u55ae\u3002</string>
<string name="could_not_download_album_cover">"\u7121\u6cd5\u4e0b\u8f09\u5408\u9069\u7684\u5c08\u8f2f\u5c01\u9762\u3002"</string>
<string name="could_not_scan_files">不能掃描 %d。</string>
<string name="create_action">建立</string>
<string name="created_playlist_x">已新增播放清單 %1$s。</string>
<string name="currently_listening_to_x_by_x">我正在聽 %2$s 的 %1$s </string>
<string name="currently_listening_to_x_by_x">我正在聽 %2$s 的 %1$s</string>
<string name="dark_theme_name">暗沉</string>

View file

@ -5,7 +5,7 @@ android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
@ -27,7 +27,7 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.2.0-alpha01'
implementation 'com.google.android.material:material:1.2.0-alpha04'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
// Used for the list preference classes