mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 04:33:36 +00:00
Add sticker support.
No sticker packs are available for use yet, but we now have the latent ability to send and receive.
This commit is contained in:
@@ -12,12 +12,11 @@ import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraintObserver;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraintObserver;
|
||||
import org.thoughtcrime.securesms.lock.RegistrationLockReminders;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.preferences.widgets.NotificationPrivacyPreference;
|
||||
import org.whispersystems.libsignal.util.Medium;
|
||||
|
||||
@@ -180,6 +179,10 @@ public class TextSecurePreferences {
|
||||
|
||||
private static final String GIF_GRID_LAYOUT = "pref_gif_grid_layout";
|
||||
|
||||
private static final String SEEN_STICKER_INTRO_TOOLTIP = "pref_seen_sticker_intro_tooltip";
|
||||
|
||||
private static final String MEDIA_KEYBOARD_MODE = "pref_media_keyboard_mode";
|
||||
|
||||
public static boolean isScreenLockEnabled(@NonNull Context context) {
|
||||
return getBooleanPreference(context, SCREEN_LOCK, false);
|
||||
}
|
||||
@@ -1078,6 +1081,23 @@ public class TextSecurePreferences {
|
||||
setBooleanPreference(context, NEEDS_MESSAGE_PULL, needsMessagePull);
|
||||
}
|
||||
|
||||
public static boolean hasSeenStickerIntroTooltip(Context context) {
|
||||
return getBooleanPreference(context, SEEN_STICKER_INTRO_TOOLTIP, false);
|
||||
}
|
||||
|
||||
public static void setHasSeenStickerIntroTooltip(Context context, boolean seenStickerTooltip) {
|
||||
setBooleanPreference(context, SEEN_STICKER_INTRO_TOOLTIP, seenStickerTooltip);
|
||||
}
|
||||
|
||||
public static void setMediaKeyboardMode(Context context, MediaKeyboardMode mode) {
|
||||
setStringPreference(context, MEDIA_KEYBOARD_MODE, mode.name());
|
||||
}
|
||||
|
||||
public static MediaKeyboardMode getMediaKeyboardMode(Context context) {
|
||||
String name = getStringPreference(context, MEDIA_KEYBOARD_MODE, MediaKeyboardMode.EMOJI.name());
|
||||
return MediaKeyboardMode.valueOf(name);
|
||||
}
|
||||
|
||||
public static void setBooleanPreference(Context context, String key, boolean value) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean(key, value).apply();
|
||||
}
|
||||
@@ -1126,4 +1146,9 @@ public class TextSecurePreferences {
|
||||
return defaultValues;
|
||||
}
|
||||
}
|
||||
|
||||
// NEVER rename these -- they're persisted by name
|
||||
public enum MediaKeyboardMode {
|
||||
EMOJI, STICKER
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user