mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Update link preview settings and add some UI polish.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package org.thoughtcrime.securesms.keyvalue;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public final class SettingsValues extends SignalStoreValues {
|
||||
|
||||
public static final String LINK_PREVIEWS = "settings.link_previews";
|
||||
|
||||
SettingsValues(@NonNull KeyValueStore store) {
|
||||
super(store);
|
||||
}
|
||||
|
||||
@Override
|
||||
void onFirstEverAppLaunch() {
|
||||
getStore().beginWrite()
|
||||
.putBoolean(LINK_PREVIEWS, true)
|
||||
.apply();
|
||||
}
|
||||
|
||||
public boolean isLinkPreviewsEnabled() {
|
||||
return getBoolean(LINK_PREVIEWS, false);
|
||||
}
|
||||
|
||||
public void setLinkPreviewsEnabled(boolean enabled) {
|
||||
putBoolean(LINK_PREVIEWS, enabled);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ public final class SignalStore {
|
||||
private final MiscellaneousValues misc;
|
||||
private final InternalValues internalValues;
|
||||
private final EmojiValues emojiValues;
|
||||
private final SettingsValues settingsValues;
|
||||
|
||||
private SignalStore() {
|
||||
this.store = ApplicationDependencies.getKeyValueStore();
|
||||
@@ -37,6 +38,7 @@ public final class SignalStore {
|
||||
this.misc = new MiscellaneousValues(store);
|
||||
this.internalValues = new InternalValues(store);
|
||||
this.emojiValues = new EmojiValues(store);
|
||||
this.settingsValues = new SettingsValues(store);
|
||||
}
|
||||
|
||||
public static void onFirstEverAppLaunch() {
|
||||
@@ -49,6 +51,7 @@ public final class SignalStore {
|
||||
tooltips().onFirstEverAppLaunch();
|
||||
misc().onFirstEverAppLaunch();
|
||||
internalValues().onFirstEverAppLaunch();
|
||||
settings().onFirstEverAppLaunch();
|
||||
}
|
||||
|
||||
public static @NonNull KbsValues kbsValues() {
|
||||
@@ -91,6 +94,10 @@ public final class SignalStore {
|
||||
return INSTANCE.emojiValues;
|
||||
}
|
||||
|
||||
public static @NonNull SettingsValues settings() {
|
||||
return INSTANCE.settingsValues;
|
||||
}
|
||||
|
||||
public static @NonNull GroupsV2AuthorizationSignalStoreCache groupsV2AuthorizationCache() {
|
||||
return new GroupsV2AuthorizationSignalStoreCache(getStore());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user