Cleaned up some compiler warnings.

This commit is contained in:
casey langen 2017-09-30 21:00:40 -07:00
parent 47a2abc6cd
commit 50f4551b2c
5 changed files with 16 additions and 22 deletions

View File

@ -44,7 +44,7 @@ class PlayQueueActivity : WebSocketActivityBase() {
val queryFactory = playback!!.playlistQueryFactory
val message: SocketMessage? = queryFactory.getRequeryMessage()
emptyView = findViewById<EmptyListView>(R.id.empty_list_view)
emptyView = findViewById(R.id.empty_list_view)
emptyView.capability = EmptyListView.Capability.OfflineOk
emptyView.emptyMessage = getString(R.string.play_queue_empty)
emptyView.alternateView = recyclerView
@ -111,9 +111,9 @@ class PlayQueueActivity : WebSocketActivityBase() {
}
private inner class ViewHolder internal constructor(itemView: View) : RecyclerView.ViewHolder(itemView) {
private val title: TextView = itemView.findViewById<TextView>(R.id.title)
private val subtitle: TextView = itemView.findViewById<TextView>(R.id.subtitle)
private val trackNum: TextView = itemView.findViewById<TextView>(R.id.track_num)
private val title: TextView = itemView.findViewById(R.id.title)
private val subtitle: TextView = itemView.findViewById(R.id.subtitle)
private val trackNum: TextView = itemView.findViewById(R.id.track_num)
internal fun bind(entry: JSONObject?, position: Int) {
trackNum.text = (position + 1).toString()

View File

@ -144,8 +144,8 @@ class TrackListActivity : WebSocketActivityBase(), Filterable {
}
private inner class ViewHolder internal constructor(itemView: View) : RecyclerView.ViewHolder(itemView) {
private val title: TextView = itemView.findViewById<TextView>(R.id.title)
private val subtitle: TextView = itemView.findViewById<TextView>(R.id.subtitle)
private val title: TextView = itemView.findViewById(R.id.title)
private val subtitle: TextView = itemView.findViewById(R.id.subtitle)
internal fun bind(entry: JSONObject?, position: Int) {
itemView.tag = position

View File

@ -40,7 +40,7 @@ class AlbumArtModel(val track: String,
}
}
class Image(internal val size: Size, internal val url: String)
private class Image(internal val size: Size, internal val url: String)
init {
this.callback = callback ?: DEFAULT_CALLBACK

View File

@ -44,14 +44,8 @@ class EmptyListView : FrameLayout {
}
var capability: Capability = Capability.OnlineOnly
set(value) {
field = value
}
var alternateView: View? = null
get() {
return field
}
set(value) {
field = value
alternateView?.visibility = if (visibility == View.GONE) View.VISIBLE else View.GONE
@ -94,7 +88,7 @@ class EmptyListView : FrameLayout {
offlineContainer = mainView?.findViewById(R.id.offline_container)
viewOfflineButton = mainView?.findViewById(R.id.offline_tracks_button)
reconnectButton = mainView?.findViewById(R.id.disconnected_button)
emptyTextView = mainView?.findViewById<TextView>(R.id.empty_text_view)
emptyTextView = mainView?.findViewById(R.id.empty_text_view)
addView(mainView)

View File

@ -313,19 +313,19 @@ class MainMetadataView : FrameLayout {
addView(child, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
this.title = findViewById<TextView>(R.id.track_title)
this.artist = findViewById<TextView>(R.id.track_artist)
this.album = findViewById<TextView>(R.id.track_album)
this.volume = findViewById<TextView>(R.id.volume)
this.title = findViewById(R.id.track_title)
this.artist = findViewById(R.id.track_artist)
this.album = findViewById(R.id.track_album)
this.volume = findViewById(R.id.volume)
this.buffering = findViewById(R.id.buffering)
this.titleWithArt = findViewById<TextView>(R.id.with_art_track_title)
this.artistAndAlbumWithArt = findViewById<TextView>(R.id.with_art_artist_and_album)
this.volumeWithArt = findViewById<TextView>(R.id.with_art_volume)
this.titleWithArt = findViewById(R.id.with_art_track_title)
this.artistAndAlbumWithArt = findViewById(R.id.with_art_artist_and_album)
this.volumeWithArt = findViewById(R.id.with_art_volume)
this.mainTrackMetadataWithAlbumArt = findViewById(R.id.main_track_metadata_with_art)
this.mainTrackMetadataNoAlbumArt = findViewById(R.id.main_track_metadata_without_art)
this.albumArtImageView = findViewById<ImageView>(R.id.album_art)
this.albumArtImageView = findViewById(R.id.album_art)
this.album.setOnClickListener { _ -> navigateToCurrentAlbum() }
this.artist.setOnClickListener { _ -> navigateToCurrentArtist() }