-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BlurNsfwExceptFromNsfwCommunities to blur types #1229
Conversation
It's also needed change nsfw type on server |
app/src/main/java/com/jerboa/ui/components/settings/lookandfeel/LookAndFeelActivity.kt
Outdated
Show resolved
Hide resolved
What do you mean by this? Currently it is not even saved server side. |
Also move the listsetting to be below the other list settings |
I'm sorry. Perhaps I misunderstand how this works. I saw that the data in AccountSettings.kt is taken from siteViewModel.siteRes. There they are initialized as API.getInstance().getSite. Could you tell me where I can see how it works? |
show_nsfw is a account setting that controls wether you see any nsfw content at all in the feed. It's not about blurring images |
…to NSFW communities (LemmyNet#957)" This reverts commit 0101e34.
Made changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking better
app/src/main/java/com/jerboa/ui/components/settings/lookandfeel/LookAndFeelActivity.kt
Outdated
Show resolved
Hide resolved
Made changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that it looks good but until I am home I can't verify if the actual functionality works.
Made changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, I will have tmmr some time to physically test these changes
Made changes |
# Conflicts: # app/src/main/java/com/jerboa/ui/components/community/list/CommunityListActivity.kt # app/src/main/res/values/strings.xml
Alright, I have confirmed the functionality and added my changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the functionality and did some changes
app/src/main/java/com/jerboa/ui/components/settings/lookandfeel/LookAndFeelActivity.kt
Outdated
Show resolved
Hide resolved
Since I have made some changes, @dessalines, could you review my changes |
Sure, testing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll allow myself to be overruled, but I don't think this is the right way to handle this. We already have a back-end blur_nsfw
user setting, that appears to be ignored right now in favor of an app-specific setting, which we should do away with / deprecate.
I also don't see the additional blur types making too much sense. There's a blur_nsfw boolean, and the only additional one that might make sense, is the addition in the back end of a blur_all_previews
setting.
Made changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the conflicts too, I'll test it later
} | ||
|
||
fun changeBlurTypeInsideCommunity(blurTypes: Int): Int = | ||
if (blurTypes.toEnum<BlurTypes>() == NsfwExceptFromNsfwCommunities) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compare on ordinal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and blurType
enum class BlurTypes(@StringRes val resId: Int) : Parcelable { | ||
Nothing(R.string.app_settings_nothing), | ||
NSFW(R.string.app_settings_blur_nsfw), | ||
NsfwExceptFromNsfwCommunities(R.string.app_settings_blur_nsfw_except_from_nsfw_communities), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this type, as discussed we keep only, blur nothing, blur nsfw and blur nsfw but not in community view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MV-GH I didn't understand you, only these 3 options remain. 4 option (ExceptFromNsfwInsideCommunity) it technical option. In community activity I swap NsfwExceptFromNsfwCommunities option for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not how I meant that second approach. The second approach was, turn NSFWExceptInsideCommunity into Nothing if passed to communityActiviity else convert it to NSFW and then you only have to handle those two cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else convert it to NSFW and then you only have to handle those two cases
I can't figure out how and where to do this. In Main Activity for every Activity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but you can do it once under appsetting and pass that. except for community activity where you then pass the other option. But first I have to know if Dessalines would accept such approach.
@dessalines Would you be against the above approach or do you rather that we have a extra param indicating that this is community view. Or do you have a better approach in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NSFWExceptInsideCommunity into Nothing if passed to communityActiviity
Yes that seems fine. No point in adding an extra enum when it can figure that out by context, in the CommunityActivity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MV-GH Am I understanding correctly that "NsfwExceptFromNsfwCommunities" works as "Nothing" only for nsfw communities, otherwise it works as "NSFW"? If this is true then I can't change it in MainActivity because I need the community type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what do you need the communityType? You map it there either to Nothing or NSFW ordinals depending if its for CommunityView
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MV-GH what behavior should there be with the nsfw posts if Community.nsfw = false and blur option = "NsfwExceptFromNsfwCommunities"? Doesn't it then transform into, a "NSFW" not in "Nothing"?
I mean not communityType but Community.nsfw parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the community nsfw option, we don't care anymore if the post comes from a nsfw community or not. And if the function receives NsfwExceptFromNsfwCommunity then throw with message likr this type should ve already been transformed into another
Pushed. I left only 3 options. "NsfwExceptFromNsfwCommunity" works like "Nsfw". And I transform "NsfwExceptFromNsfwCommunity" in "CommunityActivity" to "Nothing" |
You still need to resolve the conflicts, Edit: i resolved them for you, If I did anything wrong, you can fix it. |
Once CI passes I'll test to make sure its good too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of errors in PostListing.kt
@dessalines fixed |
@@ -82,7 +83,7 @@ fun CommunityActivity( | |||
showVotingArrowsInListView: Boolean, | |||
useCustomTabs: Boolean, | |||
usePrivateTabs: Boolean, | |||
blurNSFW: Boolean, | |||
blurNSFW: Int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't these use the BlurType enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't do it either for other enums, see postActionMode below it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmk, I'll test this shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
K I tested and its working fine. @MV-GH you're still on "request changes" btw.
@MV-GH Do I need to do anything else? |
Lemme test this and I'll merge |
My first pull request. I will be grateful for every advice