diff options
Diffstat (limited to 'app/src/main')
10 files changed, 40 insertions, 48 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java index 7bd95ca7..833c5d27 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java @@ -671,10 +671,10 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee super.onActivityResult(requestCode, resultCode, data); if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { if (resultCode == RESULT_OK) { - subredditName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); - iconUrl = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL); + subredditName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); + iconUrl = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON); subredditSelected = true; - subredditIsUser = data.getIntExtra(SubredditSelectionActivity.EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; + subredditIsUser = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; binding.subredditNameTextViewPostGalleryActivity.setTextColor(primaryTextColor); binding.subredditNameTextViewPostGalleryActivity.setText(subredditName); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java index 57b7c2c9..052827dd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java @@ -630,10 +630,10 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF 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); + subredditName = data.getExtras().getString(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); + iconUrl = data.getExtras().getString(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON); subredditSelected = true; - subredditIsUser = data.getIntExtra(SubredditSelectionActivity.EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; + subredditIsUser = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; binding.subredditNameTextViewPostImageActivity.setTextColor(primaryTextColor); binding.subredditNameTextViewPostImageActivity.setText(subredditName); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java index 19600d0a..0eb9c33e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java @@ -614,10 +614,10 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { - subredditName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); - iconUrl = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL); + subredditName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); + iconUrl = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON); subredditSelected = true; - subredditIsUser = data.getIntExtra(SubredditSelectionActivity.EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; + subredditIsUser = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; binding.subredditNameTextViewPostLinkActivity.setTextColor(primaryTextColor); binding.subredditNameTextViewPostLinkActivity.setText(subredditName); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java index 4d30f7cc..ca58380e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java @@ -734,10 +734,10 @@ public class PostPollActivity extends BaseActivity implements FlairBottomSheetFr super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { - subredditName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); - iconUrl = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL); + subredditName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); + iconUrl = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON); subredditSelected = true; - subredditIsUser = data.getIntExtra(SubredditSelectionActivity.EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; + subredditIsUser = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; binding.subredditNameTextViewPostPollActivity.setTextColor(primaryTextColor); binding.subredditNameTextViewPostPollActivity.setText(subredditName); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java index 89dfa5d0..7b79066a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java @@ -603,10 +603,10 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { - subredditName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); - iconUrl = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL); + subredditName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); + iconUrl = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON); subredditSelected = true; - subredditIsUser = data.getIntExtra(SubredditSelectionActivity.EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; + subredditIsUser = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; binding.subredditNameTextViewPostTextActivity.setTextColor(primaryTextColor); binding.subredditNameTextViewPostTextActivity.setText(subredditName); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java index c92944ba..b159fa29 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java @@ -656,10 +656,10 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { if (resultCode == RESULT_OK) { if (data != null) { - subredditName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); - iconUrl = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL); + subredditName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); + iconUrl = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON); subredditSelected = true; - subredditIsUser = data.getIntExtra(SubredditSelectionActivity.EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; + subredditIsUser = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; binding.subredditNameTextViewPostVideoActivity.setTextColor(primaryTextColor); binding.subredditNameTextViewPostVideoActivity.setText(subredditName); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java index 08ee6e68..5499f2a8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java @@ -72,8 +72,6 @@ public class SearchActivity extends BaseActivity { public static final String EXTRA_SEARCH_ONLY_SUBREDDITS = "ESOS"; public static final String EXTRA_SEARCH_ONLY_USERS = "ESOU"; public static final String EXTRA_SEARCH_SUBREDDITS_AND_USERS = "ESSAU"; - public static final String EXTRA_RETURN_SUBREDDIT_NAME = "ERSN"; - public static final String EXTRA_RETURN_SUBREDDIT_ICON_URL = "ERSIU"; public static final String RETURN_EXTRA_SELECTED_SUBREDDIT_NAMES = "RESSN"; public static final String RETURN_EXTRA_SELECTED_USERNAMES = "RESU"; public static final String EXTRA_RETURN_USER_NAME = "ERUN"; @@ -172,8 +170,8 @@ public class SearchActivity extends BaseActivity { subredditNameList.add(subredditData.getName()); returnIntent.putStringArrayListExtra(RETURN_EXTRA_SELECTED_SUBREDDIT_NAMES, subredditNameList); } else { - returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_NAME, subredditData.getName()); - returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_ICON_URL, subredditData.getIconUrl()); + returnIntent.putExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME, subredditData.getName()); + returnIntent.putExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON, subredditData.getIconUrl()); } setResult(Activity.RESULT_OK, returnIntent); } else { @@ -533,8 +531,8 @@ public class SearchActivity extends BaseActivity { protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { if (resultCode == RESULT_OK && data != null) { if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { - searchInSubredditOrUserName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); - searchInThingType = data.getIntExtra(SubredditSelectionActivity.EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT); + searchInSubredditOrUserName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); + searchInThingType = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT); setSearchInThingText(); } else if (requestCode == SUBREDDIT_SEARCH_REQUEST_CODE) { @@ -542,10 +540,8 @@ public class SearchActivity extends BaseActivity { if (getIntent().getBooleanExtra(EXTRA_IS_MULTI_SELECTION, false)) { returnIntent.putStringArrayListExtra(RETURN_EXTRA_SELECTED_SUBREDDIT_NAMES, data.getStringArrayListExtra(SearchSubredditsResultActivity.RETURN_EXTRA_SELECTED_SUBREDDIT_NAMES)); } else { - String name = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); - String iconUrl = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON); - returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_NAME, name); - returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_ICON_URL, iconUrl); + returnIntent.putExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME, data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME)); + returnIntent.putExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON, data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON)); } setResult(Activity.RESULT_OK, returnIntent); finish(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java index 4645ccb0..d146a88c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java @@ -595,10 +595,10 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom super.onActivityResult(requestCode, resultCode, data); if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { if (resultCode == RESULT_OK) { - subredditName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); - iconUrl = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL); + subredditName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); + iconUrl = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON); subredditSelected = true; - subredditIsUser = data.getIntExtra(SubredditSelectionActivity.EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; + subredditIsUser = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT) == SelectThingReturnKey.THING_TYPE.USER; binding.subredditNameTextViewSubmitCrosspostActivity.setTextColor(primaryTextColor); binding.subredditNameTextViewSubmitCrosspostActivity.setText(subredditName); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubredditSelectionActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubredditSelectionActivity.java index 4dfa2924..6b066510 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubredditSelectionActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubredditSelectionActivity.java @@ -51,9 +51,6 @@ public class SubredditSelectionActivity extends BaseActivity implements Activity public static final String EXTRA_SPECIFIED_ACCOUNT = "ESA"; public static final String EXTRA_EXTRA_CLEAR_SELECTION = "EECS"; - public static final String EXTRA_RETURN_SUBREDDIT_NAME = "ERSN"; - public static final String EXTRA_RETURN_SUBREDDIT_ICON_URL = "ERSIURL"; - public static final String EXTRA_RETURN_THING_TYPE = "ERTT"; private static final int SUBREDDIT_SEARCH_REQUEST_CODE = 0; private static final String INSERT_SUBSCRIBED_SUBREDDIT_STATE = "ISSS"; @@ -250,12 +247,10 @@ public class SubredditSelectionActivity extends BaseActivity implements Activity protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { if (requestCode == SUBREDDIT_SEARCH_REQUEST_CODE) { if (resultCode == RESULT_OK) { - String name = data.getStringExtra(SearchActivity.EXTRA_RETURN_SUBREDDIT_NAME); - String iconUrl = data.getStringExtra(SearchActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL); Intent returnIntent = new Intent(); - returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_NAME, name); - returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_ICON_URL, iconUrl); - returnIntent.putExtra(EXTRA_RETURN_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT); + returnIntent.putExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME, data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME)); + returnIntent.putExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON, data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_ICON)); + returnIntent.putExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT); setResult(Activity.RESULT_OK, returnIntent); finish(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeMainPageTabsFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeMainPageTabsFragment.java index 398180d8..ca0bdfdb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeMainPageTabsFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeMainPageTabsFragment.java @@ -566,10 +566,11 @@ public class CustomizeMainPageTabsFragment extends Fragment { public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == Activity.RESULT_OK && data != null) { + int thingType = data.getIntExtra(SelectThingReturnKey.RETURN_EXTRA_THING_TYPE, SelectThingReturnKey.THING_TYPE.SUBREDDIT); switch (requestCode) { case 0: - if (data.hasExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME)) { - tab1CurrentName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); + if (thingType == SelectThingReturnKey.THING_TYPE.SUBREDDIT) { + tab1CurrentName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); binding.tab1NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab1CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_1_NAME, tab1CurrentName).apply(); } else if (data.hasExtra(SelectThingReturnKey.RETRUN_EXTRA_MULTIREDDIT)) { @@ -579,15 +580,15 @@ public class CustomizeMainPageTabsFragment extends Fragment { binding.tab1NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab1CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_1_NAME, tab1CurrentName).apply(); } - } else if (data.hasExtra(SearchActivity.EXTRA_RETURN_USER_NAME)) { + } else if (thingType == SelectThingReturnKey.THING_TYPE.USER) { tab1CurrentName = data.getStringExtra(SearchActivity.EXTRA_RETURN_USER_NAME); binding.tab1NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab1CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_1_NAME, tab1CurrentName).apply(); } break; case 1: - if (data.hasExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME)) { - tab2CurrentName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); + if (thingType == SelectThingReturnKey.THING_TYPE.SUBREDDIT) { + tab2CurrentName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); binding.tab2NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab2CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_2_NAME, tab2CurrentName).apply(); } else if (data.hasExtra(SelectThingReturnKey.RETRUN_EXTRA_MULTIREDDIT)) { @@ -597,15 +598,15 @@ public class CustomizeMainPageTabsFragment extends Fragment { binding.tab2NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab2CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_2_NAME, tab2CurrentName).apply(); } - } else if (data.hasExtra(SearchActivity.EXTRA_RETURN_USER_NAME)) { + } else if (thingType == SelectThingReturnKey.THING_TYPE.USER) { tab2CurrentName = data.getStringExtra(SearchActivity.EXTRA_RETURN_USER_NAME); binding.tab2NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab2CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_2_NAME, tab2CurrentName).apply(); } break; case 2: - if (data.hasExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME)) { - tab3CurrentName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); + if (thingType == SelectThingReturnKey.THING_TYPE.SUBREDDIT) { + tab3CurrentName = data.getStringExtra(SelectThingReturnKey.RETURN_EXTRA_SUBREDDIT_OR_USER_NAME); binding.tab3NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab3CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_3_NAME, tab3CurrentName).apply(); } else if (data.hasExtra(SelectThingReturnKey.RETRUN_EXTRA_MULTIREDDIT)) { @@ -615,7 +616,7 @@ public class CustomizeMainPageTabsFragment extends Fragment { binding.tab3NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab3CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_3_NAME, tab3CurrentName).apply(); } - } else if (data.hasExtra(SearchActivity.EXTRA_RETURN_USER_NAME)) { + } else if (thingType == SelectThingReturnKey.THING_TYPE.USER) { tab3CurrentName = data.getStringExtra(SearchActivity.EXTRA_RETURN_USER_NAME); binding.tab3NameSummaryTextViewCustomizeMainPageTabsFragment.setText(tab3CurrentName); mainActivityTabsSharedPreferences.edit().putString((activity.accountName.equals(Account.ANONYMOUS_ACCOUNT) ? "" : activity.accountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_3_NAME, tab3CurrentName).apply(); |