aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-08-24 08:27:34 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-08-24 08:27:34 +0000
commit4d4e6165f0e1bcd72c54fa015a9e1112103e9062 (patch)
treeba276cfc847fd2addc888078784998a2df957554 /app/src/main/java/ml
parent4a3266e68994b55bf1fc40256cd65c3ac831d2e8 (diff)
downloadinfinity-for-reddit-4d4e6165f0e1bcd72c54fa015a9e1112103e9062.tar
infinity-for-reddit-4d4e6165f0e1bcd72c54fa015a9e1112103e9062.tar.gz
infinity-for-reddit-4d4e6165f0e1bcd72c54fa015a9e1112103e9062.tar.bz2
infinity-for-reddit-4d4e6165f0e1bcd72c54fa015a9e1112103e9062.tar.lz
infinity-for-reddit-4d4e6165f0e1bcd72c54fa015a9e1112103e9062.tar.xz
infinity-for-reddit-4d4e6165f0e1bcd72c54fa015a9e1112103e9062.tar.zst
infinity-for-reddit-4d4e6165f0e1bcd72c54fa015a9e1112103e9062.zip
Add an acknowledgement page in settings.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java38
1 files changed, 22 insertions, 16 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java
index c7cde780..bfdb0a21 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java
@@ -465,24 +465,26 @@ public class PostVideoActivity extends AppCompatActivity implements FlairBottomS
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) {
if(resultCode == RESULT_OK) {
- subredditName = data.getExtras().getString(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME);
- iconUrl = data.getExtras().getString(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL);
- subredditSelected = true;
- subredditIsUser = data.getExtras().getBoolean(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_IS_USER);
-
- subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor));
- subredditNameTextView.setText(subredditName);
- displaySubredditIcon();
-
- flairTextView.setVisibility(View.VISIBLE);
- flairTextView.setBackgroundColor(getResources().getColor(android.R.color.transparent));
- flairTextView.setText(getString(R.string.flair));
- flair = null;
+ if(data != null) {
+ subredditName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME);
+ iconUrl = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL);
+ subredditSelected = true;
+ subredditIsUser = data.getBooleanExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_IS_USER, false);
+
+ subredditNameTextView.setTextColor(getResources().getColor(R.color.primaryTextColor));
+ subredditNameTextView.setText(subredditName);
+ displaySubredditIcon();
+
+ flairTextView.setVisibility(View.VISIBLE);
+ flairTextView.setBackgroundColor(getResources().getColor(android.R.color.transparent));
+ flairTextView.setText(getString(R.string.flair));
+ flair = null;
+ }
}
} else if(requestCode == PICK_VIDEO_REQUEST_CODE) {
if(resultCode == RESULT_OK) {
if(data == null) {
- Snackbar.make(coordinatorLayout, R.string.error_getting_image, Snackbar.LENGTH_SHORT).show();
+ Snackbar.make(coordinatorLayout, R.string.error_getting_video, Snackbar.LENGTH_SHORT).show();
return;
}
@@ -490,8 +492,12 @@ public class PostVideoActivity extends AppCompatActivity implements FlairBottomS
loadVideo();
}
} else if (requestCode == CAPTURE_VIDEO_REQUEST_CODE) {
- videoUri = data.getData();
- loadVideo();
+ if(data != null) {
+ videoUri = data.getData();
+ loadVideo();
+ } else {
+ Snackbar.make(coordinatorLayout, R.string.error_getting_video, Snackbar.LENGTH_SHORT).show();
+ }
}
}