Remove avatar from stories header (account switch moved to bottom menu)
This commit is contained in:
parent
a807fa9db6
commit
24676bba9d
1 changed files with 4 additions and 27 deletions
|
|
@ -577,10 +577,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dispatchDraw(Canvas canvas) {
|
protected void dispatchDraw(Canvas canvas) {
|
||||||
if (!isActive) {
|
|
||||||
headerView.backupImageView.getImageReceiver().setVisible(true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!unsupported) {
|
if (!unsupported) {
|
||||||
if (playerSharedScope.renderView != null || storyAreasView != null && (storyAreasView.hasSelectedForScale() || storyAreasView.parentHighlightScaleAlpha.isInProgress())) {
|
if (playerSharedScope.renderView != null || storyAreasView != null && (storyAreasView.hasSelectedForScale() || storyAreasView.parentHighlightScaleAlpha.isInProgress())) {
|
||||||
invalidate();
|
invalidate();
|
||||||
|
|
@ -4226,7 +4222,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
isPremiumBlocked = !UserConfig.getInstance(currentAccount).isPremium() && DialogObject.isPremiumBlocked(r);
|
isPremiumBlocked = !UserConfig.getInstance(currentAccount).isPremium() && DialogObject.isPremiumBlocked(r);
|
||||||
starsPriceBlocked = DialogObject.getMessagesStarsPrice(r);
|
starsPriceBlocked = DialogObject.getMessagesStarsPrice(r);
|
||||||
avatarDrawable.setInfo(currentAccount, user);
|
avatarDrawable.setInfo(currentAccount, user);
|
||||||
headerView.backupImageView.getImageReceiver().setForUserOrChat(user, avatarDrawable);
|
|
||||||
setTitle(true, dialogId, false);
|
setTitle(true, dialogId, false);
|
||||||
} else {
|
} else {
|
||||||
isSelf = false;
|
isSelf = false;
|
||||||
|
|
@ -4243,7 +4238,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
isPremiumBlocked = isGroup && !ChatObject.canSendPlain(chat);
|
isPremiumBlocked = isGroup && !ChatObject.canSendPlain(chat);
|
||||||
starsPriceBlocked = MessagesController.getInstance(currentAccount).getSendPaidMessagesStars(dialogId);
|
starsPriceBlocked = MessagesController.getInstance(currentAccount).getSendPaidMessagesStars(dialogId);
|
||||||
avatarDrawable.setInfo(currentAccount, chat);
|
avatarDrawable.setInfo(currentAccount, chat);
|
||||||
headerView.backupImageView.getImageReceiver().setForUserOrChat(chat, avatarDrawable);
|
|
||||||
setTitle(true, dialogId, false);
|
setTitle(true, dialogId, false);
|
||||||
}
|
}
|
||||||
if (isActive && (isSelf || isChannel)) {
|
if (isActive && (isSelf || isChannel)) {
|
||||||
|
|
@ -5166,7 +5160,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
if (headerView.radialProgress != null) {
|
if (headerView.radialProgress != null) {
|
||||||
headerView.radialProgress.setProgress(currentStory.uploadingStory.progress, false);
|
headerView.radialProgress.setProgress(currentStory.uploadingStory.progress, false);
|
||||||
}
|
}
|
||||||
headerView.backupImageView.invalidate();
|
|
||||||
} else if (!animateSubtitle) {
|
} else if (!animateSubtitle) {
|
||||||
headerView.progressToUploading = 0;
|
headerView.progressToUploading = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -6303,7 +6296,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
updatePreloadImages();
|
updatePreloadImages();
|
||||||
muteIconView.setAnimation(sharedResources.muteDrawable);
|
muteIconView.setAnimation(sharedResources.muteDrawable);
|
||||||
isActive = true;
|
isActive = true;
|
||||||
headerView.backupImageView.getImageReceiver().setVisible(true, true);
|
|
||||||
if (currentStory.storyItem != null) {
|
if (currentStory.storyItem != null) {
|
||||||
FileLog.d("StoryViewer displayed story dialogId=" + dialogId + " storyId=" + currentStory.storyItem.id + " " + currentStory.getMediaDebugString());
|
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() {
|
public void reset() {
|
||||||
headerView.backupImageView.getImageReceiver().setVisible(true, true);
|
|
||||||
if (changeBoundAnimator != null) {
|
if (changeBoundAnimator != null) {
|
||||||
chatActivityEnterView.reset();
|
chatActivityEnterView.reset();
|
||||||
chatActivityEnterView.setAlpha(1f - outT);
|
chatActivityEnterView.setAlpha(1f - outT);
|
||||||
|
|
@ -6615,7 +6606,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
|
|
||||||
public static class PeerHeaderView extends FrameLayout {
|
public static class PeerHeaderView extends FrameLayout {
|
||||||
|
|
||||||
public BackupImageView backupImageView;
|
|
||||||
public SimpleTextView titleView;
|
public SimpleTextView titleView;
|
||||||
private TextView[] subtitleView = new TextView[2];
|
private TextView[] subtitleView = new TextView[2];
|
||||||
RadialProgress radialProgress;
|
RadialProgress radialProgress;
|
||||||
|
|
@ -6629,18 +6619,6 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
public PeerHeaderView(@NonNull Context context, StoryItemHolder holder) {
|
public PeerHeaderView(@NonNull Context context, StoryItemHolder holder) {
|
||||||
super(context);
|
super(context);
|
||||||
this.storyItemHolder = holder;
|
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);
|
setClipChildren(false);
|
||||||
|
|
||||||
titleView = new SimpleTextView(context) {
|
titleView = new SimpleTextView(context) {
|
||||||
|
|
@ -6658,7 +6636,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
// titleView.setSingleLine(true);
|
// titleView.setSingleLine(true);
|
||||||
// titleView.setEllipsize(TextUtils.TruncateAt.END);
|
// titleView.setEllipsize(TextUtils.TruncateAt.END);
|
||||||
NotificationCenter.listenEmojiLoading(titleView);
|
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) {
|
for (int a = 0; a < 2; ++a) {
|
||||||
subtitleView[a] = new TextView(context);
|
subtitleView[a] = new TextView(context);
|
||||||
|
|
@ -6668,7 +6646,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
subtitleView[a].setEllipsize(TextUtils.TruncateAt.MIDDLE);
|
subtitleView[a].setEllipsize(TextUtils.TruncateAt.MIDDLE);
|
||||||
subtitleView[a].setTextColor(Color.WHITE);
|
subtitleView[a].setTextColor(Color.WHITE);
|
||||||
subtitleView[a].setPadding(dp(3), 0, dp(3), dp(1));
|
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);
|
titleView.setTextColor(Color.WHITE);
|
||||||
|
|
@ -6758,11 +6736,10 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (radialProgress == null) {
|
if (radialProgress == null) {
|
||||||
radialProgress = new RadialProgress(backupImageView);
|
radialProgress = new RadialProgress(null);
|
||||||
radialProgress.setBackground(null, true, false);
|
radialProgress.setBackground(null, true, false);
|
||||||
}
|
}
|
||||||
radialProgress.setDiff(0);
|
radialProgress.setDiff(0);
|
||||||
ImageReceiver imageReceiver = backupImageView.getImageReceiver();
|
|
||||||
float offset = AndroidUtilities.dp(3) - AndroidUtilities.dp(6) * (1f - progressToUploading);
|
float offset = AndroidUtilities.dp(3) - AndroidUtilities.dp(6) * (1f - progressToUploading);
|
||||||
radialProgress.setProgressRect(
|
radialProgress.setProgressRect(
|
||||||
(int) (rect.left - offset), (int) (rect.top - offset),
|
(int) (rect.left - offset), (int) (rect.top - offset),
|
||||||
|
|
@ -6774,7 +6751,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||||
}
|
}
|
||||||
if (allowDraw) {
|
if (allowDraw) {
|
||||||
if (progressToOpen != 1f) {
|
if (progressToOpen != 1f) {
|
||||||
Paint paint = StoriesUtilities.getUnreadCirclePaint(imageReceiver, false);
|
Paint paint = StoriesUtilities.getUnreadCirclePaint(rect, false);
|
||||||
paint.setAlpha((int) (255 * progressToUploading));
|
paint.setAlpha((int) (255 * progressToUploading));
|
||||||
radialProgress.setPaint(paint);
|
radialProgress.setPaint(paint);
|
||||||
radialProgress.draw(canvas);
|
radialProgress.draw(canvas);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue