shorten onCurrentChanged() to 60 lines to not fail CI LongMethod

Signed-off-by: Holger Müller <github@euhm.de>
This commit is contained in:
Holger Müller 2022-03-21 18:38:27 +01:00
parent c247e930c4
commit 7b750c692c
No known key found for this signature in database
GPG Key ID: 016F07C42F7AC2B1
1 changed files with 5 additions and 15 deletions

View File

@ -995,26 +995,16 @@ class PlayerFragment :
) View.VISIBLE
else View.GONE
var bitRate: String? = null
var bitRate: String = ""
if (currentSong!!.bitRate != null && currentSong!!.bitRate!! > 0)
bitRate = String.format(
Util.appContext().getString(R.string.song_details_kbps),
currentSong!!.bitRate
)
bitrateFormatTextView.text =
String.format(
Util.appContext().getString(R.string.song_details_all),
if (bitRate == null) ""
else String.format(Locale.ROOT, "%s ", bitRate),
if (TextUtils.isEmpty(currentSong!!.transcodedSuffix) ||
currentSong!!.transcodedSuffix == currentSong!!.suffix ||
currentSong!!.isVideo
) currentSong!!.suffix
else String.format(
Locale.ROOT, "%s > %s", currentSong!!.suffix,
currentSong!!.transcodedSuffix
)
)
bitrateFormatTextView.text = String.format(
Locale.ROOT, "%s %s",
bitRate, currentSong!!.suffix
)
bitrateFormatTextView.visibility = View.VISIBLE
} else {
genreTextView.visibility = View.GONE