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 ) View.VISIBLE
else View.GONE else View.GONE
var bitRate: String? = null var bitRate: String = ""
if (currentSong!!.bitRate != null && currentSong!!.bitRate!! > 0) if (currentSong!!.bitRate != null && currentSong!!.bitRate!! > 0)
bitRate = String.format( bitRate = String.format(
Util.appContext().getString(R.string.song_details_kbps), Util.appContext().getString(R.string.song_details_kbps),
currentSong!!.bitRate currentSong!!.bitRate
) )
bitrateFormatTextView.text = bitrateFormatTextView.text = String.format(
String.format( Locale.ROOT, "%s %s",
Util.appContext().getString(R.string.song_details_all), bitRate, currentSong!!.suffix
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.visibility = View.VISIBLE bitrateFormatTextView.visibility = View.VISIBLE
} else { } else {
genreTextView.visibility = View.GONE genreTextView.visibility = View.GONE