Added option for #130

This commit is contained in:
l3d00m
2015-08-24 14:48:06 +02:00
parent d0956e6642
commit 2ae0885c4d
6 changed files with 19 additions and 0 deletions
@@ -61,6 +61,10 @@ public class ConversationPrefsHelper {
return getBoolean(SettingsFragment.NOTIFICATION_CALL_BUTTON, false);
}
public boolean getDimissedReadEnabled() {
return getBoolean(SettingsFragment.DISMISSED_READ, false);
}
public void putString(String key, String value) {
mConversationPrefs.edit().putString(key, value).apply();
}
@@ -474,6 +474,7 @@ public class NotificationManager {
.addAction(R.drawable.ic_accept, sRes.getString(R.string.read), readPI)
.extend(WearableIntentReceiver.getSingleConversationExtender(context, message.mContact, message.mAddress, threadId))
.setDeleteIntent(seenPI);
if (conversationPrefs.getDimissedReadEnabled()){builder.setDeleteIntent(readPI);}
if (conversationPrefs.getCallButtonEnabled()) {
Intent callIntent = new Intent(Intent.ACTION_CALL);
@@ -142,6 +142,7 @@ public class SettingsFragment extends PreferenceFragment implements
public static final String MMS_CONTACT_SUPPORT = "pref_key_mms_contact_support";
public static final String SIMPLE_PREFS = "pref_key_simple";
public static final String DONATE = "pref_key_donate";
public static final String DISMISSED_READ = "pref_key_dismiss_read";
/**
* @deprecated
*/
+2
View File
@@ -207,6 +207,8 @@
<string name="pref_vibration_summary">Vibrate when new messages are received</string>
<string name="pref_notification_call">Call button</string>
<string name="pref_notification_call_summary">Call the sender of a message right from the notification</string>
<string name="pref_dimiss_read">Mark as read</string>
<string name="pref_dismiss_read_summary">Mark as read when notification has been cleared</string>
<string name="pref_delayed">Delayed messaging</string>
<string name="pref_delayed_summary">Wait before sending your messages, so you have a chance to review them</string>
+3
View File
@@ -117,6 +117,9 @@
<Preference
android:defaultValue="false"
android:key="pref_key_notification_call" />
<Preference
android:defaultValue="false"
android:key="pref_key_dismiss_read" />
<!-- QKSMS+ -->
<Preference
@@ -71,5 +71,13 @@
android:summary="@string/pref_notification_call_summary"
android:title="@string/pref_notification_call"
android:widgetLayout="@layout/view_checkbox" />
<CheckBoxPreference
android:defaultValue="false"
android:dependency="pref_key_notifications"
android:key="pref_key_dismiss_read"
android:layout="@layout/list_item_preference"
android:summary="@string/pref_dismiss_read_summary"
android:title="@string/pref_dimiss_read"
android:widgetLayout="@layout/view_checkbox" />
</PreferenceCategory>
</PreferenceScreen>