Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"permissions": {
"allow": [
"Bash(rg:*)",
"Bash(grep:*)",
"WebFetch(domain:stackoverflow.com)",
"Bash(../gradlew compileDebugJavaWithJavac:*)",
"Bash(./gradlew compileDebugJavaWithJavac:*)",
"Bash(find:*)"
],
"deny": []
}
}
4 changes: 4 additions & 0 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ dependencies {
implementation "androidx.sharetarget:sharetarget:1.2.0"
implementation 'androidx.interpolator:interpolator:1.0.0'
implementation 'androidx.biometric:biometric:1.1.0'

// Material Design Components for CollapsingToolbarLayout
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'

implementation 'com.google.android.gms:play-services-cast-framework:21.4.0'
implementation "androidx.mediarouter:mediarouter:1.7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4001,6 +4001,7 @@ public void run() {
public static final int key_profile_creatorIcon = colorsCount++;
public static final int key_profile_title = colorsCount++;
public static final int key_profile_actionIcon = colorsCount++;
public static final int key_profile_actionText = colorsCount++;
public static final int key_profile_actionBackground = colorsCount++;
public static final int key_profile_actionPressedBackground = colorsCount++;
public static final int key_profile_verifiedBackground = colorsCount++;
Expand All @@ -4012,6 +4013,13 @@ public void run() {
public static final int key_profile_tabSelectedLine = colorsCount++;
public static final int key_profile_tabSelector = colorsCount++;

// Profile header animation colors
public static final int key_profile_headerAnimationBackground = colorsCount++;
public static final int key_profile_headerAnimationAccent = colorsCount++;
public static final int key_profile_headerAnimationOverlay = colorsCount++;
public static final int key_profile_headerAnimationGradientStart = colorsCount++;
public static final int key_profile_headerAnimationGradientEnd = colorsCount++;

public static final int key_sharedMedia_startStopLoadIcon = colorsCount++;
public static final int key_sharedMedia_linkPlaceholder = colorsCount++;
public static final int key_sharedMedia_linkPlaceholderText = colorsCount++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ public static int[] createDefaultColors() {

defaultColors[key_profile_creatorIcon] = 0xff3a95d5;
defaultColors[key_profile_actionIcon] = 0xff81868a;
defaultColors[key_profile_actionText] = 0xff000000;
defaultColors[key_profile_actionBackground] = 0xffffffff;
defaultColors[key_profile_actionPressedBackground] = 0xfff2f2f2;
defaultColors[key_profile_verifiedBackground] = 0xffb2d6f8;
Expand All @@ -547,6 +548,13 @@ public static int[] createDefaultColors() {
defaultColors[key_profile_tabSelectedLine] = 0xff4fa6e9;
defaultColors[key_profile_tabSelector] = 0x0f000000;

// Profile header animation colors
defaultColors[key_profile_headerAnimationBackground] = 0x80000000; // Semi-transparent black
defaultColors[key_profile_headerAnimationAccent] = 0x60ffffff; // Semi-transparent white
defaultColors[key_profile_headerAnimationOverlay] = 0x20000000; // Light overlay
defaultColors[key_profile_headerAnimationGradientStart] = 0xff3a95d5; // Blue gradient start
defaultColors[key_profile_headerAnimationGradientEnd] = 0xff6ab7ff; // Light blue gradient end

defaultColors[key_player_actionBarSelector] = 0x0f000000;
defaultColors[key_player_actionBarTitle] = 0xff2f3438;
defaultColors[key_player_actionBarSubtitle] = 0xff8a8a8a;
Expand Down Expand Up @@ -1420,6 +1428,7 @@ public static SparseArray<String> createColorKeysMap() {
colorKeysMap.put(key_profile_creatorIcon, "profile_creatorIcon");
colorKeysMap.put(key_profile_title, "profile_title");
colorKeysMap.put(key_profile_actionIcon, "profile_actionIcon");
colorKeysMap.put(key_profile_actionText, "profile_actionText");
colorKeysMap.put(key_profile_actionBackground, "profile_actionBackground");
colorKeysMap.put(key_profile_actionPressedBackground, "profile_actionPressedBackground");
colorKeysMap.put(key_profile_verifiedBackground, "profile_verifiedBackground");
Expand All @@ -1429,6 +1438,12 @@ public static SparseArray<String> createColorKeysMap() {
colorKeysMap.put(key_profile_tabSelectedText, "profile_tabSelectedText");
colorKeysMap.put(key_profile_tabSelectedLine, "profile_tabSelectedLine");
colorKeysMap.put(key_profile_tabSelector, "profile_tabSelector");
// Profile header animation color mappings
colorKeysMap.put(key_profile_headerAnimationBackground, "profile_headerAnimationBackground");
colorKeysMap.put(key_profile_headerAnimationAccent, "profile_headerAnimationAccent");
colorKeysMap.put(key_profile_headerAnimationOverlay, "profile_headerAnimationOverlay");
colorKeysMap.put(key_profile_headerAnimationGradientStart, "profile_headerAnimationGradientStart");
colorKeysMap.put(key_profile_headerAnimationGradientEnd, "profile_headerAnimationGradientEnd");
colorKeysMap.put(key_sharedMedia_startStopLoadIcon, "sharedMedia_startStopLoadIcon");
colorKeysMap.put(key_sharedMedia_linkPlaceholder, "sharedMedia_linkPlaceholder");
colorKeysMap.put(key_sharedMedia_linkPlaceholderText, "sharedMedia_linkPlaceholderText");
Expand Down
44 changes: 22 additions & 22 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11160,7 +11160,7 @@ private void updateInfoTopView(boolean animated) {
onClickListener = (v) -> {
Bundle args = new Bundle();
args.putLong("user_id", chatInviterId);
presentFragment(new ProfileActivity(args));
presentFragment(new ProfileNewActivity(args));
};
}
} else {
Expand Down Expand Up @@ -17391,7 +17391,7 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
if (pressActionBar) {
final INavigationLayout layout = parentLayout;
removeSelfFromStack(false);
layout.presentFragment(ProfileActivity.of(dialog_id));
layout.presentFragment(ProfileNewActivity.of(dialog_id));
} else {
parentLayout.expandPreviewFragment();
}
Expand Down Expand Up @@ -26145,18 +26145,18 @@ private void migrateToNewChat(MessageObject obj) {

INavigationLayout actionBarLayout = parentLayout;

if (index > 0 && !(lastFragment instanceof ChatActivity) && !(lastFragment instanceof ProfileActivity) && currentChat.creator) {
if (index > 0 && !(lastFragment instanceof ChatActivity) && !(lastFragment instanceof ProfileNewActivity) && currentChat.creator) {
for (int a = index, N = actionBarLayout.getFragmentStack().size() - 1; a < N; a++) {
BaseFragment fragment = actionBarLayout.getFragmentStack().get(a);
if (fragment instanceof ChatActivity) {
final Bundle bundle = new Bundle();
bundle.putLong("chat_id", channelId);
actionBarLayout.addFragmentToStack(new ChatActivity(bundle), a);
fragment.removeSelfFromStack();
} else if (fragment instanceof ProfileActivity) {
} else if (fragment instanceof ProfileNewActivity) {
Bundle args = new Bundle();
args.putLong("chat_id", channelId);
actionBarLayout.addFragmentToStack(new ProfileActivity(args), a);
actionBarLayout.addFragmentToStack(new ProfileNewActivity(args), a);
fragment.removeSelfFromStack();
} else if (fragment instanceof ChatEditActivity) {
Bundle args = new Bundle();
Expand Down Expand Up @@ -30876,7 +30876,7 @@ public void dismiss() {
}
args.putInt("report_reaction_message_id", primaryMessage.getId());
args.putLong("report_reaction_from_dialog_id", dialog_id);
ProfileActivity fragment = new ProfileActivity(args);
ProfileNewActivity fragment = new ProfileNewActivity(args);
presentFragment(fragment);
closeMenu();
}).setOnHeightChangedListener((view, newHeight) -> {
Expand Down Expand Up @@ -30965,7 +30965,7 @@ public void dismiss() {
}
args.putInt("report_reaction_message_id", primaryMessage.getId());
args.putLong("report_reaction_from_dialog_id", dialog_id);
ProfileActivity fragment = new ProfileActivity(args);
ProfileNewActivity fragment = new ProfileNewActivity(args);
presentFragment(fragment);
closeMenu();
}).setOnHeightChangedListener((view, newHeight) -> popupLayout.getSwipeBack().setNewForegroundHeight(foregroundIndex[0], AndroidUtilities.dp(44 + 8) + newHeight, true));
Expand Down Expand Up @@ -31031,7 +31031,7 @@ public void onClick(View view) {
} else if (object instanceof TLRPC.Chat) {
args.putLong("chat_id", ((TLRPC.Chat) object).id);
}
ProfileActivity fragment = new ProfileActivity(args);
ProfileNewActivity fragment = new ProfileNewActivity(args);
presentFragment(fragment);
closeMenu();
return;
Expand Down Expand Up @@ -31064,7 +31064,7 @@ public void onClick(View view) {
} else if (object instanceof TLRPC.Chat) {
args.putLong("chat_id", ((TLRPC.Chat) object).id);
}
ProfileActivity fragment = new ProfileActivity(args);
ProfileNewActivity fragment = new ProfileNewActivity(args);
presentFragment(fragment);
});

Expand Down Expand Up @@ -31137,7 +31137,7 @@ protected void openUser(long userId) {
if (userId == getUserConfig().getClientUserId()) {
args.putBoolean("my_profile", true);
}
presentFragment(new ProfileActivity(args));
presentFragment(new ProfileNewActivity(args));
}
};
final FrameLayout messageSeenLayout = new FrameLayout(contentView.getContext());
Expand Down Expand Up @@ -32253,7 +32253,7 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
if (toIndex > 0) {
string = string.substring(0, toIndex) + string.substring(toIndex + 2);
ssb = new SpannableStringBuilder(string);
ProfileActivity.ShowDrawable drawable = new ProfileActivity.ShowDrawable(string.substring(fromIndex, toIndex));
ProfileNewActivity.ShowDrawable drawable = new ProfileNewActivity.ShowDrawable(string.substring(fromIndex, toIndex));
drawable.setTextColor(Color.WHITE);
drawable.setBackgroundColor(0x1e000000);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
Expand Down Expand Up @@ -35337,7 +35337,7 @@ public void openVCard(TLRPC.User user, String phone, String vcard, String first_
args.putString("vcard_phone", phone);
args.putString("vcard_first_name", first_name);
args.putString("vcard_last_name", last_name);
presentFragment(new ProfileActivity(args));
presentFragment(new ProfileNewActivity(args));
return;
}

Expand Down Expand Up @@ -36355,7 +36355,7 @@ public void sendButtonPressed(int index, VideoEditedInfo videoEditedInfo, boolea
CharSequence subtitle = AndroidUtilities.replaceSingleTag(LocaleController.getString(R.string.ApplyAvatarHint), () -> {
Bundle args = new Bundle();
args.putLong("user_id", UserConfig.getInstance(currentAccount).clientUserId);
presentFragment(new ProfileActivity(args));
presentFragment(new ProfileNewActivity(args));
});
BulletinFactory.of(ChatActivity.this).createUsersBulletin(Collections.singletonList(user), title, subtitle, null).show();
}
Expand Down Expand Up @@ -38686,7 +38686,7 @@ private void openProfile(TLRPC.User user, boolean expandPhoto) {
Bundle args = new Bundle();
args.putLong("user_id", user.id);
args.putBoolean("expandPhoto", expandPhoto);
ProfileActivity fragment = new ProfileActivity(args);
ProfileNewActivity fragment = new ProfileNewActivity(args);
fragment.setPlayProfileAnimation(currentUser != null && currentUser.id == user.id ? 1 : 0);
AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), classGuid);
presentFragment(fragment);
Expand All @@ -38702,7 +38702,7 @@ private void openProfile(TLRPC.Chat chat, boolean expandPhoto) {
Bundle args = new Bundle();
args.putLong("chat_id", chat.id);
args.putBoolean("expandPhoto", expandPhoto);
presentFragment(new ProfileActivity(args));
presentFragment(new ProfileNewActivity(args));
}
}

Expand Down Expand Up @@ -39100,7 +39100,7 @@ protected void dispatchDraw(Canvas canvas) {
if (scrimPopupWindow != null) {
scrimPopupWindow.dismiss();
}
presentFragment(ProfileActivity.of(dialogId));
presentFragment(ProfileNewActivity.of(dialogId));
});
popupLayout.addView(userButton, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 52));
}
Expand Down Expand Up @@ -40374,7 +40374,7 @@ public void didPressGiveawayChatButton(ChatMessageCell cell, int pressedPos) {
if (cell.getMessageObject().messageOwner.media instanceof TLRPC.TL_messageMediaGiveawayResults) {
TLRPC.TL_messageMediaGiveawayResults giveaway = (TLRPC.TL_messageMediaGiveawayResults) cell.getMessageObject().messageOwner.media;
long id = giveaway.winners.get(pressedPos);
presentFragment(ProfileActivity.of(id));
presentFragment(ProfileNewActivity.of(id));
}
}

Expand Down Expand Up @@ -40585,14 +40585,14 @@ private void openUserProfile(long uid) {
if (currentEncryptedChat != null && uid == currentUser.id) {
args.putLong("dialog_id", dialog_id);
}
ProfileActivity fragment = new ProfileActivity(args);
ProfileNewActivity fragment = new ProfileNewActivity(args);
fragment.setPlayProfileAnimation(currentUser != null && currentUser.id == uid ? 1 : 0);
presentFragment(fragment);
} else {
Bundle args = new Bundle();
args.putLong("user_id", uid);
args.putBoolean("my_profile", true);
presentFragment(new ProfileActivity(args, null));
presentFragment(new ProfileNewActivity(args, null));
}
}

Expand Down Expand Up @@ -43052,7 +43052,7 @@ public void didLongPressUsername(ChatMessageCell cell, CharacterStyle link, Stri
options.addGap();
if (did != 0) {
options.addProfile(obj, getString(isUser ? R.string.ViewProfile : (isChannel ? R.string.ViewChannelProfile : R.string.ViewGroupProfile)), () -> {
presentFragment(ProfileActivity.of(did));
presentFragment(ProfileNewActivity.of(did));
});
} else {
options.addText(getString(R.string.NoUsernameFound2), 13, dp(200));
Expand Down Expand Up @@ -43272,7 +43272,7 @@ public void didPressPhoneNumber(ChatMessageCell cell, CharacterStyle link, Strin
options.addGap();
options.addProfile(user, getString(R.string.ViewProfile), () -> {
dialog.dismiss();
presentFragment(ProfileActivity.of(user.id));
presentFragment(ProfileNewActivity.of(user.id));
});
}

Expand Down Expand Up @@ -43592,7 +43592,7 @@ public void dismiss() {
}
args.putInt("report_reaction_message_id", messageObject.getId());
args.putLong("report_reaction_from_dialog_id", dialog_id);
ProfileActivity fragment = new ProfileActivity(args);
ProfileNewActivity fragment = new ProfileNewActivity(args);
presentFragment(fragment);
closeMenu();
}), LayoutHelper.createFrame(240, LayoutHelper.WRAP_CONTENT));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ protected void onCancel() {
} else {
args.putLong("chat_id", -peerId);
}
presentFragment(new ProfileActivity(args));
presentFragment(new ProfileNewActivity(args));
} else {
if (bannedRights == null) {
bannedRights = new TLRPC.TL_chatBannedRights();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* This is the source code of Telegram for Android v. 5.x.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2018.
*/

package org.telegram.ui.Components;

import android.content.Context;
import android.graphics.Canvas;
import android.view.View;

/**
* Custom avatar view that integrates with AvatarAnimationHelper to provide
* black circle transformation effect during collapsing header animations.
*/
public class AnimatedAvatarView extends BackupImageView {

private AvatarAnimationHelper animationHelper;

public AnimatedAvatarView(Context context) {
super(context);
}

/**
* Set the animation helper for black circle effect
*/
public void setAnimationHelper(AvatarAnimationHelper helper) {
this.animationHelper = helper;
}

@Override
protected void onDraw(Canvas canvas) {
// First draw the normal avatar image
super.onDraw(canvas);

// Then draw the black circle overlay if animation helper indicates it should
if (animationHelper != null && animationHelper.isInBlackCircleState()) {
animationHelper.drawBlackCircleOverlay(canvas, this);
}
}

/**
* Get the animation helper for external access
*/
public AvatarAnimationHelper getAnimationHelper() {
return animationHelper;
}
}
Loading