mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 13:23:58 +01:00
Create initViewsAndListeners() method to tidy onCreate
This commit is contained in:
parent
aa73165964
commit
11d3517b70
1 changed files with 25 additions and 21 deletions
|
|
@ -282,28 +282,12 @@ public class ShareActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
* Initialize views and setup listeners here for FAB to prevent cluttering onCreate
|
||||||
super.onCreate(savedInstanceState);
|
*/
|
||||||
|
private void initViewsAndListeners() {
|
||||||
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);
|
||||||
/*
|
//called when upper arrow floating button
|
||||||
* called when upper arrow floating button
|
|
||||||
*/
|
|
||||||
mainFab.setOnClickListener(new View.OnClickListener() {
|
mainFab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
@ -327,6 +311,26 @@ public class ShareActivity
|
||||||
Log.i("exception", e.toString());
|
Log.i("exception", e.toString());
|
||||||
}
|
}
|
||||||
zoomOutButton = (FloatingActionButton) findViewById(R.id.media_upload_zoom_out);
|
zoomOutButton = (FloatingActionButton) findViewById(R.id.media_upload_zoom_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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();
|
||||||
|
initViewsAndListeners();
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
contribution = savedInstanceState.getParcelable("contribution");
|
contribution = savedInstanceState.getParcelable("contribution");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue