diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java index a7f99a45..17674c6f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java @@ -1639,24 +1639,12 @@ public class DialogsAdapter extends RecyclerListView.SelectionAdapter implements } if (!stopUpdate) { - boolean foxInfoInserted = false; for (int k = 0; k < array.size(); k++) { if (dialogsType == DialogsActivity.DIALOGS_TYPE_ADD_USERS_TO && array.get(k) instanceof DialogsActivity.DialogsHeader) { itemInternals.add(new ItemInternal(VIEW_TYPE_HEADER_2, array.get(k))); } else { itemInternals.add(new ItemInternal(VIEW_TYPE_DIALOG, array.get(k))); } - // Insert the account-info row right after the archive folder so - // it stays pinned visible even when the archive is auto-scrolled - // out of view (the list auto-scrolls to position 1 in that case). - if (!foxInfoInserted && shouldShowFoxAccountInfo() && array.get(k) instanceof TLRPC.TL_dialogFolder) { - itemInternals.add(new ItemInternal(VIEW_TYPE_FOX_ACCOUNT_INFO)); - foxInfoInserted = true; - } - } - // No archive folder present: just pin it to the very top. - if (!foxInfoInserted && shouldShowFoxAccountInfo()) { - itemInternals.add(0, new ItemInternal(VIEW_TYPE_FOX_ACCOUNT_INFO)); } if (!forceShowEmptyCell && dialogsType != 7 && dialogsType != 8 && !MessagesController.getInstance(currentAccount).isDialogsEndReached(folderId)) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java index 8f9031d2..e1249798 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java @@ -616,6 +616,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. private ActiveGiftAuctionsHintCell activeGiftAuctionsHintCell; private DialogsHintCell dialogsHintCell; private UnconfirmedAuthHintCell authHintCell; + private org.telegram.ui.Cells.FoxAccountInfoCell foxAccountInfoCell; private Long cacheSize, deviceSize; private ArrayList frozenDialogsList; @@ -4849,6 +4850,12 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. updateDialogsHint(); }); topPanelLayout.addView(dialogsHintCell); + + foxAccountInfoCell = new org.telegram.ui.Cells.FoxAccountInfoCell(context); + topPanelLayout.addView(foxAccountInfoCell); + topPanelLayout.setPriority(foxAccountInfoCell, 1); + topPanelLayout.setDebugName(foxAccountInfoCell, "fox account info"); + updateFoxAccountInfoVisibility(); } else if (initialDialogsType == DIALOGS_TYPE_FORWARD || clickSelectsDialog()) { chatInputViewsContainer = new ChatInputViewsContainer(context); chatInputViewsContainer.setClipChildren(false); @@ -6310,6 +6317,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. checkUnconfirmedAuthHintCellVisibility(); checkActiveGiftAuctionsHintCellVisibility(); + updateFoxAccountInfoVisibility(); } private void checkUnconfirmedAuthHintCellVisibility() { @@ -6335,6 +6343,22 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. } } + private void updateFoxAccountInfoVisibility() { + if (fragmentView == null || topPanelLayout == null || foxAccountInfoCell == null) { + return; + } + final boolean isVisible = !isInPreviewMode() + && folderId == 0 && initialDialogsType == DIALOGS_TYPE_DEFAULT + && !onlySelect + && (rightSlidingDialogContainer == null || !rightSlidingDialogContainer.hasFragment()) + && !animatorSearchVisible.getValue() + && tw.nekomimi.nekogram.helpers.SponsorHelper.isCurrentUserLinked(); + if (isVisible) { + foxAccountInfoCell.update(); + } + topPanelLayout.setViewVisible(foxAccountInfoCell, isVisible); + } + private void checkActiveGiftAuctionsHintCellVisibility() { if (fragmentView == null || topPanelLayout == null) { return; @@ -10392,6 +10416,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter. } } } + updateFoxAccountInfoVisibility(); return; } if (id == NotificationCenter.dialogsNeedReload) { diff --git a/TMessagesProj/src/main/res/mipmap-hdpi/ic_launcher.png b/TMessagesProj/src/main/res/mipmap-hdpi/ic_launcher.png index f8a3ff1b..157953e1 100644 Binary files a/TMessagesProj/src/main/res/mipmap-hdpi/ic_launcher.png and b/TMessagesProj/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/TMessagesProj/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/TMessagesProj/src/main/res/mipmap-hdpi/ic_launcher_foreground.png index 27b0a4e7..1c56aafd 100644 Binary files a/TMessagesProj/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and b/TMessagesProj/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-mdpi/ic_launcher.png b/TMessagesProj/src/main/res/mipmap-mdpi/ic_launcher.png index ab4217be..f039a471 100644 Binary files a/TMessagesProj/src/main/res/mipmap-mdpi/ic_launcher.png and b/TMessagesProj/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/TMessagesProj/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/TMessagesProj/src/main/res/mipmap-mdpi/ic_launcher_foreground.png index 8dcca269..5f6a4da5 100644 Binary files a/TMessagesProj/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and b/TMessagesProj/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xhdpi/ic_launcher.png b/TMessagesProj/src/main/res/mipmap-xhdpi/ic_launcher.png index 50b3116e..064d2fad 100644 Binary files a/TMessagesProj/src/main/res/mipmap-xhdpi/ic_launcher.png and b/TMessagesProj/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/TMessagesProj/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png index 7f70ec29..b382f4dc 100644 Binary files a/TMessagesProj/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and b/TMessagesProj/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xxhdpi/ic_launcher.png b/TMessagesProj/src/main/res/mipmap-xxhdpi/ic_launcher.png index e5440db1..55f4e51a 100644 Binary files a/TMessagesProj/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/TMessagesProj/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/TMessagesProj/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png index 034033ce..ba7ec4a4 100644 Binary files a/TMessagesProj/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and b/TMessagesProj/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/TMessagesProj/src/main/res/mipmap-xxxhdpi/ic_launcher.png index d7ef9d1e..529ca414 100644 Binary files a/TMessagesProj/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/TMessagesProj/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/TMessagesProj/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/TMessagesProj/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png index 10d558ed..e82a8a60 100644 Binary files a/TMessagesProj/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and b/TMessagesProj/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