2017-09-21 17:03:05 +00:00
|
|
|
package org.thoughtcrime.securesms.preferences.widgets;
|
2015-07-31 22:05:24 +00:00
|
|
|
|
2021-02-18 18:14:40 +00:00
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
2015-07-31 22:05:24 +00:00
|
|
|
public class NotificationPrivacyPreference {
|
|
|
|
|
|
|
|
private final String preference;
|
|
|
|
|
|
|
|
public NotificationPrivacyPreference(String preference) {
|
|
|
|
this.preference = preference;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isDisplayContact() {
|
|
|
|
return "all".equals(preference) || "contact".equals(preference);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isDisplayMessage() {
|
|
|
|
return "all".equals(preference);
|
|
|
|
}
|
|
|
|
|
2021-04-13 21:12:54 +00:00
|
|
|
public boolean isDisplayNothing() {
|
|
|
|
return !isDisplayContact();
|
|
|
|
}
|
|
|
|
|
2021-02-18 18:14:40 +00:00
|
|
|
@Override
|
|
|
|
public @NonNull String toString() {
|
|
|
|
return preference;
|
|
|
|
}
|
2015-07-31 22:05:24 +00:00
|
|
|
}
|