mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
Show NSFW toggle in the nav drawer in anonymous mode.
This commit is contained in:
parent
daa6b06617
commit
3adac8a074
@ -308,6 +308,30 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
setOnClickListener = false;
|
||||
if (isNSFWEnabled) {
|
||||
stringId = R.string.disable_nsfw;
|
||||
drawableId = R.drawable.ic_nsfw_off_24dp;
|
||||
} else {
|
||||
stringId = R.string.enable_nsfw;
|
||||
drawableId = R.drawable.ic_nsfw_on_24dp;
|
||||
}
|
||||
|
||||
((MenuItemViewHolder) holder).itemView.setOnClickListener(view -> {
|
||||
if (isNSFWEnabled) {
|
||||
isNSFWEnabled = false;
|
||||
((MenuItemViewHolder) holder).menuTextView.setText(R.string.enable_nsfw);
|
||||
((MenuItemViewHolder) holder).imageView.setImageDrawable(context.getDrawable(R.drawable.ic_nsfw_on_24dp));
|
||||
itemClickListener.onMenuClick(R.string.disable_nsfw);
|
||||
} else {
|
||||
isNSFWEnabled = true;
|
||||
((MenuItemViewHolder) holder).menuTextView.setText(R.string.disable_nsfw);
|
||||
((MenuItemViewHolder) holder).imageView.setImageDrawable(context.getDrawable(R.drawable.ic_nsfw_off_24dp));
|
||||
itemClickListener.onMenuClick(R.string.enable_nsfw);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
stringId = R.string.settings;
|
||||
drawableId = R.drawable.ic_settings_24dp;
|
||||
}
|
||||
@ -379,7 +403,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re
|
||||
}
|
||||
return CURRENT_MENU_ITEMS;
|
||||
} else {
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
} else {
|
||||
if (isLoggedIn) {
|
||||
|
@ -142,8 +142,6 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<!--<include layout="@layout/content_view_subreddit_detail" />-->
|
||||
|
||||
<com.google.android.material.bottomappbar.BottomAppBar
|
||||
android:id="@+id/bottom_navigation_view_subreddit_detail_activity"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/frame_layout_view_subreddit_detail_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:application=".ViewSubredditDetailActivity"
|
||||
tools:showIn="@layout/activity_view_subreddit_detail" />
|
Loading…
Reference in New Issue
Block a user