Improve wallpaper settings screen, conversation rendering.

Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
Alex Hart
2021-01-19 21:54:10 -05:00
committed by Greyson Parrelli
parent 6bcb0de43d
commit b5712f4bd1
63 changed files with 1100 additions and 307 deletions

View File

@@ -848,7 +848,18 @@ public class Recipient {
}
public @Nullable ChatWallpaper getWallpaper() {
return wallpaper;
if (wallpaper != null) {
return wallpaper;
} else {
return SignalStore.wallpaper().getWallpaper();
}
}
/**
* A cheap way to check if wallpaper is set without doing any unnecessary proto parsing.
*/
public boolean hasWallpaper() {
return wallpaper != null || SignalStore.wallpaper().hasWallpaperSet();
}
public boolean isSystemContact() {

View File

@@ -54,6 +54,7 @@ import org.thoughtcrime.securesms.util.DateUtils;
import org.thoughtcrime.securesms.util.LifecycleCursorWrapper;
import org.thoughtcrime.securesms.util.ServiceUtil;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.wallpaper.ChatWallpaperActivity;
import java.util.Locale;
import java.util.Objects;
@@ -105,6 +106,7 @@ public class ManageRecipientFragment extends LoggingFragment {
private View secureCallButton;
private View insecureCallButton;
private View secureVideoCallButton;
private View chatWallpaperButton;
static ManageRecipientFragment newInstance(@NonNull RecipientId recipientId, boolean fromConversation) {
ManageRecipientFragment fragment = new ManageRecipientFragment();
@@ -161,6 +163,7 @@ public class ManageRecipientFragment extends LoggingFragment {
secureCallButton = view.findViewById(R.id.recipient_voice_call);
insecureCallButton = view.findViewById(R.id.recipient_insecure_voice_call);
secureVideoCallButton = view.findViewById(R.id.recipient_video_call);
chatWallpaperButton = view.findViewById(R.id.chat_wallpaper);
return view;
}
@@ -270,6 +273,7 @@ public class ManageRecipientFragment extends LoggingFragment {
secureCallButton.setOnClickListener(v -> viewModel.onSecureCall(requireActivity()));
insecureCallButton.setOnClickListener(v -> viewModel.onInsecureCall(requireActivity()));
secureVideoCallButton.setOnClickListener(v -> viewModel.onSecureVideoCall(requireActivity()));
chatWallpaperButton.setOnClickListener(v -> startActivity(ChatWallpaperActivity.createIntent(requireContext(), recipientId)));
}
@Override