Merge branch 'master' into v2.4

This commit is contained in:
Mygod
2019-04-14 10:27:46 +08:00
12 changed files with 84 additions and 85 deletions

View File

@@ -163,7 +163,7 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
override val type get() = VIEW_TYPE_BLUETOOTH
override val isStarted get() = tethering.active == true
override fun onException() = ManageBar.start(parent.requireContext())
override fun onException() = ManageBar.start(parent.context ?: app)
override fun start() = BluetoothTethering.start(this)
override fun stop() {

View File

@@ -103,7 +103,7 @@ class TetheringFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClick
}
private fun updateMonitorList(canMonitor: List<String> = emptyList()) {
val item = requireActivity().toolbar.menu.findItem(R.id.monitor) ?: return // assuming no longer foreground
val item = activity?.toolbar?.menu?.findItem(R.id.monitor) ?: return // assuming no longer foreground
item.isNotGone = canMonitor.isNotEmpty()
item.subMenu.apply {
clear()