Skip to content
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

Merged

Conversation

maskaravivek
Copy link
Member

Title (required)

Fixes #604
Fixes #1128

Description (required)

Continued on top of #1796.

  • upload overhaul
  • in-app multiple uploads

Tests performed (required)

Uploads:

  • Camera upload > done
  • Camera nearby upload with successful wikidata edit > done
  • Single gallery upload > done
  • Multiple gallery upload > done
  • Gallery upload with successful wikidata edit > done

In the current ShareActivity:

  • Tooltips for title, desc, license fields > done
  • Language selector for desc > done
  • Prefilling of title and desc when upload initiated via Nearby > done
  • License selector > done
  • Link to license and Commons policies > done
  • Zoom in (and back out) > done
  • Open location of image on maps > done

Category suggestions/selection:

  • When search text field is empty, display:

    • Recent categories > done
    • Location-based category suggestions (if image has geolocation) > not working
    • Title-based category suggestions > not working
    • Wikidata item category (if image is uploaded via Nearby and if that Wikidata item has a category) > not working
  • When user types in search text field:

    • Check for categories shortly after typing stops, repeatedly > done
    • Display exact matches at the top > done
    • Categories selected via both of these suggestion types need to be added to the list of category selections > done

Warnings:

  • If image is too dark > done
  • If image already exists in Commons (via hash check) > done
  • If user tries to submit empty title (do not allow to proceed) > The submit button is disabled for this case
  • If user does not select any categories

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

@maskaravivek
Copy link
Member Author

If the user tries to submit empty title (do not allow to proceed)

The submit button is disabled for this case. Should proceed button be disabled instead of disabling the Submit button in the final step?

If user does not select any categories

Shows no warning as of now. Will be fixing this as well.

Category suggestion seems to be not working for the following cases. Will be fixing it soon:

  • Location-based category suggestions (if the image has geolocation) > not working
  • Title-based category suggestions > not working
  • Wikidata item category (if image is uploaded via Nearby and if that Wikidata item has a category) > not working

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. :)

@misaochan
Copy link
Member

misaochan commented Nov 1, 2018

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:

  • Does multiple uploads via in-app Gallery button work for you? When I select two images from my in-app Gallery, only one is displayed in the upload activity, and only one is actually uploaded. However, multiple uploads works when activated via Share. :)

  • The steps in multiple upload are a bit confusing. Step 1 is to title/desc the first image, Step 2 is to title/desc the second image, but there is only one category selection for both? IMO we have to pick one - either we treat all images as separate ones and require separate title/descs AND separate categories for them, or we treat them all as related (as I suggested here) and require only one title/desc and one category selection (adding numbered prefixes to the title as required). I would vote for the second option, and with a limit of 5 uploads per round as mentioned in that comment.

  • Typing in the Title/Desc activity (Step 1) feels very laggy. I doubt it is my emulator, since typing in the category activity is fine, and when I loaded a previous version of the app to test, there is no lag in the same emulator. Do you encounter this as well?

  • Sometimes when I am halfway through typing a title and pause (e.g. I was going to type "Farm near Belmont", but paused after "Farm"), I get a warning "A file with the name Farm.jpg exists. Please consider changing it." IMO this check should only be done AFTER the user taps Proceed. If there is an ongoing check, this may explain the reason for my lag issue above. [Edit: Yup, the logs show that it checks after every character typed! Don't do that. :)]

11-01 20:03:49.248 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Pea
11-01 20:03:49.457 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peac
11-01 20:03:49.569 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peaco
11-01 20:03:49.756 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacoc
11-01 20:03:49.953 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock
11-01 20:03:50.082 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock 
11-01 20:03:50.165 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock i
11-01 20:03:50.322 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in
11-01 20:03:50.473 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in 
11-01 20:03:50.708 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in L
11-01 20:03:50.899 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Li
11-01 20:03:51.089 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Lit
11-01 20:03:51.279 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Litt
11-01 20:03:51.286 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Littl
11-01 20:03:51.383 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little
11-01 20:03:51.505 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little 
11-01 20:03:51.661 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little P
11-01 20:03:51.824 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Pa
11-01 20:03:51.890 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Par
11-01 20:03:52.112 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Para
11-01 20:03:52.311 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Parad
11-01 20:03:52.426 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradi
11-01 20:03:52.494 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradis
11-01 20:03:52.578 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradise
11-01 20:03:52.662 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradise 
11-01 20:03:53.352 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradise g
11-01 20:03:53.538 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradise ga
11-01 20:03:53.719 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradise gar
11-01 20:03:53.873 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradise gard
11-01 20:03:54.090 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradise garde
11-01 20:03:54.151 11042-11042/fr.free.nrw.commons I/Title: Setting title text to Peacock in Little Paradise garden
  • Warnings should be done after each "Proceed" tap. So "no title" warning after user taps Proceed at Step 1, and "no category" warning after user taps Proceed at Step 2. "No category" can be allowed to proceed after they dismiss the dialog, "no title" should not.

  • Coordinates are not added to the image template. I just uploaded an image that I checked had location data, but the upload had none. Exif data is not added either, but I'm not sure if that is caused by your PR or by When uploading several files at once the date is missing #1854 .

@misaochan
Copy link
Member

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. :)

