-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixes #2888 : First time ever tapping "Nearby": Tab does not show #2903
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.
Can you briefly explain why you are using a new thread?
because opening the tab while requesting permission is a lot on the main thread to handle, especially when the app is freshly installed requesting permission for the first time from the OS takes longer than usual , doing so on the main thread causes this lag which is viewpager not responding to Tab clicking. |
I don't think threading the issue in this case. Check out |
okay but let me tell you what i tried , i tried to do not request permission at all , what happened was that everything went smoothly and Nearby tab opened with no bug , another thing is that even when requesting the permission on another thread their was an obvious delay of 1 second or less which explains why it was causing the bug. |
@@ -209,6 +209,7 @@ public void next() { | |||
void setCurrentTitleAndDescriptions(Title title, List<Description> descriptions) { | |||
setCurrentUploadTitle(title); | |||
setCurrentUploadDescriptions(descriptions); | |||
store.putString("Title", title.toString()); |
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 related?
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 , this change of another issue , i didn't know that every pull request needs a new branch , i'll try to fix it.
@@ -602,7 +604,13 @@ private void registerLocationUpdates() { | |||
*/ | |||
private void requestLocationPermissions() { | |||
if (!getActivity().isFinishing()) { | |||
locationManager.requestPermissions(getActivity()); | |||
new Single<Object>(){ |
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.
Dispose of the single
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.
okay got it.
Codecov Report
@@ Coverage Diff @@
## master #2903 +/- ##
=========================================
+ Coverage 3.39% 3.62% +0.23%
=========================================
Files 246 246
Lines 12212 12217 +5
Branches 1080 1078 -2
=========================================
+ Hits 414 443 +29
+ Misses 11768 11740 -28
- Partials 30 34 +4
Continue to review full report at Codecov.
|
@ahmedmamdouh13 I discussed with @neslihanturan and @ashishkumar468 and we feel that the root cause of the issue is that either the lifecycle events are not handled properly or some method is returning early. Can I take up this issue and spend a couple of days trying to figure out the root cause? I suggest that you take up another beginner-friendly issue for the time being. :) |
@maskaravivek yes of course , i know it was not an ideal solution but it's their if the problem persists , thank you for informing me 🙏 |
Hi @maskaravivek , seems like this issue is solved by a technically better approach at #2925 . Please join the discussion there if you want to. Thanks for your contribution. |
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.
What isvthis
Steps to reproduce:
Workaround: Tap on "Nearby" again.
Fixes #2888 : First time ever tapping "Nearby": Tab does not show
took requesting location permission off the main thread to stop delaying UI elements
Tested on Huawei P9 lite API level 24 | Nexus 5 with API level 25.