diff --git a/app/build.gradle b/app/build.gradle index bb0220b30..3f062c5c6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,6 +26,7 @@ dependencies { transitive = true } implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0' + //noinspection GradleCompatible implementation "com.android.support:support-v4:$SUPPORT_LIB_VERSION" implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION" implementation "com.android.support:design:$SUPPORT_LIB_VERSION" diff --git a/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java b/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java index 1f15c2b2b..b3d0f98c4 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java @@ -152,8 +152,8 @@ public class ShareActivity this.title = title; this.description = description; - - if(sessionManager.getCurrentAccount()!=null) { + + if (sessionManager.getCurrentAccount() != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // Check for Storage permission that is required for upload. // Do not allow user to proceed without permission, otherwise will crash @@ -167,11 +167,10 @@ public class ShareActivity uploadBegins(); } } - else //Send user to login activity { Toast.makeText(this, "You need to login first!", Toast.LENGTH_SHORT).show(); - Intent loginIntent=new Intent(ShareActivity.this, LoginActivity.class); + Intent loginIntent = new Intent(ShareActivity.this, LoginActivity.class); startActivity(loginIntent); } } @@ -207,20 +206,13 @@ public class ShareActivity Timber.d("Cache the categories found"); } - uploadController.startUpload(title, mediaUri, description, mimeType, source, decimalCoords, c -> { - ShareActivity.this.contribution = c; - showPostUpload(); - }); + uploadController.startUpload(title,mediaUri,description,mimeType,source,decimalCoords,wikiDataEntityId,c -> - } - - - - uploadController.startUpload(title, mediaUri, description, mimeType, source, decimalCoords, wikiDataEntityId, c -> { - ShareActivity.this.contribution = c; - showPostUpload(); - }); - } + { + ShareActivity.this.contribution = c; + showPostUpload(); + }); +} /** * Starts CategorizationFragment after uploadBegins. @@ -679,3 +671,4 @@ public class ShareActivity } } + diff --git a/app/src/main/java/fr/free/nrw/commons/upload/UploadController.java b/app/src/main/java/fr/free/nrw/commons/upload/UploadController.java index 409a3a0d9..388747c7f 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/UploadController.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/UploadController.java @@ -83,13 +83,13 @@ public class UploadController { /** * Starts a new upload task. - * * @param title the title of the contribution * @param mediaUri the media URI of the contribution * @param description the description of the contribution * @param mimeType the MIME type of the contribution * @param source the source of the contribution * @param decimalCoords the coordinates in decimal. (e.g. "37.51136|-77.602615") + * @param wikiDataEntityId * @param onComplete the progress tracker */ public void startUpload(String title, Uri mediaUri, String description, String mimeType, String source, String decimalCoords, String wikiDataEntityId, ContributionUploadProgress onComplete) {