From 4834528f6023026e2ac22ebb24a926dbec8d5d75 Mon Sep 17 00:00:00 2001 From: rafalense Date: Fri, 5 Jun 2015 09:53:03 +0200 Subject: [PATCH] Update to 2.9.1.4 (547): - Option to change default emoji window size in chat screen (option in Settings/Messages) - Option to change level of compression when sharing a video (android 4.3 and up) - Added MODs to adjust Settings/Theming screen colors - Added separated MODs for forward name color for right and left bubble in chat screen - Added MOD to change icons colors in Contacts screen - Added MOD to change color of 'Photo/Sticker' text in main screen - Bug fixes --- TMessagesProj/build.gradle | 4 +- .../telegram/android/AndroidUtilities.java | 55 +++++++- .../telegram/ui/Adapters/ContactsAdapter.java | 11 +- .../org/telegram/ui/BlockedUsersActivity.java | 9 ++ .../org/telegram/ui/Cells/ChatBaseCell.java | 57 +++++--- .../org/telegram/ui/Cells/DialogCell.java | 19 ++- .../org/telegram/ui/Cells/HeaderCell.java | 13 ++ .../org/telegram/ui/Cells/SessionCell.java | 25 +++- .../telegram/ui/Cells/ShadowSectionCell.java | 22 ++++ .../org/telegram/ui/Cells/TextCheckCell.java | 17 ++- .../org/telegram/ui/Cells/TextColorCell.java | 17 ++- .../ui/Cells/TextDetailSettingsCell.java | 27 ++++ .../ui/Cells/TextInfoPrivacyCell.java | 16 +++ .../telegram/ui/Cells/TextSettingsCell.java | 36 ++++- .../java/org/telegram/ui/Cells/UserCell.java | 4 + .../java/org/telegram/ui/ChatActivity.java | 29 +++- .../ui/Components/ChatActivityEnterView.java | 26 +++- .../ui/Components/PagerSlidingTabStrip.java | 5 +- .../PhotoViewerCaptionEnterView.java | 12 +- .../org/telegram/ui/Components/Switch.java | 30 ++++- .../telegram/ui/LanguageSelectActivity.java | 4 + .../org/telegram/ui/LastSeenActivity.java | 19 ++- .../telegram/ui/LastSeenUsersActivity.java | 5 + .../java/org/telegram/ui/LaunchActivity.java | 8 +- .../ui/NotificationsSettingsActivity.java | 2 + .../org/telegram/ui/PasscodeActivity.java | 3 + .../telegram/ui/PrivacySettingsActivity.java | 2 + .../java/org/telegram/ui/ProfileActivity.java | 3 +- .../org/telegram/ui/SessionsActivity.java | 30 ++++- .../org/telegram/ui/SettingsActivity.java | 75 ++++++----- .../java/org/telegram/ui/ThemingActivity.java | 41 +++--- .../org/telegram/ui/ThemingChatActivity.java | 41 ++++-- .../org/telegram/ui/ThemingChatsActivity.java | 30 ++++- .../telegram/ui/ThemingContactsActivity.java | 29 +++- .../telegram/ui/ThemingDrawerActivity.java | 10 +- .../telegram/ui/ThemingProfileActivity.java | 6 +- .../ui/TwoStepVerificationActivity.java | 4 + .../org/telegram/ui/VideoEditorActivity.java | 78 ++++++++++- .../src/main/res/drawable-xxhdpi/Thumbs.db | Bin 702464 -> 707072 bytes .../main/res/layout/video_editor_layout.xml | 31 +++++ .../src/main/res/values-ar/strings.xml | 7 +- .../src/main/res/values-ca/strings.xml | 12 +- .../src/main/res/values-de/strings.xml | 124 ++++++++++-------- .../src/main/res/values-es/strings.xml | 18 ++- .../src/main/res/values-fr/strings.xml | 6 +- .../src/main/res/values-it/strings.xml | 24 +++- .../src/main/res/values-ko/strings.xml | 4 +- .../src/main/res/values-nl/strings.xml | 30 ++++- .../src/main/res/values-pl/strings.xml | 76 ++++++++++- .../src/main/res/values-pt-rBR/strings.xml | 25 +++- .../src/main/res/values-pt-rPT/strings.xml | 15 +-- .../src/main/res/values-tr/strings.xml | 18 ++- .../src/main/res/values-zh-rCN/strings.xml | 4 +- .../src/main/res/values-zh-rTW/strings.xml | 75 ++++++----- TMessagesProj/src/main/res/values/strings.xml | 17 ++- 55 files changed, 1018 insertions(+), 292 deletions(-) diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 94c47257..778bc592 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -88,7 +88,7 @@ android { applicationId "org.telegram.plus" minSdkVersion 8 targetSdkVersion 22 - versionCode 543 - versionName "2.9.1.1" + versionCode 546 + versionName "2.9.1.4" } } diff --git a/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java b/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java index f99110f8..4b11ce6a 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java +++ b/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java @@ -108,6 +108,9 @@ public class AndroidUtilities { public static boolean needRestart = false; + static final long delay = 7 * 24 * 60 * 60 * 1000; + static long lastCheck = -1; + static { density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; leftBaseline = isTablet() ? 80 : 72; @@ -784,7 +787,7 @@ public class AndroidUtilities { } } -public static void addMediaToGallery(String fromPath) { + public static void addMediaToGallery(String fromPath) { if (fromPath == null) { return; } @@ -1215,6 +1218,56 @@ public static void addMediaToGallery(String fromPath) { return color; } + public static void checkForThemes(final Activity context) { + //if (!BuildConfig.DEBUG) { + //} + try { + String packageName = "es.rafalense.themes"; + if(BuildConfig.DEBUG)packageName = "es.rafalense.themes.beta"; + Intent intent = context.getPackageManager().getLaunchIntentForPackage(packageName); + if(intent != null){ + return; + } else { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + //long last = preferences.getLong("lastTimeActionDone", 0); + //Log.e("checkForThemes",":lastCheck:"+lastCheck); + //Log.e("checkForThemes", System.currentTimeMillis() - lastCheck + ":"); + if (lastCheck < 0 || ( System.currentTimeMillis() - lastCheck < delay && lastCheck > 0 ) ) { + //lastCheck++; + lastCheck = preferences.getLong("lastTime", 0); + return; + } else { + SharedPreferences.Editor editor = preferences.edit(); + editor.putLong("lastTime", System.currentTimeMillis()); + editor.commit(); + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setTitle(LocaleController.getString("Themes", R.string.Themes)); + builder.setMessage(LocaleController.getString("ThemesAppMsg", R.string.ThemesAppMsg)); + final String pck = packageName; + builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + AndroidUtilities.runOnUIThread(new Runnable() { + @Override + public void run() { + Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + pck)); + if (BuildConfig.DEBUG)in = new Intent(Intent.ACTION_VIEW, Uri.parse("https://rink.hockeyapp.net/apps/b5860b775ca122d3335685f39917e68f")); + context.startActivityForResult(in, 503); + } + }); + } + }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + builder.create().show(); + lastCheck = preferences.getLong("lastTime", 0); + } + } + + } catch (Exception e) { + FileLog.e("tmessages", e); + } + } + /* static void modifyXMLfile(File preffile,String sname){ try { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsAdapter.java index d317bccf..e1cc8b9c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsAdapter.java @@ -191,6 +191,7 @@ public class ContactsAdapter extends BaseSectionsAdapter { SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); int cColorGrey = themePrefs.getInt("contactsNameColor", 0xff737373); int cColorBlack = themePrefs.getInt("contactsNameColor", 0xff000000); + int iconsColor = themePrefs.getInt("contactsIconsColor", 0xff737373); if (type == 4) { if (convertView == null) { convertView = new DividerCell(mContext); @@ -214,28 +215,28 @@ public class ContactsAdapter extends BaseSectionsAdapter { if (needPhonebook) { //actionCell.setTextAndIcon(LocaleController.getString("InviteFriends", R.string.InviteFriends), R.drawable.menu_invite); Drawable invite = mContext.getResources().getDrawable(R.drawable.menu_invite); - invite.setColorFilter(cColorGrey, PorterDuff.Mode.SRC_IN); + invite.setColorFilter(iconsColor, PorterDuff.Mode.SRC_IN); actionCell.setTextAndIcon(LocaleController.getString("InviteFriends", R.string.InviteFriends), invite); } else if (isAdmin) { //actionCell.setTextAndIcon(LocaleController.getString("InviteToGroupByLink", R.string.InviteToGroupByLink), R.drawable.menu_invite); Drawable invite = mContext.getResources().getDrawable(R.drawable.menu_invite); - invite.setColorFilter(cColorGrey, PorterDuff.Mode.SRC_IN); + invite.setColorFilter(iconsColor, PorterDuff.Mode.SRC_IN); actionCell.setTextAndIcon(LocaleController.getString("InviteToGroupByLink", R.string.InviteToGroupByLink), invite); } else { if (position == 0) { //actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), R.drawable.menu_newgroup); Drawable newGroup = mContext.getResources().getDrawable(R.drawable.menu_newgroup); - newGroup.setColorFilter(cColorGrey, PorterDuff.Mode.SRC_IN); + newGroup.setColorFilter(iconsColor, PorterDuff.Mode.SRC_IN); actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), newGroup); } else if (position == 1) { //actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), R.drawable.menu_secret); Drawable secret = mContext.getResources().getDrawable(R.drawable.menu_secret); - secret.setColorFilter(cColorGrey, PorterDuff.Mode.SRC_IN); + secret.setColorFilter(iconsColor, PorterDuff.Mode.SRC_IN); actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), secret); } else if (position == 2) { //actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), R.drawable.menu_broadcast); Drawable broadcast = mContext.getResources().getDrawable(R.drawable.menu_broadcast); - broadcast.setColorFilter(cColorGrey, PorterDuff.Mode.SRC_IN); + broadcast.setColorFilter(iconsColor, PorterDuff.Mode.SRC_IN); actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), broadcast); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java index ee43557e..25cca520 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java @@ -11,6 +11,7 @@ package org.telegram.ui; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.view.Gravity; @@ -25,9 +26,11 @@ import android.widget.ProgressBar; import android.widget.TextView; import org.telegram.PhoneFormat.PhoneFormat; +import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; import org.telegram.ui.ActionBar.ActionBar; @@ -113,6 +116,8 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe progressView.addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setEmptyView(emptyTextView); listView.setVerticalScrollBarEnabled(false); listView.setDivider(null); @@ -261,10 +266,13 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe @Override public View getView(int i, View view, ViewGroup viewGroup) { int type = getItemViewType(i); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); if (type == 0) { if (view == null) { view = new UserCell(mContext, 1); } + ((UserCell) view).setNameColor(preferences.getInt("prefTitleColor", 0xff212121)); + ((UserCell) view).setStatusColor(preferences.getInt("prefSummaryColor", 0xff8a8a8a)); TLRPC.User user = MessagesController.getInstance().getUser(MessagesController.getInstance().blockedUsers.get(i)); if (user != null) { ((UserCell) view).setData(user, null, user.phone != null && user.phone.length() != 0 ? PhoneFormat.getInstance().format("+" + user.phone) : LocaleController.getString("NumberUnknown", R.string.NumberUnknown), 0); @@ -273,6 +281,7 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe if (view == null) { view = new TextInfoCell(mContext); ((TextInfoCell) view).setText(LocaleController.getString("UnblockText", R.string.UnblockText)); + ((TextInfoCell) view).setTextColor(preferences.getInt("prefSummaryColor", 0xff8a8a8a)); } } return view; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java index 3c686fbe..1f3c65c8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java @@ -799,11 +799,11 @@ public class ChatBaseCell extends BaseCell { int defColor = themePrefs.getInt("themeColor",AndroidUtilities.defColor); if (currentMessageObject.isOut()) { //forwardNamePaint.setColor(0xff4a923c); - forwardNamePaint.setColor(themePrefs.getInt("chatForwardColor", AndroidUtilities.setDarkColor(defColor, 0x15))); + forwardNamePaint.setColor(themePrefs.getInt("chatForwardRColor", AndroidUtilities.setDarkColor(defColor, 0x15))); forwardNameX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(10); } else { //forwardNamePaint.setColor(0xff006fc8); - forwardNamePaint.setColor(themePrefs.getInt("chatForwardColor", defColor)); + forwardNamePaint.setColor(themePrefs.getInt("chatForwardLColor", defColor)); forwardNameX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(19); } canvas.save(); @@ -813,47 +813,64 @@ public class ChatBaseCell extends BaseCell { } if (currentMessageObject.isReply()) { + int defColor = themePrefs.getInt("themeColor",AndroidUtilities.defColor); + int rColor = themePrefs.getInt("chatForwardRColor", AndroidUtilities.setDarkColor(defColor, 0x15)); + int lColor = themePrefs.getInt("chatForwardLColor", defColor); + int outColor = themePrefs.getInt("chatRTextColor", 0xff000000); + int inColor = themePrefs.getInt("chatLTextColor", 0xff000000); + //int bColor = themePrefs.getInt("chatRBubbleColor", AndroidUtilities.getDefBubbleColor()); + if (currentMessageObject.type == 13) { - replyLinePaint.setColor(0xffffffff); - replyNamePaint.setColor(0xffffffff); - replyTextPaint.setColor(0xffffffff); + //replyLinePaint.setColor(0xffffffff); + //replyNamePaint.setColor(0xffffffff); + //replyTextPaint.setColor(0xffffffff); int backWidth; if (currentMessageObject.isOut()) { + //bColor = themePrefs.getInt("chatLBubbleColor", 0xffffffff);// + replyLinePaint.setColor(rColor); + replyNamePaint.setColor(rColor); + replyTextPaint.setColor(outColor); backWidth = currentBackgroundDrawable.getBounds().left - AndroidUtilities.dp(32); replyStartX = currentBackgroundDrawable.getBounds().left - AndroidUtilities.dp(9) - backWidth; } else { + replyLinePaint.setColor(lColor); + replyNamePaint.setColor(lColor); + replyTextPaint.setColor(inColor); backWidth = getWidth() - currentBackgroundDrawable.getBounds().right - AndroidUtilities.dp(32); replyStartX = currentBackgroundDrawable.getBounds().right + AndroidUtilities.dp(23); } - Drawable back; - if (ApplicationLoader.isCustomTheme()) { - back = ResourceLoader.backgroundBlack; - } else { - back = ResourceLoader.backgroundBlue; - } + //ResourceLoader.mediaBackgroundDrawable.setColorFilter(bColor, PorterDuff.Mode.SRC_IN); + Drawable back = ResourceLoader.mediaBackgroundDrawable; + //if (ApplicationLoader.isCustomTheme()) { + // back = ResourceLoader.backgroundBlack; + //} else { + // back = ResourceLoader.backgroundBlue; + //} replyStartY = layoutHeight - AndroidUtilities.dp(58); back.setBounds(replyStartX - AndroidUtilities.dp(7), replyStartY - AndroidUtilities.dp(6), replyStartX - AndroidUtilities.dp(7) + backWidth, replyStartY + AndroidUtilities.dp(41)); back.draw(canvas); } else { - int color = themePrefs.getInt("chatForwardColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15)); + //int defColor = themePrefs.getInt("themeColor",AndroidUtilities.defColor); + //int rColor = themePrefs.getInt("chatForwardRColor", AndroidUtilities.setDarkColor(defColor, 0x15)); + //int lColor = themePrefs.getInt("chatForwardLColor", defColor); if (currentMessageObject.isOut()) { - replyLinePaint.setColor(color);//0xff8dc97a); - replyNamePaint.setColor(color);//0xff61a349); - int outColor = themePrefs.getInt("chatRTextColor", 0xff000000); + replyLinePaint.setColor(rColor);//0xff8dc97a); + replyNamePaint.setColor(rColor);//0xff61a349); + //int outColor = themePrefs.getInt("chatRTextColor", 0xff000000); if (currentMessageObject.replyMessageObject != null && currentMessageObject.replyMessageObject.type == 0) { replyTextPaint.setColor(outColor);//0xff000000); } else { - replyTextPaint.setColor(color);//0xff70b15c); + replyTextPaint.setColor(rColor);//0xff70b15c); } replyStartX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(11); } else { - replyLinePaint.setColor(color);//0xff6c9fd2); - replyNamePaint.setColor(color);//0xff377aae); - int inColor = themePrefs.getInt("chatLTextColor", 0xff000000); + replyLinePaint.setColor(lColor);//0xff6c9fd2); + replyNamePaint.setColor(lColor);//0xff377aae); + //int inColor = themePrefs.getInt("chatLTextColor", 0xff000000); if (currentMessageObject.replyMessageObject != null && currentMessageObject.replyMessageObject.type == 0) { replyTextPaint.setColor(inColor);//0xff000000); } else { - replyTextPaint.setColor(color);//0xff999999); + replyTextPaint.setColor(lColor);//0xff999999); } if (currentMessageObject.contentType == 1 && media) { replyStartX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(11); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java index 7ab1d173..551581d5 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java @@ -48,6 +48,8 @@ public class DialogCell extends BaseCell { private static TextPaint timePaint; private static TextPaint countPaint; + private static TextPaint mediaPaint; + private static Drawable checkDrawable; private static Drawable halfCheckDrawable; private static Drawable clockDrawable; @@ -166,6 +168,10 @@ public class DialogCell extends BaseCell { messageTypingPaint.setTextSize(AndroidUtilities.dp(16)); messageTypingPaint.setColor(0xff4d83b3); + mediaPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); + mediaPaint.setTextSize(AndroidUtilities.dp(16)); + mediaPaint.setColor(0xff00ff00); + timePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); timePaint.setTextSize(AndroidUtilities.dp(13)); timePaint.setColor(0xff999999); @@ -387,7 +393,9 @@ public class DialogCell extends BaseCell { int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor); //String hexColor = String.format("#%08X", (0xffffffff & defColor)); String hexMsgColor = String.format("#%08X", (0xffffffff & themePrefs.getInt("chatsMessageColor", 0xff808080))); - String hexDarkColor = String.format("#%08X", (0xffffffff & themePrefs.getInt("chatsMemberColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15)))); + int darkColor = themePrefs.getInt("chatsMemberColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15)); + String hexDarkColor = String.format("#%08X", (0xffffffff & darkColor)); + String hexMediaColor = String.format("#%08X", (0xffffffff & themePrefs.getInt("chatsMediaColor", darkColor))); if (message.caption != null) { String mess = message.caption.toString(); if (mess.length() > 150) { @@ -400,7 +408,7 @@ public class DialogCell extends BaseCell { if (message.messageOwner.media != null && !message.isMediaEmpty()) { currentMessagePaint = messagePrintingPaint; //messageString = Emoji.replaceEmoji(AndroidUtilities.replaceTags(String.format("%s: %s", name, message.messageText)), messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20)); - messageString = Emoji.replaceEmoji(AndroidUtilities.replaceTags(String.format("%s: %s", name, message.messageText)), messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20)); + messageString = Emoji.replaceEmoji(AndroidUtilities.replaceTags(String.format("%s: %s", name, message.messageText)), messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20)); } else { if (message.messageOwner.message != null) { String mess = message.messageOwner.message; @@ -419,7 +427,8 @@ public class DialogCell extends BaseCell { } else { messageString = message.messageText; if (message.messageOwner.media != null && !message.isMediaEmpty()) { - currentMessagePaint = messagePrintingPaint; + //currentMessagePaint = messagePrintingPaint; + currentMessagePaint = mediaPaint; } } } @@ -833,10 +842,12 @@ public class DialogCell extends BaseCell { messagePaint.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatsMessageSize", 16))); messagePaint.setColor(themePrefs.getInt("chatsMessageColor", 0xff8f8f8f)); - + messagePrintingPaint.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatsMessageSize", 16))); messagePrintingPaint.setColor(themePrefs.getInt("chatsMessageColor", tColor)); + mediaPaint.setColor(themePrefs.getInt("chatsMediaColor", dColor)); + messageTypingPaint.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatsMessageSize", 16))); messageTypingPaint.setColor(themePrefs.getInt("chatsTypingColor", tColor)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java index 98e7d0f3..5a382b01 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java @@ -9,6 +9,7 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.content.SharedPreferences; import android.util.TypedValue; import android.view.Gravity; import android.widget.FrameLayout; @@ -16,6 +17,7 @@ import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; import org.telegram.ui.Components.LayoutHelper; public class HeaderCell extends FrameLayout { @@ -37,9 +39,20 @@ public class HeaderCell extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(38), MeasureSpec.EXACTLY)); + setTheme(); } public void setText(String text) { textView.setText(text); } + + private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int defColor = preferences.getInt("themeColor", AndroidUtilities.defColor); + int bgColor = preferences.getInt("prefBGColor", 0xffffffff); + int sColor = preferences.getInt("prefSectionColor", defColor); + setBackgroundColor(bgColor); + textView.setTextColor(sColor); + + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SessionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SessionCell.java index 4555b276..e142b8d0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SessionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SessionCell.java @@ -9,6 +9,7 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.content.SharedPreferences; import android.graphics.Canvas; import android.graphics.Paint; import android.text.TextUtils; @@ -20,6 +21,7 @@ import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; import org.telegram.ui.Components.LayoutHelper; @@ -95,18 +97,24 @@ public class SessionCell extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(90) + (needDivider ? 1 : 0), MeasureSpec.EXACTLY)); + setTheme(); } public void setSession(TLRPC.TL_authorization session, boolean divider) { needDivider = divider; nameTextView.setText(String.format(Locale.US, "%s %s", session.app_name, session.app_version)); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int defColor = preferences.getInt("themeColor", AndroidUtilities.defColor); + int summaryColor = preferences.getInt("prefSummaryColor", 0xff999999); if ((session.flags & 1) != 0) { onlineTextView.setText(LocaleController.getString("Online", R.string.Online)); - onlineTextView.setTextColor(0xff2f8cc9); + //onlineTextView.setTextColor(0xff2f8cc9); + onlineTextView.setTextColor(defColor); } else { onlineTextView.setText(LocaleController.stringForMessageListDate(session.date_active)); - onlineTextView.setTextColor(0xff999999); + //onlineTextView.setTextColor(0xff999999); + onlineTextView.setTextColor(summaryColor); } StringBuilder stringBuilder = new StringBuilder(); @@ -154,6 +162,19 @@ public class SessionCell extends FrameLayout { detailTextView.setText(stringBuilder); } + private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int bgColor = preferences.getInt("prefBGColor", 0xffffffff); + setBackgroundColor(bgColor); + int divColor = preferences.getInt("prefDividerColor", 0xffd9d9d9); + int titleColor = preferences.getInt("prefTitleColor", 0xff212121); + int summaryColor = preferences.getInt("prefSummaryColor", 0xff999999); + nameTextView.setTextColor(titleColor); + detailTextView.setTextColor(titleColor); + detailExTextView.setTextColor(summaryColor); + paint.setColor(divColor); + } + @Override protected void onDraw(Canvas canvas) { if (needDivider) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ShadowSectionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ShadowSectionCell.java index ad130f9b..6e3f7dc1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ShadowSectionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ShadowSectionCell.java @@ -9,20 +9,42 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.content.SharedPreferences; import android.view.View; import org.telegram.android.AndroidUtilities; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.R; public class ShadowSectionCell extends View { + boolean bTheme; public ShadowSectionCell(Context context) { super(context); setBackgroundResource(R.drawable.greydivider); + bTheme = true; + } + + public ShadowSectionCell(Context context, boolean theme) { + super(context); + setBackgroundResource(R.drawable.greydivider); + bTheme = theme; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(12), MeasureSpec.EXACTLY)); + if(bTheme)setTheme(); } + + private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int shadowColor = preferences.getInt("prefShadowColor", 0xfff0f0f0); + if(shadowColor == 0xfff0f0f0) { + setBackgroundResource(R.drawable.greydivider); + } else { + setBackgroundColor(shadowColor); + } + } + } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckCell.java index a36f01ff..9000f535 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCheckCell.java @@ -9,15 +9,18 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.content.SharedPreferences; import android.graphics.Canvas; import android.graphics.Paint; import android.os.Build; +import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; import org.telegram.ui.Components.FrameLayoutFixed; import org.telegram.ui.Components.LayoutHelper; import org.telegram.ui.Components.Switch; @@ -44,8 +47,9 @@ public class TextCheckCell extends FrameLayoutFixed { textView.setLines(1); textView.setMaxLines(1); textView.setSingleLine(true); + textView.setEllipsize(TextUtils.TruncateAt.END); textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); - addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 17, 0)); + addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 60, 0)); checkBox = new Switch(context); checkBox.setDuplicateParentStateEnabled(false); @@ -58,6 +62,7 @@ public class TextCheckCell extends FrameLayoutFixed { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(48) + (needDivider ? 1 : 0), MeasureSpec.EXACTLY)); + setTheme(); } public void setTextAndCheck(String text, boolean checked, boolean divider) { @@ -81,4 +86,14 @@ public class TextCheckCell extends FrameLayoutFixed { canvas.drawLine(getPaddingLeft(), getHeight() - 1, getWidth() - getPaddingRight(), getHeight() - 1, paint); } } + + private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int bgColor = preferences.getInt("prefBGColor", 0xffffffff); + setBackgroundColor(bgColor); + int divColor = preferences.getInt("prefDividerColor", 0xffd9d9d9); + int titleColor = preferences.getInt("prefTitleColor", 0xff212121); + textView.setTextColor(titleColor); + paint.setColor(divColor); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextColorCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextColorCell.java index f9ad628f..98490ddb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextColorCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextColorCell.java @@ -9,11 +9,13 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.content.SharedPreferences; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.Drawable; +import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; import android.widget.FrameLayout; @@ -21,6 +23,7 @@ import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.R; import org.telegram.ui.Components.LayoutHelper; @@ -50,8 +53,9 @@ public class TextColorCell extends FrameLayout { textView.setLines(1); textView.setMaxLines(1); textView.setSingleLine(true); + textView.setEllipsize(TextUtils.TruncateAt.END); textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); - addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 17, 0)); + addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 45, 0)); colorDrawable = getResources().getDrawable(R.drawable.switch_to_on2); } @@ -59,6 +63,7 @@ public class TextColorCell extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(48) + (needDivider ? 1 : 0), MeasureSpec.EXACTLY)); + setTheme(); } public void setTextAndColor(String text, int color, boolean divider) { @@ -86,4 +91,14 @@ public class TextColorCell extends FrameLayout { colorDrawable.draw(canvas); } } + + private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int bgColor = preferences.getInt("prefBGColor", 0xffffffff); + setBackgroundColor(bgColor); + int divColor = preferences.getInt("prefDividerColor", 0xffd9d9d9); + int titleColor = preferences.getInt("prefTitleColor", 0xff212121); + textView.setTextColor(titleColor); + paint.setColor(divColor); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailSettingsCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailSettingsCell.java index 1d9a9a06..4e0e61e8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailSettingsCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailSettingsCell.java @@ -9,6 +9,7 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.content.SharedPreferences; import android.graphics.Canvas; import android.graphics.Paint; import android.util.TypedValue; @@ -17,6 +18,7 @@ import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; import org.telegram.ui.Components.FrameLayoutFixed; import org.telegram.ui.Components.LayoutHelper; @@ -64,6 +66,7 @@ public class TextDetailSettingsCell extends FrameLayoutFixed { } else { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); } + setTheme(); } public void setMultilineDetail(boolean value) { @@ -88,10 +91,34 @@ public class TextDetailSettingsCell extends FrameLayoutFixed { setWillNotDraw(!divider); } + public void setTitleColor(int color) { + textView.setTextColor(color); + } + + public void setSummaryColor(int color) { + valueTextView.setTextColor(color); + } + + public void setDividerColor(int color) { + paint.setColor(color); + } + @Override protected void onDraw(Canvas canvas) { if (needDivider) { canvas.drawLine(getPaddingLeft(), getHeight() - 1, getWidth() - getPaddingRight(), getHeight() - 1, paint); } } + + private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int bgColor = preferences.getInt("prefBGColor", 0xffffffff); + setBackgroundColor(bgColor); + int divColor = preferences.getInt("prefDividerColor", 0xffd9d9d9); + int titleColor = preferences.getInt("prefTitleColor", 0xff212121); + int summaryColor = preferences.getInt("prefSummaryColor", 0xff8a8a8a); + textView.setTextColor(titleColor); + valueTextView.setTextColor(summaryColor); + paint.setColor(divColor); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextInfoPrivacyCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextInfoPrivacyCell.java index 57991731..9e47edf0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextInfoPrivacyCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextInfoPrivacyCell.java @@ -9,6 +9,7 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.content.SharedPreferences; import android.text.method.LinkMovementMethod; import android.util.TypedValue; import android.view.Gravity; @@ -17,6 +18,8 @@ import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; +import org.telegram.messenger.R; import org.telegram.ui.Components.LayoutHelper; public class TextInfoPrivacyCell extends FrameLayout { @@ -39,6 +42,7 @@ public class TextInfoPrivacyCell extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); + setTheme(); } public void setText(CharSequence text) { @@ -48,4 +52,16 @@ public class TextInfoPrivacyCell extends FrameLayout { public void setTextColor(int color) { textView.setTextColor(color); } + + private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int shadowColor = preferences.getInt("prefShadowColor", 0xfff0f0f0); + if(shadowColor != 0xfff0f0f0) { + setBackgroundColor(shadowColor); + } else { + setBackgroundResource(R.drawable.greydivider); + } + int summaryColor = preferences.getInt("prefSummaryColor", 0xff808080); + textView.setTextColor(summaryColor); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java index a08cce11..77a4493c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java @@ -9,8 +9,10 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.content.SharedPreferences; import android.graphics.Canvas; import android.graphics.Paint; +import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; @@ -20,6 +22,7 @@ import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; import org.telegram.ui.Components.LayoutHelper; public class TextSettingsCell extends FrameLayout { @@ -47,7 +50,7 @@ public class TextSettingsCell extends FrameLayout { textView.setSingleLine(true); textView.setEllipsize(TextUtils.TruncateAt.END); textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); - addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 17, 0)); + addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 45, 0)); valueTextView = new TextView(context); //valueTextView.setTextColor(0xff2f8cc9); @@ -68,6 +71,7 @@ public class TextSettingsCell extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + setTheme(); setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), AndroidUtilities.dp(48) + (needDivider ? 1 : 0)); int availableWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight() - AndroidUtilities.dp(34); @@ -88,6 +92,10 @@ public class TextSettingsCell extends FrameLayout { textView.setTextColor(color); } + public void setDividerColor(int color) { + paint.setColor(color); + } + public void setText(String text, boolean divider) { textView.setText(text); valueTextView.setVisibility(INVISIBLE); @@ -123,10 +131,36 @@ public class TextSettingsCell extends FrameLayout { setWillNotDraw(!divider); } + public void setTextAndIcon(String text, Drawable resDr, boolean divider) { + textView.setText(text); + valueTextView.setVisibility(INVISIBLE); + if (resDr != null) { + valueImageView.setVisibility(VISIBLE); + valueImageView.setImageDrawable(resDr); + } else { + valueImageView.setVisibility(INVISIBLE); + } + needDivider = divider; + setWillNotDraw(!divider); + } + @Override protected void onDraw(Canvas canvas) { if (needDivider) { canvas.drawLine(getPaddingLeft(), getHeight() - 1, getWidth() - getPaddingRight(), getHeight() - 1, paint); } } + + private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int bgColor = preferences.getInt("prefBGColor", 0xffffffff); + setBackgroundColor(bgColor); + int defColor = preferences.getInt("themeColor", AndroidUtilities.defColor); + int divColor = preferences.getInt("prefDividerColor", 0xffd9d9d9); + int titleColor = preferences.getInt("prefTitleColor", 0xff212121); + int sColor = preferences.getInt("prefSectionColor", defColor); + textView.setTextColor(titleColor); + paint.setColor(divColor); + valueTextView.setTextColor(sColor); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java index 61e71e2c..cf015887 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java @@ -208,6 +208,10 @@ public class UserCell extends FrameLayout { nameColor = color; } + public void setStatusColor(int color) { + statusColor = color; + } + public void setImageDrawable(Drawable drawable){ curDrawable = drawable; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 847f3b03..f173559a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -2076,6 +2076,16 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (messageObject == null && messageObjects == null && webPage == null) { return; } + SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor); + int bgColor = themePrefs.getInt("chatEditTextBGColor", 0xffffffff); + int iColor = themePrefs.getInt("chatEditTextIconsColor", bgColor == 0xffffffff ? defColor : 0xffadadad); + int textColor = themePrefs.getInt("chatEditTextColor", 0xff999999); + replyObjectTextView.setTextColor(textColor); + //int rColor = themePrefs.getInt("chatForwardRColor", defColor); + Drawable delete = getParentActivity().getResources().getDrawable(R.drawable.delete_reply); + delete.setColorFilter(iColor, PorterDuff.Mode.SRC_IN); + deleteIconImageView.setImageDrawable(delete); if (messageObject != null) { TLRPC.User user = MessagesController.getInstance().getUser(messageObject.messageOwner.from_id); if (user == null) { @@ -2088,10 +2098,15 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (foundWebPage != null) { return; } - replyIconImageView.setImageResource(R.drawable.reply); + //replyIconImageView.setImageResource(R.drawable.reply); + Drawable reply = getParentActivity().getResources().getDrawable(R.drawable.reply); + reply.setColorFilter(iColor, PorterDuff.Mode.SRC_IN); + replyIconImageView.setImageDrawable(reply); + deleteIconImageView.setVisibility(View.VISIBLE); lineView.setVisibility(View.VISIBLE); replyNameTextView.setText(ContactsController.formatName(user.first_name, user.last_name)); + replyNameTextView.setTextColor(iColor); if (messageObject.messageText != null) { String mess = messageObject.messageText.toString(); if (mess.length() > 150) { @@ -2113,7 +2128,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } chatActivityEnterView.setForceShowSendButton(true, animated); ArrayList uids = new ArrayList<>(); - replyIconImageView.setImageResource(R.drawable.forward_blue); + //replyIconImageView.setImageResource(R.drawable.forward_blue); + Drawable forward = getParentActivity().getResources().getDrawable(R.drawable.forward_blue); + forward.setColorFilter(iColor, PorterDuff.Mode.SRC_IN); + replyIconImageView.setImageDrawable(forward); deleteIconImageView.setVisibility(View.VISIBLE); lineView.setVisibility(View.VISIBLE); uids.add(messageObjects.get(0).messageOwner.from_id); @@ -2154,6 +2172,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } replyNameTextView.setText(userNames); + replyNameTextView.setTextColor(iColor);// if (type == -1 || type == 0) { if (messageObjects.size() == 1 && messageObjects.get(0).messageText != null) { String mess = messageObjects.get(0).messageText.toString(); @@ -2197,7 +2216,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } } else if (webPage != null) { - replyIconImageView.setImageResource(R.drawable.link); + //replyIconImageView.setImageResource(R.drawable.link); + Drawable link = getParentActivity().getResources().getDrawable(R.drawable.link); + link.setColorFilter(iColor, PorterDuff.Mode.SRC_IN); + replyIconImageView.setImageDrawable(link); + replyNameTextView.setTextColor(iColor);// if (webPage instanceof TLRPC.TL_webPagePending) { replyNameTextView.setText(LocaleController.getString("GettingLinkInfo", R.string.GettingLinkInfo)); replyObjectTextView.setText(pendingLinkSearchString); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java index 3ec1858c..e7c1e828 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java @@ -14,6 +14,7 @@ import android.content.SharedPreferences; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.media.AudioManager; +import android.os.Build; import android.os.PowerManager; import android.text.Editable; import android.text.TextWatcher; @@ -1314,25 +1315,38 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat if (emojiPopup != null && emojiPopup.isShowing()) { int newHeight = isWidthGreater ? keyboardHeightLand : keyboardHeight; SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("emoji", Activity.MODE_PRIVATE); - int popupSize = AndroidUtilities.dp((preferences.getInt("emojiPopupSize", 60) - 40) * 10); + int pSize = preferences.getInt("emojiPopupSize", 60); + int popupSize = AndroidUtilities.dp((pSize - 40) * 10); newHeight = popupSize < newHeight ? newHeight : popupSize; - final WindowManager.LayoutParams layoutParams = (WindowManager.LayoutParams) emojiPopup.getContentView().getLayoutParams(); + + try { + View view = emojiPopup.getContentView(); + if(Build.VERSION.SDK_INT > 22) { + if (!(view.getLayoutParams() instanceof WindowManager.LayoutParams)) { + view = (View) view.getParent(); + } + } + WindowManager.LayoutParams layoutParams = (WindowManager.LayoutParams) view.getLayoutParams(); FileLog.e("tmessages", "update emoji height to = " + newHeight); - if (layoutParams.width != AndroidUtilities.displaySize.x || layoutParams.height != newHeight) { + //if (layoutParams.width != AndroidUtilities.displaySize.x || layoutParams.height != newHeight) { + if (layoutParams.width != AndroidUtilities.displaySize.x || layoutParams.height != newHeight || (pSize > 60 && sizeNotifierLayout.getPaddingBottom() != newHeight)) { layoutParams.width = AndroidUtilities.displaySize.x; layoutParams.height = newHeight; WindowManager wm = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE); if (wm != null) { - wm.updateViewLayout(emojiPopup.getContentView(), layoutParams); - if (!keyboardVisible) { + wm.updateViewLayout(emojiPopup.getContentView(), layoutParams); + if (!keyboardVisible) { if (sizeNotifierLayout != null) { sizeNotifierLayout.setPadding(0, 0, 0, layoutParams.height); sizeNotifierLayout.requestLayout(); onWindowSizeChanged(sizeNotifierLayout.getHeight() - sizeNotifierLayout.getPaddingBottom()); - } } + } } } + } catch (Exception e) { + FileLog.e("tmessages", e); + } } boolean oldValue = keyboardVisible; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/PagerSlidingTabStrip.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/PagerSlidingTabStrip.java index 60b4c0cc..5f7beb69 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/PagerSlidingTabStrip.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/PagerSlidingTabStrip.java @@ -123,8 +123,9 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { private void addIconTab(final int position, int resId) { ImageView tab = new ImageView(getContext()); tab.setFocusable(true); - tab.setImageResource(resId); - + paintTabIcons(position); + //tab.setImageResource(resId); + tab.setImageDrawable(getResources().getDrawable(resId)); tab.setScaleType(ImageView.ScaleType.CENTER); tab.setOnClickListener(new OnClickListener() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoViewerCaptionEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoViewerCaptionEnterView.java index 0bf595a7..e8f788ec 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoViewerCaptionEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/PhotoViewerCaptionEnterView.java @@ -12,7 +12,6 @@ import android.app.Activity; import android.content.Context; import android.text.Editable; import android.text.InputFilter; -import android.text.InputType; import android.text.TextWatcher; import android.text.style.ImageSpan; import android.util.TypedValue; @@ -31,6 +30,8 @@ import android.widget.RelativeLayout; import android.widget.TextView; import org.telegram.android.AndroidUtilities; +import org.telegram.android.AnimationCompat.AnimatorSetProxy; +import org.telegram.android.AnimationCompat.ObjectAnimatorProxy; import org.telegram.android.Emoji; import org.telegram.android.LocaleController; import org.telegram.android.NotificationCenter; @@ -38,8 +39,6 @@ import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.FileLog; import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; -import org.telegram.android.AnimationCompat.AnimatorSetProxy; -import org.telegram.android.AnimationCompat.ObjectAnimatorProxy; public class PhotoViewerCaptionEnterView extends FrameLayoutFixed implements NotificationCenter.NotificationCenterDelegate, SizeNotifierRelativeLayoutPhoto.SizeNotifierRelativeLayoutPhotoDelegate { @@ -122,8 +121,11 @@ public class PhotoViewerCaptionEnterView extends FrameLayoutFixed implements Not messageEditText = new EditText(context); messageEditText.setHint(LocaleController.getString("AddCaption", R.string.AddCaption)); - messageEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_DONE); - messageEditText.setInputType(EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); + //messageEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_DONE); + //messageEditText.setInputType(EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); + //Show suggestions + messageEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); + messageEditText.setInputType(messageEditText.getInputType() | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE); messageEditText.setSingleLine(false); messageEditText.setMaxLines(4); messageEditText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/Switch.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/Switch.java index 756aa9c2..4f612147 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/Switch.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/Switch.java @@ -17,6 +17,7 @@ package org.telegram.ui.Components; import android.content.Context; +import android.content.SharedPreferences; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; @@ -33,6 +34,7 @@ import android.widget.CompoundButton; import org.telegram.android.AndroidUtilities; import org.telegram.android.AnimationCompat.ObjectAnimatorProxy; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.R; public class Switch extends CompoundButton { @@ -196,6 +198,21 @@ public class Switch extends CompoundButton { return mSplitTrack; } + /*private void setTheme(){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int defColor = preferences.getInt("themeColor", AndroidUtilities.defColor); + int sColor = preferences.getInt("prefSectionColor", defColor); + int sDarkColor = AndroidUtilities.getIntAlphaColor("prefSectionColor", sColor, 0.5f); + int darkColor = AndroidUtilities.getIntAlphaColor("themeColor", AndroidUtilities.defColor, 0.5f); + int checkColor = sColor == defColor ? darkColor : sDarkColor; + if (mTrackDrawable != null) { + mTrackDrawable.setColorFilter(new PorterDuffColorFilter(isChecked() ? checkColor : 0xffc7c7c7, PorterDuff.Mode.MULTIPLY)); + } + if (mThumbDrawable != null) { + mThumbDrawable.setColorFilter(new PorterDuffColorFilter(isChecked() ? sColor : 0xffededed, PorterDuff.Mode.MULTIPLY)); + } + }*/ + @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final Rect padding = mTempRect; @@ -416,14 +433,21 @@ public class Switch extends CompoundButton { cancelPositionAnimator(); setThumbPosition(checked ? 1 : 0); } - + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int defColor = preferences.getInt("themeColor", AndroidUtilities.defColor); + int sColor = preferences.getInt("prefSectionColor", defColor); + int sDarkColor = AndroidUtilities.getIntAlphaColor("prefSectionColor", sColor, 0.5f); + int darkColor = AndroidUtilities.getIntAlphaColor("themeColor", AndroidUtilities.defColor, 0.5f); + int checkColor = sColor == defColor ? darkColor : sDarkColor; if (mTrackDrawable != null) { //mTrackDrawable.setColorFilter(new PorterDuffColorFilter(checked ? 0xffa0d6fa : 0xffc7c7c7, PorterDuff.Mode.MULTIPLY)); - mTrackDrawable.setColorFilter(new PorterDuffColorFilter(checked ? AndroidUtilities.getIntAlphaColor("themeColor", AndroidUtilities.defColor, 0.5f) : 0xffc7c7c7, PorterDuff.Mode.MULTIPLY)); + //mTrackDrawable.setColorFilter(new PorterDuffColorFilter(checked ? AndroidUtilities.getIntAlphaColor("themeColor", AndroidUtilities.defColor, 0.5f) : 0xffc7c7c7, PorterDuff.Mode.MULTIPLY)); + mTrackDrawable.setColorFilter(new PorterDuffColorFilter(checked ? checkColor : 0xffc7c7c7, PorterDuff.Mode.MULTIPLY)); } if (mThumbDrawable != null) { //mThumbDrawable.setColorFilter(new PorterDuffColorFilter(checked ? 0xff45abef : 0xffededed, PorterDuff.Mode.MULTIPLY)); - mThumbDrawable.setColorFilter(new PorterDuffColorFilter(checked ? AndroidUtilities.getIntColor("themeColor") : 0xffededed, PorterDuff.Mode.MULTIPLY)); + //mThumbDrawable.setColorFilter(new PorterDuffColorFilter(checked ? AndroidUtilities.getIntColor("themeColor") : 0xffededed, PorterDuff.Mode.MULTIPLY)); + mThumbDrawable.setColorFilter(new PorterDuffColorFilter(checked ? sColor : 0xffededed, PorterDuff.Mode.MULTIPLY)); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java index a85bc7a4..bab33f5f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java @@ -11,6 +11,7 @@ package org.telegram.ui; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.SharedPreferences; import android.view.Gravity; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -26,6 +27,7 @@ import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.FileLog; import org.telegram.messenger.R; import org.telegram.messenger.Utilities; @@ -146,6 +148,8 @@ public class LanguageSelectActivity extends BaseFragment { frameLayout.setLayoutParams(layoutParams1); listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setEmptyView(emptyTextLayout); listView.setVerticalScrollBarEnabled(false); listView.setDivider(null); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LastSeenActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LastSeenActivity.java index 1b1f81c0..4d6ef287 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LastSeenActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LastSeenActivity.java @@ -14,6 +14,8 @@ import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.text.Spannable; import android.text.method.LinkMovementMethod; @@ -149,6 +151,8 @@ public class LastSeenActivity extends BaseFragment implements NotificationCenter frameLayout.setBackgroundColor(0xfff0f0f0); ListView listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -439,12 +443,19 @@ public class LastSeenActivity extends BaseFragment implements NotificationCenter view.setBackgroundColor(0xffffffff); } TextSettingsCell textCell = (TextSettingsCell) view; + Drawable check = mContext.getResources().getDrawable(R.drawable.check_blue); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int color = preferences.getInt("themeColor", AndroidUtilities.defColor); + check.setColorFilter(color, PorterDuff.Mode.SRC_IN); if (i == everybodyRow) { - textCell.setTextAndIcon(LocaleController.getString("LastSeenEverybody", R.string.LastSeenEverybody), currentType == 0 ? R.drawable.check_blue : 0, true); + //textCell.setTextAndIcon(LocaleController.getString("LastSeenEverybody", R.string.LastSeenEverybody), currentType == 0 ? R.drawable.check_blue : 0, true); + textCell.setTextAndIcon(LocaleController.getString("LastSeenEverybody", R.string.LastSeenEverybody), currentType == 0 ? check : null, true); } else if (i == myContactsRow) { - textCell.setTextAndIcon(LocaleController.getString("LastSeenContacts", R.string.LastSeenContacts), currentType == 2 ? R.drawable.check_blue : 0, true); + //textCell.setTextAndIcon(LocaleController.getString("LastSeenContacts", R.string.LastSeenContacts), currentType == 2 ? R.drawable.check_blue : 0, true); + textCell.setTextAndIcon(LocaleController.getString("LastSeenContacts", R.string.LastSeenContacts), currentType == 2 ? check : null, true); } else if (i == nobodyRow) { - textCell.setTextAndIcon(LocaleController.getString("LastSeenNobody", R.string.LastSeenNobody), currentType == 1 ? R.drawable.check_blue : 0, false); + //textCell.setTextAndIcon(LocaleController.getString("LastSeenNobody", R.string.LastSeenNobody), currentType == 1 ? R.drawable.check_blue : 0, false); + textCell.setTextAndIcon(LocaleController.getString("LastSeenNobody", R.string.LastSeenNobody), currentType == 1 ? check : null, false); } else if (i == alwaysShareRow) { String value; if (currentPlus.size() != 0) { @@ -465,7 +476,7 @@ public class LastSeenActivity extends BaseFragment implements NotificationCenter } else if (type == 1) { if (view == null) { view = new TextInfoPrivacyCell(mContext); - view.setBackgroundColor(0xffffffff); + //view.setBackgroundColor(0xffffffff); } if (i == lastSeenDetailRow) { ((TextInfoPrivacyCell) view).setText(LocaleController.getString("CustomHelp", R.string.CustomHelp)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LastSeenUsersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LastSeenUsersActivity.java index b476860f..47398b6a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LastSeenUsersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LastSeenUsersActivity.java @@ -11,6 +11,7 @@ package org.telegram.ui; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.view.Gravity; @@ -24,9 +25,11 @@ import android.widget.ListView; import android.widget.TextView; import org.telegram.PhoneFormat.PhoneFormat; +import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; import org.telegram.ui.ActionBar.ActionBar; @@ -139,6 +142,8 @@ public class LastSeenUsersActivity extends BaseFragment implements NotificationC }); listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setEmptyView(emptyTextView); listView.setVerticalScrollBarEnabled(false); listView.setDivider(null); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index 44f76f8b..9638b9db 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -318,9 +318,10 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa drawerLayoutContainer.closeDrawer(false); } else if (position == communityRow) { try { - String link = "https://plus.google.com/communities/106927015963860485525";//https://plus.google.com/101839105638971401281/posts" - if(Locale.getDefault().getLanguage().contains("es")){ - link = "https://plus.google.com/communities/111922519175849600270"; + String link = "https://plus.google.com/u/0/communities/106927015963860485525";//https://plus.google.com/101839105638971401281/posts" + String lg = Locale.getDefault().getLanguage(); + if(lg.contains("es") || lg.contains("gl") || lg.contains("ca")){ + link = "https://plus.google.com/u/0/communities/111922519175849600270"; } startActivityForResult(new Intent(Intent.ACTION_VIEW, Uri.parse(link)), 501); } catch (Exception e) { @@ -1356,6 +1357,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa } AndroidUtilities.checkForCrashes(this); AndroidUtilities.checkForUpdates(this); + AndroidUtilities.checkForThemes(this); ApplicationLoader.mainInterfacePaused = false; ConnectionsManager.getInstance().setAppPaused(false, false); updateCurrentConnectionState(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/NotificationsSettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/NotificationsSettingsActivity.java index d8a26116..97fb7292 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/NotificationsSettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/NotificationsSettingsActivity.java @@ -176,6 +176,8 @@ public class NotificationsSettingsActivity extends BaseFragment implements Notif FrameLayout frameLayout = (FrameLayout) fragmentView; listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PasscodeActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/PasscodeActivity.java index 49333c45..06684f49 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PasscodeActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PasscodeActivity.java @@ -11,6 +11,7 @@ package org.telegram.ui; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.SharedPreferences; import android.content.res.Configuration; import android.graphics.Typeface; import android.os.Build; @@ -298,6 +299,8 @@ public class PasscodeActivity extends BaseFragment implements NotificationCenter actionBar.setTitle(LocaleController.getString("Passcode", R.string.Passcode)); frameLayout.setBackgroundColor(0xfff0f0f0); listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java index 0423236c..db393888 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java @@ -116,6 +116,8 @@ public class PrivacySettingsActivity extends BaseFragment implements Notificatio frameLayout.setBackgroundColor(0xfff0f0f0); ListView listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index 3facecdb..26cfae90 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -1428,7 +1428,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. ((UserCell) view).setAvatarRadius(themePrefs.getInt("profileAvatarRadius", 32)); } else if (type == 5) { if (view == null) { - view = new ShadowSectionCell(mContext); + //view = new ShadowSectionCell(mContext); + view = new ShadowSectionCell(mContext, false); } view.setBackgroundColor(themePrefs.getInt("profileRowColor", 0xffffffff)); } else if (type == 6) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SessionsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SessionsActivity.java index a7185bc3..b4f52cf2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SessionsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SessionsActivity.java @@ -12,6 +12,9 @@ import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.os.Build; import android.util.TypedValue; import android.view.Gravity; @@ -33,6 +36,7 @@ import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.FileLog; import org.telegram.messenger.R; @@ -104,23 +108,33 @@ public class SessionsActivity extends BaseFragment implements NotificationCenter fragmentView = new FrameLayout(context); FrameLayout frameLayout = (FrameLayout) fragmentView; frameLayout.setBackgroundColor(0xfff0f0f0); - + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int bgColor = preferences.getInt("prefBGColor", 0xffffffff); + int summaryColor = preferences.getInt("prefSummaryColor", 0xff8a8a8a); emptyLayout = new LinearLayout(context); + emptyLayout.setOrientation(LinearLayout.VERTICAL); emptyLayout.setGravity(Gravity.CENTER); emptyLayout.setBackgroundResource(R.drawable.greydivider_bottom); emptyLayout.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, AndroidUtilities.displaySize.y - AndroidUtilities.getCurrentActionBarHeight())); - + if(bgColor != 0xffffffff)emptyLayout.setBackgroundColor(bgColor); ImageView imageView = new ImageView(context); imageView.setImageResource(R.drawable.devices); + if(summaryColor != 0xff8a8a8a) { + Drawable devices = getParentActivity().getResources().getDrawable(R.drawable.devices); + devices.setColorFilter(summaryColor, PorterDuff.Mode.SRC_IN); + imageView.setImageDrawable(devices); + } emptyLayout.addView(imageView); LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) imageView.getLayoutParams(); layoutParams2.width = LayoutHelper.WRAP_CONTENT; layoutParams2.height = LayoutHelper.WRAP_CONTENT; imageView.setLayoutParams(layoutParams2); + TextView textView = new TextView(context); - textView.setTextColor(0xff8a8a8a); + //textView.setTextColor(0xff8a8a8a); + textView.setTextColor(summaryColor); textView.setGravity(Gravity.CENTER); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 17); textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); @@ -134,7 +148,8 @@ public class SessionsActivity extends BaseFragment implements NotificationCenter textView.setLayoutParams(layoutParams2); textView = new TextView(context); - textView.setTextColor(0xff8a8a8a); + //textView.setTextColor(0xff8a8a8a); + textView.setTextColor(summaryColor); textView.setGravity(Gravity.CENTER); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 17); textView.setPadding(AndroidUtilities.dp(20), 0, AndroidUtilities.dp(20), 0); @@ -169,6 +184,7 @@ public class SessionsActivity extends BaseFragment implements NotificationCenter progressView.setLayoutParams(layoutParams); ListView listView = new ListView(context); + listView.setBackgroundColor(bgColor); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -402,7 +418,7 @@ public class SessionsActivity extends BaseFragment implements NotificationCenter if (type == 0) { if (view == null) { view = new TextSettingsCell(mContext); - view.setBackgroundColor(0xffffffff); + //view.setBackgroundColor(0xffffffff); } TextSettingsCell textCell = (TextSettingsCell) view; if (i == terminateAllSessionsRow) { @@ -423,7 +439,7 @@ public class SessionsActivity extends BaseFragment implements NotificationCenter } else if (type == 2) { if (view == null) { view = new HeaderCell(mContext); - view.setBackgroundColor(0xffffffff); + //view.setBackgroundColor(0xffffffff); } if (i == currentSessionSectionRow) { ((HeaderCell) view).setText(LocaleController.getString("CurrentSession", R.string.CurrentSession)); @@ -440,7 +456,7 @@ public class SessionsActivity extends BaseFragment implements NotificationCenter } else if (type == 4) { if (view == null) { view = new SessionCell(mContext); - view.setBackgroundColor(0xffffffff); + //view.setBackgroundColor(0xffffffff); } if (i == currentSessionRow) { ((SessionCell) view).setSession(currentSession, !sessions.isEmpty()); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index c761781a..dfa41997 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -22,6 +22,8 @@ import android.content.pm.PackageInfo; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Outline; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -361,7 +363,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter onlineTextView = new TextView(context); //onlineTextView.setTextColor(AvatarDrawable.getProfileTextColorForId(5)); - onlineTextView.setTextColor(AndroidUtilities.getIntDarkerColor("themeColor",-0x40)); + onlineTextView.setTextColor(AndroidUtilities.getIntDarkerColor("themeColor", -0x40)); onlineTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); onlineTextView.setLines(1); onlineTextView.setMaxLines(1); @@ -371,6 +373,9 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter actionBar.addView(onlineTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.BOTTOM, LocaleController.isRTL ? 16 : 97, 0, LocaleController.isRTL ? 97 : 16, 30)); listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int bgColor = preferences.getInt("prefBGColor", 0xffffffff); + listView.setBackgroundColor(bgColor); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -454,8 +459,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter if (view instanceof TextCheckCell) { ((TextCheckCell) view).setChecked(!enabled); } - } - else if (i == notificationRow) { + } else if (i == notificationRow) { presentFragment(new NotificationsSettingsActivity()); } else if (i == backgroundRow) { presentFragment(new WallpapersActivity()); @@ -478,7 +482,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } }); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); - showDialog(builder.create()); + showDialog(builder.create()); } else if (i == sendLogsRow) { sendLogs(); } else if (i == clearLogsRow) { @@ -524,7 +528,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } }); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); - showDialog(builder.create()); + showDialog(builder.create()); } else if (i == telegramFaqRow) { try { Intent pickIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(LocaleController.getString("TelegramFaqUrl", R.string.TelegramFaqUrl))); @@ -540,24 +544,24 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("SortBy", R.string.SortBy)); - builder.setItems(new CharSequence[]{ - LocaleController.getString("Default", R.string.Default), - LocaleController.getString("SortFirstName", R.string.SortFirstName), - LocaleController.getString("SortLastName", R.string.SortLastName) - }, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); - SharedPreferences.Editor editor = preferences.edit(); - editor.putInt("sortContactsBy", which); - editor.commit(); - if (listView != null) { - listView.invalidateViews(); + builder.setItems(new CharSequence[]{ + LocaleController.getString("Default", R.string.Default), + LocaleController.getString("SortFirstName", R.string.SortFirstName), + LocaleController.getString("SortLastName", R.string.SortLastName) + }, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt("sortContactsBy", which); + editor.commit(); + if (listView != null) { + listView.invalidateViews(); + } } - } - }); + }); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); - showDialog(builder.create()); + showDialog(builder.create()); } else if (i == wifiDownloadRow || i == mobileDownloadRow || i == roamingDownloadRow) { if (getParentActivity() == null) { return; @@ -611,7 +615,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter if (i == mobileDownloadRow) { editor.putInt("mobileDataDownloadMask", mask); - MediaController.getInstance().mobileDataDownloadMask = mask; + MediaController.getInstance().mobileDataDownloadMask = mask; } else if (i == wifiDownloadRow) { editor.putInt("wifiDownloadMask", mask); MediaController.getInstance().wifiDownloadMask = mask; @@ -626,14 +630,14 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } }); builder.setNegativeButton(LocaleController.getString("OK", R.string.OK), null); - showDialog(builder.create()); + showDialog(builder.create()); } else if (i == usernameRow) { presentFragment(new ChangeUsernameActivity()); } else if (i == numberRow) { presentFragment(new ChangePhoneHelpActivity()); - } else if (i == stickersRow) { - presentFragment(new StickersActivity()); - } else if (i == keepOriginalFilenameRow) { + } else if (i == stickersRow) { + presentFragment(new StickersActivity()); + } else if (i == keepOriginalFilenameRow) { SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); boolean keep = preferences.getBoolean("keepOriginalFilename", false); SharedPreferences.Editor editor = preferences.edit(); @@ -650,8 +654,19 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter frameLayout.addView(actionBar); writeButton = new ImageView(context); - writeButton.setBackgroundResource(R.drawable.floating_user_states); - writeButton.setImageResource(R.drawable.floating_camera); + writeButton.setBackgroundResource(R.drawable.floating_user_states); + if(bgColor != 0xffffffff) { + Drawable profile = context.getResources().getDrawable(R.drawable.floating3_profile); + profile.setColorFilter(bgColor, PorterDuff.Mode.SRC_IN); + writeButton.setBackgroundDrawable(profile); + } + writeButton.setImageResource(R.drawable.floating_camera); + int gColor = preferences.getInt("prefTitleColor", 0xff737373); + if(gColor != 0xff737373){ + Drawable camera = context.getResources().getDrawable(R.drawable.floating_camera); + camera.setColorFilter(gColor, PorterDuff.Mode.SRC_IN); + writeButton.setImageDrawable(camera); + } writeButton.setScaleType(ImageView.ScaleType.CENTER); if (Build.VERSION.SDK_INT >= 21) { StateListAnimator animator = new StateListAnimator(); @@ -1162,7 +1177,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } else if (i == sendLogsRow) { textCell.setText(LocaleController.getString("SendLogs", R.string.SendLogs), true); } else if (i == clearLogsRow) { - textCell.setText("Clear Logs", true); + textCell.setText("Clear Logs", false); } else if (i == askQuestionRow) { textCell.setText(LocaleController.getString("AskAQuestion", R.string.AskAQuestion), true); } else if (i == privacyRow) { @@ -1194,7 +1209,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } else if (i == keepOriginalFilenameRow) { textCell.setTextAndCheck(LocaleController.getString("KeepOriginalFilename", R.string.KeepOriginalFilename), ApplicationLoader.KEEP_ORIGINAL_FILENAME, false); } else if (i == showAndroidEmojiRow) { - textCell.setTextAndCheck(LocaleController.getString("ShowAndroidEmoji", R.string.ShowAndroidEmoji), ApplicationLoader.SHOW_ANDROID_EMOJI, true); + textCell.setTextAndCheck(LocaleController.getString("ShowAndroidEmoji", R.string.ShowAndroidEmoji), ApplicationLoader.SHOW_ANDROID_EMOJI, false); } } else if (type == 4) { if (view == null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java index efa46d7c..0f3dc484 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java @@ -68,6 +68,7 @@ public class ThemingActivity extends BaseFragment { private int contactsRow; private int drawerRow; private int profileRow; + private int settingsRow; private int themesSectionRow; private int themesSection2Row; @@ -94,6 +95,7 @@ public class ThemingActivity extends BaseFragment { contactsRow = rowCount++; drawerRow = rowCount++; profileRow = rowCount++; + settingsRow = rowCount++; themesSectionRow = rowCount++; themesSection2Row = rowCount++; @@ -144,6 +146,8 @@ public class ThemingActivity extends BaseFragment { listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -324,6 +328,8 @@ public class ThemingActivity extends BaseFragment { presentFragment(new ThemingDrawerActivity()); } else if (i == profileRow) { presentFragment(new ThemingProfileActivity()); + } else if (i == settingsRow) { + presentFragment(new ThemingSettingsActivity()); } } }); @@ -423,24 +429,26 @@ public class ThemingActivity extends BaseFragment { AndroidUtilities.themeColor = i; editor.commit(); //Reset Theme Colors + int darkColor = AndroidUtilities.setDarkColor(i, 0x15); editor.putInt("chatsHeaderColor", i); editor.putInt("chatsCountBGColor", i); editor.putInt("chatsChecksColor", i); - editor.putInt("chatsMemberColor", AndroidUtilities.setDarkColor(i, 0x15)); + editor.putInt("chatsMemberColor", darkColor); + editor.putInt("chatsMediaColor", preferences.getInt("chatsMemberColor", darkColor)); editor.putInt("chatsFloatingBGColor", i); editor.putInt("chatHeaderColor", i); editor.putInt("chatRBubbleColor", AndroidUtilities.getDefBubbleColor()); editor.putInt("chatStatusColor", AndroidUtilities.setDarkColor(i, -0x40)); - editor.putInt("chatRTimeColor", AndroidUtilities.setDarkColor(i, 0x15)); + editor.putInt("chatRTimeColor", darkColor); editor.putInt("chatEmojiViewTabColor", AndroidUtilities.setDarkColor(i, -0x15)); editor.putInt("chatChecksColor", i); editor.putInt("chatSendIconColor", i); - editor.putInt("chatMemberColor", AndroidUtilities.setDarkColor(i, 0x15)); - editor.putInt("chatForwardColor", AndroidUtilities.setDarkColor(i, 0x15)); + editor.putInt("chatMemberColor", darkColor); + editor.putInt("chatForwardColor", darkColor); editor.putInt("contactsHeaderColor", i); - editor.putInt("contactsOnlineColor", AndroidUtilities.setDarkColor(i, 0x15)); + editor.putInt("contactsOnlineColor", darkColor); editor.commit(); fixLayout(); @@ -495,7 +503,7 @@ public class ThemingActivity extends BaseFragment { @Override public boolean isEnabled(int i) { - return i == themeColorRow || i == chatsRow || i == chatRow || i == contactsRow || i == drawerRow || i == profileRow || i == resetThemeRow || i == saveThemeRow || i == applyThemeRow; + return i == themeColorRow || i == chatsRow || i == chatRow || i == contactsRow || i == drawerRow || i == profileRow || i == settingsRow || i == resetThemeRow || i == saveThemeRow || i == applyThemeRow; } @Override @@ -529,7 +537,7 @@ public class ThemingActivity extends BaseFragment { else if (type == 1) { if (view == null) { view = new HeaderCell(mContext); - view.setBackgroundColor(0xffffffff); + //view.setBackgroundColor(0xffffffff); } if (i == generalSection2Row) { ((HeaderCell) view).setText(LocaleController.getString("General", R.string.General)); @@ -554,6 +562,8 @@ public class ThemingActivity extends BaseFragment { textCell.setText(LocaleController.getString("NavigationDrawer", R.string.NavigationDrawer), true); } else if (i == profileRow) { textCell.setText(LocaleController.getString("ProfileScreen", R.string.ProfileScreen), true); + } else if (i == settingsRow) { + textCell.setText(LocaleController.getString("SettingsScreen", R.string.SettingsScreen), false); } } else if (type == 3) { @@ -561,15 +571,16 @@ public class ThemingActivity extends BaseFragment { view = new TextDetailSettingsCell(mContext); } TextDetailSettingsCell textCell = (TextDetailSettingsCell) view; - if (i == resetThemeRow) { + //textCell.setBackgroundColor(0xffffffff); + if (i == saveThemeRow) { + textCell.setMultilineDetail(true); + textCell.setTextAndValue(LocaleController.getString("SaveTheme", R.string.SaveTheme), LocaleController.getString("SaveThemeSum", R.string.SaveThemeSum), true); + } else if (i == applyThemeRow) { + textCell.setMultilineDetail(true); + textCell.setTextAndValue(LocaleController.getString("ApplyTheme", R.string.ApplyTheme), LocaleController.getString("ApplyThemeSum", R.string.ApplyThemeSum), true); + } else if (i == resetThemeRow) { textCell.setMultilineDetail(true); textCell.setTextAndValue(LocaleController.getString("ResetThemeSettings", R.string.ResetThemeSettings), LocaleController.getString("ResetThemeSettingsSum", R.string.ResetThemeSettingsSum), false); - } else if (i == saveThemeRow) { - textCell.setMultilineDetail(true); - textCell.setTextAndValue(LocaleController.getString("SaveTheme", R.string.SaveTheme), LocaleController.getString("SaveThemeSum", R.string.SaveThemeSum), false); - } else if (i == applyThemeRow) { - textCell.setMultilineDetail(true); - textCell.setTextAndValue(LocaleController.getString("ApplyTheme", R.string.ApplyTheme), LocaleController.getString("ApplyThemeSum", R.string.ApplyThemeSum), false); } } else if (type == 4){ @@ -578,7 +589,7 @@ public class ThemingActivity extends BaseFragment { } TextColorCell textCell = (TextColorCell) view; if (i == themeColorRow) { - textCell.setTextAndColor(LocaleController.getString("themeColor", R.string.themeColor), AndroidUtilities.getIntColor("themeColor"), true); + textCell.setTextAndColor(LocaleController.getString("themeColor", R.string.themeColor), AndroidUtilities.getIntColor("themeColor"), false); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java index 9312ea2d..fbd2f9b5 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java @@ -83,7 +83,8 @@ public class ThemingChatActivity extends BaseFragment { private int sendColorRow; private int memberColorCheckRow; private int memberColorRow; - private int forwardNameColorRow; + private int forwardRightNameColorRow; + private int forwardLeftNameColorRow; private int avatarRadiusRow; private int bubblesRow; private int avatarSizeRow; @@ -139,7 +140,8 @@ public class ThemingChatActivity extends BaseFragment { memberColorCheckRow = rowCount++; memberColorRow = rowCount++; - forwardNameColorRow = rowCount++; + forwardRightNameColorRow = rowCount++; + forwardLeftNameColorRow = rowCount++; sendColorRow = rowCount++; editTextSizeRow = rowCount++; @@ -186,6 +188,8 @@ public class ThemingChatActivity extends BaseFragment { FrameLayout frameLayout = (FrameLayout) fragmentView; listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -288,7 +292,7 @@ public class ThemingChatActivity extends BaseFragment { },themePrefs.getInt("chatMemberColor", darkColor), CENTER, 0, true); colorDialog.show(); - } else if (i == forwardNameColorRow) { + } else if (i == forwardRightNameColorRow) { if (getParentActivity() == null) { return; } @@ -302,6 +306,20 @@ public class ThemingChatActivity extends BaseFragment { },themePrefs.getInt(key, darkColor), CENTER, 0, true); colorDialog.show(); + } else if (i == forwardLeftNameColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt(key, color); + } + + },themePrefs.getInt(key, defColor), CENTER, 0, true); + colorDialog.show(); } else if (i == muteColorRow) { if (getParentActivity() == null) { return; @@ -997,7 +1015,7 @@ public class ThemingChatActivity extends BaseFragment { return i == headerColorRow || i == muteColorRow || i == headerIconsColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == bubblesRow || i == solidBGColorCheckRow || AndroidUtilities.getBoolPref("chatSolidBGColorCheck") && i == solidBGColorRow || i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow || i == avatarAlignTopRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow || i == textSizeRow || i == timeSizeRow || i == dateColorRow || i == dateSizeRow || i == dateBubbleColorRow || i == rTextColorRow || i == rLinkColorRow || i == lTextColorRow || i == lLinkColorRow || - i == rTimeColorRow|| i == lTimeColorRow || i == checksColorRow || i == memberColorCheckRow || AndroidUtilities.getBoolPref("chatMemberColorCheck") && i == memberColorRow || i == forwardNameColorRow || + i == rTimeColorRow|| i == lTimeColorRow || i == checksColorRow || i == memberColorCheckRow || AndroidUtilities.getBoolPref("chatMemberColorCheck") && i == memberColorRow || i == forwardRightNameColorRow || i == forwardLeftNameColorRow || i == editTextSizeRow || i == editTextColorRow || i == editTextIconsColorRow || i == sendColorRow || i == editTextBGColorRow || i == emojiViewBGColorRow || i == emojiViewTabColorRow; } @@ -1115,9 +1133,12 @@ public class ThemingChatActivity extends BaseFragment { textCell.setTextAndColor(LocaleController.getString("SolidBGColor", R.string.SolidBGColor), themePrefs.getBoolean("chatSolidBGColorCheck", false) ? themePrefs.getInt("chatSolidBGColor", 0xffffffff) : 0x00000000, true); } else if (i == memberColorRow) { textCell.setTextAndColor(LocaleController.getString("MemberColor", R.string.MemberColor), themePrefs.getBoolean("chatMemberColorCheck", false) ? themePrefs.getInt("chatMemberColor", darkColor) : 0x00000000, true); - } else if (i == forwardNameColorRow) { - textCell.setTag("chatForwardColor"); - textCell.setTextAndColor(LocaleController.getString("ForwardNameColor", R.string.ForwardNameColor), themePrefs.getInt("chatForwardColor", darkColor), true); + } else if (i == forwardRightNameColorRow) { + textCell.setTag("chatForwardRColor"); + textCell.setTextAndColor(LocaleController.getString("ForwardRightNameColor", R.string.ForwardRightNameColor), themePrefs.getInt("chatForwardRColor", darkColor), true); + } else if (i == forwardLeftNameColorRow) { + textCell.setTag("chatForwardLColor"); + textCell.setTextAndColor(LocaleController.getString("ForwardLeftNameColor", R.string.ForwardLeftNameColor), themePrefs.getInt("chatForwardLColor", defColor), true); } else if (i == muteColorRow) { textCell.setTag("chatMuteColor"); textCell.setTextAndColor(LocaleController.getString("MuteColor", R.string.MuteColor), themePrefs.getInt("chatMuteColor", 0xffffffff), true); @@ -1140,7 +1161,7 @@ public class ThemingChatActivity extends BaseFragment { } else if (i == nameColorRow) { textCell.setTextAndColor(LocaleController.getString("NameColor", R.string.NameColor), themePrefs.getInt("chatNameColor", 0xffffffff), true); } else if (i == statusColorRow) { - textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x40)), true); + textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x40)), false); } else if (i == rTimeColorRow) { textCell.setTextAndColor(LocaleController.getString("RTimeColor", R.string.RTimeColor), themePrefs.getInt("chatRTimeColor", darkColor), true); } else if (i == lTimeColorRow) { @@ -1163,7 +1184,7 @@ public class ThemingChatActivity extends BaseFragment { } else if (i == emojiViewBGColorRow) { textCell.setTextAndColor(LocaleController.getString("EmojiViewBGColor", R.string.EmojiViewBGColor), themePrefs.getInt("chatEmojiViewBGColor", 0xfff5f6f7), true); } else if (i == emojiViewTabColorRow) { - textCell.setTextAndColor(LocaleController.getString("EmojiViewTabColor", R.string.EmojiViewTabColor), themePrefs.getInt("chatEmojiViewTabColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x15)), true); + textCell.setTextAndColor(LocaleController.getString("EmojiViewTabColor", R.string.EmojiViewTabColor), themePrefs.getInt("chatEmojiViewTabColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x15)), false); } } return view; @@ -1183,7 +1204,7 @@ public class ThemingChatActivity extends BaseFragment { else if ( i == headerColorRow || i == muteColorRow || i == headerIconsColorRow || i == solidBGColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == nameColorRow || i == statusColorRow || i == dateColorRow || i == dateBubbleColorRow || - i == rTextColorRow || i == rLinkColorRow || i == lTextColorRow || i == lLinkColorRow || i == rLinkColorRow || i == rTimeColorRow || i == lTimeColorRow || i == checksColorRow || i == memberColorRow || i == forwardNameColorRow || + i == rTextColorRow || i == rLinkColorRow || i == lTextColorRow || i == lLinkColorRow || i == rLinkColorRow || i == rTimeColorRow || i == lTimeColorRow || i == checksColorRow || i == memberColorRow || i == forwardRightNameColorRow || i == forwardLeftNameColorRow || i == sendColorRow || i == editTextColorRow || i == editTextBGColorRow || i == editTextIconsColorRow || i == emojiViewBGColorRow || i == emojiViewTabColorRow) { return 3; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatsActivity.java index fc3da29e..dc60bcac 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatsActivity.java @@ -84,6 +84,7 @@ public class ThemingChatsActivity extends BaseFragment { private int unknownNameColorRow; private int groupNameColorRow; private int groupNameSizeRow; + private int mediaColorRow; private int rowCount; @@ -119,6 +120,7 @@ public class ThemingChatsActivity extends BaseFragment { messageColorRow = rowCount++; messageSizeRow = rowCount++; memberColorRow = rowCount++; + mediaColorRow = rowCount++; typingColorRow = rowCount++; timeColorRow = rowCount++; timeSizeRow = rowCount++; @@ -165,6 +167,8 @@ public class ThemingChatsActivity extends BaseFragment { FrameLayout frameLayout = (FrameLayout) fragmentView; listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -396,6 +400,21 @@ public class ThemingChatsActivity extends BaseFragment { },themePrefs.getInt( key, darkColor), CENTER, 0, false); + colorDialog.show(); + } else if (i == mediaColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt( "chatsMediaColor", color); + } + + },themePrefs.getInt( "chatsMediaColor", themePrefs.getInt("chatsMemberColor", darkColor)), CENTER, 0, false); + colorDialog.show(); } else if (i == typingColorRow) { if (getParentActivity() == null) { @@ -756,7 +775,7 @@ public class ThemingChatsActivity extends BaseFragment { public boolean isEnabled(int i) { return i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == headerTitleRow || i == rowColorRow || i == dividerColorRow || i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow || - i == nameColorRow || i == groupNameColorRow || i == unknownNameColorRow || i == muteColorRow || i == checksColorRow || i == nameSizeRow || i == groupNameSizeRow || i == messageColorRow || i == memberColorRow || i == typingColorRow || i == messageSizeRow || + i == nameColorRow || i == groupNameColorRow || i == unknownNameColorRow || i == muteColorRow || i == checksColorRow || i == nameSizeRow || i == groupNameSizeRow || i == messageColorRow || i == memberColorRow || i == mediaColorRow || i == typingColorRow || i == messageSizeRow || i == timeColorRow || i == timeSizeRow || i == countColorRow || i == countSizeRow || i == countBGColorRow || i == floatingPencilColorRow || i == floatingBGColorRow; } @@ -854,7 +873,7 @@ public class ThemingChatsActivity extends BaseFragment { textCell.setTextAndColor(LocaleController.getString("HeaderTitleColor", R.string.HeaderTitleColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true); } else if (i == headerIconsColorRow) { textCell.setTag("chatsHeaderIconsColor"); - textCell.setTextAndColor(LocaleController.getString("HeaderIconsColor", R.string.HeaderIconsColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true); + textCell.setTextAndColor(LocaleController.getString("HeaderIconsColor", R.string.HeaderIconsColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), false); } else if (i == rowColorRow) { textCell.setTag("chatsRowColor"); textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt("chatsRowColor", 0xffffffff), true); @@ -882,6 +901,9 @@ public class ThemingChatsActivity extends BaseFragment { } else if (i == memberColorRow) { textCell.setTag("chatsMemberColor"); textCell.setTextAndColor(LocaleController.getString("MemberColor", R.string.MemberColor), themePrefs.getInt("chatsMemberColor", darkColor), true); + } else if (i == mediaColorRow) { + textCell.setTag("chatsMediaColor"); + textCell.setTextAndColor(LocaleController.getString("MediaColor", R.string.MediaColor), themePrefs.getInt("chatsMediaColor", themePrefs.getInt("chatsMemberColor", darkColor)), true); } else if (i == typingColorRow) { textCell.setTag("chatsTypingColor"); textCell.setTextAndColor(LocaleController.getString("TypingColor", R.string.TypingColor), themePrefs.getInt(textCell.getTag().toString(), defColor), true); @@ -899,7 +921,7 @@ public class ThemingChatsActivity extends BaseFragment { textCell.setTextAndColor(LocaleController.getString("FloatingPencilColor", R.string.FloatingPencilColor), themePrefs.getInt("chatsFloatingPencilColor", 0xffffffff), true); } else if (i == floatingBGColorRow) { textCell.setTag("chatsFloatingBGColor"); - textCell.setTextAndColor(LocaleController.getString("FloatingBGColor", R.string.FloatingBGColor), themePrefs.getInt("chatsFloatingBGColor", defColor), true); + textCell.setTextAndColor(LocaleController.getString("FloatingBGColor", R.string.FloatingBGColor), themePrefs.getInt("chatsFloatingBGColor", defColor), false); } } /*else if (type == 4) { if (view == null) { @@ -956,7 +978,7 @@ public class ThemingChatsActivity extends BaseFragment { } else if ( i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow || i == nameSizeRow || i == groupNameSizeRow || i == messageSizeRow || i == timeSizeRow || i == countSizeRow ) { return 2; } else if ( i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || - i == rowColorRow || i == dividerColorRow || i == nameColorRow || i == groupNameColorRow || i == unknownNameColorRow || i == muteColorRow || i == checksColorRow || i == messageColorRow || i == memberColorRow || i == typingColorRow || i == timeColorRow || i == countColorRow || + i == rowColorRow || i == dividerColorRow || i == nameColorRow || i == groupNameColorRow || i == unknownNameColorRow || i == muteColorRow || i == checksColorRow || i == messageColorRow || i == memberColorRow || i == mediaColorRow || i == typingColorRow || i == timeColorRow || i == countColorRow || i == countBGColorRow || i == floatingPencilColorRow || i == floatingBGColorRow) { return 3; }/* else if (i == usernameTitleRow) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingContactsActivity.java index 9b5ccd66..c774e666 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingContactsActivity.java @@ -58,6 +58,7 @@ public class ThemingContactsActivity extends BaseFragment { private int statusColorRow; private int statusSizeRow; private int onlineColorRow; + private int iconsColorRow; private int rowCount; @@ -77,6 +78,7 @@ public class ThemingContactsActivity extends BaseFragment { rowsSection2Row = rowCount++; rowColorRow = rowCount++; avatarRadiusRow = rowCount++; + iconsColorRow = rowCount++; nameColorRow = rowCount++; nameSizeRow = rowCount++; statusColorRow = rowCount++; @@ -119,6 +121,8 @@ public class ThemingContactsActivity extends BaseFragment { FrameLayout frameLayout = (FrameLayout) fragmentView; listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -178,6 +182,19 @@ public class ThemingContactsActivity extends BaseFragment { } },themePrefs.getInt( "contactsHeaderIconsColor", 0xffffffff), CENTER, 0, false); colorDialog.show(); + } else if (i == iconsColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt( "contactsIconsColor", color); + } + },themePrefs.getInt( "contactsIconsColor", 0xff737373), CENTER, 0, false); + colorDialog.show(); } else if (i == rowColorRow) { if (getParentActivity() == null) { return; @@ -312,6 +329,8 @@ public class ThemingContactsActivity extends BaseFragment { resetInt("contactsHeaderTitleColor"); } else if (i == headerIconsColorRow) { resetInt("contactsHeaderIconsColor"); + } else if (i == iconsColorRow) { + resetInt("contactsIconsColor"); } else if (i == rowColorRow) { resetInt("contactsRowColor"); } else if (i == avatarRadiusRow) { @@ -408,7 +427,7 @@ public class ThemingContactsActivity extends BaseFragment { @Override public boolean isEnabled(int i) { - return i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == rowColorRow || i == avatarRadiusRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow || + return i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == iconsColorRow || i == rowColorRow || i == avatarRadiusRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow || i == onlineColorRow ; } @@ -481,7 +500,9 @@ public class ThemingContactsActivity extends BaseFragment { } else if (i == headerTitleColorRow) { textCell.setTextAndColor(LocaleController.getString("HeaderTitleColor", R.string.HeaderTitleColor), themePrefs.getInt("contactsHeaderTitleColor", 0xffffffff), true); } else if (i == headerIconsColorRow) { - textCell.setTextAndColor(LocaleController.getString("HeaderIconsColor", R.string.HeaderIconsColor), themePrefs.getInt("contactsHeaderIconsColor", 0xffffffff), true); + textCell.setTextAndColor(LocaleController.getString("HeaderIconsColor", R.string.HeaderIconsColor), themePrefs.getInt("contactsHeaderIconsColor", 0xffffffff), false); + } else if (i == iconsColorRow) { + textCell.setTextAndColor(LocaleController.getString("IconsColor", R.string.IconsColor), themePrefs.getInt("contactsIconsColor", 0xff737373), true); } else if (i == rowColorRow) { textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt("contactsRowColor", 0xffffffff), true); } else if (i == nameColorRow) { @@ -489,7 +510,7 @@ public class ThemingContactsActivity extends BaseFragment { } else if (i == statusColorRow) { textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt("contactsStatusColor", 0xffa8a8a8), true); } else if (i == onlineColorRow) { - textCell.setTextAndColor(LocaleController.getString("OnlineColor", R.string.OnlineColor), themePrefs.getInt("contactsOnlineColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)), true); + textCell.setTextAndColor(LocaleController.getString("OnlineColor", R.string.OnlineColor), themePrefs.getInt("contactsOnlineColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)), false); } } return view; @@ -507,7 +528,7 @@ public class ThemingContactsActivity extends BaseFragment { return 2; } - else if ( i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == rowColorRow || i == nameColorRow || i == statusColorRow || i == onlineColorRow) { + else if ( i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == iconsColorRow || i == rowColorRow || i == nameColorRow || i == statusColorRow || i == onlineColorRow) { return 3; } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingDrawerActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingDrawerActivity.java index 42d4104f..185f4a34 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingDrawerActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingDrawerActivity.java @@ -129,6 +129,8 @@ public class ThemingDrawerActivity extends BaseFragment { FrameLayout frameLayout = (FrameLayout) fragmentView; listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -576,15 +578,15 @@ public class ThemingDrawerActivity extends BaseFragment { } else if (i == nameSizeRow) { int size = themePrefs.getInt("drawerNameSize", AndroidUtilities.isTablet() ? 17 : 15); textCell.setTextAndValue(LocaleController.getString("OwnNameSize", R.string.OwnNameSize), String.format("%d", size), true); - } else if (i == phoneSizeRow) { - int size = themePrefs.getInt("drawerPhoneSize", AndroidUtilities.isTablet() ? 15 : 13); - textCell.setTextAndValue(LocaleController.getString("PhoneSize", R.string.PhoneSize), String.format("%d", size), true); } else if (i == optionSizeRow) { int size = themePrefs.getInt("drawerOptionSize", AndroidUtilities.isTablet() ? 17 : 15); textCell.setTextAndValue(LocaleController.getString("OptionSize", R.string.OptionSize), String.format("%d", size), true); + } else if (i == phoneSizeRow) { + int size = themePrefs.getInt("drawerPhoneSize", AndroidUtilities.isTablet() ? 15 : 13); + textCell.setTextAndValue(LocaleController.getString("PhoneSize", R.string.PhoneSize), String.format("%d", size), false); } else if (i == versionSizeRow) { int size = themePrefs.getInt("drawerVersionSize", AndroidUtilities.isTablet() ? 15 : 13); - textCell.setTextAndValue(LocaleController.getString("VersionSize", R.string.VersionSize), String.format("%d", size), true); + textCell.setTextAndValue(LocaleController.getString("VersionSize", R.string.VersionSize), String.format("%d", size), false); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingProfileActivity.java index d95e4e46..f81598c5 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingProfileActivity.java @@ -123,6 +123,8 @@ public class ThemingProfileActivity extends BaseFragment { FrameLayout frameLayout = (FrameLayout) fragmentView; listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -476,7 +478,7 @@ public class ThemingProfileActivity extends BaseFragment { textCell.setTextAndColor(LocaleController.getString("NameColor", R.string.NameColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true); } else if (i == statusColorRow) { textCell.setTag("profileStatusColor"); - textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt(textCell.getTag().toString(), AndroidUtilities.getIntDarkerColor("themeColor",-0x40)), true); + textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt(textCell.getTag().toString(), AndroidUtilities.getIntDarkerColor("themeColor",-0x40)), false); } else if (i == rowColorRow) { textCell.setTag("profileRowColor"); textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true); @@ -485,7 +487,7 @@ public class ThemingProfileActivity extends BaseFragment { textCell.setTextAndColor(LocaleController.getString("NameColor", R.string.NameColor), themePrefs.getInt(textCell.getTag().toString(), 0xff000000), true); } else if (i == summaryColorRow) { textCell.setTag("profileSummaryColor"); - textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt(textCell.getTag().toString(), 0xff8a8a8a), true); + textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt(textCell.getTag().toString(), 0xff8a8a8a), false); } } return view; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationActivity.java index 079bf692..a2e1cc48 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationActivity.java @@ -13,6 +13,7 @@ import android.app.Dialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.SharedPreferences; import android.graphics.Typeface; import android.os.Vibrator; import android.text.InputType; @@ -43,6 +44,7 @@ import android.widget.Toast; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; import org.telegram.android.NotificationCenter; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.FileLog; import org.telegram.messenger.R; @@ -385,6 +387,8 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific progressView.setLayoutParams(layoutParams); listView = new ListView(context); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff)); listView.setDivider(null); listView.setEmptyView(progressView); listView.setDividerHeight(0); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java index 37fa05bf..0cfdc833 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java @@ -28,6 +28,7 @@ import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.FrameLayout; import android.widget.ImageView; +import android.widget.SeekBar; import android.widget.TextView; import com.coremedia.iso.IsoFile; @@ -97,6 +98,10 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur private long esimatedDuration = 0; private long originalSize = 0; + private SeekBar bar; + private int barValue; + private long tBitrate = 0; + public interface VideoEditorActivityDelegate { void didFinishEditVideo(String videoPath, long startTime, long endTime, int resultWidth, int resultHeight, int rotationValue, int originalWidth, int originalHeight, int bitrate, long estimatedSize, long estimatedDuration); } @@ -270,7 +275,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur compressVideo = (CheckBox) fragmentView.findViewById(R.id.compress_video); compressVideo.setText(LocaleController.getString("CompressVideo", R.string.CompressVideo)); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); - compressVideo.setVisibility(originalHeight != resultHeight || originalWidth != resultWidth ? View.VISIBLE : View.GONE); + //compressVideo.setVisibility(originalHeight != resultHeight || originalWidth != resultWidth ? View.VISIBLE : View.GONE); compressVideo.setChecked(preferences.getBoolean("compress_video", true)); compressVideo.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override @@ -398,6 +403,39 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur textureView = (TextureView) fragmentView.findViewById(R.id.video_view); textureView.setSurfaceTextureListener(this); + bar = (SeekBar)fragmentView.findViewById(R.id.seekBar); + final int step = 2; + int max = 20; + final int min = 2; + int progress = preferences.getInt("compress_video_scale", 2); + bar.setMax((max - min) / step); + bar.setProgress(progress); + barValue = min + (progress * step); + bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + //Toast.makeText(getParentActivity(), seekBar.getProgress()+":"+String.valueOf(barValue), Toast.LENGTH_SHORT).show(); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt("compress_video_scale", seekBar.getProgress()); + editor.commit(); + updateVideoEditedInfo(); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + // TODO Auto-generated method stub + } + + @Override + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + barValue = min + (progress * step); + + } + }); + bar.setVisibility(compressVideo.getVisibility()); + updateVideoOriginalInfo(); updateVideoEditedInfo(); @@ -502,7 +540,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur int width; int height; - + calculate(); if (compressVideo.getVisibility() == View.GONE || compressVideo.getVisibility() == View.VISIBLE && !compressVideo.isChecked()) { width = rotationValue == 90 || rotationValue == 270 ? originalHeight : originalWidth; height = rotationValue == 90 || rotationValue == 270 ? originalWidth : originalHeight; @@ -529,6 +567,12 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur int seconds = (int) Math.ceil(esimatedDuration / 1000) - minutes * 60; String videoTimeSize = String.format("%d:%02d, ~%s", minutes, seconds, AndroidUtilities.formatFileSize(estimatedSize)); editedSizeTextView.setText(String.format("%s, %s", videoDimension, videoTimeSize)); + // + if(!compressVideo.isChecked()){ + bar.setEnabled(false); + }else{ + bar.setEnabled(true); + } } private void fixVideoSize() { @@ -737,12 +781,14 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur } videoDuration = (float)mediaHeaderBox.getDuration() / (float)mediaHeaderBox.getTimescale(); trackBitrate = (int)(sampleSizes * 8 / videoDuration); + } catch (Exception e) { FileLog.e("tmessages", e); } TrackHeaderBox headerBox = trackBox.getTrackHeaderBox(); if (headerBox.getWidth() != 0 && headerBox.getHeight() != 0) { trackHeaderBox = headerBox; + tBitrate = trackBitrate; bitrate = (int)(trackBitrate / 100000 * 100000); if (bitrate > 900000) { bitrate = 900000; @@ -766,14 +812,13 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur } resultWidth = originalWidth = (int)trackHeaderBox.getWidth(); resultHeight = originalHeight = (int)trackHeaderBox.getHeight(); - if (resultWidth > 640 || resultHeight > 640) { float scale = resultWidth > resultHeight ? 640.0f / resultWidth : 640.0f / resultHeight; resultWidth *= scale; resultHeight *= scale; if (bitrate != 0) { bitrate *= Math.max(0.5f, scale); - videoFramesSize = (long)(bitrate / 8 * videoDuration); + videoFramesSize = (long) (bitrate / 8 * videoDuration); } } @@ -793,6 +838,31 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur return true; } + private void calculate(){ + videoDuration /= 1000; + + resultWidth = originalWidth; + resultHeight = originalHeight; + + bitrate = (int)(tBitrate / 100000 * 100000); + + bitrate /= barValue; + int x = 2; + if(barValue > 4) { + if (resultWidth > 640 * x || resultHeight > 640 * x) { + if(barValue > 14)x = 1; + float scale = resultWidth > resultHeight ? 640.0f * x / resultWidth : 640.0f * x / resultHeight; + //Log.e("scale", scale + ""); + if (barValue > 6) resultWidth *= scale; + if (barValue > 6) resultHeight *= scale; + bitrate *= Math.max(0.5f, scale); + } + } + if (bitrate != 0)videoFramesSize = (long) (bitrate / 8 * videoDuration); + //Log.e("bitrate",bitrate+""); + videoDuration *= 1000; + } + private int calculateEstimatedSize(float timeDelta) { int size = (int)((audioFramesSize + videoFramesSize) * timeDelta); size += size / (32 * 1024) * 16; diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/Thumbs.db b/TMessagesProj/src/main/res/drawable-xxhdpi/Thumbs.db index 0364236e888dfd102e4ef6f7b744dafe7cc3a320..48a319fe8565da22be42a51b93cfdc6a2ca31ee6 100644 GIT binary patch delta 231 zcmZqppw%!%dqWNjo5I0G98c#q7qPS#u`q5gVqvGe%!0;akreEY`RB12KV*+Ak zAZ7t#*6k&FZ2o^IA9glu|Dw$f#2nkdXmeJqoSq}jq`>%ZVq@{PYn%-y)r}ZT8O#{s z8Il=N87zP}nZc03m>~s7Cj(_tfzXJ-k|A}nB8%kY11u~&IzUTbGay;a7R}1QuvK9D wulZbkVghpofO0?}9;;cHp&ETKFpev9UM6M(WND{I9~_?0Elu&f&c&j delta 150 zcmZpeqTTR8YeNnTTY+qq(4r~LMJ(+_ER5TWSeUM9a=d0>VE7LN(=YNes-G{oHvhl8j5>@EMF@powAtIgXmf1;qRm;ca$?JrZPz#(PENn>!|cKXQUn9j eFZwVWY+Jz9AvT>OjZ0wrK`Tys#_11ym^A_0ZA16~ diff --git a/TMessagesProj/src/main/res/layout/video_editor_layout.xml b/TMessagesProj/src/main/res/layout/video_editor_layout.xml index 331d938f..81b675ea 100644 --- a/TMessagesProj/src/main/res/layout/video_editor_layout.xml +++ b/TMessagesProj/src/main/res/layout/video_editor_layout.xml @@ -98,6 +98,23 @@ android:layout_marginLeft="13dp" android:layout_marginRight="13dp" android:id="@+id/edited_size"/> + + + + + + + diff --git a/TMessagesProj/src/main/res/values-ar/strings.xml b/TMessagesProj/src/main/res/values-ar/strings.xml index 57021d41..4dc257c1 100644 --- a/TMessagesProj/src/main/res/values-ar/strings.xml +++ b/TMessagesProj/src/main/res/values-ar/strings.xml @@ -804,9 +804,10 @@ HH:mm h:mm a %1$s الساعة %2$s - - تيليجرام نسخة الـ Android تم تحديثه. الجديد في نسخة ٢.٩:\n\n- تنصيب ومشاركة الملصقات كهذه: https://telegram.me/addstickers/Animals\n- إذا كنت رسام، قم بصنع حزمة ملصقات عن طريق مراسلة @stickers .\n\n - استخدم تيليجرام مع أندرويد أوتو. - 543 + + 546 تلغرام للاندرويد Theming diff --git a/TMessagesProj/src/main/res/values-ca/strings.xml b/TMessagesProj/src/main/res/values-ca/strings.xml index 7528f6dc..8772e2b6 100644 --- a/TMessagesProj/src/main/res/values-ca/strings.xml +++ b/TMessagesProj/src/main/res/values-ca/strings.xml @@ -660,7 +660,7 @@ Envia registres No hi ha cap registre Icona d\'enviar - Amaga el número de telèfon al menú + Amaga el telèfon al menú Color del botó de llapis Color de fons del botó de llapis Comunitat G+ @@ -694,10 +694,16 @@ S\'ha aplicat el tema! Premeu D\'acord per reiniciar Mostra les icones del sistema - Estil de la bambolla - Conserva el nom de fitxer original + Estil de la bombolla + Conserva el nom original En compte de només números, els fitxers es desaran usant el format nom_data Mida de l\'avatar Alinea l\'avatar a sobre Marge esquerre de l\'avatar + Color del nom del grup + Mida del nom del grup + Color del nom (contacte desconegut) + Amaga l\'ombra de fons personalitzada + Estableix un color de fons + Color de fons diff --git a/TMessagesProj/src/main/res/values-de/strings.xml b/TMessagesProj/src/main/res/values-de/strings.xml index 8f8bf6f2..5e2c45e9 100644 --- a/TMessagesProj/src/main/res/values-de/strings.xml +++ b/TMessagesProj/src/main/res/values-de/strings.xml @@ -805,17 +805,17 @@ h:mm a %1$s um %2$s - Plus Messenger für Android wurde aktualisiert. Neu in Version 2.9:\n\n- Installiere und teile benutzerdefinierte Sticker-Pakete, wie z.B. dieses: https://telegram.me/addstickers/Animals\n- Künstler können eigene Sticker-Pakete über unseren Sticker Bot (@stickers) einstellen.\n\n- Benutze Plus Messenger mit Android Auto (siehe android.com/auto) - 543 - - \n\nNeu in 2.9.1.1:\n\n- Hinzugefügt, einfarbigen Chat Hintergrund einstellen\n- Hinzugefügt, Hintergrund Schatten Hauptmenü ausblenden\n- Hinzugefügt, Profilbild Radius in Profilmenü einstellen + Plus Messenger für Android wurde aktualisiert. Neu in Version 2.9:\n\n- Prüfe, lade herunter und wende das Thema für den Plus Messenger an:\n https://play.google.com/store/apps/details?id=es.rafalense.themes + 546 + + \n\nNeu in 2.9.1.4:\n\n- Option zum Ändern der Standard-Größe für das Emoji-Fenster (Option unter \"Einstellungen/Nachrichten\")\n- Option zum Ändern der Komprimierung beim Senden von Videos\n- Option zum Bearbeiten der Farbe für \"Einstellungen/Thema\"\n- Farben der Namen im Chat für Sprechblasen auf linke und rechte Seite separat ändern\n- Option zum Ändern der Icon-Farben unter \"Kontakte\"\n- Option zum Ändern der Farbe für \"Foto/Sticker\" im Hauptfenster\n- Fehlerbehebungen Plus Messenger für Android - Thema bearbeiten - Ungültiger Hex Code! - Thema Farbe - Thema Einstellungen zurücksetzen - Alle Thema Einstellungen rückgängig machen - Thema Einstellungen auf Standardwerte zurücksetzen! + Themen bearbeiten + Ungültiger Hex-Code! + Themenfarbe + Thema-Einstellungen zurücksetzen + Alle Thema-Einstellungen rückgängig machen + Thema-Einstellungen auf Standardwerte zurücksetzen! Allgemein Ansichten Chatübersicht @@ -826,72 +826,72 @@ Chatliste Chatverlauf Kontaktliste - Kopfzeilen Farbe - Name Farbe - Name Größe - Nachrichtenfarbe - Nachrichtengröße - Uhrzeit/Datum Farbe - Uhrzeit/Datum Größe - Benachrichtigungzähler Farbe - Benachrichtigungszähler Größe + Farbe der Kopfzeile + Farbe der Namen + Größe der Namen + Farbe der Nachrichten + Größe der Nachrichten + Farbe für Uhrzeit/Datum + Größe für Uhrzeit/Datum + Farbe für Benachrichtigungzähler + Größe für Benachrichtigungszähler Zeilenfarbe - Benachrichtigungszähler Hintergrundfarbe + Hintergrundfarbe für Benachrichtigungszähler Statusfarbe Statusgröße - Rechte Sprechblasen Farbe - Linke Sprechblasen Farbe - Datumfarbe - Datumgröße - Datumfarbe Sprechblase - Textfarbe rechte Sprechblase - Textfarbe linke Sprechblase - Uhrzeitfarbe rechte Sprechblase - Uhrzeitfarbe linke Sprechblase - Uhrzeitgröße - Textfarbe Texteingabefeld - Textgröße Texteingabefeld + Farbe der rechten Sprechblasen + Farbe der linken Sprechblasen + Datumsfarbe + Datumsgröße + Datumsfarbe für Sprechblasen + Textfarbe für rechte Sprechblasen + Textfarbe für linke Sprechblasen + Farbe der Uhrzeit für rechte Sprechblasen + Farbe der Uhrzeit für linke Sprechblasen + Größe der Uhrzeit + Textfarbe für Texteingabefeld + Textgröße für Texteingabefeld Hintergrundfarbe Texteingabefeld - Hintergrundfarbe Emoji - Tabfarbe Emoji + Hintergrundfarbe für Emojis + Tabfarbe für Emojis Statusfarbe Online Musik - Speichere Thema - Speichern Sie Ihr Thema im Telegram/Themen Ordner - Thema gespeichert!! + Thema speichern + Thema im Ordner Telegram/Themen speichern + Thema gespeichert! %1$s auf %2$s gespeichert Thema wurde noch nicht erstellt. Verwenden Sie bitte zuerst eine der Modifikationen. Einstellungen von SD-Karte wiederhergestellt - Keine Voreinstellungsdatei in %s gefunden - Keine SD-Karte gefunden. + Keine Datei für Voreinstellungen in %s gefunden + Keine SD-Karte gefunden Name eingeben - Thema bearbeiten + Themen auswählen Thema verwenden - Eine Thema xml aus einem lokalen Ordner verwenden - Gruppenmitglieder Farbe - Häkchenfarbe + Thema-XML aus einem lokalen Ordner verwenden + Farbe der Gruppenmitglieder + Farbe der Häkchen Symbolfarbe Stumm Sende Protokolle - Es gibt keine Protokolle + Keine Protokolle gespeichert Symbolfarbe für Senden - Handy Nummer ausblenden + Telefonnummer ausblenden schwebender Stift Farbe Hintergrundfarbe schwebender Stift G+ Community Textfarbe Eingabefeld Symbolfarbe Texteingabefeld Hauptmenü - Einstellungen Hauptmenü + Hauptmenü Hintergrundfarbe Hauptmenü Benutzernamen Größe Telefonnummer Farbe Telefonnummer Größe - Profilbildfarbe - Symbolfarbe Hauptmenü - Textfarbe Hauptmenü - Textgröße Hauptmenü - Textfarbe aktuelle Version - Textgröße aktuelle Version + Profilbild Farbe + Hauptmenü Symbolfarbe + Hauptmenü Textfarbe + Hauptmenü Textgröße + Versionsanzeige Textfarbe + Versionsanzeige Textgröße Titelfarbe Kopfzeile Symbolfarbe Kopfzeile Trennstrich Farbe @@ -899,15 +899,15 @@ Gruppenmitglieder Farbe Hinweisfarbe weitergeleitete Nachricht Kopfzeilen Titel - Weiterleiten ohne Hinweis + Weiterleiten ohne Zitieren mit Klick Pop-up deaktivieren Gruppe/Kontakt Profil Benutzerdefinerten Hintergrund ausblenden Linkfarbe rechte Sprechblase Linkfarbe linke Sprechblase Thema angewendet! - Klicken Sie auf OK, um die Anwendung neu zu starten. - Google Emoji anzeigen + OK klicken, um die App neu zu starten + Google Emojis verwenden Sprechblasen Form original Dateinamen speichern Statt Zahlen wird Dateiname_Datum gespeichert @@ -918,6 +918,18 @@ Gruppenname Größe Name Farbe (unbekannte Nummer) Hintergrund Schatten ausblenden - Hintergrundfarbe einstellen + Hintergrundfarbe festlegen Hintergrundfarbe + Emoji Popup Größe + Sprechblase rechts Name weiterleiten + Sprechblase links Name weiterleiten + Symbolfarbe + Einstellungen Thema bearbeiten + Hintergrundfarbe + Trennbalken Farbe + Überschrift Farbe + Titelfarbe + Hinweis/Untertitel Farbe + \'Foto/Sticker\' Textfarbe + Möchtest Du Themen von anderen Plus Messenger Mitgliedern sehen? \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-es/strings.xml b/TMessagesProj/src/main/res/values-es/strings.xml index 8ac1c723..811c653b 100644 --- a/TMessagesProj/src/main/res/values-es/strings.xml +++ b/TMessagesProj/src/main/res/values-es/strings.xml @@ -805,10 +805,10 @@ h:mm a %1$s a las %2$s - Plus Messenger para Android fue actualizada. Novedades en la versión 2.9:\n\n- Instala y comparte packs de stickers personalizados como estos:\n https://telegram.me/addstickers/Animals\n https://telegram.me/addstickers/forocoches\n https://telegram.me/addstickers/Unofficial\n https://telegram.me/addstickers/ragefaces\n- Si eres un artista, crea packs de stickers personalizados usando nuestro bot @stickers.\n\n- Usa Plus Messenger con Android Auto. - 543 + Plus Messenger para Android fue actualizada. Novedades en la versión 2.9:\n\n- Ojea, descarga y aplica temas para Plus Messenger:\n https://play.google.com/store/apps/details?id=es.rafalense.themes + 546 - \n\nNovedades en 2.9.1.1:\n\n- Añadido MOD para poner color sólido de fondo en pantalla chat\n- Añadido MOD para quitar sombra en fondo de menú de navegación\n- Añadido MOD para ajustar radio de avatar en pantalla de perfil\n- Solución de errores + \n\nNovedades en 2.9.1.4:\n\n- Opción para cambiar tamaño de la ventana de emoticonos en pantalla chat (opción en Ajustes/Mensajes)\n- Opción para cambiar nivel de compresión al compartir vídeos\n- Añadidos MOD para ajustar colores en pantalla Ajustes/Tematización\n- Añadido MODs distintos para nombre de reenvío en globo derecho e izquierdo en pantalla chat\n- Añadido MOD para ajustar colores de iconos en pantalla Contactos\n- Añadido MOD para cambiar color de texto \'Foto/Sticker\' en pantalla principal\n- Solución de errores Plus Messenger para Android Tematización ¡Color hexadecimal inválido! @@ -920,4 +920,16 @@ Ocultar sombra de fondo personalizado Fijar color de fondo Color de fondo + Tamaño pop-up de emoticonos + Color de nombre de reenvío derecho + Color de nombre de reenvío izquierdo + Color de iconos + Pantalla Ajustes/Tematización + Color de fondo + Color de sombra + Color de sección + Color de título + Color de subtítulo/sumario + Color de texto \'Foto/Sticker\' + ¿Te gustaría ver algunos temas creados por otros usuarios de Plus Messenger? \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-fr/strings.xml b/TMessagesProj/src/main/res/values-fr/strings.xml index 74ea0249..47573d93 100644 --- a/TMessagesProj/src/main/res/values-fr/strings.xml +++ b/TMessagesProj/src/main/res/values-fr/strings.xml @@ -802,9 +802,9 @@ HH:mm h:mm a %1$s à %2$s - - Plus Messenger pour Android vient d\'être mis à jour. Nouveautés de la version 2.9: \n\n- Installez et partagez des paquets de stickers personnalisés comme celui-ci: this one: https://telegram.me/addstickers/Animals\n- Si vous êtes un artiste, créez vos paquets de stickers, en utilisant notre robot @stickers. \n\n- Utilisez Telegram avec Android Auto. - 543 + + 546 Plus Messenger pour Android Thème diff --git a/TMessagesProj/src/main/res/values-it/strings.xml b/TMessagesProj/src/main/res/values-it/strings.xml index 3d6e1c94..dc98b280 100644 --- a/TMessagesProj/src/main/res/values-it/strings.xml +++ b/TMessagesProj/src/main/res/values-it/strings.xml @@ -805,12 +805,10 @@ h:mm a %1$s alle %2$s - Plus Messenger per Android è stato aggiornato. Nuovo nella versione 2.9:\n\n- Installa e condividi pacchetti di sticker personalizzati come questo: https://telegram.me/addstickers/Animals\n- Se sei un artista, crea pacchetti di sticker utilizzando il nostro bot @stickers.\n\n- Usa Telegram con Android Auto. - 543 - - - \n\nNovità nella 2.9.1.1:\n\n- Aggiunta MOD per impostare un colore a tinta unita come sfondo della chat\n- Aggiunta MOD per nascondere l\'ombra dello sfondo del menu di navigazione\n- Aggiunta MOD per impostare il raggio dell\'avatar nella schermata del profilo\n- Correzioni bug - + Plus Messenger per Android è stato aggiornato. Nuovo nella versione 2.9:\n\n- Scegli, scarica ed applica temi per Plus Messenger:\n https://play.google.com/store/apps/details?id=es.rafalense.themes + 546 + + \n\nNovità 2.9.1.4:\n\n- Opzione per cambiare la dimensione predefinita della finestra degli emoji nella schermata della chat (opzione in Impostazioni/Messaggi)\n- Opzione per cambiare il livello di compressione per condividere un video\n- Aggiunte MOD per cambiare i colori della schermata Impostazioni/Temi\n- Aggiunte MOD separate per cambiare il colore del nome del mittente del messaggio inoltrato per la nuvoletta di destra e di sinistra nella schermata della chat\n- Aggiunta MOD per cambiare il colore delle icone nella schermata dei contatti\n- Aggiunta MOD per cambiare il colore del testo \"Photo/Sticker\" nella schermata principale\n- Correzioni bug Plus Messenger per Android Personalizzazione Codice del colore esadecimale non valido! @@ -883,7 +881,7 @@ Colore di \"sta scrivendo\" Colore delle icone del campo di testo Menu di navigazione - Lista delle opzioni + Elenco delle opzioni Colore della lista Dimensione del nome Colore del numero di telefono @@ -922,4 +920,16 @@ Nascondi ombra sfondo personalizzato Imposta il colore dello sfondo Colore dello sfondo + Dimensione popup degli Emoji + Colore del nome a destra (inoltrato) + Colore del nome a sinistra (inoltrato) + Colore delle icone + Impostazioni/Schermata dei temi + Colore di sfondo + Colore dell\'ombreggiatura + Colore della sezione + Colore del titolo + Colore Sommario/Sottotitolo + Colore del testo \"Foto/Sticker\" + Ti piacerebbe dare uno sguardo a temi creati da altri utenti di Plus Messenger? \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-ko/strings.xml b/TMessagesProj/src/main/res/values-ko/strings.xml index 24b00b33..95640446 100644 --- a/TMessagesProj/src/main/res/values-ko/strings.xml +++ b/TMessagesProj/src/main/res/values-ko/strings.xml @@ -805,6 +805,6 @@ a h:mm %1$s %2$s - 텔레그램 안드로이드 버전이 업데이트 되었습니다. 새로운 버전은 2.9 입니다:\n\n - 아래와 같은 커스텀 스티커 설치 및 공유 : https://telegram.me/addstickers/Animals\n - 커스텀 스티커를 신규로 생성하여 등록할 수 있는 @stickers 봇 활용\n\n - Android Auto와 텔레그램 호환 - 543 + 텔레그램 안드로이드 버전이 업데이트 되었습니다. 새로운 버전은 2.9 입니다:\n\n - 아래와 같은 커스텀 스티커 설치 및 공유 : https://play.google.com/store/apps/details?id=es.rafalense.themes\n - 커스텀 스티커를 신규로 생성하여 등록할 수 있는 @stickers 봇 활용\n\n - Android Auto와 텔레그램 호환 + 546 \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-nl/strings.xml b/TMessagesProj/src/main/res/values-nl/strings.xml index 5148d600..c7d49e42 100644 --- a/TMessagesProj/src/main/res/values-nl/strings.xml +++ b/TMessagesProj/src/main/res/values-nl/strings.xml @@ -807,15 +807,16 @@ Gebruikers kunnen met een tik stickers toevoegen via \"Toevoegen aan stickers\". h:mm a %1$s om %2$s - Plus Messenger voor Android is geüpdatet. - 543 - + Plus Messenger voor Android is geüpdatet. Nieuw in versie 2.9:\n\n Bekijk, download en pas thema\'s toe op de Plus Messenger-app:\n https://play.google.com/store/apps/details?id=es.rafalense.themes + 546 + + \n\nNieuw in 2.9.1.4:\n\- Optie om de standaard emoji venstergrootte in het chatscherm te veranderen (optie te vinden in Instellingen -> Berichten)\n- Optie om de compressiegraad te veranderen wanneer je een video verzendt\n- MOD toegevoegd om de kleuren te veranderen in het Instellingen/Thema scherm\n- Aparte MODs toegevoegd voor de kleur van de naam bij het doorsturen van een bericht in het chatscherm. De linker en rechter ballon zijn bij deze optie gescheiden\n- MOD toegevoegd om de icoonkleuren in het contactenscherm te veranderen\n- MOD toegevoegd om de kleur van de \"Photo/Sticker\" tekst in het main scherm\n- Fouten verholpen Plus Messenger voor Android - Thema\'s - Ongeldige kleurhexcode! + Uiterlijk Aanpassen + Ongeldige hexadecimale kleurcode! Themakleur Thema-instellingen herstellen - Alle thema-instellingen ongedaan make + Alle thema-instellingen ongedaan maken Thema-instellingen herstellen naar standaardwaarden! Algemeen Schermen @@ -870,7 +871,7 @@ Gebruikers kunnen met een tik stickers toevoegen via \"Toevoegen aan stickers\". Thema toepassen XML-thema uit lokale map toepassen Lidkleur - Kleur van tikken + Vinkkleur Kleur van gedempt Logbestanden versturen Er zijn geen logbestanden @@ -918,4 +919,19 @@ Gebruikers kunnen met een tik stickers toevoegen via \"Toevoegen aan stickers\". Kleur van groepsnaam Grootte van groepsnaam Naamkleur (onbekend nummer) + Aangepaste achtergrondschaduw verbergen + Achtergrondkleur instellen + Achtergrondkleur + Emoji Popup grootte + Forwarded naamkleur rechterbubbel + Forwarded naamkleur linkerbubbel + Iconen kleur + Instellingen/Thema scherm + Achtergrond Kleur + Schaduw Kleur + Sectie Kleur + Titelkleur + Samenvatting/Ondertitel kleur + \'Foto/Sticker\' tekst kleur + Wilt u thema\'s bekijken van andere Plus Messenger gebruikers? \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-pl/strings.xml b/TMessagesProj/src/main/res/values-pl/strings.xml index 383c9e29..92b1ebcf 100644 --- a/TMessagesProj/src/main/res/values-pl/strings.xml +++ b/TMessagesProj/src/main/res/values-pl/strings.xml @@ -55,6 +55,7 @@ Włącz dźwięki W %1$s Wyłącz + Hashtagi Nowe ogłoszenie Wprowadź nazwę listy @@ -81,6 +82,14 @@ pisze... pisze... piszą... + %1$s nagrywa dźwięk + %1$s wysyła zdjęcie + %1$s wysyła video + %1$s wysyła plik + nagrywanie dźwięku + wysyłanie zdjęcia + Wysyłanie wideo... + Wysyłanie pliku... Masz pytania/sugestie odnoście Telegram? Zrób zdjęcie Galeria @@ -298,6 +307,10 @@ Inny Wyłączone Wyłączone + Wyłączony + Wyłącz + Dźwięki czatu + Kod dostępu Zmień kod dostępu @@ -356,9 +369,15 @@ Ziarno Ostrość Rozmycie + Wyłącz + Liniowy + Promienisty Czy na pewno chcesz usunąć to zdjęcie? Czy na pewno chcesz usunąć to video? Czy chcesz porzucić zmiany? + Czy na pewno chcesz wyczyść historię wyszukiwania? + Czysto + Prywatność i bezpieczeństwo Prywatność @@ -455,7 +474,7 @@ Nieprawidłowe nazwisko Wczytywanie ... Nie masz odtwarzacza wideo, zainstaluj jakiś aby kontynuować - Proszę wyślij email na adres sms@telegram.org i opisz nam swój problem. + Proszę wyślij email na adres sms@stel.com i opisz nam swój problem. Nie posiadasz aplikacji, aby otworzyć ten typ pliku\'%1$s\'. Zainstaluj jedną z nich, aby otworzyć ten plik Ten kontakt nie używa Telegramu, wysłać mu zaproszenie ? Na pewno ? @@ -584,6 +603,61 @@ %1$d użytkowników %1$d użytkowników %1$d użytkowników + + %1$d przekazano wiadomość + Przekazane wiadomość + %1$d przekazano wiadomości + %1$d przekazano wiadomości + %1$d przekazano wiadomości + %1$d przekazano wiadomości + %1$d przekazano pliki + Przekazany plik + %1$d przekazano pliki + %1$d przekazano pliki + %1$d przekazano pliki + %1$d przekazano pliki + %1$d przekazano pliki + Przekazano zdjęcie + %1$d przekazano zdjęcia + %1$d przekazano zdjęcia + %1$d przekazano zdjęcia + %1$d przekazano zdjęcia + %1$d przekazano filmy + Przekazano film + %1$d przekazano filmy + %1$d przekazano filmy + %1$d przekazano filmy + %1$d przekazano filmy + %1$d przekazano dźwięki + Przekazano dźwięk + %1$d przekazano dźwięki + %1$d przekazano dźwięki + %1$d przekazano dźwięki + %1$d przekazano dźwięki + %1$d przekazano lokalizacje + Przekazano lokalizację + %1$d przekazano lokalizacje + %1$d przekazano lokalizacje + %1$d przekazano lokalizacje + %1$d przekazano lokalizacje + %1$d przekazano kontakty + Przekazano kontakt + %1$d przekazano kontakty + %1$d przekazano kontakty + %1$d przekazano kontakty + %1$d przekazano kontakty + %1$d przekazano naklejki + Przekazano naklejkę + %1$d przekazano naklejki + %1$d przekazano naklejki + %1$d przekazano naklejki + %1$d przekazał Ci naklejkę + i %1$d inni + i %1$d inny + i %1$d inni + i %1$d inni + i %1$d inni + i %1$d inni MMMM yyyy MMM dd diff --git a/TMessagesProj/src/main/res/values-pt-rBR/strings.xml b/TMessagesProj/src/main/res/values-pt-rBR/strings.xml index 9411de67..3ea649c5 100644 --- a/TMessagesProj/src/main/res/values-pt-rBR/strings.xml +++ b/TMessagesProj/src/main/res/values-pt-rBR/strings.xml @@ -805,12 +805,10 @@ h:mm a %1$s às %2$s - Plus Messenger para Android acaba de ser atualizado. Novidades da versão 2.9:\n\n- Instale e compartilhe pacotes de stickers customizados como esse: https://telegram.me/addstickers/Animals\n- Se você é um artista, crie stickers customizados usando o @stickers bot.\n\n- Use Telegram com Android Auto. - 543 - - - \n\nNovidades da versão 2.9.1.1:\n\n- Correções de bugs - + Plus Messenger para Android acaba de ser atualizado. Novidades da versão 2.9:\n\n- Confira, baixe e use temas para o app Plus Messenger:\n https://play.google.com/store/apps/details?id=es.rafalense.themes + 546 + + Plus Messenger para Android Personalização Código de cor hexadecimal inválido! @@ -919,4 +917,19 @@ Cor do Nome do Grupo Tamanho do Nome do Grupo Cor do Nome (Número Desconhecido) + Ocultar Sombra do Fundo Personalizado + Definir Cor de Fundo + Cor de Fundo + Tamanho do Pop-up de Emoji + Cor do Nome Direito ao Encaminhar + Cor do Nome Esquerdo ao Encaminhar + Cor dos Ícones + Tela de Configurações/Personalizações + Cor de Fundo + Cor da Sombra + Cor das Sessões + Cor dos Títulos + Cor dos Subtítulos/Descrições + Cor do Texto \'Foto/Adesivo\' + Gostaria de ver e experimentar alguns temas feitos por outros usuários do Plus Messenger? \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-pt-rPT/strings.xml b/TMessagesProj/src/main/res/values-pt-rPT/strings.xml index c58f21f9..a12cb525 100644 --- a/TMessagesProj/src/main/res/values-pt-rPT/strings.xml +++ b/TMessagesProj/src/main/res/values-pt-rPT/strings.xml @@ -805,20 +805,9 @@ h:mm a %1$s às %2$s - Plus Messenger para Android acaba de ser atualizado. Novidades da versão 2.9:\n\n- Instale e compartilhe pacotes de stickers customizados como esse: https://telegram.me/addstickers/Animals\n- Se você é um artista, crie stickers customizados usando o @stickers bot.\n\n- Use Telegram com Android Auto. - 543 + Plus Messenger para Android acaba de ser atualizado. Novidades da versão 2.9:\n\n- Baixe e use temas para o app Plus Messenger:\n https://play.google.com/store/apps/details?id=es.rafalense.themes + 546 - Plus Messenger para Android Temas O código hexadecimal da cor é inválido! diff --git a/TMessagesProj/src/main/res/values-tr/strings.xml b/TMessagesProj/src/main/res/values-tr/strings.xml index e89170b1..69e6d977 100644 --- a/TMessagesProj/src/main/res/values-tr/strings.xml +++ b/TMessagesProj/src/main/res/values-tr/strings.xml @@ -393,8 +393,8 @@ %1$d hafta SS:dd - - \n\n2.9.1.1\'daki Yenilikler:\n\n- Diğer küçük hata düzeltmeleri + + \n\n2.9.1.4\'teki Yenilikler\n\n- Sohbet ekranındaki emoji penceresinin varsayılan boyutunu değiştirme özelliği eklendi (Özellik Ayarlar/Mesajlar sekmesinde)\n- Video gönderirken sıkıştırma seviyesini ayarlama özelliği eklendi\n- Ayarlar/Mesajlar\'a ekran renklerini değiştiren MOD eklendi\n- İletilen isim rengini ayırmak için sohbet ekranındaki sağ ve sol baloncuğa MOD uygulandı\n- Sohbet ekranındaki ikon renklerini değiştirmek için MOD eklendi\n- Ana ekrandaki \'Fotoğraflar/Çıkartmalar\' yazısını değiştirmek için MOD eklendi\n- Hata düzeltmeleri yapıldı Android için Plus Messenger Tema Geçersiz renk hex kodu! @@ -503,7 +503,19 @@ Grup isim rengi Grup isim boyutu İsim Rengi (Bilinmeyen Numara) - Kişisel arkaplan gölgesini gizle + Özelleştirilmiş arkaplan gölgesini gizle Arkaplan rengini ayarla Arkaplan rengi + Emoji penceresi boyutu + İletilen sağ baloncuk isim rengi + İletilen sol baloncuk isim rengi + İkon rengi + Ayarlar/Tema ekranı + Arkaplan rengi + Gölge rengi + Bölüm rengi + Başlık rengi + Özet/Altyazı rengi + \'Fotoğraf/Çıkartma\' yazı rengi + Diğer Plus Messenger kullanıcıları tarafından oluşturulmuş temalara gözatmak istermisiniz? diff --git a/TMessagesProj/src/main/res/values-zh-rCN/strings.xml b/TMessagesProj/src/main/res/values-zh-rCN/strings.xml index 57e4c3ca..615023af 100644 --- a/TMessagesProj/src/main/res/values-zh-rCN/strings.xml +++ b/TMessagesProj/src/main/res/values-zh-rCN/strings.xml @@ -779,8 +779,8 @@ h:mm a %1$s 的 %2$s - Android 版的 Telegram 已更新。最新版本是 2.9,新增功能有:\n\n- 安装和共享自制图贴 https://telegram.me/addstickers/Animals\n- 如果您是艺术家,可以自制并使用 @Stickers 机器人上传您的图贴\n- 为 Android Auto 修改适配。 - 543 + Android 版的 Telegram 已更新。最新版本是 2.9,新增功能有:\n\n- 安装和共享自制图贴 https://play.google.com/store/apps/details?id=es.rafalense.themes\n- 如果您是艺术家,可以自制并使用 @Stickers 机器人上传您的图贴\n- 为 Android Auto 修改适配。 + 546 Plus Messenger for Android 主题 diff --git a/TMessagesProj/src/main/res/values-zh-rTW/strings.xml b/TMessagesProj/src/main/res/values-zh-rTW/strings.xml index 8cda69a6..7006f0ca 100644 --- a/TMessagesProj/src/main/res/values-zh-rTW/strings.xml +++ b/TMessagesProj/src/main/res/values-zh-rTW/strings.xml @@ -802,8 +802,8 @@ a h:mm %1$s 於時間 %2$s - 適用於 Android 的 Plus Messenger 已經更新。在 2.9 版中的新功能:\n\n- 安裝和分享自訂貼圖集,像這樣的:https://telegram.me/addstickers/Animals\n- 如果您是一個畫家,您可以使用我們的 @Stickers Bot 建立自訂貼圖集。\n\n- 使用帶有 Android Auto 功能的 Telegram。 - 543 + 適用於 Android 的 Plus Messenger 已經更新。在 2.9 版中的新功能:\n\n- 安裝和分享自訂貼圖集,像這樣的:https://play.google.com/store/apps/details?id=es.rafalense.themes\n- 如果您是一個畫家,您可以使用我們的 @Stickers Bot 建立自訂貼圖集。\n\n- 使用帶有 Android Auto 功能的 Telegram。 + 546 Plus Messenger Android版 佈景主題 @@ -814,42 +814,42 @@ 重置為預設主題! 一般 螢幕畫面 - 主螢幕 - 聊天螢幕 - 聯絡人螢幕 + 主畫面 + 聊天室畫面 + 聯絡人畫面 標題 聊天清單 聊天清單 聯絡人清單 - 標題背景顏色 + 標題顏色 名稱顏色 名稱字體大小 訊息顏色 訊息字體大小 時間/日期顏色 時間/日期字體大小 - 訊息數量顏色 - 訊息數量字體大小 - 行背景顏色 - 訊息數量背景顏色 + 訊息數顏色 + 訊息數字體大小 + 行顏色 + 訊息數背景色 狀態顏色 狀態大小 - 右邊聊天氣球顏色 - 左邊聊天氣球顏色 + 右邊對話氣泡顏色 + 左邊對話氣泡顏色 日期顏色 日期大小 - 日期氣球顏色 - 右邊信息顏色 - 左邊信息顏色 - 右邊時間戳顏色 - 左邊時間戳顏色 + 日期背景色 + 右邊文字顏色 + 左邊文字顏色 + 右邊時間顏色 + 左邊時間顏色 時間大小 - 輸入欄字體顏色 - 輸入欄字體大小 - 輸入欄背景顏色 - 表情背景顏色 - 表情頁顏色 + 輸入欄顏色 + 輸入欄大小 + 輸入欄背景色 + 表情符號背景色 + 表情符號分頁顏色 在線上的顏色 音樂 儲存主題 @@ -857,39 +857,39 @@ 主題已儲存! %1$s 已儲存至 %2$s 主題尚未建立。請先套用任何一個模組 - 已從儲存卡恢復主題 - 在 %s 裡找不到設定檔 - 找不到儲存卡 + 從記憶卡復原偏好設定 + 在 %s 裡找不到偏好設定檔 + 找不到記憶卡。 輸入名稱 主題 套用主題 從本地資料夾套用xml格式主題 成員顏色 - 勾的顏色 + 勾勾顏色 靜音圖示顏色 傳送日誌 空白日誌 傳送圖示 隱藏選單中的電話號碼 - 浮動圖標顏色 - 浮動圖標背景顏色 + 浮動鉛筆顏色 + 浮動鉛筆背景色 G+社群 - 輸入中 顏色 - 輸入欄圖標顏色 + 輸入中顏色 + 輸入欄圖示顏色 導航欄抽屜 - 選項列表 - 列表顏色 - 名字大小 + 選項清單 + 清單顏色 + 名稱大小 電話號碼顏色 電話號碼大小 頭像顏色 - 選擇圖標顏色 + 選項圖示的顏色 選擇字體顏色 選擇字體大小 版本號字體顏色 版本號字體大小 標題顏色 - 標題圖標顏色 + 標題圖示顏色 分隔線顏色 頭像半徑 設定成員顏色 @@ -903,7 +903,7 @@ 左邊連結顏色 主題已套用! 點擊確定來重啟應用程式 - 顯示手機 emoji 表情符號 + 顯示手機表情符號 對話氣泡風格 保留原始檔名 取代僅僅是數字的方式,檔案將被儲存為「名稱_日期」的格式 @@ -913,4 +913,7 @@ 群組名稱顏色 群組名稱大小 名稱顏色 (數量不明) + 隱藏自訂背景陰影 + 設定背景色 + 背景色 diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index b2c4fbd2..00906c05 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -804,10 +804,10 @@ h:mm a %1$s at %2$s - Plus Messenger for Android has been updated. New in version 2.9:\n\n- Install and share custom sticker sets like these ones:\n https://telegram.me/addstickers/Animals\n https://telegram.me/addstickers/Unofficial\n https://telegram.me/addstickers/ragefaces\n- If you\'re an artist, create custom sticker sets using our @stickers bot.\n\n- Use Plus Messenger with Android Auto. - 543 + Plus Messenger for Android has been updated. New in version 2.9:\n\n- Check, download and apply themes for Plus Messenger:\n https://play.google.com/store/apps/details?id=es.rafalense.themes + 546 - \n\nNew in 2.9.1.1:\n\n- Added MOD to set solid color for chat background\n- Added MOD to hide background shadow of navigation menu\n- Added MOD to set avatar radius in profile screen\n- Bug fixes + \n\nNew in 2.9.1.4:\n\n- Option to change default emoji window size in chat screen (option in Settings/Messages)\n- Option to change level of compression when sharing a video\n- Added MODs to adjust Settings/Theming screen colors\n- Added separated MODs for forward name color for right and left bubble in chat screen\n- Added MOD to change icons colors in Contacts screen\n- Added MOD to change color of \'Photo/Sticker\' text in main screen\n- Bug fixes Plus Messenger for Android Theming Invalid color hex code! @@ -920,4 +920,15 @@ Set background color Background color Emoji Popup size + Forward right name color + Forward left name color + Icons color + Settings/Theming screen + Background Color + Shadow Color + Section Color + Title Color + Summary/Subtitle Color + \'Photo/Sticker\' text color + Would you like to check some themes created by other Plus Messenger users? \ No newline at end of file