mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 04:39:04 +00:00
Add option to enable/disable party activity notifications
This commit is contained in:
parent
d562277b8e
commit
6fe25ddce4
5 changed files with 19 additions and 0 deletions
|
|
@ -844,4 +844,5 @@
|
|||
<string name="repeat_daily">Daily</string>
|
||||
<string name="search">Search</string>
|
||||
<string name="search_hint">Search tasks</string>
|
||||
<string name="preference_push_party_activity">Party Activity</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -245,6 +245,12 @@
|
|||
android:title="@string/preference_push_important_announcements"
|
||||
android:layout="@layout/preference_child_summary"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="preference_push_party_activity"
|
||||
android:defaultValue="true"
|
||||
android:title="@string/preference_push_party_activity"
|
||||
android:layout="@layout/preference_child_summary"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
|||
|
|
@ -2,9 +2,18 @@ package com.habitrpg.android.habitica.helpers.notifications
|
|||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.core.app.NotificationCompat
|
||||
|
||||
class ChatMentionNotification(context: Context, identifier: String) : HabiticaLocalNotification(context, identifier) {
|
||||
|
||||
override fun configureNotificationBuilder(data: MutableMap<String, String>): NotificationCompat.Builder {
|
||||
val style = NotificationCompat.BigTextStyle()
|
||||
.setBigContentTitle(title)
|
||||
.bigText(message)
|
||||
return super.configureNotificationBuilder(data)
|
||||
.setStyle(style)
|
||||
}
|
||||
|
||||
override fun configureMainIntent(intent: Intent) {
|
||||
super.configureMainIntent(intent)
|
||||
intent.putExtra("type", data?.get("type"))
|
||||
|
|
|
|||
|
|
@ -13,4 +13,5 @@ open class PushNotificationsPreference : RealmObject() {
|
|||
var questStarted: Boolean = false
|
||||
var giftedGems: Boolean = false
|
||||
var giftedSubscription: Boolean = false
|
||||
var partyActivity: Boolean = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class PushNotificationsPreferencesFragment : BasePreferencesFragment(), SharedPr
|
|||
updatePreference("preference_push_your_quest_has_begun", user?.preferences?.pushNotifications?.questStarted)
|
||||
updatePreference("preference_push_invited_to_quest", user?.preferences?.pushNotifications?.invitedQuest)
|
||||
updatePreference("preference_push_important_announcements", user?.preferences?.pushNotifications?.majorUpdates)
|
||||
updatePreference("preference_push_party_activity", user?.preferences?.pushNotifications?.partyActivity)
|
||||
isSettingUser = false
|
||||
isInitialSet = false
|
||||
}
|
||||
|
|
@ -67,6 +68,7 @@ class PushNotificationsPreferencesFragment : BasePreferencesFragment(), SharedPr
|
|||
"preference_push_your_quest_has_begun" -> "questStarted"
|
||||
"preference_push_invited_to_quest" -> "invitedQuest"
|
||||
"preference_push_important_announcements" -> "majorUpdates"
|
||||
"preference_push_party_activity" -> "partyActivity"
|
||||
else -> null
|
||||
}
|
||||
if (pathKey != null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue