-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promote live location labs flag [PSF-959] #6350
Conversation
|
||
<!-- Live Location Sharing Labs Flag Promotional BottomSheet --> | ||
<string name="live_location_labs_promotion_title">Live location sharing</string> | ||
<string name="live_location_labs_promotion_description">Please note: this is a labs feature using a temporary implementation. This means you will not be able to delete your location history, and advanced users will be able to see your location history even after you stop sharing your live location with this room.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the final copy? it's a little bit techy~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is. I think it is not so hard to understand for users.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment above could be replaced by extracting this condition to its own function
private fun hasUserOptedInToLiveLocationLabs(code, data) {
return resultCode == VectorBaseBottomSheetDialogFragment.ResultListener.RESULT_OK && (data as? Boolean) == true
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny refactor comment, not a blocker, LGTM 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small remarks
companion object { | ||
fun newInstance(resultListener: ResultListener): LiveLocationLabsFlagPromotionBottomSheet { | ||
return LiveLocationLabsFlagPromotionBottomSheet().also { | ||
it.resultListener = resultListener |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big big deal, but we will loose the listener if the Fragment is recreated by system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Fixed.
@@ -1047,6 +1047,12 @@ class VectorPreferences @Inject constructor( | |||
return defaultPrefs.getBoolean(SETTINGS_LABS_ENABLE_LIVE_LOCATION, false) | |||
} | |||
|
|||
fun setLiveLocationLabsEnabled() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my remark, sorry I should have detailed more in the first place.
Also fix the ktlint!
} | ||
} | ||
|
||
private val fragmentLifecycleCallbacks = object : FragmentManager.FragmentLifecycleCallbacks() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit weird to use this for Listener, please use fragment result API instead https://developer.android.com/guide/fragments/communicate#fragment-result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.
Lets merge this if everything is green! |
SonarCloud Quality Gate failed. |
Type of change
Content
We want to show users the Live Location Sharing option with an informative dialog.
Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist