Suppress deprecations

This commit is contained in:
Prathamesh More 2022-05-16 13:37:32 +05:30
parent ebd35bf026
commit 28d83d9437
5 changed files with 12 additions and 4 deletions

View file

@ -275,7 +275,7 @@ class CirclePlayerFragment : AbsPlayerFragment(R.layout.fragment_circle_player),
} }
override fun onProgressChanged(seekBar: CircularSeekBar?, progress: Float, fromUser: Boolean) { override fun onProgressChanged(circularSeekBar: CircularSeekBar?, progress: Float, fromUser: Boolean) {
val audioManager = audioManager val audioManager = audioManager
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress.toInt(), 0) audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress.toInt(), 0)
} }
@ -286,7 +286,7 @@ class CirclePlayerFragment : AbsPlayerFragment(R.layout.fragment_circle_player),
override fun onStopTrackingTouch(seekBar: CircularSeekBar?) { override fun onStopTrackingTouch(seekBar: CircularSeekBar?) {
} }
fun setUpProgressSlider() { private fun setUpProgressSlider() {
binding.progressSlider.applyColor(accentColor()) binding.progressSlider.applyColor(accentColor())
binding.progressSlider.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() { binding.progressSlider.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() {
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {

View file

@ -15,6 +15,7 @@
package code.name.monkey.retromusic.helper package code.name.monkey.retromusic.helper
import android.os.Handler import android.os.Handler
import android.os.Looper
import android.os.Message import android.os.Message
import kotlin.math.max import kotlin.math.max
@ -32,13 +33,17 @@ class MusicProgressViewUpdateHelper : Handler {
removeMessages(CMD_REFRESH_PROGRESS_VIEWS) removeMessages(CMD_REFRESH_PROGRESS_VIEWS)
} }
constructor(callback: Callback) { constructor(callback: Callback) : super(Looper.getMainLooper()) {
this.callback = callback this.callback = callback
this.intervalPlaying = UPDATE_INTERVAL_PLAYING this.intervalPlaying = UPDATE_INTERVAL_PLAYING
this.intervalPaused = UPDATE_INTERVAL_PAUSED this.intervalPaused = UPDATE_INTERVAL_PAUSED
} }
constructor(callback: Callback, intervalPlaying: Int, intervalPaused: Int) { constructor(
callback: Callback,
intervalPlaying: Int,
intervalPaused: Int,
) : super(Looper.getMainLooper()) {
this.callback = callback this.callback = callback
this.intervalPlaying = intervalPlaying this.intervalPlaying = intervalPlaying
this.intervalPaused = intervalPaused this.intervalPaused = intervalPaused

View file

@ -42,6 +42,7 @@ import kotlin.math.abs
* 歌词 Created by wcy on 2015/11/9. * 歌词 Created by wcy on 2015/11/9.
*/ */
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
@Suppress("deprecation")
class CoverLrcView @JvmOverloads constructor( class CoverLrcView @JvmOverloads constructor(
context: Context?, context: Context?,
attrs: AttributeSet? = null, attrs: AttributeSet? = null,

View file

@ -205,6 +205,7 @@ class PackageValidator(
* If the app is not found, or if the app does not have exactly one signature, this method * If the app is not found, or if the app does not have exactly one signature, this method
* returns `null` as the signature. * returns `null` as the signature.
*/ */
@Suppress("deprecation")
private fun getSignature(packageInfo: PackageInfo): String? { private fun getSignature(packageInfo: PackageInfo): String? {
// Security best practices dictate that an app should be signed with exactly one (1) // Security best practices dictate that an app should be signed with exactly one (1)
// signature. Because of this, if there are multiple signatures, reject it. // signature. Because of this, if there are multiple signatures, reject it.

View file

@ -336,6 +336,7 @@ object PreferenceUtil {
val isLockScreen get() = sharedPreferences.getBoolean(LOCK_SCREEN, false) val isLockScreen get() = sharedPreferences.getBoolean(LOCK_SCREEN, false)
@Suppress("deprecation")
fun isAllowedToDownloadMetadata(context: Context): Boolean { fun isAllowedToDownloadMetadata(context: Context): Boolean {
return when (autoDownloadImagesPolicy) { return when (autoDownloadImagesPolicy) {
"always" -> true "always" -> true