@maskaravivek
Copy link
Member Author

Thanks for reviewing and testing the PR @misaochan. Will incorporate the feedback based on your comments.

The steps in multiple upload are a bit confusing. Step 1 is to title/desc the first image, Step 2 is to title/desc the second image, but there is only one category selection for both? IMO we have to pick one - either we treat all images as separate ones and require separate title/descs AND separate categories for them, or we treat them all as related (as I suggested here) and require only one title/desc and one category selection (adding numbered prefixes to the title as required). I would vote for the second option.

@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.

  • This would be an enhancement over the current flow where the set is appended with numbers 1..2..3 etc. As title is non editable, I would personally prefer naming it to my satisfaction.
  • On clicking the gallery button, the user can be educated using a Showcase about selecting images of a particular category only.
  • Generally people would be interested about uploading photos of a place/visit which would usually have a common category. For eg. I clicked a lot of pictures of penguins at Boulder's beach and uploaded the photos using multiple uploads option. Here I wanted to select the same category for all photos but it would have been great to name all the photos individually.
  • Categories can be edited later. Right now the app doesn't allow for category edits afterwards but its in our PG 2019 plans(Modify categories/description afterwards #161).
  • Web frontend has the infrastructure to allow for both title/desc and category selection while making multiple uploads but with limited screen space on mobile it might be a good step to atleast start allowing title/desc. Hopefully, we can later evolve the UI to support individual category selection screens or we could have different flows based on user choice.

and with a limit of 5 uploads per round as mentioned in that comment.

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.

@misaochan
Copy link
Member

misaochan commented Nov 4, 2018

@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.

screenshot_1541334036

@maskaravivek
Copy link
Member Author

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.

Sure. Will add the sub texts.

How much time do you reckon it'll take for a custom implementation of a 5 image limit?

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. :(

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 do.

@commons-app commons-app deleted a comment Nov 4, 2018
@misaochan
Copy link
Member

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.

@ashishkumar468
Copy link
Collaborator

Do you feel 1 week should be enough for implementing the custom UI?

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.

@misaochan
Copy link
Member

misaochan commented Nov 5, 2018

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...

@maskaravivek
Copy link
Member Author

@misaochan We can probably use a library for now and implement a custom UI in future, keeping the task as a tech debt.

@misaochan
Copy link
Member

@maskaravivek Fair point. Matisse does look quite reputable. Shall we go with that for now?

@codecov-io
Copy link

codecov-io commented Nov 5, 2018

Codecov Report

Merging #1968 into 2.9-release will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@              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
Impacted Files Coverage Δ
.../fr/free/nrw/commons/di/ActivityBuilderModule.java 0% <ø> (ø) ⬆️
.../fr/free/nrw/commons/di/FragmentBuilderModule.java 0% <ø> (ø) ⬆️
...r/free/nrw/commons/auth/AuthenticatedActivity.java 0% <ø> (ø) ⬆️
...java/fr/free/nrw/commons/upload/UploadService.java 0% <ø> (ø) ⬆️
...n/java/fr/free/nrw/commons/theme/BaseActivity.java 56.25% <ø> (ø) ⬆️
...ava/fr/free/nrw/commons/utils/PermissionUtils.java 0% <ø> (ø) ⬆️
...main/java/fr/free/nrw/commons/upload/Language.java 0% <ø> (ø) ⬆️
.../free/nrw/commons/di/CommonsApplicationModule.java 27.5% <0%> (-16.5%) ⬇️
.../nrw/commons/upload/HeightLimitedRecyclerView.java 0% <0%> (ø)
...src/main/java/fr/free/nrw/commons/utils/BiMap.java 0% <0%> (ø)
... and 50 more

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 ab401fd...cff471e. Read the comment docs.

@maskaravivek
Copy link
Member Author

maskaravivek commented Nov 5, 2018

Have made the following fixes:

Category suggestions:

  • Location-based category suggestions (if the image has geolocation)
  • Title-based category suggestions
  • Wikidata item category (if image is uploaded via Nearby and if that Wikidata item has a category)

Warnings:

  • If the user tries to submit empty title (do not allow to proceed)
  • If user does not select any categories
  • If the title of the image is duplicate

Also, based on the review:

Does multiple uploads via in-app Gallery button work for you?

Yes, it works for me just like the gallery uploads

Typing in the Title/Desc activity (Step 1) feels very laggy.

Yes, earlier an API call was being made after every character was typed. Fixed. :)

Sometimes when I am halfway through typing a title and pause (e.g. I was going to type "Farm near Belmont", but paused after "Farm"), I get a warning "A file with the name Farm.jpg exists.

Fixed. Now the check is made only when Next is clicked.

Warnings should be done after each "Proceed" tap. So "no title" warning after user taps Proceed at Step 1, and "no category" warning after user taps Proceed at Step 2. "No category" can be allowed to proceed after they dismiss the dialog, "no title" should not.

Done.

Coordinates are not added to the image template. I just uploaded an image that I checked had location data, but the upload had none. Exif data is not added either, but I'm not sure if that is caused by your PR or by #1854 .

@ashishkumar468 is working on it.

I forgot to mention - please make sure the temp file changes in #1749 are included, otherwise the crashes will resume.

@ashishkumar468's fix should take care of this as well.

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.

Done.

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.

Fixed.

@commons-app commons-app deleted a comment Nov 5, 2018
@maskaravivek maskaravivek changed the base branch from master to 2.9-release November 6, 2018 08:20
@misaochan
Copy link
Member

misaochan commented Nov 6, 2018

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:

  • Fresh install of app
  • Log in
  • Tap Gallery button in app
  • Go to Google Photos and select 3 images
  • Receiving shared content, then ShareActivity loads with just 1 image, Step 1 of 3 (if there are 3 images in set it should be Step 1 of 5).
  • Completed all 3 steps, and indeed only 1 image was uploaded.

screenshot_1541516341

11-07 00:55:20.481 24487-24487/fr.free.nrw.commons D/ContributionsListFragme: onRequestPermissionsResult: req code =  perm = [android.permission.READ_EXTERNAL_STORAGE] grant =[0]
11-07 00:55:20.482 24487-24487/fr.free.nrw.commons D/ContributionsListFragme: Call controller.startGalleryPick()
11-07 00:55:20.482 24487-24487/fr.free.nrw.commons D/ContributionController: startGalleryPick() called with pickImageIntent
11-07 00:55:20.995 24487-24514/fr.free.nrw.commons D/EGL_emulation: eglMakeCurrent: 0xe4b84420: ver 3 1 (tinfo 0xe4b83450)
11-07 00:56:12.487 24487-24487/fr.free.nrw.commons D/ContributionsListFragme: OnActivityResult() parameters: Req code: 3 Result code: -1 Data: Intent { dat=content://com.google.android.apps.photos.contentprovider/0/1/mediakey:/local%3A1c758eec-6c87-4813-81ed-e5117ed610a8/ORIGINAL/NONE/2091809993 flg=0x1 clip={text/uri-list U:content://com.google.android.apps.photos.contentprovider/0/1/mediakey%3A%2Flocal%253A1c758eec-6c87-4813-81ed-e5117ed610a8/ORIGINAL/NONE/2091809993 ...} }
11-07 00:56:12.488 24487-24487/fr.free.nrw.commons D/ContributionController: handleImagePicked() called with onActivityResult(). Boolean isDirectUpload: falseString wikiDataEntityId: null
11-07 00:56:12.501 24487-24487/fr.free.nrw.commons I/ContributionController: Image selected
11-07 00:56:12.501 24487-24487/fr.free.nrw.commons D/ContributionController: Put extras into image intent, isDirectUpload is false
11-07 00:56:12.503 27328-29987/system_process I/ActivityManager: START u0 {act=android.intent.action.SEND typ=image/jpeg flg=0x1 cmp=fr.free.nrw.commons/.upload.UploadActivity clip={image/jpeg U:content://com.google.android.apps.photos.contentprovider/0/1/mediakey%3A%2Flocal%253A1c758eec-6c87-4813-81ed-e5117ed610a8/ORIGINAL/NONE/2091809993} (has extras)} from uid 10090
11-07 00:56:12.641 24487-24487/fr.free.nrw.commons I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
11-07 00:56:12.854 24487-24487/fr.free.nrw.commons D/ExternalStorageUtils: External storage permission not granted, API >= 23
11-07 00:56:12.857 24487-24487/fr.free.nrw.commons D/DexterPermissionObtaine: External storage permission is being requested
11-07 00:56:12.876 27328-28019/system_process I/ActivityManager: START u0 {cmp=fr.free.nrw.commons/com.karumi.dexter.DexterActivity} from uid 10090
11-07 00:56:12.918 24487-24487/fr.free.nrw.commons D/ExternalStorageUtils: External storage permission not granted, API >= 23
11-07 00:56:12.924 24487-24499/fr.free.nrw.commons I/zygote: Background concurrent copying GC freed 8381(559KB) AllocSpace objects, 1(20KB) LOS objects, 49% free, 3MB/6MB, paused 5.725ms total 139.265ms
11-07 00:56:12.944 24487-24514/fr.free.nrw.commons D/EGL_emulation: eglMakeCurrent: 0xe4b84420: ver 3 1 (tinfo 0xe4b83450)
11-07 00:56:13.027 24487-24487/fr.free.nrw.commons I/DescriptionsAdapter$Vie: descItemEditText:android.support.design.widget.TextInputEditText{83a3a80 VFED..CL. ......I. 0,0-0,0 #7f090092 app:id/description_item_edit_text}
11-07 00:56:13.029 24487-24487/fr.free.nrw.commons D/DescriptionsAdapter$Vie: Title is null
11-07 00:56:13.043 24487-24487/fr.free.nrw.commons I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
11-07 00:56:13.046 24487-24487/fr.free.nrw.commons I/DescriptionsAdapter$Vie: descItemEditText:android.support.v7.widget.AppCompatEditText{4bd25f1 VFED..CL. ......I. 0,0-0,0 #7f090092 app:id/description_item_edit_text}
11-07 00:56:13.047 24487-24487/fr.free.nrw.commons D/DescriptionsAdapter$Vie: Description is fr.free.nrw.commons.upload.Description@2c5a057
11-07 00:56:13.381 27328-27343/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{6412a6b u0 fr.free.nrw.commons/.upload.UploadActivity t68}
11-07 00:56:13.566 24487-24553/fr.free.nrw.commons D/CustomApiResult: API response is
     <?xml version="1.0" encoding="UTF-8"?><api batchcomplete=""><query><userinfo id="6998903" name="Misaochan2"/></query></api>
11-07 00:56:13.752 24487-24487/fr.free.nrw.commons E/RecyclerView: No adapter attached; skipping layout
11-07 00:56:13.796 24487-24487/fr.free.nrw.commons I/Choreographer: Skipped 46 frames!  The application may be doing too much work on its main thread.
11-07 00:56:13.806 24487-24514/fr.free.nrw.commons D/EGL_emulation: eglMakeCurrent: 0xe4b84420: ver 3 1 (tinfo 0xe4b83450)
11-07 00:56:14.128 24487-24493/fr.free.nrw.commons I/zygote: Do full code cache collection, code=986KB, data=644KB
11-07 00:56:14.129 24487-24493/fr.free.nrw.commons I/zygote: After code cache collection, code=964KB, data=558KB
11-07 00:56:14.158 24487-24493/fr.free.nrw.commons I/zygote: Do partial code cache collection, code=967KB, data=569KB
    After code cache collection, code=966KB, data=569KB
    Increasing code cache capacity to 3MB
11-07 00:56:14.180 24487-24514/fr.free.nrw.commons D/EGL_emulation: eglMakeCurrent: 0xe4b84420: ver 3 1 (tinfo 0xe4b83450)
11-07 00:56:14.331 24487-24487/fr.free.nrw.commons D/DexterPermissionObtaine: User has granted us the permission for writing the external storage
11-07 00:56:14.331 24487-24487/fr.free.nrw.commons I/UploadActivity: Received single upload
11-07 00:56:14.548 24487-24514/fr.free.nrw.commons D/EGL_emulation: eglMakeCurrent: 0xe4b84420: ver 3 1 (tinfo 0xe4b83450)
11-07 00:56:14.671 24487-24487/fr.free.nrw.commons D/ExternalStorageUtils: External storage permission granted, API >= 23
11-07 00:56:14.671 24487-24487/fr.free.nrw.commons I/DexterPermissionObtaine: Storage permissions already granted.
11-07 00:56:14.671 24487-24487/fr.free.nrw.commons I/UploadPresenter: uploadModel.getCount():0
11-07 00:56:14.718 24487-24487/fr.free.nrw.commons D/UploadActivity: Position: 2 Attribution-ShareAlike 3.0
11-07 00:56:14.725 24487-24487/fr.free.nrw.commons I/UploadPresenter: Updating content for currentPage1
11-07 00:56:14.726 24487-24487/fr.free.nrw.commons E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException:  (No such file or directory)
11-07 00:56:14.726 24487-24487/fr.free.nrw.commons W/ImageView: resolveUri failed on bad bitmap uri: 
11-07 00:56:14.776 24487-24564/fr.free.nrw.commons D/FileUtils: Filepath (copied): /data/user/0/fr.free.nrw.commons/cache/1541516174642.jpg
11-07 00:56:14.779 24487-24564/fr.free.nrw.commons I/UploadModel: File path is /data/user/0/fr.free.nrw.commons/cache/1541516174642.jpg
11-07 00:56:14.822 24487-24514/fr.free.nrw.commons D/EGL_emulation: eglMakeCurrent: 0xe4b84420: ver 3 1 (tinfo 0xe4b83450)
11-07 00:56:14.857 24487-24564/fr.free.nrw.commons D/FileProcessor: Calling GPSExtractor
11-07 00:56:14.858 24487-24564/fr.free.nrw.commons D/FileProcessor: filePath/data/user/0/fr.free.nrw.commons/cache/1541516174642.jpg
    folderTime Number:3
11-07 00:56:14.859 24487-24564/fr.free.nrw.commons D/FileProcessor: fild date:1541516103000 time of creation1541516174000
11-07 00:56:14.860 24487-24564/fr.free.nrw.commons D/FileProcessor: not null fild EXIFfalse coordsnull
11-07 00:56:14.864 24487-24564/fr.free.nrw.commons D/FileProcessor: fild date:1541516109000 time of creation1541516174000
11-07 00:56:14.890 24487-24564/fr.free.nrw.commons D/FileProcessor: not null fild EXIFfalse coordsnull
11-07 00:56:14.900 24487-24564/fr.free.nrw.commons D/FileProcessor: fild date:1541516174000 time of creation1541516174000
11-07 00:56:14.952 24487-24564/fr.free.nrw.commons D/FileProcessor: not null fild EXIFfalse coordsnull
11-07 00:56:15.075 24487-24564/fr.free.nrw.commons I/FileUtils: File SHA1: 39c9f154ebcd247d82570faf8455b63c8c0181c7
11-07 00:56:15.260 24487-24487/fr.free.nrw.commons D/CategoriesModel: Direct category found: 
11-07 00:56:15.261 24487-24487/fr.free.nrw.commons D/CategoriesModel: Image has no direct Cat
11-07 00:56:15.589 24487-24564/fr.free.nrw.commons D/CustomApiResult: API response is
     <?xml version="1.0" encoding="UTF-8"?><api batchcomplete=""><query><allimages/></query></api>
11-07 00:56:16.146 24487-24564/fr.free.nrw.commons D/ImageUtils: total 12192768
11-07 00:56:16.429 24487-24487/fr.free.nrw.commons I/UploadPresenter: uploadModel.getCount():1
11-07 00:56:16.435 24487-24487/fr.free.nrw.commons D/UploadActivity: Position: 2 Attribution-ShareAlike 3.0
11-07 00:56:16.439 24487-24487/fr.free.nrw.commons I/UploadPresenter: Updating content for currentPage1
11-07 00:56:17.181 24487-24487/fr.free.nrw.commons I/Choreographer: Skipped 44 frames!  The application may be doing too much work on its main thread.
11-07 00:56:17.230 24487-24487/fr.free.nrw.commons I/DescriptionsAdapter$Vie: descItemEditText:android.support.design.widget.TextInputEditText{bf432fd VFED..CL. ......I. 0,0-0,0 #7f090092 app:id/description_item_edit_text}
11-07 00:56:17.231 24487-24487/fr.free.nrw.commons D/DescriptionsAdapter$Vie: Title is null
11-07 00:56:17.248 24487-24487/fr.free.nrw.commons I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
11-07 00:56:17.250 24487-24487/fr.free.nrw.commons I/DescriptionsAdapter$Vie: descItemEditText:android.support.v7.widget.AppCompatEditText{7d0174a VFED..CL. ......I. 0,0-0,0 #7f090092 app:id/description_item_edit_text}
11-07 00:56:17.259 24487-24487/fr.free.nrw.commons D/DescriptionsAdapter$Vie: Description is fr.free.nrw.commons.upload.Description@7eea6bb
11-07 00:56:17.667 24487-24499/fr.free.nrw.commons I/zygote: NativeAlloc concurrent copying GC freed 2821(195KB) AllocSpace objects, 3(46MB) LOS objects, 50% free, 4MB/8MB, paused 781us total 489.891ms
11-07 00:56:17.833 24487-24487/fr.free.nrw.commons I/AssistStructure: Flattened final assist data: 13864 bytes, containing 1 windows, 60 views

@misaochan
Copy link
Member

misaochan commented Nov 6, 2018

  • Testing suggestions and warnings, results below:

Category suggestions:

Location-based category suggestions (if the image has geolocation)

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)

Title-based category suggestions

Works fantastic!

Wikidata item category (if image is uploaded via Nearby and if that Wikidata item has a category)

Works fantastic

Warnings:

If the user tries to submit empty title (do not allow to proceed)

Works excellent

If user does not select any categories

Works excellent

If the title of the image is duplicate

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)

  • Additional tests: In-app camera works fine, duplicate titles are given numbered suffixes appropriately and do not overwrite previous files, and .png uploads work fine. Great job! :)

  • Date of image works fine now, takes from Exif data instead of upload date. :)

  • An additional bug I found - if you type in a title and desc and go to Step 2, then tap "previous" to go back to Step 1 and modify your title/desc... the title is saved, but the desc is empty. Desc should be saved along with title. (problem 4)

  • Is there a reason the previous upload and title always shows up in the first upload screen, before it is replaced with the current file? It doesn't really impact the final outcome, but could be confusing to the user. (problem 5)

@maskaravivek
Copy link
Member Author

maskaravivek commented Nov 6, 2018

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)

Able to reproduce it for Google photos. If I choose a photo from stock gallery then in-app upload works.

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)

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.

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)

fixed.

An additional bug I found - if you type in a title and desc and go to Step 2, then tap "previous" to go back to Step 1 and modify your title/desc... the title is saved, but the desc is empty. Desc should be saved along with title. (problem 4)

Works well for multiple uploads. Doesn't work while uploading a single photo. Working on it.

@misaochan
Copy link
Member

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.

@maskaravivek
Copy link
Member Author

problem 1 and problem 3 is fixed now.

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)

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?

An additional bug I found - if you type in a title and desc and go to Step 2, then tap "previous" to go back to Step 1 and modify your title/desc... the title is saved, but the desc is empty. Desc should be saved along with title. (problem 4)

Unable to understand how the title/description is being cached. Would need someone's help to fix the issue.

Is there a reason the previous upload and title always shows up in the first upload screen, before it is replaced with the current file? It doesn't really impact the final outcome, but could be confusing to the user. (problem 5)

Have tried setting setBottomCardVisibility to show a waiting screen but it doesn't work.

@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.

@maskaravivek
Copy link
Member Author

@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.

Use previous title/description stuff was very handy. It is not there now unfortunately.

I wasn't aware that such a feature existed. Will check and add it. :)

When adding another description in another language, I encountered some problems:
I click to +, add another description and can continue without choosing the language.

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.

There is no way to regret from adding another description after tapping to +.

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.

It is really hard to find the language from list, it is not sorted in anyway
I was able to find Turkish on the list previously. But now, it is not there.

I will check why Turkish is not appearing. Infact will try to restore the previous list if that was more useful.

@neslihanturan
Copy link
Collaborator

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.

@maskaravivek
Copy link
Member Author

maskaravivek commented Nov 18, 2018

@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.
https://commons.wikimedia.beta.wmflabs.org/wiki/File:Hello_world_test_.jpg

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.

@neslihanturan
Copy link
Collaborator

By the way I tried to record weird sound during upload (on API 26)
Screencast 2018-11-18 14:37:02.mp4.zip

@neslihanturan
Copy link
Collaborator

Well, tested @maskaravivek .

  • The sound same on master too.
  • Language list is alphabetically ordered in master (pitty me scrolunt until Turkish:( )
  • Descriotions on Turkish added with no problem on master.
    image

@neslihanturan
Copy link
Collaborator

And this branch uploads descriptions on another languages with not problem as well. Thanks @maskaravivek ! :)
image

@misaochan
Copy link
Member

Successfully did a multiple upload via in-app gallery > Google Photos on API 27 :)

  • Date works perfectly
  • Desc and language works perfectly
  • App handles similar filenames perfectly

Well done @maskaravivek !! :) And thanks for the additional testing @neslihanturan .

@misaochan misaochan merged commit 2704c9e into commons-app:2.9-release Nov 19, 2018
maskaravivek added a commit that referenced this pull request Nov 19, 2018
* 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
hoplite390 added a commit to hoplite390/apps-android-commons that referenced this pull request Nov 22, 2018
*  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.
@maskaravivek maskaravivek deleted the multipleUploadsWithOverHaul branch December 2, 2018 15:16
neslihanturan pushed a commit that referenced this pull request Dec 3, 2018
* 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.
sivaraam added a commit to sivaraam/apps-android-commons that referenced this pull request Dec 23, 2018
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.
maskaravivek pushed a commit that referenced this pull request Dec 25, 2018
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.
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.

7 participants