mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-02 15:36:32 +00:00
Split pinned chats into a separate remote config.
This commit is contained in:
@@ -78,9 +78,9 @@ public class FromTextView extends SimpleEmojiTextView {
|
||||
|
||||
setText(builder);
|
||||
|
||||
if (recipient.isBlocked()) setCompoundDrawablesRelativeWithIntrinsicBounds(getBlocked(), null, null, null);
|
||||
else if (RemoteConfig.getShowChatFolders() && isPinned) setCompoundDrawablesRelativeWithIntrinsicBounds(getPinned(), null, null, null);
|
||||
else setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, 0, 0);
|
||||
if (recipient.isBlocked()) setCompoundDrawablesRelativeWithIntrinsicBounds(getBlocked(), null, null, null);
|
||||
else if (RemoteConfig.getInlinePinnedChats() && isPinned) setCompoundDrawablesRelativeWithIntrinsicBounds(getPinned(), null, null, null);
|
||||
else setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
private Drawable getBlocked() {
|
||||
|
||||
@@ -193,7 +193,7 @@ abstract class ConversationListDataSource implements PagedDataSource<Long, Conve
|
||||
totalCount++;
|
||||
}
|
||||
|
||||
if (!RemoteConfig.getShowChatFolders() && pinnedCount != 0) {
|
||||
if (!RemoteConfig.getInlinePinnedChats() && pinnedCount != 0) {
|
||||
if (unpinnedCount != 0) {
|
||||
totalCount += 2;
|
||||
} else {
|
||||
@@ -209,7 +209,7 @@ abstract class ConversationListDataSource implements PagedDataSource<Long, Conve
|
||||
List<Cursor> cursors = new ArrayList<>(5);
|
||||
long originalLimit = limit;
|
||||
|
||||
if (!RemoteConfig.getShowChatFolders() && offset == 0 && hasPinnedHeader()) {
|
||||
if (!RemoteConfig.getInlinePinnedChats() && offset == 0 && hasPinnedHeader()) {
|
||||
MatrixCursor pinnedHeaderCursor = new MatrixCursor(ConversationReader.HEADER_COLUMN);
|
||||
pinnedHeaderCursor.addRow(ConversationReader.PINNED_HEADER);
|
||||
cursors.add(pinnedHeaderCursor);
|
||||
@@ -220,7 +220,7 @@ abstract class ConversationListDataSource implements PagedDataSource<Long, Conve
|
||||
cursors.add(pinnedCursor);
|
||||
limit -= pinnedCursor.getCount();
|
||||
|
||||
if (!RemoteConfig.getShowChatFolders() && offset == 0 && hasUnpinnedHeader()) {
|
||||
if (!RemoteConfig.getInlinePinnedChats() && offset == 0 && hasUnpinnedHeader()) {
|
||||
MatrixCursor unpinnedHeaderCursor = new MatrixCursor(ConversationReader.HEADER_COLUMN);
|
||||
unpinnedHeaderCursor.addRow(ConversationReader.UNPINNED_HEADER);
|
||||
cursors.add(unpinnedHeaderCursor);
|
||||
@@ -250,7 +250,7 @@ abstract class ConversationListDataSource implements PagedDataSource<Long, Conve
|
||||
|
||||
@VisibleForTesting
|
||||
int getHeaderOffset() {
|
||||
if (RemoteConfig.getShowChatFolders()) {
|
||||
if (RemoteConfig.getInlinePinnedChats()) {
|
||||
return 0;
|
||||
} else {
|
||||
return (hasPinnedHeader() ? 1 : 0) + (hasUnpinnedHeader() ? 1 : 0);
|
||||
|
||||
@@ -1111,6 +1111,14 @@ object RemoteConfig {
|
||||
hotSwappable = true
|
||||
)
|
||||
|
||||
/** Whether or not to use the new pinned chat UI. */
|
||||
@JvmStatic
|
||||
val inlinePinnedChats: Boolean by remoteBoolean(
|
||||
key = "android.inlinePinnedChats",
|
||||
defaultValue = false,
|
||||
hotSwappable = true
|
||||
)
|
||||
|
||||
@JvmStatic
|
||||
@get:JvmName("newCallUi")
|
||||
val newCallUi: Boolean by remoteBoolean(
|
||||
|
||||
Reference in New Issue
Block a user