Added comments and whitespace

This commit is contained in:
misaochan 2016-07-13 19:38:36 +12:00
parent af0c1dc3a8
commit 8f78f904a0

View file

@ -75,7 +75,6 @@ public class ShareActivity
private String title; private String title;
private String description; private String description;
private Snackbar snackbar; private Snackbar snackbar;
public ShareActivity() { public ShareActivity() {
@ -87,12 +86,12 @@ public class ShareActivity
this.title = title; this.title = title;
this.description = description; this.description = description;
//Check for Storage permission that is required for upload. Do not allow user to proceed without permission, otherwise will crash
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1); ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
} else { } else {
uploadBegins(); uploadBegins();
} }
} }
private void showPostUpload() { private void showPostUpload() {
@ -161,7 +160,6 @@ public class ShareActivity
protected void onAuthCookieAcquired(String authCookie) { protected void onAuthCookieAcquired(String authCookie) {
app.getApi().setAuthCookie(authCookie); app.getApi().setAuthCookie(authCookie);
shareView = (SingleUploadFragment) getSupportFragmentManager().findFragmentByTag("shareView"); shareView = (SingleUploadFragment) getSupportFragmentManager().findFragmentByTag("shareView");
categorizationFragment = (CategorizationFragment) getSupportFragmentManager().findFragmentByTag("categorization"); categorizationFragment = (CategorizationFragment) getSupportFragmentManager().findFragmentByTag("categorization");
if(shareView == null && categorizationFragment == null) { if(shareView == null && categorizationFragment == null) {
@ -181,11 +179,6 @@ public class ShareActivity
finish(); finish();
} }
/**
* Initiates retrieval of image coordinates or user coordinates, and caching of coordinates.
* Then initiates the calls to MediaWiki API through an instance of MwVolleyApi.
*/
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -305,6 +298,7 @@ public class ShareActivity
if (grantResults.length > 0 if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//Uploading only begins if storage permission granted
uploadBegins(); uploadBegins();
snackbar.dismiss(); snackbar.dismiss();
getFileMetadata(); getFileMetadata();
@ -355,6 +349,10 @@ public class ShareActivity
useImageCoords(); useImageCoords();
} }
/**
* Initiates retrieval of image coordinates or user coordinates, and caching of coordinates.
* Then initiates the calls to MediaWiki API through an instance of MwVolleyApi.
*/
public void useImageCoords() { public void useImageCoords() {
if(decimalCoords != null) { if(decimalCoords != null) {
Log.d(TAG, "Decimal coords of image: " + decimalCoords); Log.d(TAG, "Decimal coords of image: " + decimalCoords);
@ -411,5 +409,4 @@ public class ShareActivity
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
} }