Fixes crash when uploading image via share without logging in

This commit is contained in:
Shridhar Goel 2018-06-28 19:57:11 +05:30
parent 05def522af
commit 90705996a8
3 changed files with 12 additions and 18 deletions

View file

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

View file

@ -167,7 +167,6 @@ public class ShareActivity
uploadBegins();
}
}
else //Send user to login activity
{
Toast.makeText(this, "You need to login first!", Toast.LENGTH_SHORT).show();
@ -207,16 +206,9 @@ 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();
});
@ -679,3 +671,4 @@ public class ShareActivity
}
}

View file

@ -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) {