Update libsignal-client to 0.14.0

This commit is contained in:
Greyson Parrelli
2022-03-14 15:49:46 -04:00
committed by Cody Henthorne
parent 749bbf428d
commit 057231b9c3
650 changed files with 2154 additions and 2384 deletions

View File

@@ -7,7 +7,6 @@ import androidx.annotation.NonNull;
import org.thoughtcrime.securesms.conversation.colors.ChatColors;
import org.thoughtcrime.securesms.conversation.colors.ChatColorsMapper;
import org.thoughtcrime.securesms.conversation.colors.ChatColorsPalette;
import org.thoughtcrime.securesms.database.model.databaseprotos.Wallpaper;
import java.util.Arrays;

View File

@@ -6,7 +6,6 @@ import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.lifecycle.ViewModelProviders;
import androidx.navigation.NavGraph;
import androidx.navigation.Navigation;

View File

@@ -2,7 +2,6 @@ package org.thoughtcrime.securesms.wallpaper;
import android.net.Uri;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import org.thoughtcrime.securesms.database.model.databaseprotos.Wallpaper;

View File

@@ -23,10 +23,10 @@ import org.thoughtcrime.securesms.recipients.RecipientId;
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.FullscreenHelper;
import org.thoughtcrime.securesms.util.adapter.mapping.MappingModel;
import org.thoughtcrime.securesms.util.Projection;
import org.thoughtcrime.securesms.util.ViewUtil;
import org.thoughtcrime.securesms.util.WindowUtil;
import org.thoughtcrime.securesms.util.adapter.mapping.MappingModel;
import java.util.Collections;
import java.util.Objects;

View File

@@ -20,16 +20,16 @@ import org.thoughtcrime.securesms.recipients.RecipientId;
import org.thoughtcrime.securesms.util.DefaultValueLiveData;
import org.thoughtcrime.securesms.util.adapter.mapping.MappingModel;
import org.thoughtcrime.securesms.util.livedata.LiveDataUtil;
import org.whispersystems.libsignal.util.guava.Optional;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
public class ChatWallpaperViewModel extends ViewModel {
private final ChatWallpaperRepository repository = new ChatWallpaperRepository();
private final MutableLiveData<Optional<ChatWallpaper>> wallpaper = new MutableLiveData<>();
private final MutableLiveData<List<ChatWallpaper>> builtins = new MutableLiveData<>();
private final ChatWallpaperRepository repository = new ChatWallpaperRepository();
private final MutableLiveData<Optional<ChatWallpaper>> wallpaper = new MutableLiveData<>();
private final MutableLiveData<List<ChatWallpaper>> builtins = new MutableLiveData<>();
private final MutableLiveData<Boolean> dimInDarkTheme = new MutableLiveData<>();
private final MutableLiveData<Boolean> enableWallpaperControls = new MutableLiveData<>();
private final MutableLiveData<ChatColors> chatColors = new MutableLiveData<>();
@@ -44,7 +44,7 @@ public class ChatWallpaperViewModel extends ViewModel {
ChatWallpaper currentWallpaper = repository.getCurrentWallpaper(recipientId);
dimInDarkTheme.setValue(currentWallpaper == null || currentWallpaper.getDimLevelForDarkTheme() > 0f);
enableWallpaperControls.setValue(hasClearableWallpaper());
wallpaper.setValue(Optional.fromNullable(currentWallpaper));
wallpaper.setValue(Optional.ofNullable(currentWallpaper));
if (recipientId != null) {
liveRecipient = Recipient.live(recipientId);
@@ -87,7 +87,7 @@ public class ChatWallpaperViewModel extends ViewModel {
}
void setWallpaper(@Nullable ChatWallpaper chatWallpaper) {
wallpaper.setValue(Optional.fromNullable(chatWallpaper));
wallpaper.setValue(Optional.ofNullable(chatWallpaper));
}
void saveWallpaperSelection() {
@@ -100,7 +100,7 @@ public class ChatWallpaperViewModel extends ViewModel {
if (recipientId != null) {
ChatWallpaper globalWallpaper = SignalStore.wallpaper().getWallpaper();
this.wallpaper.setValue(Optional.fromNullable(globalWallpaper));
this.wallpaper.setValue(Optional.ofNullable(globalWallpaper));
this.dimInDarkTheme.setValue(globalWallpaper == null || globalWallpaper.getDimLevelForDarkTheme() > 0);
}
@@ -110,7 +110,7 @@ public class ChatWallpaperViewModel extends ViewModel {
enableWallpaperControls.setValue(true);
}
Optional<ChatWallpaper> updated = wallpaper.transform(paper -> ChatWallpaperFactory.updateWithDimming(paper, dimInDarkTheme ? ChatWallpaper.FIXED_DIM_LEVEL_FOR_DARK_THEME : 0f));
Optional<ChatWallpaper> updated = wallpaper.map(paper -> ChatWallpaperFactory.updateWithDimming(paper, dimInDarkTheme ? ChatWallpaper.FIXED_DIM_LEVEL_FOR_DARK_THEME : 0f));
if (updated.isPresent()) {
repository.saveWallpaper(recipientId, updated.get(), this::refreshChatColors);

View File

@@ -10,15 +10,11 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
import org.jetbrains.annotations.NotNull;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.conversation.colors.ChatColors;
import org.thoughtcrime.securesms.conversation.colors.ChatColorsPalette;
import org.thoughtcrime.securesms.database.model.databaseprotos.Wallpaper;
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader;
import org.thoughtcrime.securesms.mms.GlideApp;

View File

@@ -15,7 +15,6 @@ import androidx.lifecycle.ViewModelProvider;
import org.signal.core.util.concurrent.SignalExecutors;
import org.signal.core.util.logging.Log;
import org.signal.imageeditor.core.RendererContext;
import org.signal.imageeditor.core.model.EditorModel;
import org.thoughtcrime.securesms.fonts.FontTypefaceProvider;
import org.thoughtcrime.securesms.recipients.Recipient;