reworks requested by @ogarcia
Signed-off-by: Holger Müller <github@euhm.de>
This commit is contained in:
parent
2f5704548c
commit
c247e930c4
|
@ -60,7 +60,6 @@ import kotlinx.coroutines.cancel
|
|||
import kotlinx.coroutines.launch
|
||||
import org.koin.android.ext.android.inject
|
||||
import org.koin.core.component.KoinComponent
|
||||
import org.koin.core.component.get
|
||||
import org.moire.ultrasonic.R
|
||||
import org.moire.ultrasonic.adapters.BaseAdapter
|
||||
import org.moire.ultrasonic.adapters.TrackViewBinder
|
||||
|
@ -141,7 +140,7 @@ class PlayerFragment :
|
|||
private lateinit var artistTextView: TextView
|
||||
private lateinit var albumTextView: TextView
|
||||
private lateinit var genreTextView: TextView
|
||||
private lateinit var detailsTextView: TextView
|
||||
private lateinit var bitrateFormatTextView: TextView
|
||||
private lateinit var albumArtImageView: ImageView
|
||||
private lateinit var playlistView: RecyclerView
|
||||
private lateinit var positionTextView: TextView
|
||||
|
@ -180,7 +179,7 @@ class PlayerFragment :
|
|||
artistTextView = view.findViewById(R.id.current_playing_artist)
|
||||
albumTextView = view.findViewById(R.id.current_playing_album)
|
||||
genreTextView = view.findViewById(R.id.current_playing_genre)
|
||||
detailsTextView = view.findViewById(R.id.current_file_details)
|
||||
bitrateFormatTextView = view.findViewById(R.id.current_playing_bitrate_format)
|
||||
albumArtImageView = view.findViewById(R.id.current_playing_album_art_image)
|
||||
positionTextView = view.findViewById(R.id.current_playing_position)
|
||||
downloadTrackTextView = view.findViewById(R.id.current_playing_track)
|
||||
|
@ -989,19 +988,20 @@ class PlayerFragment :
|
|||
if (currentSong!!.year != null && Settings.showNowPlayingDetails)
|
||||
albumTextView.append(String.format(Locale.ROOT, " (%d)", currentSong!!.year))
|
||||
|
||||
if (Settings.showNowPlayingDetails) {
|
||||
genreTextView.text = currentSong!!.genre
|
||||
genreTextView.visibility =
|
||||
if (currentSong!!.genre != null && currentSong!!.genre!!.isNotBlank() &&
|
||||
Settings.showNowPlayingDetails
|
||||
if (currentSong!!.genre != null && currentSong!!.genre!!.isNotBlank()
|
||||
) View.VISIBLE
|
||||
else View.GONE
|
||||
|
||||
var bitRate: String? = null
|
||||
if (currentSong!!.bitRate != null && currentSong!!.bitRate!! > 0)
|
||||
bitRate = String.format(
|
||||
Util.appContext().getString(R.string.song_details_kbps), currentSong!!.bitRate
|
||||
Util.appContext().getString(R.string.song_details_kbps),
|
||||
currentSong!!.bitRate
|
||||
)
|
||||
detailsTextView.text =
|
||||
bitrateFormatTextView.text =
|
||||
String.format(
|
||||
Util.appContext().getString(R.string.song_details_all),
|
||||
if (bitRate == null) ""
|
||||
|
@ -1015,9 +1015,11 @@ class PlayerFragment :
|
|||
currentSong!!.transcodedSuffix
|
||||
)
|
||||
)
|
||||
detailsTextView.visibility =
|
||||
if (Settings.showNowPlayingDetails) View.VISIBLE
|
||||
else View.GONE
|
||||
bitrateFormatTextView.visibility = View.VISIBLE
|
||||
} else {
|
||||
genreTextView.visibility = View.GONE
|
||||
bitrateFormatTextView.visibility = View.GONE
|
||||
}
|
||||
|
||||
downloadTrackTextView.text = trackFormat
|
||||
downloadTotalDurationTextView.text = duration
|
||||
|
@ -1030,7 +1032,7 @@ class PlayerFragment :
|
|||
artistTextView.text = null
|
||||
albumTextView.text = null
|
||||
genreTextView.text = null
|
||||
detailsTextView.text = null
|
||||
bitrateFormatTextView.text = null
|
||||
downloadTrackTextView.text = null
|
||||
downloadTotalDurationTextView.text = null
|
||||
imageLoaderProvider.getImageLoader()
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
a:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
a:id="@+id/current_file_details"
|
||||
a:id="@+id/current_playing_bitrate_format"
|
||||
a:layout_width="wrap_content"
|
||||
a:layout_height="wrap_content"
|
||||
a:ellipsize="start"
|
||||
|
|
|
@ -332,9 +332,8 @@
|
|||
<string name="main.video" tools:ignore="UnusedResources">Video</string>
|
||||
<string name="settings.wifi_required_summary">Only download media on unmetered connections</string>
|
||||
<string name="settings.wifi_required_title">Download on Wi-Fi only</string>
|
||||
<string name="song_details.all">%1$s%2$s</string>
|
||||
<string name="song_details.all" translatable="false">%1$s%2$s</string>
|
||||
<string name="song_details.kbps">%d kbps</string>
|
||||
<string name="song_details.nowplaying">%1$s  •  %2$d  •  %3$d kbps %4$s</string>
|
||||
<string name="util.bytes_format.byte">0 B</string>
|
||||
<string name="util.bytes_format.gigabyte">0.00 GB</string>
|
||||
<string name="util.bytes_format.kilobyte">0 KB</string>
|
||||
|
|
Loading…
Reference in New Issue