mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-10 17:03:50 +01:00
Code review fixes.
This commit is contained in:
parent
ab34bb6df7
commit
320915e0a1
@ -197,11 +197,14 @@ class LocationSharingFragment @Inject constructor(
|
|||||||
|
|
||||||
private val liveLocationLabsFlagPromotionListener = object : VectorBaseBottomSheetDialogFragment.ResultListener {
|
private val liveLocationLabsFlagPromotionListener = object : VectorBaseBottomSheetDialogFragment.ResultListener {
|
||||||
override fun onBottomSheetResult(resultCode: Int, data: Any?) {
|
override fun onBottomSheetResult(resultCode: Int, data: Any?) {
|
||||||
// Check if the user wants to enable the labs flag
|
handleLiveLocationLabsFlagPromotionResult(resultCode, data)
|
||||||
if (resultCode == VectorBaseBottomSheetDialogFragment.ResultListener.RESULT_OK && (data as? Boolean) == true) {
|
}
|
||||||
vectorPreferences.setLiveLocationLabsEnabled()
|
}
|
||||||
startLiveLocationSharing()
|
|
||||||
}
|
private fun handleLiveLocationLabsFlagPromotionResult(resultCode: Int, data: Any?) {
|
||||||
|
if (resultCode == VectorBaseBottomSheetDialogFragment.ResultListener.RESULT_OK && (data as? Boolean) == true) {
|
||||||
|
vectorPreferences.setLiveLocationLabsEnabled(isEnabled = true)
|
||||||
|
startLiveLocationSharing()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1047,9 +1047,9 @@ class VectorPreferences @Inject constructor(
|
|||||||
return defaultPrefs.getBoolean(SETTINGS_LABS_ENABLE_LIVE_LOCATION, false)
|
return defaultPrefs.getBoolean(SETTINGS_LABS_ENABLE_LIVE_LOCATION, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setLiveLocationLabsEnabled() {
|
fun setLiveLocationLabsEnabled(isEnabled: Boolean) {
|
||||||
defaultPrefs.edit {
|
defaultPrefs.edit {
|
||||||
putBoolean(SETTINGS_LABS_ENABLE_LIVE_LOCATION, true)
|
putBoolean(SETTINGS_LABS_ENABLE_LIVE_LOCATION, isEnabled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user