mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Create new receiveIntent() method to tidy onCreate
This commit is contained in:
parent
c0c74f68d2
commit
aa73165964
1 changed files with 24 additions and 19 deletions
|
|
@ -257,23 +257,10 @@ public class ShareActivity
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
* Receive intent from ContributionController.java when user selects picture to upload
|
||||||
super.onCreate(savedInstanceState);
|
*/
|
||||||
|
private void receiveIntent() {
|
||||||
setContentView(R.layout.activity_share);
|
|
||||||
ButterKnife.bind(this);
|
|
||||||
initBack();
|
|
||||||
backgroundImageView = (SimpleDraweeView) findViewById(R.id.backgroundImage);
|
|
||||||
backgroundImageView.setHierarchy(GenericDraweeHierarchyBuilder
|
|
||||||
.newInstance(getResources())
|
|
||||||
.setPlaceholderImage(VectorDrawableCompat.create(getResources(),
|
|
||||||
R.drawable.ic_image_black_24dp, getTheme()))
|
|
||||||
.setFailureImage(VectorDrawableCompat.create(getResources(),
|
|
||||||
R.drawable.ic_error_outline_black_24dp, getTheme()))
|
|
||||||
.build());
|
|
||||||
|
|
||||||
//Receive intent from ContributionController.java when user selects picture to upload
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
|
|
||||||
if (Intent.ACTION_SEND.equals(intent.getAction())) {
|
if (Intent.ACTION_SEND.equals(intent.getAction())) {
|
||||||
|
|
@ -293,6 +280,25 @@ public class ShareActivity
|
||||||
if (mediaUri != null) {
|
if (mediaUri != null) {
|
||||||
backgroundImageView.setImageURI(mediaUri);
|
backgroundImageView.setImageURI(mediaUri);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
setContentView(R.layout.activity_share);
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
initBack();
|
||||||
|
backgroundImageView = (SimpleDraweeView) findViewById(R.id.backgroundImage);
|
||||||
|
backgroundImageView.setHierarchy(GenericDraweeHierarchyBuilder
|
||||||
|
.newInstance(getResources())
|
||||||
|
.setPlaceholderImage(VectorDrawableCompat.create(getResources(),
|
||||||
|
R.drawable.ic_image_black_24dp, getTheme()))
|
||||||
|
.setFailureImage(VectorDrawableCompat.create(getResources(),
|
||||||
|
R.drawable.ic_error_outline_black_24dp, getTheme()))
|
||||||
|
.build());
|
||||||
|
|
||||||
|
receiveIntent();
|
||||||
|
|
||||||
mainFab = (FloatingActionButton) findViewById(R.id.main_fab);
|
mainFab = (FloatingActionButton) findViewById(R.id.main_fab);
|
||||||
/*
|
/*
|
||||||
|
|
@ -339,8 +345,7 @@ public class ShareActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: We should only use snackbar for location permissions, since storage permissions are MANDATORY
|
// Check location permissions if M or newer for category suggestions, request via snackbar if not present
|
||||||
// Check storage permissions if marshmallow or newer
|
|
||||||
if (!locationPermitted) {
|
if (!locationPermitted) {
|
||||||
requestPermissionUsingSnackBar(
|
requestPermissionUsingSnackBar(
|
||||||
getString(R.string.location_permission_rationale),
|
getString(R.string.location_permission_rationale),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue