Update beta dependencies because it is called beta branch
This commit is contained in:
@@ -7,9 +7,9 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.get
|
||||
import androidx.lifecycle.observe
|
||||
import be.mygod.vpnhotspot.client.ClientViewModel
|
||||
import be.mygod.vpnhotspot.client.ClientsFragment
|
||||
import be.mygod.vpnhotspot.databinding.ActivityMainBinding
|
||||
@@ -30,13 +30,13 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
|
||||
if (savedInstanceState == null) displayFragment(TetheringFragment())
|
||||
val model = ViewModelProviders.of(this).get<ClientViewModel>()
|
||||
if (RepeaterService.supported) ServiceForegroundConnector(this, model, RepeaterService::class)
|
||||
model.clients.observe(this, Observer {
|
||||
model.clients.observe(this) {
|
||||
if (it.isNotEmpty()) binding.navigation.showBadge(R.id.navigation_clients).apply {
|
||||
backgroundColor = ContextCompat.getColor(this@MainActivity, R.color.colorSecondary)
|
||||
badgeTextColor = ContextCompat.getColor(this@MainActivity, R.color.primary_text_default_material_light)
|
||||
number = it.size
|
||||
} else binding.navigation.removeBadge(R.id.navigation_clients)
|
||||
})
|
||||
}
|
||||
SmartSnackbar.Register(lifecycle, binding.fragmentHolder)
|
||||
WifiDoubleLock.ActivityListener(this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user