mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-30 03:24:44 +01:00
Hide read posts in ViewSubredditDetailActivity.
This commit is contained in:
parent
a6975f2489
commit
59baa9c51c
@ -711,6 +711,9 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
||||
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_RANDOM:
|
||||
fab.setImageResource(R.drawable.ic_random_24dp);
|
||||
break;
|
||||
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_HIDE_READ_POSTS:
|
||||
fab.setImageResource(R.drawable.ic_hide_read_posts_24dp);
|
||||
break;
|
||||
default:
|
||||
fab.setImageResource(R.drawable.ic_add_day_night_24dp);
|
||||
break;
|
||||
@ -746,6 +749,11 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
||||
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_RANDOM:
|
||||
random();
|
||||
break;
|
||||
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_HIDE_READ_POSTS:
|
||||
if (sectionsPagerAdapter != null) {
|
||||
sectionsPagerAdapter.hideReadPosts();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
postTypeBottomSheetFragment.show(getSupportFragmentManager(), postTypeBottomSheetFragment.getTag());
|
||||
break;
|
||||
@ -1125,6 +1133,11 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
||||
random();
|
||||
break;
|
||||
}
|
||||
case FABMoreOptionsBottomSheetFragment.FAB_HIDE_READ_POSTS: {
|
||||
if (sectionsPagerAdapter != null) {
|
||||
sectionsPagerAdapter.hideReadPosts();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1314,6 +1327,15 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
||||
}
|
||||
}
|
||||
|
||||
void hideReadPosts() {
|
||||
if (fragmentManager != null) {
|
||||
Fragment fragment = fragmentManager.findFragmentByTag("f0");
|
||||
if (fragment instanceof PostFragment) {
|
||||
((PostFragment) fragment).hideReadPosts();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 2;
|
||||
|
@ -208,6 +208,7 @@ public class SharedPreferencesUtils {
|
||||
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_SUBREDDIT = 5;
|
||||
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_USER = 6;
|
||||
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_RANDOM = 7;
|
||||
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_HIDE_READ_POSTS = 8;
|
||||
|
||||
public static final String NSFW_AND_SPOILER_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.nsfw_and_spoiler";
|
||||
public static final String NSFW_BASE = "_nsfw";
|
||||
|
Loading…
x
Reference in New Issue
Block a user