-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixes #1198 #1202
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
Fixes #1198 #1202
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1202 +/- ##
=========================================
- Coverage 3.82% 3.81% -0.02%
=========================================
Files 125 126 +1
Lines 5902 5919 +17
Branches 582 583 +1
=========================================
Hits 226 226
- Misses 5661 5678 +17
Partials 15 15
Continue to review full report at Codecov.
|
* Created by knightshade on 25/2/18. | ||
*/ | ||
|
||
public class NotificationWorkerFragment extends Fragment { |
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.
@knight-shade I am confused why you added NotificationWorkerFragment
. Can you briefly explain the intent behind it.
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.
Sure @maskaravivek , the sole purpose of NotificationWorkerFragment is to retain notifications list (data) initially fetched from the server across orientation change. Its a headless fragment , so after orientation change when the Notification activity is recreated, instead of fetching notification list again from server, it uses the initially fetched notification list which is stored is NotificationWorkerFragment.
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.
@maskaravivek I am convinced that this PR is beneficial for us. What do you think?
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.
And please resolve conflicts (Actually they will be solved when you revert build.gradle changes)
app/build.gradle
Outdated
@@ -49,7 +49,7 @@ dependencies { | |||
compile 'com.facebook.stetho:stetho:1.5.0' | |||
|
|||
testCompile 'junit:junit:4.12' | |||
testCompile 'org.robolectric:robolectric:3.4' | |||
testCompile 'org.robolectric:robolectric:3.7.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.
I guess these are accidentally here.
app/build.gradle
Outdated
@@ -78,7 +78,7 @@ dependencies { | |||
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" | |||
|
|||
testImplementation 'junit:junit:4.12' | |||
testImplementation 'org.robolectric:robolectric:3.4' | |||
testImplementation 'org.robolectric:robolectric:3.7.1' | |||
testImplementation 'org.mockito:mockito-all:1.10.19' |
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.
I guess also this one is accidentally here.
* Created by knightshade on 25/2/18. | ||
*/ | ||
|
||
public class NotificationWorkerFragment extends Fragment { |
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.
@maskaravivek I am convinced that this PR is beneficial for us. What do you think?
Yes, this looks good to me! I have resolved the merge conflicts too. @neslihanturan Can you help in testing it. :) |
Tested, thanks @knight-shade |
Thanks @maskaravivek for resolving merge conflicts. 😄 |
Description
Fixes #1198
Now notifications list retained across orientation change without fetching again from server.