aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-02-26 12:11:32 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-02-26 12:11:32 +0000
commita6289f4c1fbf21b719bfc41a99e00b2eecbd1458 (patch)
tree344e8b5d550096e061b7c4e0bdea950654c2078e
parent8274704037ce37777a92a5ee1047c7aa72eb126f (diff)
downloadinfinity-for-reddit-a6289f4c1fbf21b719bfc41a99e00b2eecbd1458.tar
infinity-for-reddit-a6289f4c1fbf21b719bfc41a99e00b2eecbd1458.tar.gz
infinity-for-reddit-a6289f4c1fbf21b719bfc41a99e00b2eecbd1458.tar.bz2
infinity-for-reddit-a6289f4c1fbf21b719bfc41a99e00b2eecbd1458.tar.lz
infinity-for-reddit-a6289f4c1fbf21b719bfc41a99e00b2eecbd1458.tar.xz
infinity-for-reddit-a6289f4c1fbf21b719bfc41a99e00b2eecbd1458.tar.zst
infinity-for-reddit-a6289f4c1fbf21b719bfc41a99e00b2eecbd1458.zip
Minor bugs fixed.
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java
index 7b1d6ade..7e89c508 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java
@@ -444,11 +444,11 @@ public class CustomizePostFilterActivity extends BaseActivity {
} else if (requestCode == ADD_USERS_REQUEST_CODE) {
ArrayList<String> usernames = data.getStringArrayListExtra(SearchActivity.RETURN_EXTRA_SELECTED_USERNAMES);
String currentUsers = excludesUsersTextInputEditText.getText().toString().trim();
- if (usernames != null && !currentUsers.isEmpty() && currentUsers.charAt(currentUsers.length() - 1) != ',') {
- String newString = currentUsers + ",";
- excludesUsersTextInputEditText.setText(newString);
- }
- if (usernames != null) {
+ if (usernames != null && !usernames.isEmpty()) {
+ if (!currentUsers.isEmpty() && currentUsers.charAt(currentUsers.length() - 1) != ',') {
+ String newString = currentUsers + ",";
+ excludesUsersTextInputEditText.setText(newString);
+ }
StringBuilder stringBuilder = new StringBuilder();
for (String s : usernames) {
stringBuilder.append(s).append(",");
@@ -462,11 +462,11 @@ public class CustomizePostFilterActivity extends BaseActivity {
private void updateExcludeSubredditNames(ArrayList<String> subredditNames) {
String currentSubreddits = excludesSubredditsTextInputEditText.getText().toString().trim();
- if (subredditNames != null && !currentSubreddits.isEmpty() && currentSubreddits.charAt(currentSubreddits.length() - 1) != ',') {
- String newString = currentSubreddits + ",";
- excludesSubredditsTextInputEditText.setText(newString);
- }
- if (subredditNames != null) {
+ if (subredditNames != null && !subredditNames.isEmpty()) {
+ if (!currentSubreddits.isEmpty() && currentSubreddits.charAt(currentSubreddits.length() - 1) != ',') {
+ String newString = currentSubreddits + ",";
+ excludesSubredditsTextInputEditText.setText(newString);
+ }
StringBuilder stringBuilder = new StringBuilder();
for (String s : subredditNames) {
stringBuilder.append(s).append(",");