diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java index 9648fd6f9..cf37f6649 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java @@ -30,11 +30,9 @@ public class Theme { public static final int ACTION_BAR_COLOR = 0xff415e6b; public static final int ACTION_BAR_PHOTO_VIEWER_COLOR = 0x7f000000; public static final int ACTION_BAR_MEDIA_PICKER_COLOR = 0xff333333; - public static final int ACTION_BAR_CHANNEL_INTRO_COLOR = 0xffffffff; public static final int ACTION_BAR_PLAYER_COLOR = 0xffffffff; public static final int ACTION_BAR_TITLE_COLOR = 0xffffffff; public static final int ACTION_BAR_SUBTITLE_COLOR = 0xffd5e8f7; - public static final int ACTION_BAR_PROFILE_COLOR = 0xff415e6b; public static final int ACTION_BAR_PROFILE_SUBTITLE_COLOR = 0xffd7eafa; public static final int ACTION_BAR_MAIN_AVATAR_COLOR = 0xff5085b1; public static final int ACTION_BAR_ACTION_MODE_TEXT_COLOR = 0xff737373; @@ -68,7 +66,6 @@ public class Theme { public static final int CHAT_ADD_CONTACT_TEXT_COLOR = 0xff4a82b5; public static final int CHAT_REPORT_SPAM_TEXT_COLOR = 0xffcf5957; public static final int CHAT_BOTTOM_OVERLAY_TEXT_COLOR = 0xff7f7f7f; - public static final int CHAT_BOTTOM_CHAT_OVERLAY_TEXT_COLOR = 0xff3a8ccf; public static final int CHAT_GIF_HINT_TEXT_COLOR = 0xffffffff; public static final int CHAT_EMPTY_VIEW_TEXT_COLOR = 0xffffffff; public static final int CHAT_SEARCH_COUNT_TEXT_COLOR = 0xff4e9ad4; @@ -85,13 +82,6 @@ public class Theme { public static final int AUTODOWNLOAD_SHEET_SAVE_TEXT_COLOR = 0xff3a8ccf; - public static final int SHARE_SHEET_COPY_TEXT_COLOR = 0xff3a8ccf; - public static final int SHARE_SHEET_SEND_TEXT_COLOR = 0xff3ec1f9; - public static final int SHARE_SHEET_SEND_DISABLED_TEXT_COLOR = 0xffb3b3b3; - public static final int SHARE_SHEET_EDIT_TEXT_COLOR = 0xff212121; - public static final int SHARE_SHEET_EDIT_PLACEHOLDER_TEXT_COLOR = 0xff979797; - public static final int SHARE_SHEET_BADGE_TEXT_COLOR = 0xffffffff; - public static final int STICKERS_SHEET_TITLE_TEXT_COLOR = 0xff212121; public static final int STICKERS_SHEET_SEND_TEXT_COLOR = 0xff3a8ccf; public static final int STICKERS_SHEET_ADD_TEXT_COLOR = 0xff3a8ccf; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java index a67afb69d..9c18ed16c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java @@ -52,7 +52,7 @@ public class DrawerProfileCell extends FrameLayout { public DrawerProfileCell(Context context) { super(context); - setBackgroundColor(Theme.ACTION_BAR_PROFILE_COLOR); + setBackgroundColor(Theme.ACTION_BAR_COLOR); shadowView = new ImageView(context); shadowView.setVisibility(INVISIBLE); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarDrawable.java index 4290708cb..d0108b957 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarDrawable.java @@ -31,12 +31,11 @@ public class AvatarDrawable extends Drawable { private static Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); private static TextPaint namePaint; private static TextPaint namePaintSmall; - private static int[] arrColors = {0xffe56555, 0xfff28c48, 0xff8e85ee, 0xff76c84d, 0xff5fbed5, 0xff549cdd, 0xff8e85ee, 0xff8cdc99}; - private static int[] arrColorsProfiles = {0xffd86f65, 0xfff69d61, 0xff8c79d2, 0xff67b35d, 0xff56a2bb, Theme.ACTION_BAR_MAIN_AVATAR_COLOR, 0xff8c79d2, 0xfff37fa6}; - private static int[] arrColorsProfilesBack = {Theme.ACTION_BAR_PROFILE_COLOR, Theme.ACTION_BAR_PROFILE_COLOR, Theme.ACTION_BAR_PROFILE_COLOR, Theme.ACTION_BAR_PROFILE_COLOR, Theme.ACTION_BAR_PROFILE_COLOR, Theme.ACTION_BAR_PROFILE_COLOR, Theme.ACTION_BAR_PROFILE_COLOR, Theme.ACTION_BAR_PROFILE_COLOR}; + private static int[] arrColors = {0xffe56555, 0xfff28c48, 0xff8e85ee, 0xff76c84d, 0xff5fbed5, 0xff549cdd, 0xff8e85ee, 0xff8cdc99}; + private static int[] arrColorsProfiles = {0xffd86f65, 0xfff69d61, 0xff8c79d2, 0xff67b35d, 0xff56a2bb, Theme.ACTION_BAR_MAIN_AVATAR_COLOR, 0xff8c79d2, 0xfff37fa6}; private static int[] arrColorsProfilesText = {0xfff9cbc5, 0xfffdddc8, 0xffcdc4ed, 0xffc0edba, 0xffb8e2f0, Theme.ACTION_BAR_PROFILE_SUBTITLE_COLOR, 0xffcdc4ed, 0xffb3d7f7}; - private static int[] arrColorsNames = {0xffca5650, 0xffd87b29, 0xff4e92cc, 0xff50b232, 0xff42b1a8, 0xff4e92cc, 0xff4e92cc, 0xff4e92cc}; - private static int[] arrColorsButtons = {Theme.ACTION_BAR_RED_SELECTOR_COLOR, Theme.ACTION_BAR_ORANGE_SELECTOR_COLOR, Theme.ACTION_BAR_VIOLET_SELECTOR_COLOR, + private static int[] arrColorsNames = {0xffca5650, 0xffd87b29, 0xff4e92cc, 0xff50b232, 0xff42b1a8, 0xff4e92cc, 0xff4e92cc, 0xff4e92cc}; + private static int[] arrColorsButtons = {Theme.ACTION_BAR_RED_SELECTOR_COLOR, Theme.ACTION_BAR_ORANGE_SELECTOR_COLOR, Theme.ACTION_BAR_VIOLET_SELECTOR_COLOR, Theme.ACTION_BAR_GREEN_SELECTOR_COLOR, Theme.ACTION_BAR_CYAN_SELECTOR_COLOR, Theme.ACTION_BAR_BLUE_SELECTOR_COLOR, Theme.ACTION_BAR_VIOLET_SELECTOR_COLOR, Theme.ACTION_BAR_BLUE_SELECTOR_COLOR}; private static Drawable broadcastDrawable; @@ -102,29 +101,6 @@ public class AvatarDrawable extends Drawable { } public static int getColorIndex(int id) { - if (id >= 0 && id < 8) { - return id; - } - /*try { - String str; - if (id >= 0) { - str = String.format(Locale.US, "%d%d", id, UserConfig.getClientUserId()); - } else { - str = String.format(Locale.US, "%d", id); - } - if (str.length() > 15) { - str = str.substring(0, 15); - } - java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5"); - byte[] digest = md.digest(str.getBytes()); - int b = digest[Math.abs(id % 16)]; - if (b < 0) { - b += 256; - } - return Math.abs(b) % arrColors.length; - } catch (Exception e) { - FileLog.e("tmessages", e); - }*/ return Math.abs(id % arrColors.length); } @@ -144,10 +120,6 @@ public class AvatarDrawable extends Drawable { return arrColorsProfilesText[getColorIndex(id)]; } - public static int getProfileBackColorForId(int id) { - return arrColorsProfilesBack[getColorIndex(id)]; - } - public static int getNameColorForId(int id) { return arrColorsNames[getColorIndex(id)]; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index 3f3c771bb..4eef113ac 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -578,7 +578,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. }; layoutManager.setOrientation(LinearLayoutManager.VERTICAL); listView.setLayoutManager(layoutManager); - listView.setGlowColor(AvatarDrawable.getProfileBackColorForId(user_id != 0 || ChatObject.isChannel(chat_id) && !currentChat.megagroup ? 5 : chat_id)); + listView.setGlowColor(Theme.ACTION_BAR_COLOR); frameLayout.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT)); listView.setAdapter(listAdapter); @@ -799,7 +799,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. }); topView = new TopView(context); - topView.setBackgroundColor(AvatarDrawable.getProfileBackColorForId(user_id != 0 || ChatObject.isChannel(chat_id) && !currentChat.megagroup ? 5 : chat_id)); + topView.setBackgroundColor(Theme.ACTION_BAR_COLOR); frameLayout.addView(topView); frameLayout.addView(actionBar); @@ -1545,7 +1545,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. listView.setAlpha(progress); listView.setTranslationX(AndroidUtilities.dp(48) - AndroidUtilities.dp(48) * progress); - int color = AvatarDrawable.getProfileBackColorForId(user_id != 0 || ChatObject.isChannel(chat_id) && !currentChat.megagroup ? 5 : chat_id); + int color = Theme.ACTION_BAR_COLOR; int r = Color.red(Theme.ACTION_BAR_COLOR); int g = Color.green(Theme.ACTION_BAR_COLOR); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java index 726bfb5d8..2cdc17e60 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java @@ -40,6 +40,7 @@ import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.tgnet.ConnectionsManager; import org.telegram.tgnet.TLRPC; +import org.telegram.ui.ActionBar.Theme; import org.telegram.ui.Adapters.BaseFragmentAdapter; import org.telegram.ui.Cells.TextColorCell; import org.telegram.ui.Cells.TextDetailSettingsCell; @@ -116,7 +117,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); - AndroidUtilities.setListViewEdgeEffectColor(listView, AvatarDrawable.getProfileBackColorForId(5)); + AndroidUtilities.setListViewEdgeEffectColor(listView, Theme.ACTION_BAR_COLOR); frameLayout.addView(listView); final FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) listView.getLayoutParams(); layoutParams.width = LayoutHelper.MATCH_PARENT; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index be2e87892..840117b88 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -290,10 +290,6 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter @Override public View createView(Context context) { - /* EDIT BY MR - actionBar.setBackgroundColor(AvatarDrawable.getProfileBackColorForId(5)); - actionBar.setItemsBackgroundColor(AvatarDrawable.getButtonColorForId(5)); - */ actionBar.setBackButtonImage(R.drawable.ic_ab_back); /* EDIT BY MR */ actionBar.setAllowOverlayTitle(true); @@ -380,7 +376,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); - AndroidUtilities.setListViewEdgeEffectColor(listView, AvatarDrawable.getProfileBackColorForId(5)); + AndroidUtilities.setListViewEdgeEffectColor(listView, Theme.ACTION_BAR_COLOR); frameLayout.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT)); listView.setAdapter(listAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @@ -724,7 +720,6 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter /* EDIT BY MR extraHeightView = new View(context); extraHeightView.setPivotY(0); - extraHeightView.setBackgroundColor(AvatarDrawable.getProfileBackColorForId(5)); frameLayout.addView(extraHeightView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 88)); shadowView = new View(context);