Remove some reddit specific options from a few places

Removed multireddits. Also remove the "random" option from the "more options" menu
This commit is contained in:
Bazsalanszky 2023-08-04 10:54:21 +02:00
parent 4bfe1b0c02
commit 5de8751079
8 changed files with 7 additions and 65 deletions

View File

@ -1400,10 +1400,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
goToUser();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_RANDOM: {
randomThing();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_HIDE_READ_POSTS: {
if (sectionsPagerAdapter != null) {
sectionsPagerAdapter.hideReadPosts();

View File

@ -558,10 +558,6 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect
goToUser();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_RANDOM: {
random();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_HIDE_READ_POSTS: {
if (sectionsPagerAdapter != null) {
sectionsPagerAdapter.hideReadPosts();

View File

@ -233,7 +233,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
});
sectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(sectionsPagerAdapter);
viewPager.setOffscreenPageLimit(3);
viewPager.setOffscreenPageLimit(1);
if (viewPager.getCurrentItem() != 2) {
fab.hide();
}
@ -358,7 +358,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
}
if (!(!forceLoad && mInsertMultiredditSuccess)) {
loadMultiReddits();
//loadMultiReddits();
}
}
@ -412,7 +412,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
public void success() {
Toast.makeText(SubscribedThingListingActivity.this,
R.string.delete_multi_reddit_success, Toast.LENGTH_SHORT).show();
loadMultiReddits();
//loadMultiReddits();
}
@Override
@ -439,7 +439,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
@Subscribe
public void onRefreshMultiRedditsEvent(RefreshMultiRedditsEvent event) {
loadMultiReddits();
//loadMultiReddits();
}
@Override
@ -477,6 +477,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
@Override
public Fragment getItem(int position) {
switch (position) {
default:
case 0: {
SubscribedSubredditsListingFragment fragment = new SubscribedSubredditsListingFragment();
Bundle bundle = new Bundle();
@ -487,28 +488,12 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
fragment.setArguments(bundle);
return fragment;
}
case 1: {
FollowedUsersListingFragment fragment = new FollowedUsersListingFragment();
Bundle bundle = new Bundle();
bundle.putString(FollowedUsersListingFragment.EXTRA_ACCOUNT_NAME, mAccountName == null ? "-" : mAccountName);
bundle.putString(FollowedUsersListingFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
fragment.setArguments(bundle);
return fragment;
}
default: {
MultiRedditListingFragment fragment = new MultiRedditListingFragment();
Bundle bundle = new Bundle();
bundle.putString(MultiRedditListingFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
bundle.putString(MultiRedditListingFragment.EXTRA_ACCOUNT_NAME, mAccountName == null ? "-" : mAccountName);
fragment.setArguments(bundle);
return fragment;
}
}
}
@Override
public int getCount() {
return 3;
return 1;
}
@Override

View File

@ -946,10 +946,6 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
goToUser();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_RANDOM: {
random();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_HIDE_READ_POSTS: {
if (mFragment instanceof PostFragment) {
((PostFragment) mFragment).hideReadPosts();

View File

@ -1402,10 +1402,6 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
goToUser();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_RANDOM: {
random();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_HIDE_READ_POSTS: {
if (sectionsPagerAdapter != null) {
sectionsPagerAdapter.hideReadPosts();

View File

@ -1341,10 +1341,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
goToUser();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_RANDOM: {
random();
break;
}
case FABMoreOptionsBottomSheetFragment.FAB_HIDE_READ_POSTS: {
if (sectionsPagerAdapter != null) {
sectionsPagerAdapter.hideReadPosts();

View File

@ -24,7 +24,6 @@ public class FABMoreOptionsBottomSheetFragment extends LandscapeExpandedRoundedB
public static final int FAB_OPTION_SEARCH = 4;
public static final int FAB_OPTION_GO_TO_SUBREDDIT = 5;
public static final int FAB_OPTION_GO_TO_USER = 6;
public static final int FAB_RANDOM = 7;
public static final int FAB_HIDE_READ_POSTS = 8;
public static final int FAB_FILTER_POSTS = 9;
public static final int FAB_GO_TO_TOP = 10;
@ -86,10 +85,6 @@ public class FABMoreOptionsBottomSheetFragment extends LandscapeExpandedRoundedB
dismiss();
});
binding.randomTextViewFabMoreOptionsBottomSheetFragment.setOnClickListener(view -> {
activity.fabOptionSelected(FAB_RANDOM);
dismiss();
});
binding.filterPostsTextViewFabMoreOptionsBottomSheetFragment.setOnClickListener(view -> {
activity.fabOptionSelected(FAB_FILTER_POSTS);

View File

@ -144,25 +144,6 @@
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/random_text_view_fab_more_options_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/random"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
app:drawableStartCompat="@drawable/ic_random_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/hide_read_posts_text_view_fab_more_options_bottom_sheet_fragment"
android:layout_width="match_parent"