Remove avatar from stories header (account switch moved to bottom menu)

This commit is contained in:
instant992 2026-06-16 22:19:45 +04:00
parent a807fa9db6
commit 24676bba9d

View file

@ -577,10 +577,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
@Override
protected void dispatchDraw(Canvas canvas) {
if (!isActive) {
headerView.backupImageView.getImageReceiver().setVisible(true, true);
}
if (!unsupported) {
if (playerSharedScope.renderView != null || storyAreasView != null && (storyAreasView.hasSelectedForScale() || storyAreasView.parentHighlightScaleAlpha.isInProgress())) {
invalidate();
@ -4226,7 +4222,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
isPremiumBlocked = !UserConfig.getInstance(currentAccount).isPremium() && DialogObject.isPremiumBlocked(r);
starsPriceBlocked = DialogObject.getMessagesStarsPrice(r);
avatarDrawable.setInfo(currentAccount, user);
headerView.backupImageView.getImageReceiver().setForUserOrChat(user, avatarDrawable);
setTitle(true, dialogId, false);
} else {
isSelf = false;
@ -4243,7 +4238,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
isPremiumBlocked = isGroup && !ChatObject.canSendPlain(chat);
starsPriceBlocked = MessagesController.getInstance(currentAccount).getSendPaidMessagesStars(dialogId);
avatarDrawable.setInfo(currentAccount, chat);
headerView.backupImageView.getImageReceiver().setForUserOrChat(chat, avatarDrawable);
setTitle(true, dialogId, false);
}
if (isActive && (isSelf || isChannel)) {
@ -5166,7 +5160,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
if (headerView.radialProgress != null) {
headerView.radialProgress.setProgress(currentStory.uploadingStory.progress, false);
}
headerView.backupImageView.invalidate();
} else if (!animateSubtitle) {
headerView.progressToUploading = 0;
}
@ -6303,7 +6296,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
updatePreloadImages();
muteIconView.setAnimation(sharedResources.muteDrawable);
isActive = true;
headerView.backupImageView.getImageReceiver().setVisible(true, true);
if (currentStory.storyItem != null) {
FileLog.d("StoryViewer displayed story dialogId=" + dialogId + " storyId=" + currentStory.storyItem.id + " " + currentStory.getMediaDebugString());
}
@ -6337,7 +6329,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
}
public void reset() {
headerView.backupImageView.getImageReceiver().setVisible(true, true);
if (changeBoundAnimator != null) {
chatActivityEnterView.reset();
chatActivityEnterView.setAlpha(1f - outT);
@ -6615,7 +6606,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
public static class PeerHeaderView extends FrameLayout {
public BackupImageView backupImageView;
public SimpleTextView titleView;
private TextView[] subtitleView = new TextView[2];
RadialProgress radialProgress;
@ -6629,18 +6619,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
public PeerHeaderView(@NonNull Context context, StoryItemHolder holder) {
super(context);
this.storyItemHolder = holder;
backupImageView = new BackupImageView(context) {
@Override
protected void onDraw(Canvas canvas) {
if (imageReceiver.getVisible()) {
AndroidUtilities.rectTmp.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
drawUploadingProgress(canvas, AndroidUtilities.rectTmp, true, 1f);
}
super.onDraw(canvas);
}
};
backupImageView.setRoundRadius(dp(16));
addView(backupImageView, LayoutHelper.createFrame(32, 32, 0, 12, 2, 0, 0));
setClipChildren(false);
titleView = new SimpleTextView(context) {
@ -6658,7 +6636,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
// titleView.setSingleLine(true);
// titleView.setEllipsize(TextUtils.TruncateAt.END);
NotificationCenter.listenEmojiLoading(titleView);
addView(titleView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, 0, 54, 0, 86, 0));
addView(titleView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, 0, 12, 0, 86, 0));
for (int a = 0; a < 2; ++a) {
subtitleView[a] = new TextView(context);
@ -6668,7 +6646,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
subtitleView[a].setEllipsize(TextUtils.TruncateAt.MIDDLE);
subtitleView[a].setTextColor(Color.WHITE);
subtitleView[a].setPadding(dp(3), 0, dp(3), dp(1));
addView(subtitleView[a], LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, 0, 51, 18, 83, 0));
addView(subtitleView[a], LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, 0, 9, 18, 83, 0));
}
titleView.setTextColor(Color.WHITE);
@ -6758,11 +6736,10 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
}
}
if (radialProgress == null) {
radialProgress = new RadialProgress(backupImageView);
radialProgress = new RadialProgress(null);
radialProgress.setBackground(null, true, false);
}
radialProgress.setDiff(0);
ImageReceiver imageReceiver = backupImageView.getImageReceiver();
float offset = AndroidUtilities.dp(3) - AndroidUtilities.dp(6) * (1f - progressToUploading);
radialProgress.setProgressRect(
(int) (rect.left - offset), (int) (rect.top - offset),
@ -6774,7 +6751,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
}
if (allowDraw) {
if (progressToOpen != 1f) {
Paint paint = StoriesUtilities.getUnreadCirclePaint(imageReceiver, false);
Paint paint = StoriesUtilities.getUnreadCirclePaint(rect, false);
paint.setAlpha((int) (255 * progressToUploading));
radialProgress.setPaint(paint);
radialProgress.draw(canvas);