Fix address not updated
This commit is contained in:
@@ -76,8 +76,9 @@ class RepeaterFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClickL
|
|||||||
fun onStatusChanged() {
|
fun onStatusChanged() {
|
||||||
notifyPropertyChanged(BR.switchEnabled)
|
notifyPropertyChanged(BR.switchEnabled)
|
||||||
notifyPropertyChanged(BR.serviceStarted)
|
notifyPropertyChanged(BR.serviceStarted)
|
||||||
|
if (binder?.active != true) onGroupChanged()
|
||||||
}
|
}
|
||||||
fun onGroupChanged(group: WifiP2pGroup? = binder?.service?.group) {
|
fun onGroupChanged(group: WifiP2pGroup? = null) {
|
||||||
notifyPropertyChanged(BR.ssid)
|
notifyPropertyChanged(BR.ssid)
|
||||||
p2pInterface = group?.`interface`
|
p2pInterface = group?.`interface`
|
||||||
notifyPropertyChanged(BR.addresses)
|
notifyPropertyChanged(BR.addresses)
|
||||||
@@ -208,7 +209,6 @@ class RepeaterFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClickL
|
|||||||
binder.groupChanged -= this
|
binder.groupChanged -= this
|
||||||
this.binder = null
|
this.binder = null
|
||||||
data.onStatusChanged()
|
data.onStatusChanged()
|
||||||
data.onGroupChanged()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMenuItemClick(item: MenuItem) = when (item.itemId) {
|
override fun onMenuItemClick(item: MenuItem) = when (item.itemId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user