mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Fixes crash when uploading image via share without logging in
This commit is contained in:
parent
05def522af
commit
90705996a8
3 changed files with 12 additions and 18 deletions
|
|
@ -26,6 +26,7 @@ dependencies {
|
||||||
transitive = true
|
transitive = true
|
||||||
}
|
}
|
||||||
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
||||||
|
//noinspection GradleCompatible
|
||||||
implementation "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
|
implementation "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
|
||||||
implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
|
implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
|
||||||
implementation "com.android.support:design:$SUPPORT_LIB_VERSION"
|
implementation "com.android.support:design:$SUPPORT_LIB_VERSION"
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,6 @@ public class ShareActivity
|
||||||
uploadBegins();
|
uploadBegins();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else //Send user to login activity
|
else //Send user to login activity
|
||||||
{
|
{
|
||||||
Toast.makeText(this, "You need to login first!", Toast.LENGTH_SHORT).show();
|
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");
|
Timber.d("Cache the categories found");
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadController.startUpload(title, mediaUri, description, mimeType, source, decimalCoords, c -> {
|
uploadController.startUpload(title,mediaUri,description,mimeType,source,decimalCoords,wikiDataEntityId,c ->
|
||||||
ShareActivity.this.contribution = c;
|
|
||||||
showPostUpload();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uploadController.startUpload(title, mediaUri, description, mimeType, source, decimalCoords, wikiDataEntityId, c -> {
|
|
||||||
ShareActivity.this.contribution = c;
|
ShareActivity.this.contribution = c;
|
||||||
showPostUpload();
|
showPostUpload();
|
||||||
});
|
});
|
||||||
|
|
@ -679,3 +671,4 @@ public class ShareActivity
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,13 +83,13 @@ public class UploadController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a new upload task.
|
* Starts a new upload task.
|
||||||
*
|
|
||||||
* @param title the title of the contribution
|
* @param title the title of the contribution
|
||||||
* @param mediaUri the media URI of the contribution
|
* @param mediaUri the media URI of the contribution
|
||||||
* @param description the description of the contribution
|
* @param description the description of the contribution
|
||||||
* @param mimeType the MIME type of the contribution
|
* @param mimeType the MIME type of the contribution
|
||||||
* @param source the source of the contribution
|
* @param source the source of the contribution
|
||||||
* @param decimalCoords the coordinates in decimal. (e.g. "37.51136|-77.602615")
|
* @param decimalCoords the coordinates in decimal. (e.g. "37.51136|-77.602615")
|
||||||
|
* @param wikiDataEntityId
|
||||||
* @param onComplete the progress tracker
|
* @param onComplete the progress tracker
|
||||||
*/
|
*/
|
||||||
public void startUpload(String title, Uri mediaUri, String description, String mimeType, String source, String decimalCoords, String wikiDataEntityId, ContributionUploadProgress onComplete) {
|
public void startUpload(String title, Uri mediaUri, String description, String mimeType, String source, String decimalCoords, String wikiDataEntityId, ContributionUploadProgress onComplete) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue