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:
Greyson Parrelli
2019-04-17 10:21:30 -04:00
parent d5fffb0132
commit 2a644437fb
447 changed files with 8782 additions and 1132 deletions

View File

@@ -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
}
}