-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixes #2888: Use Dexter for requesting location permissions #2925
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
Conversation
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 for the PR, @maskaravivek. Works fine for me
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 @maskaravivek , I have tested this. Tabs works fine but nearby doesn't load on API26 device.
One more issue: if I send the app to background while nearby tab is selected, then disable the permission, when I come back to the app it does not request permission. Even more if I switch to contributions tab and come back to nearby tab, it still doesn't request for permission. |
Is there any error in the logs? |
No, there is just an error about SettingsActivity which seems irrelevant. |
These are the logs I see after seeing loading screen for long time and switching back to contribution tab and come back to nearby tab:
|
Codecov Report
@@ Coverage Diff @@
## master #2925 +/- ##
=========================================
+ Coverage 3.69% 3.73% +0.04%
=========================================
Files 249 249
Lines 12270 12135 -135
Branches 1090 1076 -14
=========================================
Hits 453 453
+ Misses 11782 11647 -135
Partials 35 35
Continue to review full report at Codecov.
|
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 review job has been created and sent to the PullRequest network.
@maskaravivek you can click here to see the review status or cancel the code review job.
@neslihanturan I have fixed the pending issues with this PR and its ready for review now. :) PFA the attached video for various scenarios. https://drive.google.com/file/d/1aCuegxzwD4NUY0f5xzyT_g0VQ1YkNuyh/view?usp=sharing |
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.
No issues found in the PR. Please consider the readability suggestions.
Reviewed with ❤️ by PullRequest
@@ -194,7 +195,7 @@ private void initBottomSheetBehaviour() { | |||
|
|||
@Override | |||
public void onStateChanged(View bottomSheet, int newState) { |
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.
To let other collaborators know that newState
is intentionally unused: rename to unusedNewState
.
@@ -120,6 +119,10 @@ public static void checkPermissionsAndPerformAction(Activity activity, String pe | |||
@Override | |||
public void onPermissionRationaleShouldBeShown(PermissionRequest permission, | |||
PermissionToken token) { | |||
if (rationaleTitle == -1 && rationaleMessage == -1) { |
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.
It seems that you are trying to silently request permission here. The magic number of -1 is not clear from the caller's perspective.
Add function level comments in both checkPermissionsAndPerformAction that rationaleTitle and rationaleMessage can be invalid @StringRes and the meaning of -1, -1.
* @param isContributionsListFragment true when contribution fragment should be visible, false | ||
* means user clicked to MediaDetails | ||
*/ | ||
private void updateContributionFragmentTabContent(boolean isContributionsListFragment) { |
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 change relevant to "Use Dexter for requesting location permissions"? If not, I think it would be better to be in a seperate PR.
Description (required)
Fixes #2888