Pin account-info row above the list and refresh app icon

- Move the balance/subscription row out of the scrolling list into the
  fixed top panel (DialogsActivityTopPanelLayout), so it sits above the
  archive folder and is never hidden by the archive auto-scroll
- Visibility tracks SponsorHelper.isCurrentUserLinked and refreshes on
  sponsorStatusUpdated and dialog-hint updates
- Regenerate launcher icon from the new foxigram4.png
This commit is contained in:
instant992 2026-06-10 02:46:52 +04:00
parent a776898268
commit edd7c4a8b4
12 changed files with 25 additions and 12 deletions

View file

@ -1639,24 +1639,12 @@ public class DialogsAdapter extends RecyclerListView.SelectionAdapter implements
} }
if (!stopUpdate) { if (!stopUpdate) {
boolean foxInfoInserted = false;
for (int k = 0; k < array.size(); k++) { for (int k = 0; k < array.size(); k++) {
if (dialogsType == DialogsActivity.DIALOGS_TYPE_ADD_USERS_TO && array.get(k) instanceof DialogsActivity.DialogsHeader) { 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))); itemInternals.add(new ItemInternal(VIEW_TYPE_HEADER_2, array.get(k)));
} else { } else {
itemInternals.add(new ItemInternal(VIEW_TYPE_DIALOG, array.get(k))); 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)) { if (!forceShowEmptyCell && dialogsType != 7 && dialogsType != 8 && !MessagesController.getInstance(currentAccount).isDialogsEndReached(folderId)) {

View file

@ -616,6 +616,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
private ActiveGiftAuctionsHintCell activeGiftAuctionsHintCell; private ActiveGiftAuctionsHintCell activeGiftAuctionsHintCell;
private DialogsHintCell dialogsHintCell; private DialogsHintCell dialogsHintCell;
private UnconfirmedAuthHintCell authHintCell; private UnconfirmedAuthHintCell authHintCell;
private org.telegram.ui.Cells.FoxAccountInfoCell foxAccountInfoCell;
private Long cacheSize, deviceSize; private Long cacheSize, deviceSize;
private ArrayList<TLRPC.Dialog> frozenDialogsList; private ArrayList<TLRPC.Dialog> frozenDialogsList;
@ -4849,6 +4850,12 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
updateDialogsHint(); updateDialogsHint();
}); });
topPanelLayout.addView(dialogsHintCell); 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()) { } else if (initialDialogsType == DIALOGS_TYPE_FORWARD || clickSelectsDialog()) {
chatInputViewsContainer = new ChatInputViewsContainer(context); chatInputViewsContainer = new ChatInputViewsContainer(context);
chatInputViewsContainer.setClipChildren(false); chatInputViewsContainer.setClipChildren(false);
@ -6310,6 +6317,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
checkUnconfirmedAuthHintCellVisibility(); checkUnconfirmedAuthHintCellVisibility();
checkActiveGiftAuctionsHintCellVisibility(); checkActiveGiftAuctionsHintCellVisibility();
updateFoxAccountInfoVisibility();
} }
private void checkUnconfirmedAuthHintCellVisibility() { 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() { private void checkActiveGiftAuctionsHintCellVisibility() {
if (fragmentView == null || topPanelLayout == null) { if (fragmentView == null || topPanelLayout == null) {
return; return;
@ -10392,6 +10416,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
} }
} }
} }
updateFoxAccountInfoVisibility();
return; return;
} }
if (id == NotificationCenter.dialogsNeedReload) { if (id == NotificationCenter.dialogsNeedReload) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 178 KiB