-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Feature/refactor contributions #3046
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
neslihanturan
merged 14 commits into
commons-app:master
from
ashishkumar468:feature/refactor-contributions
Jul 7, 2019
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cd6ea1e
* Refactored ContributionsListFragment to use RecyclerView
ashishkumar468 2d6b81b
Improved the logic for cache in ContributionViewHolder
ashishkumar468 a8ac3af
Some more refactoring
ashishkumar468 b6757cd
While displaying images in ContributionsList, check if status is not …
ashishkumar468 99c2e69
typo correction in LocalDataSource
ashishkumar468 cfb45d7
Fixed formatting in ContributionsPresenter
ashishkumar468 d76dd0a
retain adapter position when orientation changes
ashishkumar468 d3d56c1
retain child position with its id
ashishkumar468 b1810c0
Made ContributionViewHolder not implement ViewHolder
ashishkumar468 9f597fb
Code formatting, review suggested changes
ashishkumar468 ce2ca18
initialise the rv layout managers only when needed
ashishkumar468 fc1b0df
added test cases for ContributionPresenter
ashishkumar468 e18fb14
removed not needed semi colon
ashishkumar468 cfb3eb3
added more java docs and code formatting
ashishkumar468 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
app/src/main/java/fr/free/nrw/commons/contributions/ContributionsContract.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package fr.free.nrw.commons.contributions; | ||
|
|
||
| import android.database.Cursor; | ||
| import androidx.loader.app.LoaderManager; | ||
| import fr.free.nrw.commons.BasePresenter; | ||
| import fr.free.nrw.commons.Media; | ||
|
|
||
| /** | ||
| * The contract for Contributions View & Presenter | ||
| */ | ||
| public class ContributionsContract { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add java docs |
||
|
|
||
| public interface View { | ||
|
|
||
| void showWelcomeTip(boolean numberOfUploads); | ||
|
|
||
| void showProgress(boolean shouldShow); | ||
|
|
||
| void showNoContributionsUI(boolean shouldShow); | ||
|
|
||
| void setUploadCount(int count); | ||
|
|
||
| void onDataSetChanged(); | ||
| } | ||
|
|
||
| public interface UserActionListener extends BasePresenter<ContributionsContract.View>, | ||
| LoaderManager.LoaderCallbacks<Cursor> { | ||
|
|
||
| Contribution getContributionsFromCursor(Cursor cursor); | ||
|
|
||
| void deleteUpload(Contribution contribution); | ||
|
|
||
| Media getItemAtPosition(int i); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If
getState() != Contribution.STATE_COMPLETED, doescontribution.getLocalUri()have some temporary image?Uh oh!
There was an error while loading. Please reload this page.
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, contribution.localUri has the temporary uri for the image which is saved in the db while the upload is in progress