-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Multiple uploads with over haul #1968
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
Multiple uploads with over haul #1968
Conversation
If the user tries to submit empty title (do not allow to proceed)
If user does not select any categories
Category suggestion seems to be not working for the following cases. Will be fixing it soon:
Also, similar images bit doesn't work for me. Will be fixing it. Other than these everything else works smoothly. @misaochan It would be great if you could also do a round of just basic testing and let me know if anything else needs to be fixed for it to be merged into master. :) |
Hi @maskaravivek , thanks for picking this up! It works pretty great overall, and the UI looks fantastic. :) And category addition is flawless now, since it is submitted together with the image, instead of later. No more issues with categories not being added, yay! Nearby uploads also work perfectly with the Wikidata edit succeeding. Tested on API 27 Nexus S emulator:
|
I forgot to mention - please make sure the temp file changes in #1749 are included, otherwise the crashes will resume. Oh, and we need to make sure that we test on .png, too. :) |
Thanks for reviewing and testing the PR @misaochan. Will incorporate the feedback based on your comments.
@misaochan I understand your concerns regarding the steps in multiple uploads but IMO it would be great if we allowed separate title/desc for each of the images even if I am allowed to choose categories once.
Regarding putting a restriction on the number of images selected, Android natively doesn't allow to enforce a limit. A custom image picker UI needs to be provided for having this limit in place. For that, we can either use a library(for eg. https://github.com/zhihu/Matisse) that provides a image picker or write a custom implementation for it. |
@maskaravivek Good points re: the steps. In view of that, I think it is OK to keep the current flow for now, but we should be more explicit to prevent confusion for the user. Perhaps in the "Step 1 of 4" title, we can have a subtext that says "(1st image in set)", then "(2nd image in set)", so on and so forth? Then in Step 3 of 4 for categories, the subtext will be "(all images in set)", and similarly for the license step. How much time do you reckon it'll take for a custom implementation of a 5 image limit? I forgot to mention this earlier - when the user selects the text field in the title/desc step to start typing, I think we should minimize the top card. Otherwise, in smaller screens, the keyboard + card will block the view almost entirely. |
Sure. Will add the sub texts.
If we use a library then it would be much quicker to implement but if we chose to implement it on our own then it would take a week of my time. Ashish has worked on a custom UI in the past. @ashishkumar468 Do you feel 1 week should be enough for implementing the custom UI? Also, I was hoping to get this first merged to master and then work on the image limit thing. I don't want the PR to get to unmanageable size. Just in a few days, we have so many conflicts. :(
Sure will do. |
5873cf6
to
63609b7
Compare
Sure, let's merge this PR when it is ready, and leave the upload limit for the next PR. :) Please ping me when you have implemented the fixes, I can re-test and merge. |
One week may not be sufficient, if we have to consider all the edge cases, as this involves building an entire custom activity/fragment similar to gallery picker, except the files modularisation. |
Ah, I see. In that case perhaps we may just release without the limit, and then implement the feature of locking multiple uploads for accounts above a certain revert % in the future? My biggest fear is that one or two newbies could potentially do a lot of damage with unlimited multiple uploads. The risk is small, especially if they have to manually name every file before the upload begins, but it does exist. On the other hand, I suppose it isn't any larger a risk than the UploadWizard already takes... |
@misaochan We can probably use a library for now and implement a custom UI in future, keeping the task as a tech debt. |
@maskaravivek Fair point. Matisse does look quite reputable. Shall we go with that for now? |
Codecov Report
@@ Coverage Diff @@
## 2.9-release #1968 +/- ##
==============================================
- Coverage 4.17% 4.14% -0.03%
==============================================
Files 216 223 +7
Lines 11147 11193 +46
Branches 1025 1020 -5
==============================================
- Hits 465 464 -1
- Misses 10647 10694 +47
Partials 35 35
Continue to review full report at Codecov.
|
2d7cd8f
to
b3348a6
Compare
Have made the following fixes: Category suggestions:
Warnings:
Also, based on the review:
Yes, it works for me just like the gallery uploads
Yes, earlier an API call was being made after every character was typed. Fixed. :)
Fixed. Now the check is made only when Next is clicked.
Done.
@ashishkumar468 is working on it.
@ashishkumar468's fix should take care of this as well.
Done.
Fixed. |
b3348a6
to
bd4504f
Compare
e4816af
to
15251a1
Compare
Tested on API 27 Nexus S emulator, in-app gallery multiple uploads do not work. (They do work in stock gallery > Share > Commons app) (problem 1) Steps:
|
I am actually not having coordinates sent with my upload, or any location-based category suggestions at all, even though my images have geotags. However I'm not sure if it's a Google Photos thing or not. Do coordinates work for you? (problem 2)
Works fantastic!
Works fantastic
Works excellent
Works excellent
I tried this with a multiple image upload. It warned me and asked if I wanted to proceed. I said "no", but instead of being allowed to modify my title, the image I was naming is gone entirely, and I was sent immediately to the 2nd image in the set (which is now the sole image being uploaded). (problem 3)
|
Able to reproduce it for Google photos. If I choose a photo from stock gallery then in-app upload works.
Yes, location-based category suggestions work for me and also the coords are set correctly. I uploaded an image with geotags (https://commons.wikimedia.org/wiki/File:Zeta_office_Diamond_District.jpg). I also got the suggestions for the category while uploading. The problem could be related to google photo's content resolver.
fixed.
Works well for multiple uploads. Doesn't work while uploading a single photo. Working on it. |
Is it possible to solve the multiple uploads bug for Google Photos? A lot of people use that to store their images, so it would break for a lot of users if we don't fix it. Location-based category suggestions failing for Google Photos is not that urgent a problem - if it works for stock gallery, we can create a bug issue for that and carry on with the release. |
204cd81
to
be7e094
Compare
problem 1 and problem 3 is fixed now.
Even exif interface is unable to extract location from the pictures when images are picked using Google photos. @ashishkumar468 would you be able to help with it as you have worked with Exif in the past?
Unable to understand how the title/description is being cached. Would need someone's help to fix the issue.
Have tried setting @misaochan Are these issues blocking issues? If these issues are minor then we could merge the PR and open separate issues for each of them. Someone might be able to help in fixing them. |
2f08222
to
e6eaa6e
Compare
@neslihanturan Thanks for testing the PR. I checked the logs that you shared with me, and apparently, the uploads were failing for you because of "not logged in" error. The issue doesn't seem to be related to this PR and can be taken up when we revisit our auth mechanism. If it happens more frequently then we can take it up on a higher priority.
I wasn't aware that such a feature existed. Will check and add it. :)
The description is optional. So validations are not added here. Should it be added? I don't think that descriptions would be posted on Commons if the language is empty.
Do you mean an option to delete a description? It would be great if you could help by sharing a quick mock on where the delete (x) button should be placed. There's very little space on the screen.
I will check why Turkish is not appearing. Infact will try to restore the previous list if that was more useful. |
I am glad logs are worked for you, and I am even more glad, this PR wasn't the actual reason. Will send mockups soon. I think "delete description" is not a blocker, while language list is. So the only priority before release can be language list. Others can be fixed later. |
@neslihanturan I have fixed the issue with language spinner. There's a weird issue that I am facing. On uploading images with multiple descriptions, for some of the languages, the description appears properly. Eg. https://commons.wikimedia.beta.wmflabs.org/wiki/File:Hetest_ehe.jpg But for others like Turkish, it's not showing up properly. Eg. Am not sure if there's an issue with the code or with the templates. @ashishkumar468 Do you have any insights on this? Edit: Ignore this comment. It seems beta server doesn't have all the templates. |
By the way I tried to record weird sound during upload (on API 26) |
Well, tested @maskaravivek . |
And this branch uploads descriptions on another languages with not problem as well. Thanks @maskaravivek ! :) |
4550bea
to
cff471e
Compare
Successfully did a multiple upload via in-app gallery > Google Photos on API 27 :)
Well done @maskaravivek !! :) And thanks for the additional testing @neslihanturan . |
* Added new upload activity that receives shared files from the gallery. Cards show and hide, plus titles are correct. Displayed thumbnails for the shared images * Better handling of the view paging plus error handling for required fields. * Code cleanup to make things more readable. * Extracted a model from the category search fragment that can possibly be shared with the new upload activity. * Added category selection to the combined upload screen. * Cleanup before the home-stretch on the GUI. * Adding license selection. * Fixed build warnings + cleanup * Start to support the dark theme. * Work in progress to add quality checking. * Fixing merge. * GPSExtractor: optimized away the EXifInterface object * Implemented submit functionality, temporarily fixed jacoco crash by disabling DUMMY UploadView object. * Implemented uploading of categories along with the picture. The category screen now displays GPS and recent categories when nothing is searched. * Implemented caching of files. Did some work on picture quality detection. * Implemented too dark picture detection. * Added a side card for zoom and map buttons along with pretty animations for stuff. * Added duplicate image on commons checking and fixed files not getting proper file extensions in several places. * Added support for map button and switched in-app upload buttons to UploadActivity * Pretty pretty animations! * Implemented zoom functionality for th background image. Just pinching on the image works instead of requiring buttons. * Added multi-language descriptions with categories by region. * Reimplemented the duplicate title checker and implemented a check against putting the same language twice in the description. * Javadocs for Description and UploadPresenter, plus some general cleanup. * Small code changes. * Implemented login checks for the Upload screen. * Implement receiving data from Nearby. * Feature/permissions library (#1855) * Added permission for Dexter, the runtime permission handling library * [Preparing fir issue #1773] Added a utility function which would take the user to app settings screen where he could manually give us the required permission * Added an alert dialog with positive and negative callback [Preparing fir issue #1773] * Improvements in the way External Storage Permission is handled in MultipleShareActivity[Bug fix #1697] 1. Used dexter to handle the external storage permission 2. Behaviour changes : When user tries to share(uppload) images to commons via MultipleShareActivity, following decision tree is followed a. If the app has permission for external storage, normal upload operation is followed b. If the app does not has the permission for external storage, dexter is used to ask for the same c. If the user gives us the required permission, normal upload flow is proceeded d. If the doesnot gives us the required permission a rationale dialog is shown with the appropriate message to let him know why we need the permission e. If he presses okay, steps a-c are followed and if he presses cancel, we close the app. f. If while asking for permission, the user chooses never ask again, then next time he tries to upload an image via MSA, the rational dialog follows the app setting screen where he could manually give us the required permission and the onActivityResult of same is handled * Added a Constants class to handle request and result codes from one place and other related constants common to the all app elements * replaced hardcoded strings ok and cancel in DialogUtil to string resources * init permission rationale dialog in activities onCreate * Code formatting, updated access modifiers wherever required, added javadocs for new methods created * *shifted constants to app class *Added JavaDocs in PermissionUtils * removed class REQUEST_CODES from CommonsApplication and instead put the enclosing constants in the App class itself * Made Codacy happy. * Abstarcted permission acquisition into new class DexterPermissionObtainer * Fixed Nearby upload detection * Migrated bad picture detection from AsyncTask to RxJava. * Removed ShareActivity and related dead code * Removed dead or duplicate code from FileProcessor * Added info button to title EditText * Fixed the add description button not disappearing. Added "Starting Upload" toast. Added link to the license on final screen. Made it so that the map button is hidden when image lacks gps coords. * Support in app multiple uploads * Minor changes to fix build * Changes to fix pending issues with upload flow * Fix display of similar image fragment * When uploading several files at once the date is missing #1854 (#2) * Bug fix issue #1854 * updated ContributionsDao to save create date, which it was not doing currently [it was instead saving current date] * UploadItem accepts are dateCreated param * Added a function in UploadModel, getFileCreatedDate which tries to fetched the file creaction date from all possible content providers. * Fix pending issues in upload flow * Make multiple uploads work for Google Photos * Fix default state for upload activity * Fix keyboard state for license screen * Fix descriptions for uploads * wip * Fix language spinner
* Added resaons in dropdown list * Made changes * Fixed Conflicts * Shifted strings to String.xml * Localisation updates from https://translatewiki.net. * Remove unused mediawiki api dependency (commons-app#1991) * Categories with pipe suffix (commons-app#1873) * Bug fix issue commons-app#1826 Changes made : -Certain category names used to show suffixed with strings prefixed with pipe '|'. Removed everything after the pipe. As per the discussion on the thread, its safe to remove everything after the pipe, including the pipe * review suggested changes *Code formatting *Extracted out the index of pipe in a variable *Added issue link in comments * Remove libraries section from README (commons-app#1988) * Remove libraries section from README * Add wiki link to "libraries used" to README * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Main screen ui changes, fixes commons-app#725 Main screen UI overhaul (commons-app#1922) * Delete Contributions Activity content to rewrite it * Add layout for new Contributions Activity design * Bind views * Override auth cookie required * Add tabs and fragments method * Create ContributionsFragment which will hold ContributionsListFragment and MediaDetailsFragment * Add NearbyFragment which will hold NearbyMapFragment and NearbyListFragment * Add ContributionsActivityPagerAdapter inner class to manage view pager * Create strings will be written on tabs for contributions and nearby * Create setTabAndViewPagerSynchronisation method to sycn view pager and tab layout. If user swipe pages, tabs will also change (and vice versa) * Add theme dependent background color for Drawer Layout of activity_contributions layout file * Add theme dependent background color for tabs in main * Create Contributions Fragment structure which will hold Media Detail Fragment and Contributions List Fragment * Inifilate contributions list fragment view * Create variables and methods to reuse and create Media Detils Fragment and Contributions List Fragment which will be inside Contribution Fragment * Override cursor loader methods * set MediaDetilsView fragment or ContributionListFragment according to users state * Show details of an image when item is clicked * Add delete and retry functionality, note: not tested yet * Override media count methods * Implement onBack Pressed settings * Register and unregister datasetObservers * Add contributin list fragment * Add contribution list layout with FABs for camera and galerry * Make sure we called onAuthAcquired from fragment after is is attached * Create ContributionListViewUtils class to change visibility of views according to MediaDetailsFragment visiblity or their loading state * Make number of uploads visible if contribution list is visible and number of uploads is uploaded. Progress bar is visible if contribution list is visible and number of uploads are uploading. Both invisible if Media Details Fragment is visible * Return parent fragment instead of parent activity * GetPagerFragment instead of getActivity since currently ContributionsFragment take over responsibility from ContributionsActivity * Add contribution number next to tab text for contribution, as discussed in thread * Remove number of uploads from contributions fragment since we moved it text of tab layout * Add unread notifications asynctask to check unread notifications on background * Save latest time user notification activity viewed * Add shared preferences provider for latest notification activity visit time * Add shared preferences provider for latest notification activity visit time * Change notification icon (add blue dot) whenever a notification comes * Recover notifications state on come back to contributions list from media details fragment * Add date with year parameter to Notification class, because we will use it on comparasion of dates * Check if user visited noifications activity after last notification came * Add ation to notification icon * Add nearby custom card view class * Add card view to activity * Add a button which will be displayed when nearby permission is not granted thus closest point can't be displayed on main screen. Besides, theme dependent click styles are added to button * Add button click and permission request logic. Not: solve why location manager is null * Inject location manager to activity instead * Make card view dismissable with swip * Add preference to disable or display closest nearby location * Add a bugfix to set visibility of nearby notification cardview * Add UI modifier methods to display notifications * Modify getFromWikidataQuery method, so that based on the restunClosestResult boolean, we get only the closest nearby place, instead of fetching bunch of nearby places each time * Make inner class vaariables public to reach them out of package * Temporarily comment out icon setter methods since it crashes under API19 * Inject location manager * Register location manager accoring to permission is given, then call nearby card view updater methods * Change method calls loadAttractionsFromLocation by considering new parameter to decide between closest nearby call or an usual nearby call * Add progress bar to nearby cardview * Fix notifications string * Hide nearby card view when Media Details is visible * Change tab on nerby card view click * Add hardcoded strings to strings.xml * Move nearby activity to new nearby frament * Add fragments for nearby list and map into outer nearby fragment * Change options menu item according to tab view * Make nearby card view invisible on swipe to nearby tab * Use retained nearby fragment * Add action to list sheet button * This commit caused contrib list become invisible thus, Revert "Use retained nearby fragment" This reverts commit 86b3633. * Make sure retained fragments are used for -both- nearby and contrib fragments * Remove unrelated part added because of confusion, sorry * Make sure nearbyNotificationCardView visibility works corrent * Move nearby methods from nerby activity to nearby fragment, and add a lastLocationDuplicate variable to distinguish first time location from nearby fragment and nearby notification card on contributions activity * Change activity.findViewByID lines with parentFragment.view.findViewById * Remove toolbar from nearby fragment, since contributions activity already has * Disable view pager swipe, since using map is very hard with swipe option of view pager * Place progress bar inside nearby card notification to center * Make sure using retaied nearby map fragment and nearby list fragment inside nearby fragment * Update nearby notification content on slight location updates too, if it is first update after on resume. This prevented very long time loading progress bar * Add case for no nearest pleace found, to prevent bug * Prevent a possible bug can be caused from activity already killed * Add click actions to FAB buttons in contributions list fragment. And arrange FAB margins * Try to use a new location manager instance instead of using single object for both nearby map and nearby notification card view. Because location manager has a state mechanism which is designed to be called from a single point. When I call same methods from both nearby card view notification and nearby map, next update time of map etc. gets confused. * Set radius to initial value on getFromWikidataQuery (when it is called for getting closest result to be used in nearby card view notification). Normally, algorithm increase radius, this technique works for nearby map but when it comes to finding nearest point, it can return null * Add an enum to make card view visibility more stable, however, still there is a bug. * Prevent some more nearby card view visilbility bugs, however still there is a bug * Add some nullchecks for precaution * Check nearby permission and refresh nearby view if nearby tab selected, othervise do nothing * Send user to contrib tab if permission is denied after masrhmallow * Change nearby fragment background so that progress bar is visible now * Reduce code duplicate * request location and gps permission from contribution nearby car view too * Make sure using retained fragments * Make sure Contrib list fragment is retained on orientation change * Fix NPE at options menu * Make fragment flag fancier, define it per fragment instance, instead of activity * Fix Service leak and onsavedInstance NPE errrors both occured on orientation change * Refresh nearby map on orientation change * Remove unused imports, organise logs and add comments for NearbyMapFragment class * Remove all references of nearby activity, since we don't use it anymore * Remove unused imports, organise logs and add comments for Nearby Controller * Remove unused imports, organise logs and add comments for NearbyFragment * Remove unused imports, organise logs and add comments for NearbyNotificationCardView * Change class name from Contributions Activity to Main Activity. Remove unused imports, organise logs and add comments for MainAtivity * Remove extra spaces * Remove unused imports and logs * Remove unused imports, organise logs and add comments for LocationServiceManager * Remove unused imports, organise logs and add comments for NotificationsActivity * Remove unused imports, organise logs and add comments for Contributions Fragment * bug fix nearby notification card dismiss/restore issue * Change display_nearby_notification_summary varibale with Tap here to see the nearest place that needs pictures * Add nearest place notification card dismiss toast * Fix mistake made on previous commit, while fixing conflicts * Set no data yet message invisible after contributions list is loaded * Change FAB margins, according to Josephine's review * Change FAB margins, according to Josephine's review * Change contributions list background to white, to make FAB more visible * Add infobutton with popup window next to nearby tba, to explain what does this tab do * Change hambuger icon to back arrow when media details activity visible * On back button clicked from nearby fragment, switch back to contributions fragment, instead of closing the app * Check nearby card view visibility on coming back from media details activity * Change notification icon with default vector supplied by android vector repos. If we use the one I drawn on inkscape, produced vector is not compatible with API level 19 and below. I couldn't find a proper solution, and decided to change icon * Fix a possible NPE, caused by loation manager has Main activity reference after it is destroyed * Change hardcoded string with var from string xml * Make sure you listen storage permissions from contribution list framgent FABs * Make sure you listened storage permissions for Neaby fragment buttons too * Check NPEs causing crashes. Now it does not crash after coming back from settings activity * Make notification icon compatible with <API19 devices, by drawing and using .png images * Change back icon arrow vector with png * Attempt to solve location manager caused memory leak * Fix memory leaks and optimize imports * Merge 2.9 release * Small ui fixes on new main ui (commons-app#1995) * Return to main activity from notifications activity on back button is pressed * Make nearby info image a little far from nearby text, to prevent wrong clicks * Bug fix issue commons-app#1999 (commons-app#2000) * Added a threshold on swipe, ie. if a swipe is considered a swipe only if it covers a distance of 100dp * Multiple uploads with over haul (commons-app#1968) * Added new upload activity that receives shared files from the gallery. Cards show and hide, plus titles are correct. Displayed thumbnails for the shared images * Better handling of the view paging plus error handling for required fields. * Code cleanup to make things more readable. * Extracted a model from the category search fragment that can possibly be shared with the new upload activity. * Added category selection to the combined upload screen. * Cleanup before the home-stretch on the GUI. * Adding license selection. * Fixed build warnings + cleanup * Start to support the dark theme. * Work in progress to add quality checking. * Fixing merge. * GPSExtractor: optimized away the EXifInterface object * Implemented submit functionality, temporarily fixed jacoco crash by disabling DUMMY UploadView object. * Implemented uploading of categories along with the picture. The category screen now displays GPS and recent categories when nothing is searched. * Implemented caching of files. Did some work on picture quality detection. * Implemented too dark picture detection. * Added a side card for zoom and map buttons along with pretty animations for stuff. * Added duplicate image on commons checking and fixed files not getting proper file extensions in several places. * Added support for map button and switched in-app upload buttons to UploadActivity * Pretty pretty animations! * Implemented zoom functionality for th background image. Just pinching on the image works instead of requiring buttons. * Added multi-language descriptions with categories by region. * Reimplemented the duplicate title checker and implemented a check against putting the same language twice in the description. * Javadocs for Description and UploadPresenter, plus some general cleanup. * Small code changes. * Implemented login checks for the Upload screen. * Implement receiving data from Nearby. * Feature/permissions library (commons-app#1855) * Added permission for Dexter, the runtime permission handling library * [Preparing fir issue commons-app#1773] Added a utility function which would take the user to app settings screen where he could manually give us the required permission * Added an alert dialog with positive and negative callback [Preparing fir issue commons-app#1773] * Improvements in the way External Storage Permission is handled in MultipleShareActivity[Bug fix commons-app#1697] 1. Used dexter to handle the external storage permission 2. Behaviour changes : When user tries to share(uppload) images to commons via MultipleShareActivity, following decision tree is followed a. If the app has permission for external storage, normal upload operation is followed b. If the app does not has the permission for external storage, dexter is used to ask for the same c. If the user gives us the required permission, normal upload flow is proceeded d. If the doesnot gives us the required permission a rationale dialog is shown with the appropriate message to let him know why we need the permission e. If he presses okay, steps a-c are followed and if he presses cancel, we close the app. f. If while asking for permission, the user chooses never ask again, then next time he tries to upload an image via MSA, the rational dialog follows the app setting screen where he could manually give us the required permission and the onActivityResult of same is handled * Added a Constants class to handle request and result codes from one place and other related constants common to the all app elements * replaced hardcoded strings ok and cancel in DialogUtil to string resources * init permission rationale dialog in activities onCreate * Code formatting, updated access modifiers wherever required, added javadocs for new methods created * *shifted constants to app class *Added JavaDocs in PermissionUtils * removed class REQUEST_CODES from CommonsApplication and instead put the enclosing constants in the App class itself * Made Codacy happy. * Abstarcted permission acquisition into new class DexterPermissionObtainer * Fixed Nearby upload detection * Migrated bad picture detection from AsyncTask to RxJava. * Removed ShareActivity and related dead code * Removed dead or duplicate code from FileProcessor * Added info button to title EditText * Fixed the add description button not disappearing. Added "Starting Upload" toast. Added link to the license on final screen. Made it so that the map button is hidden when image lacks gps coords. * Support in app multiple uploads * Minor changes to fix build * Changes to fix pending issues with upload flow * Fix display of similar image fragment * When uploading several files at once the date is missing commons-app#1854 (#2) * Bug fix issue commons-app#1854 * updated ContributionsDao to save create date, which it was not doing currently [it was instead saving current date] * UploadItem accepts are dateCreated param * Added a function in UploadModel, getFileCreatedDate which tries to fetched the file creaction date from all possible content providers. * Fix pending issues in upload flow * Make multiple uploads work for Google Photos * Fix default state for upload activity * Fix keyboard state for license screen * Fix descriptions for uploads * wip * Fix language spinner * Fix visibility error on media details view (commons-app#2009) * Localisation updates from https://translatewiki.net.
* Add "rawUsername" (without underscore instead of spaces) to SessionManager as Bundle to preserve string. * Update UploadController.java * Update UploadController.java * Update for my fork (#4) * Added resaons in dropdown list * Made changes * Fixed Conflicts * Shifted strings to String.xml * Localisation updates from https://translatewiki.net. * Remove unused mediawiki api dependency (#1991) * Categories with pipe suffix (#1873) * Bug fix issue #1826 Changes made : -Certain category names used to show suffixed with strings prefixed with pipe '|'. Removed everything after the pipe. As per the discussion on the thread, its safe to remove everything after the pipe, including the pipe * review suggested changes *Code formatting *Extracted out the index of pipe in a variable *Added issue link in comments * Remove libraries section from README (#1988) * Remove libraries section from README * Add wiki link to "libraries used" to README * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Main screen ui changes, fixes #725 Main screen UI overhaul (#1922) * Delete Contributions Activity content to rewrite it * Add layout for new Contributions Activity design * Bind views * Override auth cookie required * Add tabs and fragments method * Create ContributionsFragment which will hold ContributionsListFragment and MediaDetailsFragment * Add NearbyFragment which will hold NearbyMapFragment and NearbyListFragment * Add ContributionsActivityPagerAdapter inner class to manage view pager * Create strings will be written on tabs for contributions and nearby * Create setTabAndViewPagerSynchronisation method to sycn view pager and tab layout. If user swipe pages, tabs will also change (and vice versa) * Add theme dependent background color for Drawer Layout of activity_contributions layout file * Add theme dependent background color for tabs in main * Create Contributions Fragment structure which will hold Media Detail Fragment and Contributions List Fragment * Inifilate contributions list fragment view * Create variables and methods to reuse and create Media Detils Fragment and Contributions List Fragment which will be inside Contribution Fragment * Override cursor loader methods * set MediaDetilsView fragment or ContributionListFragment according to users state * Show details of an image when item is clicked * Add delete and retry functionality, note: not tested yet * Override media count methods * Implement onBack Pressed settings * Register and unregister datasetObservers * Add contributin list fragment * Add contribution list layout with FABs for camera and galerry * Make sure we called onAuthAcquired from fragment after is is attached * Create ContributionListViewUtils class to change visibility of views according to MediaDetailsFragment visiblity or their loading state * Make number of uploads visible if contribution list is visible and number of uploads is uploaded. Progress bar is visible if contribution list is visible and number of uploads are uploading. Both invisible if Media Details Fragment is visible * Return parent fragment instead of parent activity * GetPagerFragment instead of getActivity since currently ContributionsFragment take over responsibility from ContributionsActivity * Add contribution number next to tab text for contribution, as discussed in thread * Remove number of uploads from contributions fragment since we moved it text of tab layout * Add unread notifications asynctask to check unread notifications on background * Save latest time user notification activity viewed * Add shared preferences provider for latest notification activity visit time * Add shared preferences provider for latest notification activity visit time * Change notification icon (add blue dot) whenever a notification comes * Recover notifications state on come back to contributions list from media details fragment * Add date with year parameter to Notification class, because we will use it on comparasion of dates * Check if user visited noifications activity after last notification came * Add ation to notification icon * Add nearby custom card view class * Add card view to activity * Add a button which will be displayed when nearby permission is not granted thus closest point can't be displayed on main screen. Besides, theme dependent click styles are added to button * Add button click and permission request logic. Not: solve why location manager is null * Inject location manager to activity instead * Make card view dismissable with swip * Add preference to disable or display closest nearby location * Add a bugfix to set visibility of nearby notification cardview * Add UI modifier methods to display notifications * Modify getFromWikidataQuery method, so that based on the restunClosestResult boolean, we get only the closest nearby place, instead of fetching bunch of nearby places each time * Make inner class vaariables public to reach them out of package * Temporarily comment out icon setter methods since it crashes under API19 * Inject location manager * Register location manager accoring to permission is given, then call nearby card view updater methods * Change method calls loadAttractionsFromLocation by considering new parameter to decide between closest nearby call or an usual nearby call * Add progress bar to nearby cardview * Fix notifications string * Hide nearby card view when Media Details is visible * Change tab on nerby card view click * Add hardcoded strings to strings.xml * Move nearby activity to new nearby frament * Add fragments for nearby list and map into outer nearby fragment * Change options menu item according to tab view * Make nearby card view invisible on swipe to nearby tab * Use retained nearby fragment * Add action to list sheet button * This commit caused contrib list become invisible thus, Revert "Use retained nearby fragment" This reverts commit 86b3633. * Make sure retained fragments are used for -both- nearby and contrib fragments * Remove unrelated part added because of confusion, sorry * Make sure nearbyNotificationCardView visibility works corrent * Move nearby methods from nerby activity to nearby fragment, and add a lastLocationDuplicate variable to distinguish first time location from nearby fragment and nearby notification card on contributions activity * Change activity.findViewByID lines with parentFragment.view.findViewById * Remove toolbar from nearby fragment, since contributions activity already has * Disable view pager swipe, since using map is very hard with swipe option of view pager * Place progress bar inside nearby card notification to center * Make sure using retaied nearby map fragment and nearby list fragment inside nearby fragment * Update nearby notification content on slight location updates too, if it is first update after on resume. This prevented very long time loading progress bar * Add case for no nearest pleace found, to prevent bug * Prevent a possible bug can be caused from activity already killed * Add click actions to FAB buttons in contributions list fragment. And arrange FAB margins * Try to use a new location manager instance instead of using single object for both nearby map and nearby notification card view. Because location manager has a state mechanism which is designed to be called from a single point. When I call same methods from both nearby card view notification and nearby map, next update time of map etc. gets confused. * Set radius to initial value on getFromWikidataQuery (when it is called for getting closest result to be used in nearby card view notification). Normally, algorithm increase radius, this technique works for nearby map but when it comes to finding nearest point, it can return null * Add an enum to make card view visibility more stable, however, still there is a bug. * Prevent some more nearby card view visilbility bugs, however still there is a bug * Add some nullchecks for precaution * Check nearby permission and refresh nearby view if nearby tab selected, othervise do nothing * Send user to contrib tab if permission is denied after masrhmallow * Change nearby fragment background so that progress bar is visible now * Reduce code duplicate * request location and gps permission from contribution nearby car view too * Make sure using retained fragments * Make sure Contrib list fragment is retained on orientation change * Fix NPE at options menu * Make fragment flag fancier, define it per fragment instance, instead of activity * Fix Service leak and onsavedInstance NPE errrors both occured on orientation change * Refresh nearby map on orientation change * Remove unused imports, organise logs and add comments for NearbyMapFragment class * Remove all references of nearby activity, since we don't use it anymore * Remove unused imports, organise logs and add comments for Nearby Controller * Remove unused imports, organise logs and add comments for NearbyFragment * Remove unused imports, organise logs and add comments for NearbyNotificationCardView * Change class name from Contributions Activity to Main Activity. Remove unused imports, organise logs and add comments for MainAtivity * Remove extra spaces * Remove unused imports and logs * Remove unused imports, organise logs and add comments for LocationServiceManager * Remove unused imports, organise logs and add comments for NotificationsActivity * Remove unused imports, organise logs and add comments for Contributions Fragment * bug fix nearby notification card dismiss/restore issue * Change display_nearby_notification_summary varibale with Tap here to see the nearest place that needs pictures * Add nearest place notification card dismiss toast * Fix mistake made on previous commit, while fixing conflicts * Set no data yet message invisible after contributions list is loaded * Change FAB margins, according to Josephine's review * Change FAB margins, according to Josephine's review * Change contributions list background to white, to make FAB more visible * Add infobutton with popup window next to nearby tba, to explain what does this tab do * Change hambuger icon to back arrow when media details activity visible * On back button clicked from nearby fragment, switch back to contributions fragment, instead of closing the app * Check nearby card view visibility on coming back from media details activity * Change notification icon with default vector supplied by android vector repos. If we use the one I drawn on inkscape, produced vector is not compatible with API level 19 and below. I couldn't find a proper solution, and decided to change icon * Fix a possible NPE, caused by loation manager has Main activity reference after it is destroyed * Change hardcoded string with var from string xml * Make sure you listen storage permissions from contribution list framgent FABs * Make sure you listened storage permissions for Neaby fragment buttons too * Check NPEs causing crashes. Now it does not crash after coming back from settings activity * Make notification icon compatible with <API19 devices, by drawing and using .png images * Change back icon arrow vector with png * Attempt to solve location manager caused memory leak * Fix memory leaks and optimize imports * Merge 2.9 release * Small ui fixes on new main ui (#1995) * Return to main activity from notifications activity on back button is pressed * Make nearby info image a little far from nearby text, to prevent wrong clicks * Bug fix issue #1999 (#2000) * Added a threshold on swipe, ie. if a swipe is considered a swipe only if it covers a distance of 100dp * Multiple uploads with over haul (#1968) * Added new upload activity that receives shared files from the gallery. Cards show and hide, plus titles are correct. Displayed thumbnails for the shared images * Better handling of the view paging plus error handling for required fields. * Code cleanup to make things more readable. * Extracted a model from the category search fragment that can possibly be shared with the new upload activity. * Added category selection to the combined upload screen. * Cleanup before the home-stretch on the GUI. * Adding license selection. * Fixed build warnings + cleanup * Start to support the dark theme. * Work in progress to add quality checking. * Fixing merge. * GPSExtractor: optimized away the EXifInterface object * Implemented submit functionality, temporarily fixed jacoco crash by disabling DUMMY UploadView object. * Implemented uploading of categories along with the picture. The category screen now displays GPS and recent categories when nothing is searched. * Implemented caching of files. Did some work on picture quality detection. * Implemented too dark picture detection. * Added a side card for zoom and map buttons along with pretty animations for stuff. * Added duplicate image on commons checking and fixed files not getting proper file extensions in several places. * Added support for map button and switched in-app upload buttons to UploadActivity * Pretty pretty animations! * Implemented zoom functionality for th background image. Just pinching on the image works instead of requiring buttons. * Added multi-language descriptions with categories by region. * Reimplemented the duplicate title checker and implemented a check against putting the same language twice in the description. * Javadocs for Description and UploadPresenter, plus some general cleanup. * Small code changes. * Implemented login checks for the Upload screen. * Implement receiving data from Nearby. * Feature/permissions library (#1855) * Added permission for Dexter, the runtime permission handling library * [Preparing fir issue #1773] Added a utility function which would take the user to app settings screen where he could manually give us the required permission * Added an alert dialog with positive and negative callback [Preparing fir issue #1773] * Improvements in the way External Storage Permission is handled in MultipleShareActivity[Bug fix #1697] 1. Used dexter to handle the external storage permission 2. Behaviour changes : When user tries to share(uppload) images to commons via MultipleShareActivity, following decision tree is followed a. If the app has permission for external storage, normal upload operation is followed b. If the app does not has the permission for external storage, dexter is used to ask for the same c. If the user gives us the required permission, normal upload flow is proceeded d. If the doesnot gives us the required permission a rationale dialog is shown with the appropriate message to let him know why we need the permission e. If he presses okay, steps a-c are followed and if he presses cancel, we close the app. f. If while asking for permission, the user chooses never ask again, then next time he tries to upload an image via MSA, the rational dialog follows the app setting screen where he could manually give us the required permission and the onActivityResult of same is handled * Added a Constants class to handle request and result codes from one place and other related constants common to the all app elements * replaced hardcoded strings ok and cancel in DialogUtil to string resources * init permission rationale dialog in activities onCreate * Code formatting, updated access modifiers wherever required, added javadocs for new methods created * *shifted constants to app class *Added JavaDocs in PermissionUtils * removed class REQUEST_CODES from CommonsApplication and instead put the enclosing constants in the App class itself * Made Codacy happy. * Abstarcted permission acquisition into new class DexterPermissionObtainer * Fixed Nearby upload detection * Migrated bad picture detection from AsyncTask to RxJava. * Removed ShareActivity and related dead code * Removed dead or duplicate code from FileProcessor * Added info button to title EditText * Fixed the add description button not disappearing. Added "Starting Upload" toast. Added link to the license on final screen. Made it so that the map button is hidden when image lacks gps coords. * Support in app multiple uploads * Minor changes to fix build * Changes to fix pending issues with upload flow * Fix display of similar image fragment * When uploading several files at once the date is missing #1854 (#2) * Bug fix issue #1854 * updated ContributionsDao to save create date, which it was not doing currently [it was instead saving current date] * UploadItem accepts are dateCreated param * Added a function in UploadModel, getFileCreatedDate which tries to fetched the file creaction date from all possible content providers. * Fix pending issues in upload flow * Make multiple uploads work for Google Photos * Fix default state for upload activity * Fix keyboard state for license screen * Fix descriptions for uploads * wip * Fix language spinner * Fix visibility error on media details view (#2009) * Localisation updates from https://translatewiki.net. * Update UploadController.java * Repair gradle file Repair gradle build file so that it uses buildToolsVersion buildToolsVersion. * Repair gradle repair gradle * repair gradle repair gradle to fix Travis * Update UpdateModel() sessionManager.getUserName() >> sessionManager.getRawUserName() It will build new Contribution with stored username string without underscore. * Add getAuthorName. In case getRawUserName return null as described in #1982 this method, will return getUsername. Users with underscore issue will see the fix after re-log.
In the upload revamp, commit f607c1c (Multiple uploads with over haul (commons-app#1968), 19 Nov 2018), kept back the label for the single upload intent but removed the label for the multiple upload intent. Correct it and bring back the label for the multiple upload intent thus giving a more useful label for the intent, again.
In the upload revamp, commit f607c1c (Multiple uploads with over haul (#1968), 19 Nov 2018), kept back the label for the single upload intent but removed the label for the multiple upload intent. Correct it and bring back the label for the multiple upload intent thus giving a more useful label for the intent, again.
Title (required)
Fixes #604
Fixes #1128
Description (required)
Continued on top of #1796.
Tests performed (required)
Uploads:
In the current ShareActivity:
Category suggestions/selection:
When search text field is empty, display:
When user types in search text field:
Warnings:
Image templates:
Ensure the same templates are added (not sure if this will be an issue if backend has not changed, but make sure you check). > done