popup for nsfw content
This commit is contained in:
@@ -18,11 +18,13 @@ class AppDelegate: NSObject, UIApplicationDelegate {
|
|||||||
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
||||||
// PersistenceController.shared.clearDB()
|
// PersistenceController.shared.clearDB()
|
||||||
// PersistenceController.shared.deleteLast(numberOfEntries: 5)
|
// PersistenceController.shared.deleteLast(numberOfEntries: 5)
|
||||||
|
// GroupUserDefaults.groupDefaults.set(false, forKey: UserDefaultsStore.Keys.showNSFW.rawValue)
|
||||||
|
|
||||||
|
|
||||||
PersistenceController.shared.removeNoForDates()
|
PersistenceController.shared.removeNoForDates()
|
||||||
PersistenceController.shared.fillInMissingDates()
|
PersistenceController.shared.fillInMissingDates()
|
||||||
UNUserNotificationCenter.current().delegate = self
|
UNUserNotificationCenter.current().delegate = self
|
||||||
|
|
||||||
let theme = UserDefaultsStore.theme()
|
|
||||||
UIPageControl.appearance().currentPageIndicatorTintColor = UIColor(textColor)
|
UIPageControl.appearance().currentPageIndicatorTintColor = UIColor(textColor)
|
||||||
UIPageControl.appearance().pageIndicatorTintColor = UIColor.systemGray
|
UIPageControl.appearance().pageIndicatorTintColor = UIColor.systemGray
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class UserDefaultsStore {
|
|||||||
case customMoodTint
|
case customMoodTint
|
||||||
case customMoodTintUpdateNumber
|
case customMoodTintUpdateNumber
|
||||||
case textColor
|
case textColor
|
||||||
|
case showNSFW
|
||||||
|
|
||||||
case contentViewCurrentSelectedHeaderViewBackDays
|
case contentViewCurrentSelectedHeaderViewBackDays
|
||||||
case contentViewHeaderTag
|
case contentViewHeaderTag
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ struct CustomizeView: View {
|
|||||||
|
|
||||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = .black
|
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = .black
|
||||||
|
|
||||||
|
@AppStorage(UserDefaultsStore.Keys.showNSFW.rawValue, store: GroupUserDefaults.groupDefaults) private var showNSFW: Bool = false
|
||||||
|
|
||||||
@State private var sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
|
@State private var sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
|
||||||
|
@State private var showOver18Alert = false
|
||||||
|
|
||||||
@StateObject private var customMoodTint = UserDefaultsStore.getCustomMoodTint()
|
@StateObject private var customMoodTint = UserDefaultsStore.getCustomMoodTint()
|
||||||
|
|
||||||
@@ -213,7 +216,6 @@ struct CustomizeView: View {
|
|||||||
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
||||||
.fill(imagePack == images ? theme.currentTheme.bgColor : .clear)
|
.fill(imagePack == images ? theme.currentTheme.bgColor : .clear)
|
||||||
.padding([.top, .bottom], -3)
|
.padding([.top, .bottom], -3)
|
||||||
|
|
||||||
)
|
)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
|
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
|
||||||
@@ -403,10 +405,27 @@ struct CustomizeView: View {
|
|||||||
.padding(5)
|
.padding(5)
|
||||||
)
|
)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
|
if aPack.rawValue == PersonalityPack.Rude.rawValue && !showNSFW {
|
||||||
impactMed.impactOccurred()
|
showOver18Alert = true
|
||||||
personalityPack = aPack
|
} else {
|
||||||
LocalNotification.rescheduleNotifiations()
|
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
|
||||||
|
impactMed.impactOccurred()
|
||||||
|
personalityPack = aPack
|
||||||
|
LocalNotification.rescheduleNotifiations()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.blur(radius: aPack.rawValue == PersonalityPack.Rude.rawValue && !showNSFW ? 5 : 0)
|
||||||
|
.alert(isPresented: $showOver18Alert) {
|
||||||
|
let primaryButton = Alert.Button.default(Text(String(localized: "customize_view_over18alert_ok"))) {
|
||||||
|
showNSFW = true
|
||||||
|
}
|
||||||
|
let secondaryButton = Alert.Button.cancel(Text(String(localized: "customize_view_over18alert_no"))) {
|
||||||
|
showNSFW = false
|
||||||
|
}
|
||||||
|
return Alert(title: Text(String(localized: "customize_view_over18alert_title")),
|
||||||
|
message: Text(String(localized: "customize_view_over18alert_body")),
|
||||||
|
primaryButton: primaryButton,
|
||||||
|
secondaryButton: secondaryButton)
|
||||||
}
|
}
|
||||||
if aPack.rawValue != (PersonalityPack.allCases.sorted(by: { $0.rawValue > $1.rawValue }).first?.rawValue) ?? 0 {
|
if aPack.rawValue != (PersonalityPack.allCases.sorted(by: { $0.rawValue > $1.rawValue }).first?.rawValue) ?? 0 {
|
||||||
Divider()
|
Divider()
|
||||||
|
|||||||
@@ -78,6 +78,10 @@
|
|||||||
"customize_view_view_change_icon" = "Change App Icon";
|
"customize_view_view_change_icon" = "Change App Icon";
|
||||||
"customize_view_view_text_color" = "Text Color";
|
"customize_view_view_text_color" = "Text Color";
|
||||||
"customize_view_view_example_row" = "Example row";
|
"customize_view_view_example_row" = "Example row";
|
||||||
|
"customize_view_over18alert_title" = "Are you over 18?";
|
||||||
|
"customize_view_over18alert_body" = "Some of this is explicit, are you over 18?";
|
||||||
|
"customize_view_over18alert_ok" = "Sure";
|
||||||
|
"customize_view_over18alert_no" = "Nah, I'm good";
|
||||||
|
|
||||||
"create_widget_view_left_eye" = "Left Eye";
|
"create_widget_view_left_eye" = "Left Eye";
|
||||||
"create_widget_view_right_eye" = "Right Eye";
|
"create_widget_view_right_eye" = "Right Eye";
|
||||||
|
|||||||
Reference in New Issue
Block a user