Fixed lint issues

This commit is contained in:
Nite 2021-10-10 14:15:03 +02:00
parent 4b4853374c
commit 381e29b2d1
No known key found for this signature in database
GPG Key ID: 1D1AD59B1C6386C1
2 changed files with 9 additions and 7 deletions

View File

@ -19,7 +19,6 @@ import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout import androidx.drawerlayout.widget.DrawerLayout
import androidx.fragment.app.FragmentContainerView import androidx.fragment.app.FragmentContainerView
import androidx.navigation.NavController import androidx.navigation.NavController
import androidx.navigation.Navigation
import androidx.navigation.findNavController import androidx.navigation.findNavController
import androidx.navigation.fragment.NavHostFragment import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.AppBarConfiguration
@ -186,10 +185,13 @@ class NavigationActivity : AppCompatActivity() {
nowPlayingEventDistributor.subscribe(nowPlayingEventListener) nowPlayingEventDistributor.subscribe(nowPlayingEventListener)
themeChangedEventDistributor.subscribe(themeChangedEventListener) themeChangedEventDistributor.subscribe(themeChangedEventListener)
serverRepository.liveServerCount().observe(this, { count -> serverRepository.liveServerCount().observe(
this,
{ count ->
cachedServerCount = count ?: 0 cachedServerCount = count ?: 0
setSelectServerButtonText() setSelectServerButtonText()
}) }
)
ActiveServerProvider.liveActiveServerId.observe(this, { setSelectServerButtonText() }) ActiveServerProvider.liveActiveServerId.observe(this, { setSelectServerButtonText() })
} }
@ -251,7 +253,8 @@ class NavigationActivity : AppCompatActivity() {
bookmarksMenuItem = navigationView?.menu?.findItem(R.id.bookmarksFragment) bookmarksMenuItem = navigationView?.menu?.findItem(R.id.bookmarksFragment)
sharesMenuItem = navigationView?.menu?.findItem(R.id.sharesFragment) sharesMenuItem = navigationView?.menu?.findItem(R.id.sharesFragment)
podcastsMenuItem = navigationView?.menu?.findItem(R.id.podcastFragment) podcastsMenuItem = navigationView?.menu?.findItem(R.id.podcastFragment)
selectServerButton = navigationView?.getHeaderView(0)?.findViewById(R.id.header_select_server) selectServerButton =
navigationView?.getHeaderView(0)?.findViewById(R.id.header_select_server)
selectServerButton?.setOnClickListener { selectServerButton?.setOnClickListener {
if (drawerLayout?.isDrawerVisible(GravityCompat.START) == true) if (drawerLayout?.isDrawerVisible(GravityCompat.START) == true)
this.drawerLayout?.closeDrawer(GravityCompat.START) this.drawerLayout?.closeDrawer(GravityCompat.START)

View File

@ -1,6 +1,5 @@
package org.moire.ultrasonic.data package org.moire.ultrasonic.data
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.room.Room import androidx.room.Room
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers