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

Feature/refractor uploads [WIP] #2887

Conversation

ashishkumar468
Copy link
Collaborator

Description (required)

Fixes Refractor UploadActivity #2886

What changes did you make and why?
Optimised UploadActivity, added fragments for various stages of upload, switched to MVP
Tests performed (required)
Performed single and multiple uploads, seems to work fine
Tested betaDebug on OnePlus 3T with API level 27

maskaravivek and others added 14 commits March 1, 2019 02:25
* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery
* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md
* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix commons-app#2580]
* Bug Fix commons-app#2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state
* Bug Fix issue commons-app#2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction
* Addded null check on bookmark before operating on it
* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse
* Handled null auth cookies
* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest
@codecov-io
Copy link

codecov-io commented Apr 17, 2019

Codecov Report

Merging #2887 into master will increase coverage by 0.67%.
The diff coverage is 16.42%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2887      +/-   ##
=========================================
+ Coverage    3.69%   4.36%   +0.67%     
=========================================
  Files         247     257      +10     
  Lines       12216   12361     +145     
  Branches     1081    1059      -22     
=========================================
+ Hits          451     540      +89     
- Misses      11731   11783      +52     
- Partials       34      38       +4
Impacted Files Coverage Δ
...fr/free/nrw/commons/media/MediaDetailFragment.java 0% <ø> (ø) ⬆️
...va/fr/free/nrw/commons/explore/SearchActivity.java 0% <ø> (ø) ⬆️
.../fr/free/nrw/commons/category/CategoriesModel.java 0% <ø> (ø) ⬆️
.../fr/free/nrw/commons/di/FragmentBuilderModule.java 0% <ø> (ø) ⬆️
...a/fr/free/nrw/commons/upload/UploadController.java 39.08% <ø> (ø) ⬆️
app/src/main/java/fr/free/nrw/commons/Utils.java 18.03% <ø> (ø) ⬆️
.../java/fr/free/nrw/commons/upload/GPSExtractor.java 1.75% <ø> (ø) ⬆️
...ree/nrw/commons/contributions/ContributionDao.java 0% <ø> (ø) ⬆️
.../fr/free/nrw/commons/upload/ThumbnailsAdapter.java 0% <0%> (ø)
...fr/free/nrw/commons/upload/UploadBaseFragment.java 0% <0%> (ø)
... and 37 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 ab783a4...3286816. Read the comment docs.

Copy link
Collaborator

@neslihanturan neslihanturan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some style issues

import fr.free.nrw.commons.BasePresenter;
import java.util.List;

public interface IUpload {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ashishkumar468 , as we discussed privately, IClassName convention can change to ClassName convention.

@@ -52,6 +52,10 @@ public SimilarImageDialogFragment() {
public void onNegativeResponse();
}

public void setmOnResponse(onResponse mOnResponse) {
this.mOnResponse = mOnResponse;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this variable name

public class LocalDataSource {

private BasicKvStore defaultKvStore;
private JsonKvStore directKvStore;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy complaints that this variables are not used.

@neslihanturan
Copy link
Collaborator

Hi @ashishkumar468 , in my first run I got such crash:

2019-04-17 12:51:35.186 26919-26919/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: fr.free.nrw.commons, PID: 26919
    java.lang.RuntimeException: Unable to start service fr.free.nrw.commons.upload.UploadService@4b21759 with Intent { act=fr.free.nrw.commons.upload.upload cmp=fr.free.nrw.commons/.upload.UploadService }: android.database.sqlite.SQLiteException: Can't downgrade database from version 10 to 9
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3556)
        at android.app.ActivityThread.-wrap20(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: android.database.sqlite.SQLiteException: Can't downgrade database from version 10 to 9
        at android.database.sqlite.SQLiteOpenHelper.onDowngrade(SQLiteOpenHelper.java:418)
        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:297)
        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:194)
        at fr.free.nrw.commons.contributions.ContributionsContentProvider.update(ContributionsContentProvider.java:160)
        at android.content.ContentProvider$Transport.update(ContentProvider.java:359)
        at android.content.ContentResolver.update(ContentResolver.java:1672)
        at fr.free.nrw.commons.upload.UploadService.onStartCommand(UploadService.java:172)
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3539)
        at android.app.ActivityThread.-wrap20(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6541) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
2019-04-17 12:51:35.187 26919-26919/? E/ACRA: ACRA caught a RuntimeException for fr.free.nrw.commons
    java.lang.RuntimeException: Unable to start service fr.free.nrw.commons.upload.UploadService@4b21759 with Intent { act=fr.free.nrw.commons.upload.upload cmp=fr.free.nrw.commons/.upload.UploadService }: android.database.sqlite.SQLiteException: Can't downgrade database from version 10 to 9
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3556)
        at android.app.ActivityThread.-wrap20(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: android.database.sqlite.SQLiteException: Can't downgrade database from version 10 to 9
        at android.database.sqlite.SQLiteOpenHelper.onDowngrade(SQLiteOpenHelper.java:418)
        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:297)
        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:194)
        at fr.free.nrw.commons.contributions.ContributionsContentProvider.update(ContributionsContentProvider.java:160)
        at android.content.ContentProvider$Transport.update(ContentProvider.java:359)
        at android.content.ContentResolver.update(ContentResolver.java:1672)
        at fr.free.nrw.commons.upload.UploadService.onStartCommand(UploadService.java:172)
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3539)
        at android.app.ActivityThread.-wrap20(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6541) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
2019-04-17 12:51:35.188 1687-1701/system_process E/memtrack: Couldn't load memtrack module
2019-04-17 12:51:35.331 2202-26847/com.google.android.gms.

@neslihanturan
Copy link
Collaborator

After a fresh install, my upload test was successful. Thanks @ashishkumar468 ! SIt would be great someone with nearby images could test this as well.
One issue I recognized: It does not warns me for uploading same picture.
For the UI changes, it looked like this on my screen:
image

I find having white-ish frame around image and white UI elements together confusing. And I preferred the previous design in terms of spaces on left and right.

@ashishkumar468
Copy link
Collaborator Author

After a fresh install, my upload test was successful. Thanks @ashishkumar468 ! SIt would be great someone with nearby images could test this as well.
One issue I recognized: It does not warns me for uploading same picture.
For the UI changes, it looked like this on my screen:
image

I find having white-ish frame around image and white UI elements together confusing. And I preferred the previous design in terms of spaces on left and right.

Thanks for the feedback @neslihanturan
I will verify duplicate image error and work on the ui changes

@neslihanturan
Copy link
Collaborator

After testing bunch uploads,

  • I liked greyed out design instead of blue rectangle
  • While entering text, the layout on top collapses. I would prefer it won't collapse automatically to see what you enter description and file name for. On previous version it doesn't collapse. Thanks!

@ashishkumar468
Copy link
Collaborator Author

After testing bunch uploads,

  • I liked greyed out design instead of blue rectangle
  • While entering text, the layout on top collapses. I would prefer it won't collapse automatically to see what you enter description and file name for. On previous version it doesn't collapse. Thanks!

can you re verify this @neslihanturan. I am not able to reproduce it

@@ -54,6 +56,12 @@

void inject(PicOfDayAppWidget picOfDayAppWidget);

void inject(UploadCategoriesFragment uploadCategoriesFragment);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to declare inject method for fragment classes. If the fragment extends CommonsDaggerSupportFragment then, the injection can be used directly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define the fragments here. Add them in FragmentBuilderModule

private JsonKvStore directKvStore;

@Inject
public UploadLocalDataSource(@Named("default_preferences") BasicKvStore defaultKvStore,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should be using just 1 shared pref here. Lets use JsonKvStore directKvStore

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JsonKvStore extends BasicKvStore

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally yes, but WikidataEditService pulls the value("Picture_Has_Correct_Location") from DirectKcStore. I could change it at both the places, but I thought it could be done in a separate PR. What do you suggest, shall I make the changes in this PR itself ?

import android.view.KeyEvent;
import android.view.MotionEvent;

public class NonSwipeableViewPager extends ViewPager {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnswipableViewPager already exists. Can it be reused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks for reminding me :-)

@@ -18,7 +18,7 @@ android.enableBuildCache=true
compileSdkVersion=android-28
buildToolsVersion=28.0.3

SUPPORT_LIB_VERSION=27.1.1
SUPPORT_LIB_VERSION=28.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK we are no longer using support libs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but 2.10 is not merged with master and the test cases were failing (weirdly), because of the version, and that is why I had to upgrade

import org.powermock.modules.junit4.PowerMockRunner


@RunWith(PowerMockRunner::class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to avoid power mock based tests?

Copy link
Member

@maskaravivek maskaravivek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added some minor comments that need to be addressed.

I will take a pull and try to fix some of the code styling issues on my own.

@@ -11,6 +11,10 @@

import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.page.PageTitle;
import fr.free.nrw.commons.location.LatLng;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports?

@@ -54,6 +56,12 @@

void inject(PicOfDayAppWidget picOfDayAppWidget);

void inject(UploadCategoriesFragment uploadCategoriesFragment);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define the fragments here. Add them in FragmentBuilderModule

@@ -40,6 +40,10 @@
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import io.reactivex.disposables.Disposable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

@@ -59,6 +59,12 @@
import org.apache.commons.lang3.StringUtils;
import org.wikipedia.util.DateUtil;
import org.wikipedia.util.StringUtil;
import java.io.IOException;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

@@ -44,11 +44,15 @@
import fr.free.nrw.commons.utils.NetworkUtils;
import fr.free.nrw.commons.utils.PermissionUtils;
import fr.free.nrw.commons.utils.ViewUtil;
import javax.inject.Inject;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

import javax.inject.Singleton;

@Singleton
public class UploadLocalDataSource {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add java docs. For class and methods

return Observable.fromIterable(uploadableFiles)
.map(uploadableFile -> getUploadItem(uploadableFile, place, source, similarImageInterface));
}

Single<Integer> getImageQuality(UploadItem uploadItem, boolean checkTitle) {
@SuppressLint("CheckResult")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SuppressLint not required

import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
import fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment;

public class UploadBaseFragment extends Fragment {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it extend CommonsDaggerFragment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you can inject directly without adding the class in ApplicationComponent

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ApplicationlessInjection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required

}

private void showInfoAlert(int titleStringID, int messageStringId, String... formatArgs) {
new AlertDialog.Builder(getContext()).setTitle(titleStringID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Dialog Util

@ashishkumar468
Copy link
Collaborator Author

Thanks for your commit @maskaravivek :-)

@maskaravivek
Copy link
Member

@ashishkumar468 Test cases for reference:

Uploads:

  • Camera upload > yet to be tested
  • Camera nearby upload with successful wikidata edit > yet to be tested
  • Single gallery upload > yet to be tested
  • Multiple gallery upload > yet to be tested
  • Gallery upload with successful wikidata edit > yet to be tested

In the current ShareActivity:

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

Category suggestions/selection:

  • When search text field is empty, display:
    -Recent categories > yet to be tested
  • 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 > yet to be tested
  • Display exact matches at the top > yet to be tested
  • Categories selected via both of these suggestion types need to be added to the list of category selections > yet to be tested

Warnings:

  • If image is too dark > yet to be tested
  • If image already exists in Commons (via hash check) > yet to be tested
  • 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). > yet to be tested

@ashishkumar468
Copy link
Collaborator Author

@vanshikaarora Thanks for testing the PR. As this is not yet merged with master, we don't need to create a new issue for it. You can raise a PR on this branch, which will eventually be merged into master once we have finalised the test cases mentioned by @maskaravivek

@ashishkumar468
Copy link
Collaborator Author

ashishkumar468 commented May 24, 2019

@vanshikaarora I am not able to reproduce the issue, I might have missed the steps,
I tried this,
Click on Camera to Capture a picture,
Once the Upload Activity opens, click on Title to add title,
Click on Description info to see the info dialog
Click on Description Edit Text to add Description,

Is there anything I am missing ?
Attaching screenshot for the same
device-2019-05-24-143418

@vanshikaarora
Copy link
Collaborator

@ashishkumar468 I tried tu run the app again but could not reproduce this time. I'll try more, if this happens again

@vanshikaarora
Copy link
Collaborator

@ashishkumar468 @maskaravivek I have tested few of the things as posted earlier. Out of which, here is a general summary.

Warnings:

If image is too dark > yet to be tested
If image already exists in Commons (via hash check) > yet to be tested
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

I have tested each of these and they work fine for me.

Uploads:

Camera upload > yet to be tested
Camera nearby upload with successful wikidata edit > yet to be tested
Single gallery upload > yet to be tested
Multiple gallery upload > yet to be tested
Gallery upload with successful wikidata edit > yet to be tested

However for this section I have noticed some issues like The popup comes up iteratively sometimes while testing. Hence I couldn't write description for the Image

ezgif com-video-to-gif (2)

@vanshikaarora
Copy link
Collaborator

Issues Observed

Title and description empty when returning from License Activity.

*Steps to reproduce

  • Add title and description
  • Select categories then move to next
  • Now Go back to previous "Step 1 of 3"
  • Title and description are now blank however the same thing didn't happened with Category checkboxes

@ashishkumar468 @maskaravivek Shall I create a separate Issue for this or send a Pr for this Issue itself?

@maskaravivek
Copy link
Member

Please send a PR on top of this PR itself as AFAIK it was working earlier

@ashishkumar468 ashishkumar468 changed the base branch from master to refactor_uploads May 28, 2019 10:10
Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ A review job has been created and sent to the PullRequest network.


@ashishkumar468 you can click here to see the review status or cancel the code review job.

@ashishkumar468 ashishkumar468 merged commit a7712f0 into commons-app:refactor_uploads May 28, 2019
maskaravivek pushed a commit that referenced this pull request Jun 13, 2019
* Feature/refractor uploads [WIP] (#2887)

* Fix duplicate param information (#2515)

* Bug fix issue #2476 (#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix #2580]

* Bug Fix #2585 (#2647)

* Bug Fix #2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue #2648 (#2678)

* Bug Fix issue #2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue #2652 (#2706)

* Addded null check on bookmark before operating on it

* BugFix issue #2711 (#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix #2718 (#2719)

* Handled null auth cookies

* Fix #2791: NPE when nominating for deletion and leaving screen (#2792)

* Bug Fix issue #2789 (#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix #2720 (#2831)

BugFix deprecated licenes #2720

* ui fixes, wip, upload

* *Issue #2886, BugFix #2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* Bug fix, reduced the add description edit text clickable bound (#2973)

* Bugfix/uploads (#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (#3001)

* Bugfix/uploads (#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (#3016)
misaochan pushed a commit that referenced this pull request Mar 10, 2020
* [WIP] Fixes #2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (#2887)

* Fix duplicate param information (#2515)

* Bug fix issue #2476 (#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix #2580]

* Bug Fix #2585 (#2647)

* Bug Fix #2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue #2648 (#2678)

* Bug Fix issue #2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue #2652 (#2706)

* Addded null check on bookmark before operating on it

* BugFix issue #2711 (#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix #2718 (#2719)

* Handled null auth cookies

* Fix #2791: NPE when nominating for deletion and leaving screen (#2792)

* Bug Fix issue #2789 (#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix #2720 (#2831)

BugFix deprecated licenes #2720

* ui fixes, wip, upload

* *Issue #2886, BugFix #2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (#3001)

* Bugfix/uploads (#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue #3006

* resolved issue #3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue #3035

* fixed issue #3033

* fixed issue #3005

* fixed issue #3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue #3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue #3100

* fixed issue #3098

* fixed issue #3099

* fixed issue #3104 and #3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue #3108 and #3107

* fix isse #3108

* fixed issue #3110 and #3112

* fixed issue #3113

* added documentations

* fixed issue #3076 and #3109

* added depiction search test

* fixed issue #3113

* fixed issue #3111

* fixed issue #3106

* Showing items in explore

* minor change

* fixed issue #3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue #3119

* fixed issue #3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue #3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix #3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* #3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
maskaravivek added a commit that referenced this pull request Apr 21, 2020
* #3222 Merge master into Structured Data branch, fix conflicts (#3447)

* [WIP] Fixes #2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (#2887)

* Fix duplicate param information (#2515)

* Bug fix issue #2476 (#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix #2580]

* Bug Fix #2585 (#2647)

* Bug Fix #2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue #2648 (#2678)

* Bug Fix issue #2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue #2652 (#2706)

* Addded null check on bookmark before operating on it

* BugFix issue #2711 (#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix #2718 (#2719)

* Handled null auth cookies

* Fix #2791: NPE when nominating for deletion and leaving screen (#2792)

* Bug Fix issue #2789 (#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix #2720 (#2831)

BugFix deprecated licenes #2720

* ui fixes, wip, upload

* *Issue #2886, BugFix #2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (#3001)

* Bugfix/uploads (#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue #3006

* resolved issue #3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue #3035

* fixed issue #3033

* fixed issue #3005

* fixed issue #3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue #3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue #3100

* fixed issue #3098

* fixed issue #3099

* fixed issue #3104 and #3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue #3108 and #3107

* fix isse #3108

* fixed issue #3110 and #3112

* fixed issue #3113

* added documentations

* fixed issue #3076 and #3109

* added depiction search test

* fixed issue #3113

* fixed issue #3111

* fixed issue #3106

* Showing items in explore

* minor change

* fixed issue #3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue #3119

* fixed issue #3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue #3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix #3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* #3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>

* #3482 Use Room in Structured Data branch - remove unused code (#3483)

* #3482 Use Room in Structured Data branch - remove unused code

* #3482 Use Room in Structured Data branch - fix unit test compilation

* #3482 Use Room in Structured Data branch - add kdoc

* #3490 Depiction Search in upload shows No Results before it gets results (#3491)

* #3482 Use Room in Structured Data branch - remove unused code

* #3482 Use Room in Structured Data branch - fix unit test compilation

* #3490 Depiction Search in upload shows No Results before it gets results - stop showing error on subscription

* #3490 Depiction Search in upload shows No Results before it gets results - update test cases

* make labels nullable too

* fix unit test compilation

* #3222 remove lingering reference to depiction content provider

* Fix Crash

* #3222 Merge master into Structured Data branch, fix conflicts - review fixes

* Fix method invocations

* #3529 Captions/depictions are not saved to Commons (#3574)

* #3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* #3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* #3529 Captions/depictions are not saved to Commons - fix test

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs  (#3578)

* #3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* #3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* #3529 Captions/depictions are not saved to Commons - fix test

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - replace title with the first MediaDetail

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - restore button disabling

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - fix nearby place

* fix thumbnail issue 3526 (#3617)

* #3222 Merge master into Structured Data branch, fix conflicts - fix bad merge

* #3529 Captions/depictions are not saved to Commons (#3588)

* #3529 Captions/depictions are not saved to Commons - update flow to update appropriate data

* #3529 Captions/depictions are not saved to Commons - fix invoking of setlabel

* #3529 Captions/depictions are not saved to Commons - fix unit tests

* #3529 Captions/depictions are not saved to Commons - use constant for @nAmed

* #3529 Captions/depictions are not saved to Commons - remove captions interface

* #3529 Captions/depictions are not saved to Commons - delete unused Contribution fields - enforce Single Responsibility by using PageContentsCreator

* #3529 Captions/depictions are not saved to Commons - prefix id with M - remove language from url and only add from Field

* #3529 Captions/depictions are not saved to Commons - make edits of depictions and captions sequential

* #3529 Captions/depictions are not saved to Commons - remove unused model fields

* #3529 Captions/depictions are not saved to Commons - weaken type of categories - copy list on Contribution creation

* #3529 Captions/depictions are not saved to Commons - mark Media fields private - weaken types - remove partly implemented fields

* #3529 Captions/depictions are not saved to Commons - add semi colon

* #3529 Captions/depictions are not saved to Commons - fix test

* Fix issue 3526 Unlike "Items" tab, "child classes" tab does not display description nor image thumbnail (#3619)

* fix thumbnail issue 3526

* Fix Description issue 3526

* revert changes on this file, not finished with it yet

* Fix Description for Child and Parent classes - issue 3526

* Remove conflict text in file

* Remove retrofit.HEAD import

* Incorporated review comments

* Fix issue 3137 (#3637)

* Fix issue 3137

* Remove import Timber

* Remove unnecessary space

* #3222 Merge master into Structured Data branch, fix conflicts - revert logging

* Fix build

* #3661 No Depictions Selected Dialog has reversed buttons - fix button order

* Revert "#3661 No Depictions Selected Dialog has reversed buttons - fix button order"

This reverts commit d8f9809.

* #3222 Merge master into Structured Data branch, fix conflicts - remove unused methods/fields

* #3661 No Depictions Selected Dialog has reversed buttons - fix button order (#3662)

* #3653 Many Mnull requests - stop requesting captions for null ids (#3657)

* #3653 Many Mnull requests - stop requesting captions for null ids

* #3653 Many Mnull requests - move log line

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items  (#3650)

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items - for empty search terms show nearby items for depictions

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items - use linear radii progression to search for places

* #3666 Crash when uploading on structured-data branch - revert cleanup of UploadController (#3670)

* #3222 Merge Structured Data branch into master - fix caption rendering in new UI

* #3222 Merge Structured Data branch into master - upgrade retrofit + okhttp

* #3664 Stop using JsonObject on StructuredData (#3672)

* #3664 Stop using JsonObject on StructuredData - remove usage in Media classes - remove from depicts client - create partial network models

* #3664 Stop using JsonObject on StructuredData - allow partial mapping of polymorphic models by returning null in typeadapter

* #3664 Stop using JsonObject on StructuredData - use models for editing depicts property

* #3664 Stop using JsonObject on StructuredData - use models for sparql parent query

* #3664 Stop using JsonObject on StructuredData - fix unit test compilation

* #3664 Stop using JsonObject on StructuredData - unify sparql responses

* #3664 Stop using JsonObject on StructuredData - minor cleanup of misnamed/unused/too broad visibility

* #3664 Stop using JsonObject on StructuredData - share variable names and logic for the Sarql queries

* #3664 Stop using JsonObject on StructuredData - add error logging

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
Co-authored-by: vvijayalakshmi21 <34595292+vvijayalakshmi21@users.noreply.github.com>
macgills added a commit that referenced this pull request Apr 22, 2020
* #3222 Merge master into Structured Data branch, fix conflicts (#3447)

* [WIP] Fixes #2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (#2887)

* Fix duplicate param information (#2515)

* Bug fix issue #2476 (#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix #2580]

* Bug Fix #2585 (#2647)

* Bug Fix #2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue #2648 (#2678)

* Bug Fix issue #2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue #2652 (#2706)

* Addded null check on bookmark before operating on it

* BugFix issue #2711 (#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix #2718 (#2719)

* Handled null auth cookies

* Fix #2791: NPE when nominating for deletion and leaving screen (#2792)

* Bug Fix issue #2789 (#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix #2720 (#2831)

BugFix deprecated licenes #2720

* ui fixes, wip, upload

* *Issue #2886, BugFix #2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (#3001)

* Bugfix/uploads (#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue #3006

* resolved issue #3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue #3035

* fixed issue #3033

* fixed issue #3005

* fixed issue #3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue #3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue #3100

* fixed issue #3098

* fixed issue #3099

* fixed issue #3104 and #3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue #3108 and #3107

* fix isse #3108

* fixed issue #3110 and #3112

* fixed issue #3113

* added documentations

* fixed issue #3076 and #3109

* added depiction search test

* fixed issue #3113

* fixed issue #3111

* fixed issue #3106

* Showing items in explore

* minor change

* fixed issue #3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue #3119

* fixed issue #3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue #3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix #3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* #3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>

* #3482 Use Room in Structured Data branch - remove unused code (#3483)

* #3482 Use Room in Structured Data branch - remove unused code

* #3482 Use Room in Structured Data branch - fix unit test compilation

* #3482 Use Room in Structured Data branch - add kdoc

* #3490 Depiction Search in upload shows No Results before it gets results (#3491)

* #3482 Use Room in Structured Data branch - remove unused code

* #3482 Use Room in Structured Data branch - fix unit test compilation

* #3490 Depiction Search in upload shows No Results before it gets results - stop showing error on subscription

* #3490 Depiction Search in upload shows No Results before it gets results - update test cases

* make labels nullable too

* fix unit test compilation

* #3222 remove lingering reference to depiction content provider

* Fix Crash

* #3222 Merge master into Structured Data branch, fix conflicts - review fixes

* Fix method invocations

* #3529 Captions/depictions are not saved to Commons (#3574)

* #3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* #3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* #3529 Captions/depictions are not saved to Commons - fix test

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs  (#3578)

* #3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* #3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* #3529 Captions/depictions are not saved to Commons - fix test

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - replace title with the first MediaDetail

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - restore button disabling

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - fix nearby place

* fix thumbnail issue 3526 (#3617)

* #3222 Merge master into Structured Data branch, fix conflicts - fix bad merge

* #3529 Captions/depictions are not saved to Commons (#3588)

* #3529 Captions/depictions are not saved to Commons - update flow to update appropriate data

* #3529 Captions/depictions are not saved to Commons - fix invoking of setlabel

* #3529 Captions/depictions are not saved to Commons - fix unit tests

* #3529 Captions/depictions are not saved to Commons - use constant for @nAmed

* #3529 Captions/depictions are not saved to Commons - remove captions interface

* #3529 Captions/depictions are not saved to Commons - delete unused Contribution fields - enforce Single Responsibility by using PageContentsCreator

* #3529 Captions/depictions are not saved to Commons - prefix id with M - remove language from url and only add from Field

* #3529 Captions/depictions are not saved to Commons - make edits of depictions and captions sequential

* #3529 Captions/depictions are not saved to Commons - remove unused model fields

* #3529 Captions/depictions are not saved to Commons - weaken type of categories - copy list on Contribution creation

* #3529 Captions/depictions are not saved to Commons - mark Media fields private - weaken types - remove partly implemented fields

* #3529 Captions/depictions are not saved to Commons - add semi colon

* #3529 Captions/depictions are not saved to Commons - fix test

* Fix issue 3526 Unlike "Items" tab, "child classes" tab does not display description nor image thumbnail (#3619)

* fix thumbnail issue 3526

* Fix Description issue 3526

* revert changes on this file, not finished with it yet

* Fix Description for Child and Parent classes - issue 3526

* Remove conflict text in file

* Remove retrofit.HEAD import

* Incorporated review comments

* Fix issue 3137 (#3637)

* Fix issue 3137

* Remove import Timber

* Remove unnecessary space

* #3222 Merge master into Structured Data branch, fix conflicts - revert logging

* Fix build

* #3661 No Depictions Selected Dialog has reversed buttons - fix button order

* Revert "#3661 No Depictions Selected Dialog has reversed buttons - fix button order"

This reverts commit d8f9809.

* #3222 Merge master into Structured Data branch, fix conflicts - remove unused methods/fields

* #3661 No Depictions Selected Dialog has reversed buttons - fix button order (#3662)

* #3653 Many Mnull requests - stop requesting captions for null ids (#3657)

* #3653 Many Mnull requests - stop requesting captions for null ids

* #3653 Many Mnull requests - move log line

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items  (#3650)

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items - for empty search terms show nearby items for depictions

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items - use linear radii progression to search for places

* #3666 Crash when uploading on structured-data branch - revert cleanup of UploadController (#3670)

* #3222 Merge Structured Data branch into master - fix caption rendering in new UI

* #3222 Merge Structured Data branch into master - upgrade retrofit + okhttp

* #3664 Stop using JsonObject on StructuredData (#3672)

* #3664 Stop using JsonObject on StructuredData - remove usage in Media classes - remove from depicts client - create partial network models

* #3664 Stop using JsonObject on StructuredData - allow partial mapping of polymorphic models by returning null in typeadapter

* #3664 Stop using JsonObject on StructuredData - use models for editing depicts property

* #3664 Stop using JsonObject on StructuredData - use models for sparql parent query

* #3664 Stop using JsonObject on StructuredData - fix unit test compilation

* #3664 Stop using JsonObject on StructuredData - unify sparql responses

* #3664 Stop using JsonObject on StructuredData - minor cleanup of misnamed/unused/too broad visibility

* #3664 Stop using JsonObject on StructuredData - share variable names and logic for the Sarql queries

* #3664 Stop using JsonObject on StructuredData - add error logging

* #228 Overwrite happens - fix extension of filename (#3689)

* #3675 Rename buttons of the dialog box shown when no depiction is selected - remove "yes, submit" and "no, go back" (#3688)

* #3680 Tip appears even when not tapping the (i) icon - use TextInputLayout EndIcons (#3683)

* #3680 Tip appears even when not tapping the (i) icon - use TextInputLayout EndIcons

* #3680 Tip appears even when not tapping the (i) icon - reaorder endIcon mode call so tinting is applied

* structured data - fix compilation

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
Co-authored-by: vvijayalakshmi21 <34595292+vvijayalakshmi21@users.noreply.github.com>
ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this pull request Oct 10, 2020
…p#3553)

* commons-app#3222 Merge master into Structured Data branch, fix conflicts (commons-app#3447)

* [WIP] Fixes commons-app#2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (commons-app#2887)

* Fix duplicate param information (commons-app#2515)

* Bug fix issue commons-app#2476 (commons-app#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (commons-app#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (commons-app#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix commons-app#2580]

* Bug Fix commons-app#2585 (commons-app#2647)

* Bug Fix commons-app#2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue commons-app#2648 (commons-app#2678)

* Bug Fix issue commons-app#2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue commons-app#2652 (commons-app#2706)

* Addded null check on bookmark before operating on it

* BugFix issue commons-app#2711 (commons-app#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix commons-app#2718 (commons-app#2719)

* Handled null auth cookies

* Fix commons-app#2791: NPE when nominating for deletion and leaving screen (commons-app#2792)

* Bug Fix issue commons-app#2789 (commons-app#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix commons-app#2720 (commons-app#2831)

BugFix deprecated licenes commons-app#2720

* ui fixes, wip, upload

* *Issue commons-app#2886, BugFix commons-app#2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (commons-app#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (commons-app#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (commons-app#3001)

* Bugfix/uploads (commons-app#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (commons-app#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (commons-app#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (commons-app#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue commons-app#3006

* resolved issue commons-app#3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue commons-app#3035

* fixed issue commons-app#3033

* fixed issue commons-app#3005

* fixed issue commons-app#3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue commons-app#3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue commons-app#3100

* fixed issue commons-app#3098

* fixed issue commons-app#3099

* fixed issue commons-app#3104 and commons-app#3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue commons-app#3108 and commons-app#3107

* fix isse commons-app#3108

* fixed issue commons-app#3110 and commons-app#3112

* fixed issue commons-app#3113

* added documentations

* fixed issue commons-app#3076 and commons-app#3109

* added depiction search test

* fixed issue commons-app#3113

* fixed issue commons-app#3111

* fixed issue commons-app#3106

* Showing items in explore

* minor change

* fixed issue commons-app#3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue commons-app#3119

* fixed issue commons-app#3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue commons-app#3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix commons-app#3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* commons-app#3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>

* commons-app#3482 Use Room in Structured Data branch - remove unused code (commons-app#3483)

* commons-app#3482 Use Room in Structured Data branch - remove unused code

* commons-app#3482 Use Room in Structured Data branch - fix unit test compilation

* commons-app#3482 Use Room in Structured Data branch - add kdoc

* commons-app#3490 Depiction Search in upload shows No Results before it gets results (commons-app#3491)

* commons-app#3482 Use Room in Structured Data branch - remove unused code

* commons-app#3482 Use Room in Structured Data branch - fix unit test compilation

* commons-app#3490 Depiction Search in upload shows No Results before it gets results - stop showing error on subscription

* commons-app#3490 Depiction Search in upload shows No Results before it gets results - update test cases

* make labels nullable too

* fix unit test compilation

* commons-app#3222 remove lingering reference to depiction content provider

* Fix Crash

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - review fixes

* Fix method invocations

* commons-app#3529 Captions/depictions are not saved to Commons (commons-app#3574)

* commons-app#3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* commons-app#3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs  (commons-app#3578)

* commons-app#3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* commons-app#3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - replace title with the first MediaDetail

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - restore button disabling

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - fix nearby place

* fix thumbnail issue 3526 (commons-app#3617)

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - fix bad merge

* commons-app#3529 Captions/depictions are not saved to Commons (commons-app#3588)

* commons-app#3529 Captions/depictions are not saved to Commons - update flow to update appropriate data

* commons-app#3529 Captions/depictions are not saved to Commons - fix invoking of setlabel

* commons-app#3529 Captions/depictions are not saved to Commons - fix unit tests

* commons-app#3529 Captions/depictions are not saved to Commons - use constant for @nAmed

* commons-app#3529 Captions/depictions are not saved to Commons - remove captions interface

* commons-app#3529 Captions/depictions are not saved to Commons - delete unused Contribution fields - enforce Single Responsibility by using PageContentsCreator

* commons-app#3529 Captions/depictions are not saved to Commons - prefix id with M - remove language from url and only add from Field

* commons-app#3529 Captions/depictions are not saved to Commons - make edits of depictions and captions sequential

* commons-app#3529 Captions/depictions are not saved to Commons - remove unused model fields

* commons-app#3529 Captions/depictions are not saved to Commons - weaken type of categories - copy list on Contribution creation

* commons-app#3529 Captions/depictions are not saved to Commons - mark Media fields private - weaken types - remove partly implemented fields

* commons-app#3529 Captions/depictions are not saved to Commons - add semi colon

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* Fix issue 3526 Unlike "Items" tab, "child classes" tab does not display description nor image thumbnail (commons-app#3619)

* fix thumbnail issue 3526

* Fix Description issue 3526

* revert changes on this file, not finished with it yet

* Fix Description for Child and Parent classes - issue 3526

* Remove conflict text in file

* Remove retrofit.HEAD import

* Incorporated review comments

* Fix issue 3137 (commons-app#3637)

* Fix issue 3137

* Remove import Timber

* Remove unnecessary space

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - revert logging

* Fix build

* commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order

* Revert "commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order"

This reverts commit d8f9809.

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - remove unused methods/fields

* commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order (commons-app#3662)

* commons-app#3653 Many Mnull requests - stop requesting captions for null ids (commons-app#3657)

* commons-app#3653 Many Mnull requests - stop requesting captions for null ids

* commons-app#3653 Many Mnull requests - move log line

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items  (commons-app#3650)

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items - for empty search terms show nearby items for depictions

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items - use linear radii progression to search for places

* commons-app#3666 Crash when uploading on structured-data branch - revert cleanup of UploadController (commons-app#3670)

* commons-app#3222 Merge Structured Data branch into master - fix caption rendering in new UI

* commons-app#3222 Merge Structured Data branch into master - upgrade retrofit + okhttp

* commons-app#3664 Stop using JsonObject on StructuredData (commons-app#3672)

* commons-app#3664 Stop using JsonObject on StructuredData - remove usage in Media classes - remove from depicts client - create partial network models

* commons-app#3664 Stop using JsonObject on StructuredData - allow partial mapping of polymorphic models by returning null in typeadapter

* commons-app#3664 Stop using JsonObject on StructuredData - use models for editing depicts property

* commons-app#3664 Stop using JsonObject on StructuredData - use models for sparql parent query

* commons-app#3664 Stop using JsonObject on StructuredData - fix unit test compilation

* commons-app#3664 Stop using JsonObject on StructuredData - unify sparql responses

* commons-app#3664 Stop using JsonObject on StructuredData - minor cleanup of misnamed/unused/too broad visibility

* commons-app#3664 Stop using JsonObject on StructuredData - share variable names and logic for the Sarql queries

* commons-app#3664 Stop using JsonObject on StructuredData - add error logging

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
Co-authored-by: vvijayalakshmi21 <34595292+vvijayalakshmi21@users.noreply.github.com>
ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this pull request Oct 10, 2020
* commons-app#3222 Merge master into Structured Data branch, fix conflicts (commons-app#3447)

* [WIP] Fixes commons-app#2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (commons-app#2887)

* Fix duplicate param information (commons-app#2515)

* Bug fix issue commons-app#2476 (commons-app#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (commons-app#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (commons-app#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix commons-app#2580]

* Bug Fix commons-app#2585 (commons-app#2647)

* Bug Fix commons-app#2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue commons-app#2648 (commons-app#2678)

* Bug Fix issue commons-app#2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue commons-app#2652 (commons-app#2706)

* Addded null check on bookmark before operating on it

* BugFix issue commons-app#2711 (commons-app#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix commons-app#2718 (commons-app#2719)

* Handled null auth cookies

* Fix commons-app#2791: NPE when nominating for deletion and leaving screen (commons-app#2792)

* Bug Fix issue commons-app#2789 (commons-app#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix commons-app#2720 (commons-app#2831)

BugFix deprecated licenes commons-app#2720

* ui fixes, wip, upload

* *Issue commons-app#2886, BugFix commons-app#2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (commons-app#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (commons-app#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (commons-app#3001)

* Bugfix/uploads (commons-app#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (commons-app#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (commons-app#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (commons-app#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue commons-app#3006

* resolved issue commons-app#3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue commons-app#3035

* fixed issue commons-app#3033

* fixed issue commons-app#3005

* fixed issue commons-app#3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue commons-app#3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue commons-app#3100

* fixed issue commons-app#3098

* fixed issue commons-app#3099

* fixed issue commons-app#3104 and commons-app#3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue commons-app#3108 and commons-app#3107

* fix isse commons-app#3108

* fixed issue commons-app#3110 and commons-app#3112

* fixed issue commons-app#3113

* added documentations

* fixed issue commons-app#3076 and commons-app#3109

* added depiction search test

* fixed issue commons-app#3113

* fixed issue commons-app#3111

* fixed issue commons-app#3106

* Showing items in explore

* minor change

* fixed issue commons-app#3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue commons-app#3119

* fixed issue commons-app#3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue commons-app#3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix commons-app#3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* commons-app#3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>

* commons-app#3482 Use Room in Structured Data branch - remove unused code (commons-app#3483)

* commons-app#3482 Use Room in Structured Data branch - remove unused code

* commons-app#3482 Use Room in Structured Data branch - fix unit test compilation

* commons-app#3482 Use Room in Structured Data branch - add kdoc

* commons-app#3490 Depiction Search in upload shows No Results before it gets results (commons-app#3491)

* commons-app#3482 Use Room in Structured Data branch - remove unused code

* commons-app#3482 Use Room in Structured Data branch - fix unit test compilation

* commons-app#3490 Depiction Search in upload shows No Results before it gets results - stop showing error on subscription

* commons-app#3490 Depiction Search in upload shows No Results before it gets results - update test cases

* make labels nullable too

* fix unit test compilation

* commons-app#3222 remove lingering reference to depiction content provider

* Fix Crash

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - review fixes

* Fix method invocations

* commons-app#3529 Captions/depictions are not saved to Commons (commons-app#3574)

* commons-app#3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* commons-app#3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs  (commons-app#3578)

* commons-app#3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* commons-app#3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - replace title with the first MediaDetail

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - restore button disabling

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - fix nearby place

* fix thumbnail issue 3526 (commons-app#3617)

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - fix bad merge

* commons-app#3529 Captions/depictions are not saved to Commons (commons-app#3588)

* commons-app#3529 Captions/depictions are not saved to Commons - update flow to update appropriate data

* commons-app#3529 Captions/depictions are not saved to Commons - fix invoking of setlabel

* commons-app#3529 Captions/depictions are not saved to Commons - fix unit tests

* commons-app#3529 Captions/depictions are not saved to Commons - use constant for @nAmed

* commons-app#3529 Captions/depictions are not saved to Commons - remove captions interface

* commons-app#3529 Captions/depictions are not saved to Commons - delete unused Contribution fields - enforce Single Responsibility by using PageContentsCreator

* commons-app#3529 Captions/depictions are not saved to Commons - prefix id with M - remove language from url and only add from Field

* commons-app#3529 Captions/depictions are not saved to Commons - make edits of depictions and captions sequential

* commons-app#3529 Captions/depictions are not saved to Commons - remove unused model fields

* commons-app#3529 Captions/depictions are not saved to Commons - weaken type of categories - copy list on Contribution creation

* commons-app#3529 Captions/depictions are not saved to Commons - mark Media fields private - weaken types - remove partly implemented fields

* commons-app#3529 Captions/depictions are not saved to Commons - add semi colon

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* Fix issue 3526 Unlike "Items" tab, "child classes" tab does not display description nor image thumbnail (commons-app#3619)

* fix thumbnail issue 3526

* Fix Description issue 3526

* revert changes on this file, not finished with it yet

* Fix Description for Child and Parent classes - issue 3526

* Remove conflict text in file

* Remove retrofit.HEAD import

* Incorporated review comments

* Fix issue 3137 (commons-app#3637)

* Fix issue 3137

* Remove import Timber

* Remove unnecessary space

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - revert logging

* Fix build

* commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order

* Revert "commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order"

This reverts commit d8f9809.

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - remove unused methods/fields

* commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order (commons-app#3662)

* commons-app#3653 Many Mnull requests - stop requesting captions for null ids (commons-app#3657)

* commons-app#3653 Many Mnull requests - stop requesting captions for null ids

* commons-app#3653 Many Mnull requests - move log line

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items  (commons-app#3650)

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items - for empty search terms show nearby items for depictions

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items - use linear radii progression to search for places

* commons-app#3666 Crash when uploading on structured-data branch - revert cleanup of UploadController (commons-app#3670)

* commons-app#3222 Merge Structured Data branch into master - fix caption rendering in new UI

* commons-app#3222 Merge Structured Data branch into master - upgrade retrofit + okhttp

* commons-app#3664 Stop using JsonObject on StructuredData (commons-app#3672)

* commons-app#3664 Stop using JsonObject on StructuredData - remove usage in Media classes - remove from depicts client - create partial network models

* commons-app#3664 Stop using JsonObject on StructuredData - allow partial mapping of polymorphic models by returning null in typeadapter

* commons-app#3664 Stop using JsonObject on StructuredData - use models for editing depicts property

* commons-app#3664 Stop using JsonObject on StructuredData - use models for sparql parent query

* commons-app#3664 Stop using JsonObject on StructuredData - fix unit test compilation

* commons-app#3664 Stop using JsonObject on StructuredData - unify sparql responses

* commons-app#3664 Stop using JsonObject on StructuredData - minor cleanup of misnamed/unused/too broad visibility

* commons-app#3664 Stop using JsonObject on StructuredData - share variable names and logic for the Sarql queries

* commons-app#3664 Stop using JsonObject on StructuredData - add error logging

* commons-app#228 Overwrite happens - fix extension of filename (commons-app#3689)

* commons-app#3675 Rename buttons of the dialog box shown when no depiction is selected - remove "yes, submit" and "no, go back" (commons-app#3688)

* commons-app#3680 Tip appears even when not tapping the (i) icon - use TextInputLayout EndIcons (commons-app#3683)

* commons-app#3680 Tip appears even when not tapping the (i) icon - use TextInputLayout EndIcons

* commons-app#3680 Tip appears even when not tapping the (i) icon - reaorder endIcon mode call so tinting is applied

* structured data - fix compilation

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
Co-authored-by: vvijayalakshmi21 <34595292+vvijayalakshmi21@users.noreply.github.com>
ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this pull request Oct 10, 2020
…p#3553)

* commons-app#3222 Merge master into Structured Data branch, fix conflicts (commons-app#3447)

* [WIP] Fixes commons-app#2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (commons-app#2887)

* Fix duplicate param information (commons-app#2515)

* Bug fix issue commons-app#2476 (commons-app#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (commons-app#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (commons-app#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix commons-app#2580]

* Bug Fix commons-app#2585 (commons-app#2647)

* Bug Fix commons-app#2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue commons-app#2648 (commons-app#2678)

* Bug Fix issue commons-app#2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue commons-app#2652 (commons-app#2706)

* Addded null check on bookmark before operating on it

* BugFix issue commons-app#2711 (commons-app#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix commons-app#2718 (commons-app#2719)

* Handled null auth cookies

* Fix commons-app#2791: NPE when nominating for deletion and leaving screen (commons-app#2792)

* Bug Fix issue commons-app#2789 (commons-app#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix commons-app#2720 (commons-app#2831)

BugFix deprecated licenes commons-app#2720

* ui fixes, wip, upload

* *Issue commons-app#2886, BugFix commons-app#2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (commons-app#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (commons-app#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (commons-app#3001)

* Bugfix/uploads (commons-app#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (commons-app#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (commons-app#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (commons-app#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue commons-app#3006

* resolved issue commons-app#3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue commons-app#3035

* fixed issue commons-app#3033

* fixed issue commons-app#3005

* fixed issue commons-app#3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue commons-app#3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue commons-app#3100

* fixed issue commons-app#3098

* fixed issue commons-app#3099

* fixed issue commons-app#3104 and commons-app#3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue commons-app#3108 and commons-app#3107

* fix isse commons-app#3108

* fixed issue commons-app#3110 and commons-app#3112

* fixed issue commons-app#3113

* added documentations

* fixed issue commons-app#3076 and commons-app#3109

* added depiction search test

* fixed issue commons-app#3113

* fixed issue commons-app#3111

* fixed issue commons-app#3106

* Showing items in explore

* minor change

* fixed issue commons-app#3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue commons-app#3119

* fixed issue commons-app#3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue commons-app#3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix commons-app#3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* commons-app#3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>

* commons-app#3482 Use Room in Structured Data branch - remove unused code (commons-app#3483)

* commons-app#3482 Use Room in Structured Data branch - remove unused code

* commons-app#3482 Use Room in Structured Data branch - fix unit test compilation

* commons-app#3482 Use Room in Structured Data branch - add kdoc

* commons-app#3490 Depiction Search in upload shows No Results before it gets results (commons-app#3491)

* commons-app#3482 Use Room in Structured Data branch - remove unused code

* commons-app#3482 Use Room in Structured Data branch - fix unit test compilation

* commons-app#3490 Depiction Search in upload shows No Results before it gets results - stop showing error on subscription

* commons-app#3490 Depiction Search in upload shows No Results before it gets results - update test cases

* make labels nullable too

* fix unit test compilation

* commons-app#3222 remove lingering reference to depiction content provider

* Fix Crash

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - review fixes

* Fix method invocations

* commons-app#3529 Captions/depictions are not saved to Commons (commons-app#3574)

* commons-app#3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* commons-app#3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs  (commons-app#3578)

* commons-app#3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* commons-app#3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - replace title with the first MediaDetail

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - restore button disabling

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - fix nearby place

* fix thumbnail issue 3526 (commons-app#3617)

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - fix bad merge

* commons-app#3529 Captions/depictions are not saved to Commons (commons-app#3588)

* commons-app#3529 Captions/depictions are not saved to Commons - update flow to update appropriate data

* commons-app#3529 Captions/depictions are not saved to Commons - fix invoking of setlabel

* commons-app#3529 Captions/depictions are not saved to Commons - fix unit tests

* commons-app#3529 Captions/depictions are not saved to Commons - use constant for @nAmed

* commons-app#3529 Captions/depictions are not saved to Commons - remove captions interface

* commons-app#3529 Captions/depictions are not saved to Commons - delete unused Contribution fields - enforce Single Responsibility by using PageContentsCreator

* commons-app#3529 Captions/depictions are not saved to Commons - prefix id with M - remove language from url and only add from Field

* commons-app#3529 Captions/depictions are not saved to Commons - make edits of depictions and captions sequential

* commons-app#3529 Captions/depictions are not saved to Commons - remove unused model fields

* commons-app#3529 Captions/depictions are not saved to Commons - weaken type of categories - copy list on Contribution creation

* commons-app#3529 Captions/depictions are not saved to Commons - mark Media fields private - weaken types - remove partly implemented fields

* commons-app#3529 Captions/depictions are not saved to Commons - add semi colon

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* Fix issue 3526 Unlike "Items" tab, "child classes" tab does not display description nor image thumbnail (commons-app#3619)

* fix thumbnail issue 3526

* Fix Description issue 3526

* revert changes on this file, not finished with it yet

* Fix Description for Child and Parent classes - issue 3526

* Remove conflict text in file

* Remove retrofit.HEAD import

* Incorporated review comments

* Fix issue 3137 (commons-app#3637)

* Fix issue 3137

* Remove import Timber

* Remove unnecessary space

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - revert logging

* Fix build

* commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order

* Revert "commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order"

This reverts commit d8f9809.

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - remove unused methods/fields

* commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order (commons-app#3662)

* commons-app#3653 Many Mnull requests - stop requesting captions for null ids (commons-app#3657)

* commons-app#3653 Many Mnull requests - stop requesting captions for null ids

* commons-app#3653 Many Mnull requests - move log line

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items  (commons-app#3650)

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items - for empty search terms show nearby items for depictions

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items - use linear radii progression to search for places

* commons-app#3666 Crash when uploading on structured-data branch - revert cleanup of UploadController (commons-app#3670)

* commons-app#3222 Merge Structured Data branch into master - fix caption rendering in new UI

* commons-app#3222 Merge Structured Data branch into master - upgrade retrofit + okhttp

* commons-app#3664 Stop using JsonObject on StructuredData (commons-app#3672)

* commons-app#3664 Stop using JsonObject on StructuredData - remove usage in Media classes - remove from depicts client - create partial network models

* commons-app#3664 Stop using JsonObject on StructuredData - allow partial mapping of polymorphic models by returning null in typeadapter

* commons-app#3664 Stop using JsonObject on StructuredData - use models for editing depicts property

* commons-app#3664 Stop using JsonObject on StructuredData - use models for sparql parent query

* commons-app#3664 Stop using JsonObject on StructuredData - fix unit test compilation

* commons-app#3664 Stop using JsonObject on StructuredData - unify sparql responses

* commons-app#3664 Stop using JsonObject on StructuredData - minor cleanup of misnamed/unused/too broad visibility

* commons-app#3664 Stop using JsonObject on StructuredData - share variable names and logic for the Sarql queries

* commons-app#3664 Stop using JsonObject on StructuredData - add error logging

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
Co-authored-by: vvijayalakshmi21 <34595292+vvijayalakshmi21@users.noreply.github.com>
ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this pull request Oct 10, 2020
* commons-app#3222 Merge master into Structured Data branch, fix conflicts (commons-app#3447)

* [WIP] Fixes commons-app#2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (commons-app#2887)

* Fix duplicate param information (commons-app#2515)

* Bug fix issue commons-app#2476 (commons-app#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (commons-app#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (commons-app#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix commons-app#2580]

* Bug Fix commons-app#2585 (commons-app#2647)

* Bug Fix commons-app#2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue commons-app#2648 (commons-app#2678)

* Bug Fix issue commons-app#2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue commons-app#2652 (commons-app#2706)

* Addded null check on bookmark before operating on it

* BugFix issue commons-app#2711 (commons-app#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix commons-app#2718 (commons-app#2719)

* Handled null auth cookies

* Fix commons-app#2791: NPE when nominating for deletion and leaving screen (commons-app#2792)

* Bug Fix issue commons-app#2789 (commons-app#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix commons-app#2720 (commons-app#2831)

BugFix deprecated licenes commons-app#2720

* ui fixes, wip, upload

* *Issue commons-app#2886, BugFix commons-app#2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (commons-app#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (commons-app#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (commons-app#3001)

* Bugfix/uploads (commons-app#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (commons-app#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (commons-app#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (commons-app#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue commons-app#3006

* resolved issue commons-app#3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue commons-app#3035

* fixed issue commons-app#3033

* fixed issue commons-app#3005

* fixed issue commons-app#3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue commons-app#3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue commons-app#3100

* fixed issue commons-app#3098

* fixed issue commons-app#3099

* fixed issue commons-app#3104 and commons-app#3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue commons-app#3108 and commons-app#3107

* fix isse commons-app#3108

* fixed issue commons-app#3110 and commons-app#3112

* fixed issue commons-app#3113

* added documentations

* fixed issue commons-app#3076 and commons-app#3109

* added depiction search test

* fixed issue commons-app#3113

* fixed issue commons-app#3111

* fixed issue commons-app#3106

* Showing items in explore

* minor change

* fixed issue commons-app#3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue commons-app#3119

* fixed issue commons-app#3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue commons-app#3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix commons-app#3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* commons-app#3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>

* commons-app#3482 Use Room in Structured Data branch - remove unused code (commons-app#3483)

* commons-app#3482 Use Room in Structured Data branch - remove unused code

* commons-app#3482 Use Room in Structured Data branch - fix unit test compilation

* commons-app#3482 Use Room in Structured Data branch - add kdoc

* commons-app#3490 Depiction Search in upload shows No Results before it gets results (commons-app#3491)

* commons-app#3482 Use Room in Structured Data branch - remove unused code

* commons-app#3482 Use Room in Structured Data branch - fix unit test compilation

* commons-app#3490 Depiction Search in upload shows No Results before it gets results - stop showing error on subscription

* commons-app#3490 Depiction Search in upload shows No Results before it gets results - update test cases

* make labels nullable too

* fix unit test compilation

* commons-app#3222 remove lingering reference to depiction content provider

* Fix Crash

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - review fixes

* Fix method invocations

* commons-app#3529 Captions/depictions are not saved to Commons (commons-app#3574)

* commons-app#3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* commons-app#3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs  (commons-app#3578)

* commons-app#3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* commons-app#3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - replace title with the first MediaDetail

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - restore button disabling

* commons-app#3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - fix nearby place

* fix thumbnail issue 3526 (commons-app#3617)

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - fix bad merge

* commons-app#3529 Captions/depictions are not saved to Commons (commons-app#3588)

* commons-app#3529 Captions/depictions are not saved to Commons - update flow to update appropriate data

* commons-app#3529 Captions/depictions are not saved to Commons - fix invoking of setlabel

* commons-app#3529 Captions/depictions are not saved to Commons - fix unit tests

* commons-app#3529 Captions/depictions are not saved to Commons - use constant for @nAmed

* commons-app#3529 Captions/depictions are not saved to Commons - remove captions interface

* commons-app#3529 Captions/depictions are not saved to Commons - delete unused Contribution fields - enforce Single Responsibility by using PageContentsCreator

* commons-app#3529 Captions/depictions are not saved to Commons - prefix id with M - remove language from url and only add from Field

* commons-app#3529 Captions/depictions are not saved to Commons - make edits of depictions and captions sequential

* commons-app#3529 Captions/depictions are not saved to Commons - remove unused model fields

* commons-app#3529 Captions/depictions are not saved to Commons - weaken type of categories - copy list on Contribution creation

* commons-app#3529 Captions/depictions are not saved to Commons - mark Media fields private - weaken types - remove partly implemented fields

* commons-app#3529 Captions/depictions are not saved to Commons - add semi colon

* commons-app#3529 Captions/depictions are not saved to Commons - fix test

* Fix issue 3526 Unlike "Items" tab, "child classes" tab does not display description nor image thumbnail (commons-app#3619)

* fix thumbnail issue 3526

* Fix Description issue 3526

* revert changes on this file, not finished with it yet

* Fix Description for Child and Parent classes - issue 3526

* Remove conflict text in file

* Remove retrofit.HEAD import

* Incorporated review comments

* Fix issue 3137 (commons-app#3637)

* Fix issue 3137

* Remove import Timber

* Remove unnecessary space

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - revert logging

* Fix build

* commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order

* Revert "commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order"

This reverts commit d8f9809.

* commons-app#3222 Merge master into Structured Data branch, fix conflicts - remove unused methods/fields

* commons-app#3661 No Depictions Selected Dialog has reversed buttons - fix button order (commons-app#3662)

* commons-app#3653 Many Mnull requests - stop requesting captions for null ids (commons-app#3657)

* commons-app#3653 Many Mnull requests - stop requesting captions for null ids

* commons-app#3653 Many Mnull requests - move log line

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items  (commons-app#3650)

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items - for empty search terms show nearby items for depictions

* commons-app#3633 [structured-data branch] In depictions selection screen, suggest nearby items - use linear radii progression to search for places

* commons-app#3666 Crash when uploading on structured-data branch - revert cleanup of UploadController (commons-app#3670)

* commons-app#3222 Merge Structured Data branch into master - fix caption rendering in new UI

* commons-app#3222 Merge Structured Data branch into master - upgrade retrofit + okhttp

* commons-app#3664 Stop using JsonObject on StructuredData (commons-app#3672)

* commons-app#3664 Stop using JsonObject on StructuredData - remove usage in Media classes - remove from depicts client - create partial network models

* commons-app#3664 Stop using JsonObject on StructuredData - allow partial mapping of polymorphic models by returning null in typeadapter

* commons-app#3664 Stop using JsonObject on StructuredData - use models for editing depicts property

* commons-app#3664 Stop using JsonObject on StructuredData - use models for sparql parent query

* commons-app#3664 Stop using JsonObject on StructuredData - fix unit test compilation

* commons-app#3664 Stop using JsonObject on StructuredData - unify sparql responses

* commons-app#3664 Stop using JsonObject on StructuredData - minor cleanup of misnamed/unused/too broad visibility

* commons-app#3664 Stop using JsonObject on StructuredData - share variable names and logic for the Sarql queries

* commons-app#3664 Stop using JsonObject on StructuredData - add error logging

* commons-app#228 Overwrite happens - fix extension of filename (commons-app#3689)

* commons-app#3675 Rename buttons of the dialog box shown when no depiction is selected - remove "yes, submit" and "no, go back" (commons-app#3688)

* commons-app#3680 Tip appears even when not tapping the (i) icon - use TextInputLayout EndIcons (commons-app#3683)

* commons-app#3680 Tip appears even when not tapping the (i) icon - use TextInputLayout EndIcons

* commons-app#3680 Tip appears even when not tapping the (i) icon - reaorder endIcon mode call so tinting is applied

* structured data - fix compilation

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
Co-authored-by: vvijayalakshmi21 <34595292+vvijayalakshmi21@users.noreply.github.com>
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.

6 participants