Skip to content

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

Merged
merged 2 commits into from
Mar 16, 2018
Merged

Fixes #1198 #1202

merged 2 commits into from
Mar 16, 2018

Conversation

knight-shade
Copy link
Contributor

Description

Fixes #1198

Now notifications list retained across orientation change without fetching again from server.

@codecov-io
Copy link

codecov-io commented Feb 25, 2018

Codecov Report

Merging #1202 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
...mmons/notification/NotificationWorkerFragment.java 0% <0%> (ø)
...nrw/commons/notification/NotificationActivity.java 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e412c9a...ff54d03. Read the comment docs.

* Created by knightshade on 25/2/18.
*/

public class NotificationWorkerFragment extends Fragment {
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Collaborator

@neslihanturan neslihanturan left a 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'

Copy link
Collaborator

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'
Copy link
Collaborator

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 {
Copy link
Collaborator

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?

@maskaravivek
Copy link
Member

Yes, this looks good to me! I have resolved the merge conflicts too. @neslihanturan Can you help in testing it. :)

@neslihanturan
Copy link
Collaborator

Tested, thanks @knight-shade

@neslihanturan neslihanturan merged commit 80cc8b7 into commons-app:master Mar 16, 2018
@knight-shade
Copy link
Contributor Author

Thanks @maskaravivek for resolving merge conflicts. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants