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