diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index ad3b7a5e..20e4f893 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -10,6 +10,7 @@ dependencies { //compile 'com.google.android.gms:play-services:7.5.0' compile 'net.hockeyapp.android:HockeySDK:3.5.+' compile 'com.googlecode.mp4parser:isoparser:1.0.+' + compile 'com.android.support:multidex:1.0.1' } android { @@ -81,7 +82,8 @@ android { applicationId "org.telegram.plus" minSdkVersion 8 targetSdkVersion 22 - versionCode 583 - versionName "3.1.1.3" + versionCode 586 + versionName "3.1.1.6" + multiDexEnabled true } } diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java b/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java index 4a413965..231026db 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java @@ -23,8 +23,8 @@ import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLog; -import org.telegram.messenger.TLRPC; import org.telegram.messenger.R; +import org.telegram.messenger.TLRPC; import org.telegram.messenger.UserConfig; import org.telegram.ui.Components.URLSpanNoUnderline; import org.telegram.ui.Components.URLSpanNoUnderlineBold; @@ -78,6 +78,11 @@ public class MessageObject { public ArrayList textLayoutBlocks; + protected int leftBound = 52;//52 + public boolean showAvatar = false; + public boolean showMyAvatar = false; + public boolean showMyAvatarGroup = true; + public MessageObject(TLRPC.Message message, AbstractMap users, boolean generateLayout) { if (textPaint == null) { textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); @@ -98,6 +103,12 @@ public class MessageObject { textPaintRight.linkColor = themePrefs.getInt("chatRLinkColor", def); textPaintRight.setTextSize(AndroidUtilities.dp(MessagesController.getInstance().fontSize)); + showMyAvatar = themePrefs.getBoolean("chatShowOwnAvatar", false); + showMyAvatarGroup = themePrefs.getBoolean("chatShowOwnAvatarGroup", false); + showAvatar = themePrefs.getBoolean("chatShowContactAvatar", false); + int aSize = themePrefs.getInt("chatAvatarSize", 42); + leftBound = aSize + AndroidUtilities.dp(3); + messageOwner = message; if (message.replyMessage != null) { @@ -695,14 +706,18 @@ public class MessageObject { int maxWidth; if (AndroidUtilities.isTablet()) { - if (messageOwner.to_id.chat_id != 0 && !isOut()) { - maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122); + //if (messageOwner.to_id.chat_id != 0 && !isOut()) { + if (( (messageOwner.to_id.chat_id != 0 || showAvatar) && !isOut() ) || ( messageOwner.to_id.chat_id == 0 && showMyAvatar && isOut() ) || ( messageOwner.to_id.chat_id != 0 && showMyAvatarGroup && isOut())) { + //maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122); + maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(leftBound + 70); } else { maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(80); } } else { - if (messageOwner.to_id.chat_id != 0 && !isOut()) { - maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122); + //if (messageOwner.to_id.chat_id != 0 && !isOut()) { + if (((messageOwner.to_id.chat_id != 0 || showAvatar) && !isOut())|| ( messageOwner.to_id.chat_id == 0 && showMyAvatar && isOut() ) || ( messageOwner.to_id.chat_id != 0 && showMyAvatarGroup && isOut())) { + //maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122); + maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(leftBound + 70); } else { maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(80); } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java index b74e5c27..f6594896 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java @@ -24,6 +24,7 @@ import android.os.AsyncTask; import android.os.Build; import android.os.Handler; import android.os.PowerManager; +import android.support.multidex.MultiDex; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; @@ -97,7 +98,7 @@ public class ApplicationLoader extends Application { int cacheColorHint = 0; // SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); - if(themePrefs.getBoolean("chatSolidBGColorCheck", false)){ + if (themePrefs.getBoolean("chatSolidBGColorCheck", false)) { cachedWallpaper = null; selectedColor = themePrefs.getInt("chatSolidBGColor", 0xffffffff); } @@ -357,6 +358,12 @@ public class ApplicationLoader extends Application { }); } + @Override + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } + private void storeRegistrationId(Context context, String regId) { final SharedPreferences prefs = getGCMPreferences(context); int appVersion = BuildVars.BUILD_VERSION; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java index 139c0ad6..db6567f0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java @@ -13,6 +13,7 @@ import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; @@ -20,6 +21,7 @@ import android.widget.Button; import android.widget.TextView; import org.telegram.android.AndroidUtilities; +import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.FileLog; import org.telegram.messenger.R; @@ -274,7 +276,8 @@ public class BaseFragment { }); visibleDialog.show(); //Always after .show() - int color = AndroidUtilities.getIntColor("themeColor"); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int color = preferences.getInt("dialogColor", preferences.getInt("themeColor", AndroidUtilities.defColor)); int id = visibleDialog.getContext().getResources().getIdentifier("android:id/alertTitle", null, null); TextView tv = (TextView) visibleDialog.findViewById(id); if(tv != null)tv.setTextColor(color); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java index 0f47cf00..57f71a52 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java @@ -11,6 +11,8 @@ package org.telegram.ui.Adapters; import android.content.Context; import android.content.SharedPreferences; import android.content.pm.PackageInfo; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; @@ -102,28 +104,40 @@ public class DrawerLayoutAdapter extends BaseAdapter { view = new DrawerActionCell(mContext); } DrawerActionCell actionCell = (DrawerActionCell) view; - actionCell.setTextColor(themePrefs.getInt("drawerOptionColor", 0xff444444)); - actionCell.setTextSize(themePrefs.getInt("drawerOptionSize", 15)); + //actionCell.setTextColor(themePrefs.getInt("drawerOptionColor", 0xff444444)); + //actionCell.setTextSize(themePrefs.getInt("drawerOptionSize", 15)); //actionCell.setIconColor(themePrefs.getInt("drawerIconColor", 0xff737373)); int color = themePrefs.getInt("drawerIconColor", 0xff737373); if (i == 2) { - actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), R.drawable.menu_newgroup, color); + Drawable newGroup = mContext.getResources().getDrawable(R.drawable.menu_newgroup); + newGroup.setColorFilter(color, PorterDuff.Mode.SRC_IN); + actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), newGroup); + //actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), R.drawable.menu_newgroup); } else if (i == 3) { - actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), R.drawable.menu_secret, color); + //actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), R.drawable.menu_secret); + Drawable secret = mContext.getResources().getDrawable(R.drawable.menu_secret); + secret.setColorFilter(color, PorterDuff.Mode.SRC_IN); + actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), secret); } else if (i == 4) { - actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), R.drawable.menu_broadcast, color); + //actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), R.drawable.menu_broadcast); + Drawable broadcast = mContext.getResources().getDrawable(R.drawable.menu_broadcast); + broadcast.setColorFilter(color, PorterDuff.Mode.SRC_IN); + actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), broadcast); } else if (i == contactsRow) { - actionCell.setTextAndIcon(LocaleController.getString("Contacts", R.string.Contacts), R.drawable.menu_contacts, color); + //actionCell.setTextAndIcon(LocaleController.getString("Contacts", R.string.Contacts), R.drawable.menu_contacts); + Drawable contacts = mContext.getResources().getDrawable(R.drawable.menu_contacts); + contacts.setColorFilter(color, PorterDuff.Mode.SRC_IN); + actionCell.setTextAndIcon(LocaleController.getString("Contacts", R.string.Contacts), contacts); }/* else if (i == 7) { actionCell.setTextAndIcon(LocaleController.getString("InviteFriends", R.string.InviteFriends), R.drawable.menu_invite); }*/ else if (i == themesRow) { - actionCell.setTextAndIcon(LocaleController.getString("Themes", R.string.Themes), R.drawable.menu_themes, color); + actionCell.setTextAndIcon(LocaleController.getString("Themes", R.string.Themes), R.drawable.menu_themes); } else if (i == themingRow) { - actionCell.setTextAndIcon(LocaleController.getString("Theming", R.string.Theming), R.drawable.menu_theming, color); + actionCell.setTextAndIcon(LocaleController.getString("Theming", R.string.Theming), R.drawable.menu_theming); } else if (i == settingsRow) { - actionCell.setTextAndIcon(LocaleController.getString("Settings", R.string.Settings), R.drawable.menu_settings, color); + actionCell.setTextAndIcon(LocaleController.getString("Settings", R.string.Settings), R.drawable.menu_settings); } else if (i == communityRow) { - actionCell.setTextAndIcon(LocaleController.getString("Community", R.string.Community), R.drawable.menu_forum, color); + actionCell.setTextAndIcon(LocaleController.getString("Community", R.string.Community), R.drawable.menu_forum); } /*else if (i == 10) { actionCell.setTextAndIcon(LocaleController.getString("TelegramFaq", R.string.TelegramFaq), R.drawable.menu_help); }*/ diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatAudioCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatAudioCell.java index e8bae160..e3332ca6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatAudioCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatAudioCell.java @@ -302,14 +302,20 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega super.onLayout(changed, left, top, right, bottom); if (currentMessageObject.isOut()) { - seekBarX = layoutWidth - backgroundWidth + AndroidUtilities.dp(55); - buttonX = layoutWidth - backgroundWidth + AndroidUtilities.dp(13); - timeX = layoutWidth - backgroundWidth + AndroidUtilities.dp(66); + //seekBarX = layoutWidth - backgroundWidth + AndroidUtilities.dp(55); + //buttonX = layoutWidth - backgroundWidth + AndroidUtilities.dp(13); + //timeX = layoutWidth - backgroundWidth + AndroidUtilities.dp(66); + seekBarX = layoutWidth - backgroundWidth + AndroidUtilities.dp(55) - (((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) ? AndroidUtilities.dp(leftBound) : 0); + buttonX = layoutWidth - backgroundWidth + AndroidUtilities.dp(13) - (((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) ? AndroidUtilities.dp(leftBound) : 0); + timeX = layoutWidth - backgroundWidth + AndroidUtilities.dp(66) - (((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) ? AndroidUtilities.dp(leftBound) : 0); } else { if (isChat || showAvatar) { - seekBarX = AndroidUtilities.dp(116); - buttonX = AndroidUtilities.dp(74); - timeX = AndroidUtilities.dp(127); + //seekBarX = AndroidUtilities.dp(116); + //buttonX = AndroidUtilities.dp(74); + //timeX = AndroidUtilities.dp(127); + seekBarX = AndroidUtilities.dp(leftBound + 64); + buttonX = AndroidUtilities.dp(leftBound + 22); + timeX = AndroidUtilities.dp(leftBound + 75); } else { seekBarX = AndroidUtilities.dp(64); buttonX = AndroidUtilities.dp(22); @@ -331,9 +337,11 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega boolean dataChanged = currentMessageObject == messageObject && isUserDataChanged(); if (currentMessageObject != messageObject || dataChanged) { if (AndroidUtilities.isTablet()) { - backgroundWidth = Math.min(AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(isChat || showAvatar ? 102 : 50), AndroidUtilities.dp(300)); + //backgroundWidth = Math.min(AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(isChat ? 102 : 50), AndroidUtilities.dp(300)); + backgroundWidth = Math.min(AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp((isChat || showAvatar) || (messageObject.isOut() && ((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat))) ? leftBound + 50 : 50), AndroidUtilities.dp(300)); } else { - backgroundWidth = Math.min(AndroidUtilities.displaySize.x - AndroidUtilities.dp(isChat || showAvatar ? 102 : 50), AndroidUtilities.dp(300)); + //backgroundWidth = Math.min(AndroidUtilities.displaySize.x - AndroidUtilities.dp(isChat ? 102 : 50), AndroidUtilities.dp(300)); + backgroundWidth = Math.min(AndroidUtilities.displaySize.x - AndroidUtilities.dp((isChat || showAvatar) || (messageObject.isOut() && ((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat))) ? leftBound + 50 : 50), AndroidUtilities.dp(300)); } if (messageObject.isOut()) { 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 996c5fb3..b064bccf 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java @@ -134,12 +134,17 @@ public class ChatBaseCell extends BaseCell { private int last_send_state = 0; private int last_delete_date = 0; - private int leftBound = 52;//52 - private int avatarSize = AndroidUtilities.dp(42); + protected int leftBound = 52;//52 + //private int avatarSize = AndroidUtilities.dp(42); + protected int avatarSize = AndroidUtilities.dp(42); protected boolean avatarAlignTop = false; + protected boolean ownAvatarAlignTop = false; private int avatarLeft = AndroidUtilities.dp(6); boolean showAvatar = false; + boolean showMyAvatar = false; + boolean showMyAvatarGroup = true; + private int checkX = 0; public ChatBaseCell(Context context) { super(context); @@ -185,67 +190,78 @@ public class ChatBaseCell extends BaseCell { int radius = AndroidUtilities.dp(themePrefs.getInt("chatAvatarRadius", 32)); avatarImage.setRoundRadius(radius); avatarDrawable.setRadius(radius); - avatarSize = AndroidUtilities.dp(themePrefs.getInt("chatAvatarSize", 42)); + int aSize = themePrefs.getInt("chatAvatarSize", 42); + avatarSize = AndroidUtilities.dp(aSize); avatarLeft = AndroidUtilities.dp(themePrefs.getInt("chatAvatarMarginLeft", 6)); avatarAlignTop = themePrefs.getBoolean("chatAvatarAlignTop", false); + ownAvatarAlignTop = themePrefs.getBoolean("chatOwnAvatarAlignTop", false); //setBubbles(themePrefs.getString("chatBubbleStyle", ImageListActivity.getBubbleName(0))); + showMyAvatar = themePrefs.getBoolean("chatShowOwnAvatar", false); + showMyAvatarGroup = themePrefs.getBoolean("chatShowOwnAvatarGroup", false); + showAvatar = themePrefs.getBoolean("chatShowContactAvatar", false); + leftBound = aSize + AndroidUtilities.dp(3); + //Log.e("ChatBaseCell", "leftBound " + leftBound); } private void updateTheme(){ SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor); - int lColor = AndroidUtilities.getDefBubbleColor(); - int dColor = AndroidUtilities.setDarkColor(defColor, 0x15); - int rBubbleColor = themePrefs.getInt("chatRBubbleColor", lColor); - int rBubbleSColor = AndroidUtilities.setDarkColor(rBubbleColor, 0x15); - int lBubbleColor = themePrefs.getInt("chatLBubbleColor", 0xffffffff); - int lBubbleSColor = AndroidUtilities.setDarkColor(lBubbleColor, 0x15); + try{ + int lColor = AndroidUtilities.getDefBubbleColor(); + int dColor = AndroidUtilities.setDarkColor(defColor, 0x15); + int rBubbleColor = themePrefs.getInt("chatRBubbleColor", lColor); + int rBubbleSColor = AndroidUtilities.setDarkColor(rBubbleColor, 0x15); + int lBubbleColor = themePrefs.getInt("chatLBubbleColor", 0xffffffff); + int lBubbleSColor = AndroidUtilities.setDarkColor(lBubbleColor, 0x15); - timePaintOut.setColor(themePrefs.getInt("chatRTimeColor", dColor)); - timePaintOut.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatTimeSize", 12))); - timePaintIn.setColor(themePrefs.getInt("chatLTimeColor", 0xffa1aab3)); - timePaintIn.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatTimeSize", 12))); + timePaintOut.setColor(themePrefs.getInt("chatRTimeColor", dColor)); + timePaintOut.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatTimeSize", 12))); + timePaintIn.setColor(themePrefs.getInt("chatLTimeColor", 0xffa1aab3)); + timePaintIn.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatTimeSize", 12))); - int linkColor = themePrefs.getInt("chatLLinkColor", defColor); - int bColor = AndroidUtilities.getIntAlphaColor("chatLBubbleColor", 0xffffffff, 0.9f); - if(currentMessageObject.isOut()){ - bColor = AndroidUtilities.getIntAlphaColor("chatRBubbleColor", lColor, 0.9f); - linkColor = themePrefs.getInt("chatRLinkColor", defColor); + int linkColor = themePrefs.getInt("chatLLinkColor", defColor); + int bColor = AndroidUtilities.getIntAlphaColor("chatLBubbleColor", 0xffffffff, 0.9f); + if(currentMessageObject.isOut()){ + bColor = AndroidUtilities.getIntAlphaColor("chatRBubbleColor", lColor, 0.9f); + linkColor = themePrefs.getInt("chatRLinkColor", defColor); + } + replyTextPaint.linkColor = linkColor; + //ResourceLoader.loadRecources(getContext()); + /*if(ResourceLoader.mediaBackgroundDrawable == null){ + ResourceLoader.mediaBackgroundDrawable = getResources().getDrawable(R.drawable.phototime); + ResourceLoader.checkDrawable = getResources().getDrawable(R.drawable.msg_check); + ResourceLoader.halfCheckDrawable = getResources().getDrawable(R.drawable.msg_halfcheck); + ResourceLoader.clockDrawable = getResources().getDrawable(R.drawable.msg_clock); + ResourceLoader.checkMediaDrawable = getResources().getDrawable(R.drawable.msg_check_w); + ResourceLoader.halfCheckMediaDrawable = getResources().getDrawable(R.drawable.msg_halfcheck_w); + ResourceLoader.clockMediaDrawable = getResources().getDrawable(R.drawable.msg_clock_photo); + //ResourceLoader.videoIconDrawable = getResources().getDrawable(R.drawable.ic_video); + ResourceLoader.docMenuInDrawable = getResources().getDrawable(R.drawable.doc_actions_b); + ResourceLoader.docMenuOutDrawable = getResources().getDrawable(R.drawable.doc_actions_g); + }*/ + + ResourceLoader.mediaBackgroundDrawable.setColorFilter(bColor, PorterDuff.Mode.SRC_IN); + + ResourceLoader.backgroundDrawableOut.setColorFilter(rBubbleColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.backgroundMediaDrawableOut.setColorFilter(rBubbleColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.backgroundDrawableOutSelected.setColorFilter(rBubbleSColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.backgroundMediaDrawableOutSelected.setColorFilter(rBubbleSColor, PorterDuff.Mode.SRC_IN); + + ResourceLoader.backgroundDrawableIn.setColorFilter(lBubbleColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.backgroundMediaDrawableIn.setColorFilter(lBubbleColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.backgroundDrawableInSelected.setColorFilter(lBubbleSColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.backgroundMediaDrawableInSelected.setColorFilter(lBubbleSColor, PorterDuff.Mode.SRC_IN); + + int checksColor = themePrefs.getInt("chatChecksColor", defColor); + ResourceLoader.checkDrawable.setColorFilter(checksColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.halfCheckDrawable.setColorFilter(checksColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.clockDrawable.setColorFilter(checksColor, PorterDuff.Mode.SRC_IN); + ResourceLoader.checkMediaDrawable.setColorFilter(checksColor, PorterDuff.Mode.MULTIPLY); + ResourceLoader.halfCheckMediaDrawable.setColorFilter(checksColor, PorterDuff.Mode.MULTIPLY); + ResourceLoader.halfCheckMediaDrawable.setColorFilter(checksColor, PorterDuff.Mode.MULTIPLY); + } catch (NullPointerException e) { + FileLog.e("tmessages", e); } - replyTextPaint.linkColor = linkColor; - //ResourceLoader.loadRecources(getContext()); - /*if(ResourceLoader.mediaBackgroundDrawable == null){ - ResourceLoader.mediaBackgroundDrawable = getResources().getDrawable(R.drawable.phototime); - ResourceLoader.checkDrawable = getResources().getDrawable(R.drawable.msg_check); - ResourceLoader.halfCheckDrawable = getResources().getDrawable(R.drawable.msg_halfcheck); - ResourceLoader.clockDrawable = getResources().getDrawable(R.drawable.msg_clock); - ResourceLoader.checkMediaDrawable = getResources().getDrawable(R.drawable.msg_check_w); - ResourceLoader.halfCheckMediaDrawable = getResources().getDrawable(R.drawable.msg_halfcheck_w); - ResourceLoader.clockMediaDrawable = getResources().getDrawable(R.drawable.msg_clock_photo); - //ResourceLoader.videoIconDrawable = getResources().getDrawable(R.drawable.ic_video); - ResourceLoader.docMenuInDrawable = getResources().getDrawable(R.drawable.doc_actions_b); - ResourceLoader.docMenuOutDrawable = getResources().getDrawable(R.drawable.doc_actions_g); - }*/ - - ResourceLoader.mediaBackgroundDrawable.setColorFilter(bColor, PorterDuff.Mode.SRC_IN); - - ResourceLoader.backgroundDrawableOut.setColorFilter(rBubbleColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.backgroundMediaDrawableOut.setColorFilter(rBubbleColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.backgroundDrawableOutSelected.setColorFilter(rBubbleSColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.backgroundMediaDrawableOutSelected.setColorFilter(rBubbleSColor, PorterDuff.Mode.SRC_IN); - - ResourceLoader.backgroundDrawableIn.setColorFilter(lBubbleColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.backgroundMediaDrawableIn.setColorFilter(lBubbleColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.backgroundDrawableInSelected.setColorFilter(lBubbleSColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.backgroundMediaDrawableInSelected.setColorFilter(lBubbleSColor, PorterDuff.Mode.SRC_IN); - - int checksColor = themePrefs.getInt("chatChecksColor", defColor); - ResourceLoader.checkDrawable.setColorFilter(checksColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.halfCheckDrawable.setColorFilter(checksColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.clockDrawable.setColorFilter(checksColor, PorterDuff.Mode.SRC_IN); - ResourceLoader.checkMediaDrawable.setColorFilter(checksColor, PorterDuff.Mode.MULTIPLY); - ResourceLoader.halfCheckMediaDrawable.setColorFilter(checksColor, PorterDuff.Mode.MULTIPLY); - ResourceLoader.halfCheckMediaDrawable.setColorFilter(checksColor, PorterDuff.Mode.MULTIPLY); } @@ -383,7 +399,7 @@ public class ChatBaseCell extends BaseCell { currentUser = MessagesController.getInstance().getUser(messageObject.messageOwner.from_id); //if (isChat && !messageObject.isOut()) { - if ((isChat || showAvatar) && !messageObject.isOut()) { + if ( ( (isChat || showAvatar) && !messageObject.isOut() ) || ((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) && messageObject.isOut()) { isAvatarVisible = true; if (currentUser != null) { if (currentUser.photo != null) { @@ -495,9 +511,11 @@ public class ChatBaseCell extends BaseCell { width = AndroidUtilities.displaySize.x; } if (messageObject.isOut()) { - maxWidth = width - backgroundWidth - AndroidUtilities.dp(60); + //maxWidth = width - backgroundWidth - AndroidUtilities.dp(60); + maxWidth = width - backgroundWidth - AndroidUtilities.dp(60 + ((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat) ? (leftBound + 10) : 0)); } else { - maxWidth = width - backgroundWidth - AndroidUtilities.dp(56 + (isChat || showAvatar ? 61 : 0)); + //maxWidth = width - backgroundWidth - AndroidUtilities.dp(56 + (isChat ? 61 : 0)); + maxWidth = width - backgroundWidth - AndroidUtilities.dp(56 + (isChat || showAvatar ? (leftBound + 10) : 0)); } } else { maxWidth = getMaxNameWidth() - AndroidUtilities.dp(22); @@ -664,18 +682,26 @@ public class ChatBaseCell extends BaseCell { timeX = backgroundWidth - AndroidUtilities.dp(9) - timeWidth + (isChat || showAvatar ? AndroidUtilities.dp(leftBound) : 0); } else { timeX = layoutWidth - timeWidth - AndroidUtilities.dp(38.5f); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat))timeX = layoutWidth - timeWidth - AndroidUtilities.dp(38.5f) - AndroidUtilities.dp(leftBound); + checkX = timeX + timeWidth; } } else { if (!currentMessageObject.isOut()) { timeX = backgroundWidth - AndroidUtilities.dp(4) - timeWidth + (isChat || showAvatar ? AndroidUtilities.dp(leftBound) : 0); } else { timeX = layoutWidth - timeWidth - AndroidUtilities.dp(42.0f); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat))timeX = layoutWidth - timeWidth - AndroidUtilities.dp(42.0f) - AndroidUtilities.dp(leftBound); + checkX = timeX + timeWidth; } } if (isAvatarVisible) { //avatarImage.setImageCoords(AndroidUtilities.dp(6), layoutHeight - AndroidUtilities.dp(45), AndroidUtilities.dp(42), AndroidUtilities.dp(42)); - avatarImage.setImageCoords(avatarLeft, avatarAlignTop ? AndroidUtilities.dp(3) : layoutHeight - AndroidUtilities.dp(3) - avatarSize, avatarSize, avatarSize); + if(((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) && currentMessageObject.isOut()){ + avatarImage.setImageCoords(layoutWidth - avatarSize - avatarLeft, ownAvatarAlignTop ? AndroidUtilities.dp(3) : layoutHeight - AndroidUtilities.dp(3) - avatarSize, avatarSize, avatarSize); + }else{ + avatarImage.setImageCoords(avatarLeft, avatarAlignTop ? AndroidUtilities.dp(3) : layoutHeight - AndroidUtilities.dp(3) - avatarSize, avatarSize, avatarSize); + } } wasLayout = true; @@ -723,7 +749,13 @@ public class ChatBaseCell extends BaseCell { currentBackgroundDrawable = ResourceLoader.backgroundMediaDrawableOut; } } - setDrawableBounds(currentBackgroundDrawable, layoutWidth - backgroundWidth - (!media ? 0 : AndroidUtilities.dp(9)), AndroidUtilities.dp(1), backgroundWidth, layoutHeight - AndroidUtilities.dp(2)); + + if ((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) { + setDrawableBounds(currentBackgroundDrawable, layoutWidth - backgroundWidth - (!media ? 0 : AndroidUtilities.dp(9)) - AndroidUtilities.dp(leftBound), AndroidUtilities.dp(1), backgroundWidth, layoutHeight - AndroidUtilities.dp(2)); + }else{ + setDrawableBounds(currentBackgroundDrawable, layoutWidth - backgroundWidth - (!media ? 0 : AndroidUtilities.dp(9)), AndroidUtilities.dp(1), backgroundWidth, layoutHeight - AndroidUtilities.dp(2)); + } + } else { if (isPressed() && isCheckPressed || !isCheckPressed && isPressed || isHighlighted) { if (!media) { @@ -769,10 +801,13 @@ public class ChatBaseCell extends BaseCell { //forwardNamePaint.setColor(0xff4a923c); forwardNamePaint.setColor(themePrefs.getInt("chatForwardRColor", AndroidUtilities.setDarkColor(defColor, 0x15))); forwardNameX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(10); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat))forwardNameY = AndroidUtilities.dp((drawName ? 10 : 0)); } else { //forwardNamePaint.setColor(0xff006fc8); forwardNamePaint.setColor(themePrefs.getInt("chatForwardLColor", defColor)); forwardNameX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(19); + //Plus + if((!isChat && showAvatar))forwardNameY = AndroidUtilities.dp((drawName ? 10 : 0)); } canvas.save(); canvas.translate(forwardNameX - forwardNameOffsetX, forwardNameY); @@ -914,20 +949,36 @@ public class ChatBaseCell extends BaseCell { if (drawClock) { if (!media) { - setDrawableBounds(ResourceLoader.clockDrawable, layoutWidth - AndroidUtilities.dp(18.5f) - ResourceLoader.clockDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.5f) - ResourceLoader.clockDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.clockDrawable, checkX - AndroidUtilities.dp(3.5f) + ResourceLoader.clockDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.5f) - ResourceLoader.clockDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.clockDrawable, layoutWidth - AndroidUtilities.dp(18.5f) - ResourceLoader.clockDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.5f) - ResourceLoader.clockDrawable.getIntrinsicHeight()); + } ResourceLoader.clockDrawable.draw(canvas); } else { - setDrawableBounds(ResourceLoader.clockMediaDrawable, layoutWidth - AndroidUtilities.dp(22.0f) - ResourceLoader.clockMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.clockMediaDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.clockMediaDrawable, checkX - AndroidUtilities.dp(7.0f) + ResourceLoader.clockMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.clockMediaDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.clockMediaDrawable, layoutWidth - AndroidUtilities.dp(22.0f) - ResourceLoader.clockMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.clockMediaDrawable.getIntrinsicHeight()); + } ResourceLoader.clockMediaDrawable.draw(canvas); } } if (isBroadcast) { if (drawCheck1 || drawCheck2) { if (!media) { - setDrawableBounds(ResourceLoader.broadcastDrawable, layoutWidth - AndroidUtilities.dp(20.5f) - ResourceLoader.broadcastDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.broadcastDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.broadcastDrawable, checkX - AndroidUtilities.dp(5.5f) + ResourceLoader.broadcastDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.broadcastDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.broadcastDrawable, layoutWidth - AndroidUtilities.dp(20.5f) - ResourceLoader.broadcastDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.broadcastDrawable.getIntrinsicHeight()); + } ResourceLoader.broadcastDrawable.draw(canvas); } else { - setDrawableBounds(ResourceLoader.broadcastMediaDrawable, layoutWidth - AndroidUtilities.dp(24.0f) - ResourceLoader.broadcastMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.broadcastMediaDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.broadcastMediaDrawable, checkX - AndroidUtilities.dp(9.0f) + ResourceLoader.broadcastMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.broadcastMediaDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.broadcastMediaDrawable, layoutWidth - AndroidUtilities.dp(24.0f) - ResourceLoader.broadcastMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.broadcastMediaDrawable.getIntrinsicHeight()); + } ResourceLoader.broadcastMediaDrawable.draw(canvas); } } @@ -935,36 +986,68 @@ public class ChatBaseCell extends BaseCell { if (drawCheck2) { if (!media) { if (drawCheck1) { - setDrawableBounds(ResourceLoader.checkDrawable, layoutWidth - AndroidUtilities.dp(22.5f) - ResourceLoader.checkDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.checkDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.checkDrawable, checkX - AndroidUtilities.dp(7.5f) + ResourceLoader.checkDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.checkDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.checkDrawable, layoutWidth - AndroidUtilities.dp(22.5f) - ResourceLoader.checkDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.checkDrawable.getIntrinsicHeight()); + } } else { - setDrawableBounds(ResourceLoader.checkDrawable, layoutWidth - AndroidUtilities.dp(18.5f) - ResourceLoader.checkDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.checkDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.checkDrawable, checkX - AndroidUtilities.dp(3.5f) + ResourceLoader.checkDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.checkDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.checkDrawable, layoutWidth - AndroidUtilities.dp(18.5f) - ResourceLoader.checkDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.checkDrawable.getIntrinsicHeight()); + } } ResourceLoader.checkDrawable.draw(canvas); } else { if (drawCheck1) { - setDrawableBounds(ResourceLoader.checkMediaDrawable, layoutWidth - AndroidUtilities.dp(26.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.checkMediaDrawable, checkX - AndroidUtilities.dp(8.0f) + ResourceLoader.checkMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.checkMediaDrawable, layoutWidth - AndroidUtilities.dp(26.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicHeight()); + } } else { - setDrawableBounds(ResourceLoader.checkMediaDrawable, layoutWidth - AndroidUtilities.dp(22.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.checkMediaDrawable, checkX - AndroidUtilities.dp(7.0f) + ResourceLoader.checkMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.checkMediaDrawable, layoutWidth - AndroidUtilities.dp(22.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.checkMediaDrawable.getIntrinsicHeight()); + } } ResourceLoader.checkMediaDrawable.draw(canvas); } } if (drawCheck1) { if (!media) { - setDrawableBounds(ResourceLoader.halfCheckDrawable, layoutWidth - AndroidUtilities.dp(18) - ResourceLoader.halfCheckDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.halfCheckDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.halfCheckDrawable, checkX - AndroidUtilities.dp(3) + ResourceLoader.halfCheckDrawable.getIntrinsicWidth() , layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.halfCheckDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.halfCheckDrawable, layoutWidth - AndroidUtilities.dp(18) - ResourceLoader.halfCheckDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(8.0f) - ResourceLoader.halfCheckDrawable.getIntrinsicHeight()); + } ResourceLoader.halfCheckDrawable.draw(canvas); } else { - setDrawableBounds(ResourceLoader.halfCheckMediaDrawable, layoutWidth - AndroidUtilities.dp(20.5f) - ResourceLoader.halfCheckMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.halfCheckMediaDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.halfCheckMediaDrawable, checkX - AndroidUtilities.dp(3.0f) + ResourceLoader.halfCheckMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.halfCheckMediaDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.halfCheckMediaDrawable, layoutWidth - AndroidUtilities.dp(20.5f) - ResourceLoader.halfCheckMediaDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(13.0f) - ResourceLoader.halfCheckMediaDrawable.getIntrinsicHeight()); + } ResourceLoader.halfCheckMediaDrawable.draw(canvas); } } } if (drawError) { if (!media) { - setDrawableBounds(ResourceLoader.errorDrawable, layoutWidth - AndroidUtilities.dp(18) - ResourceLoader.errorDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(6.5f) - ResourceLoader.errorDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.errorDrawable, checkX - AndroidUtilities.dp(3) + ResourceLoader.errorDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(6.5f) - ResourceLoader.errorDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.errorDrawable, layoutWidth - AndroidUtilities.dp(18) - ResourceLoader.errorDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(6.5f) - ResourceLoader.errorDrawable.getIntrinsicHeight()); + } ResourceLoader.errorDrawable.draw(canvas); } else { - setDrawableBounds(ResourceLoader.errorDrawable, layoutWidth - AndroidUtilities.dp(20.5f) - ResourceLoader.errorDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(12.5f) - ResourceLoader.errorDrawable.getIntrinsicHeight()); + if((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)){ + setDrawableBounds(ResourceLoader.errorDrawable, checkX - AndroidUtilities.dp(5.5f) + ResourceLoader.errorDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(12.5f) - ResourceLoader.errorDrawable.getIntrinsicHeight()); + }else{ + setDrawableBounds(ResourceLoader.errorDrawable, layoutWidth - AndroidUtilities.dp(20.5f) - ResourceLoader.errorDrawable.getIntrinsicWidth(), layoutHeight - AndroidUtilities.dp(12.5f) - ResourceLoader.errorDrawable.getIntrinsicHeight()); + } ResourceLoader.errorDrawable.draw(canvas); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatContactCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatContactCell.java index 2aa9d9da..8ea482d4 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatContactCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatContactCell.java @@ -260,10 +260,12 @@ public class ChatContactCell extends ChatBaseCell { int x; if (currentMessageObject.isOut()) { - x = layoutWidth - backgroundWidth + AndroidUtilities.dp(8); + //x = layoutWidth - backgroundWidth + AndroidUtilities.dp(8); + x = layoutWidth - backgroundWidth + AndroidUtilities.dp(8) - (((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) ? AndroidUtilities.dp(leftBound) : 0); } else { if (isChat || showAvatar) { - x = AndroidUtilities.dp(69); + //x = AndroidUtilities.dp(69); + x = AndroidUtilities.dp(leftBound + 17); } else { x = AndroidUtilities.dp(16); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java index f23675df..8dd57354 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java @@ -667,7 +667,8 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD double lon = messageObject.messageOwner.media.geo._long; if (messageObject.messageOwner.media.title != null && messageObject.messageOwner.media.title.length() > 0) { - int maxWidth = (AndroidUtilities.isTablet() ? AndroidUtilities.getMinTabletSide() : Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y)) - AndroidUtilities.dp(((isChat || showAvatar) && !messageObject.isOut() ? 102 : 40) + 86 + 24); + //int maxWidth = (AndroidUtilities.isTablet() ? AndroidUtilities.getMinTabletSide() : Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y)) - AndroidUtilities.dp((isChat && !messageObject.isOut() ? 102 : 40) + 86 + 24); + int maxWidth = (AndroidUtilities.isTablet() ? AndroidUtilities.getMinTabletSide() : Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y)) - AndroidUtilities.dp(((isChat || showAvatar) && !messageObject.isOut() ? leftBound + 50 : 40) + 86 + 24); nameLayout = StaticLayoutEx.createStaticLayout(messageObject.messageOwner.media.title, locationTitlePaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false, TextUtils.TruncateAt.END, maxWidth - AndroidUtilities.dp(4), 3); int lineCount = nameLayout.getLineCount(); if (messageObject.messageOwner.media.address != null && messageObject.messageOwner.media.address.length() > 0) { @@ -1017,13 +1018,16 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD int x; if (currentMessageObject.isOut()) { if (media) { - x = layoutWidth - backgroundWidth - AndroidUtilities.dp(3); + //x = layoutWidth - backgroundWidth - AndroidUtilities.dp(3); + x = layoutWidth - backgroundWidth - AndroidUtilities.dp(3) - (((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) ? AndroidUtilities.dp(leftBound) : 0); } else { - x = layoutWidth - backgroundWidth + AndroidUtilities.dp(6); + //x = layoutWidth - backgroundWidth + AndroidUtilities.dp(6); + x = layoutWidth - backgroundWidth + AndroidUtilities.dp(6) - (((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) ? AndroidUtilities.dp(leftBound) : 0); } } else { if (isChat || showAvatar) { - x = AndroidUtilities.dp(67); + //x = AndroidUtilities.dp(67); + x = AndroidUtilities.dp(leftBound + 15); } else { x = AndroidUtilities.dp(15); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java index 9a846489..ad4b4e87 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java @@ -29,10 +29,10 @@ import android.view.MotionEvent; import org.telegram.android.AndroidUtilities; import org.telegram.android.ImageReceiver; import org.telegram.android.MediaController; -import org.telegram.messenger.FileLoader; -import org.telegram.messenger.FileLog; import org.telegram.android.MessageObject; import org.telegram.messenger.ApplicationLoader; +import org.telegram.messenger.FileLoader; +import org.telegram.messenger.FileLog; import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; import org.telegram.ui.Components.ResourceLoader; @@ -331,16 +331,18 @@ public class ChatMessageCell extends ChatBaseCell { int maxWidth; if (AndroidUtilities.isTablet()) { - if ((isChat || showAvatar) && !messageObject.isOut()) { - maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122); + if (( (isChat || showAvatar) && !messageObject.isOut() ) || (((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) && messageObject.isOut())) { + //maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122); + maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(leftBound + 70); drawName = true; } else { maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(80); drawName = false; } } else { - if ((isChat || showAvatar) && !messageObject.isOut()) { - maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122); + if (( (isChat || showAvatar) && !messageObject.isOut() ) || (((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) && messageObject.isOut())) { + //maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122); + maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(leftBound + 70); drawName = true; } else { maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(80); @@ -350,10 +352,13 @@ public class ChatMessageCell extends ChatBaseCell { backgroundWidth = maxWidth; + //Log.e("setMessageObject 1", "backgroundWidth " + backgroundWidth+" layoutWidth " + layoutWidth); + super.setMessageObject(messageObject); backgroundWidth = messageObject.textWidth; totalHeight = messageObject.textHeight + AndroidUtilities.dp(19.5f) + namesOffset; + //Log.e("setMessageObject 2", "backgroundWidth " + backgroundWidth+" namesOffset " + namesOffset); int maxChildWidth = Math.max(backgroundWidth, nameWidth); maxChildWidth = Math.max(maxChildWidth, forwardedNameWidth); @@ -369,14 +374,18 @@ public class ChatMessageCell extends ChatBaseCell { if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && messageObject.messageOwner.media.webpage instanceof TLRPC.TL_webPage) { int linkPreviewMaxWidth; if (AndroidUtilities.isTablet()) { - if (currentMessageObject.messageOwner.to_id.chat_id != 0 && !currentMessageObject.isOut()) { - linkPreviewMaxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122); + //if (currentMessageObject.messageOwner.to_id.chat_id != 0 && !currentMessageObject.isOut()) { + if (( (currentMessageObject.messageOwner.to_id.chat_id != 0 || showAvatar) && !currentMessageObject.isOut() ) || (currentMessageObject.messageOwner.to_id.chat_id == 0 && showMyAvatar && currentMessageObject.isOut()) || (currentMessageObject.messageOwner.to_id.chat_id != 0 && showMyAvatarGroup && currentMessageObject.isOut()) ) { + //linkPreviewMaxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122); + linkPreviewMaxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(leftBound + 70); } else { linkPreviewMaxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(80); } } else { - if (currentMessageObject.messageOwner.to_id.chat_id != 0 && !currentMessageObject.isOut()) { - linkPreviewMaxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122); + //if (currentMessageObject.messageOwner.to_id.chat_id != 0 && !currentMessageObject.isOut()) { + if (( (currentMessageObject.messageOwner.to_id.chat_id != 0 || showAvatar) && !currentMessageObject.isOut() ) || (currentMessageObject.messageOwner.to_id.chat_id == 0 && showMyAvatar && currentMessageObject.isOut()) || (currentMessageObject.messageOwner.to_id.chat_id != 0 && showMyAvatarGroup && currentMessageObject.isOut())) { + //linkPreviewMaxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122); + linkPreviewMaxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(leftBound + 70); } else { linkPreviewMaxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(80); } @@ -649,6 +658,18 @@ public class ChatMessageCell extends ChatBaseCell { backgroundWidth = Math.max(maxChildWidth, messageObject.lastLineWidth + timeMore) + AndroidUtilities.dp(29); } } + //Plus + //Log.e("setMessageObject3", "totalHeight " + totalHeight + " namesOffset " + namesOffset + " messageObject.textHeight: " + messageObject.textHeight); + if( ( showAvatar && !isChat && !messageObject.isOut() ) || ((( (showMyAvatar && !isChat) || (showMyAvatarGroup && isChat)) && messageObject.isOut()))){ + if ((totalHeight < avatarSize)) { + totalHeight = avatarSize + AndroidUtilities.dp(10); + //Log.e("setMessageObject2","totalHeight "+totalHeight); + } + //totalHeight = messageObject.textHeight + AndroidUtilities.dp(19.5f) + namesOffset; + + } + + //Log.e("setMessageObject 3", "backgroundWidth " + backgroundWidth+" maxChildWidth " + maxChildWidth); } } @@ -662,10 +683,12 @@ public class ChatMessageCell extends ChatBaseCell { super.onLayout(changed, left, top, right, bottom); if (currentMessageObject.isOut()) { - textX = layoutWidth - backgroundWidth + AndroidUtilities.dp(10); + //textX = layoutWidth - backgroundWidth + AndroidUtilities.dp(10); + textX = layoutWidth - backgroundWidth + AndroidUtilities.dp(10) - ((showMyAvatar && !isChat) || (showMyAvatarGroup && isChat) ? AndroidUtilities.dp(leftBound) : 0); textY = AndroidUtilities.dp(10) + namesOffset; } else { - textX = AndroidUtilities.dp(19) + (isChat || showAvatar ? AndroidUtilities.dp(52) : 0); + //textX = AndroidUtilities.dp(19) + (isChat ? AndroidUtilities.dp(52) : 0); + textX = AndroidUtilities.dp(19) + (isChat || showAvatar ? AndroidUtilities.dp(leftBound) : 0); textY = AndroidUtilities.dp(10) + namesOffset; } } @@ -678,10 +701,12 @@ public class ChatMessageCell extends ChatBaseCell { } if (currentMessageObject.isOut()) { - textX = layoutWidth - backgroundWidth + AndroidUtilities.dp(10); + //textX = layoutWidth - backgroundWidth + AndroidUtilities.dp(10); + textX = layoutWidth - backgroundWidth + AndroidUtilities.dp(10) - ( (showMyAvatar && !isChat) || (showMyAvatarGroup && isChat) ? AndroidUtilities.dp(leftBound) : 0); textY = AndroidUtilities.dp(10) + namesOffset; } else { - textX = AndroidUtilities.dp(19) + (isChat || showAvatar ? AndroidUtilities.dp(52) : 0); + //textX = AndroidUtilities.dp(19) + (isChat ? AndroidUtilities.dp(52) : 0); + textX = AndroidUtilities.dp(19) + (isChat || showAvatar ? AndroidUtilities.dp(leftBound) : 0); textY = AndroidUtilities.dp(10) + namesOffset; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java index b68d7e24..ad87b36e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java @@ -36,35 +36,37 @@ public class DrawerActionCell extends FrameLayout { textView.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL); textView.setCompoundDrawablePadding(AndroidUtilities.dp(34)); addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.LEFT | Gravity.TOP, 14, 0, 16, 0)); + //updateTheme(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(48), MeasureSpec.EXACTLY)); + updateTheme(); } public void setTextAndIcon(String text, int resId) { textView.setText(text); - textView.setCompoundDrawablesWithIntrinsicBounds(resId, 0, 0, 0); + //textView.setCompoundDrawablesWithIntrinsicBounds(resId, 0, 0, 0); + int color = AndroidUtilities.getIntDef("drawerIconColor", 0xff737373); + getResources().getDrawable(resId).setColorFilter(color, PorterDuff.Mode.SRC_IN); + textView.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(resId), null, null, null); } - public void setTextAndIcon(String text, int resId, int color) { + public void setTextAndIcon(String text, Drawable drawable) { textView.setText(text); - Drawable d = getResources().getDrawable(resId); - d.setColorFilter(color, PorterDuff.Mode.SRC_IN); - textView.setCompoundDrawablesWithIntrinsicBounds(d, null, null, null); + textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); } - public void setTextColor(int color) { - textView.setTextColor(color); + private void updateTheme(){ + //Log.e("DrawerActionCell","updateTheme"); + textView.setTextColor(AndroidUtilities.getIntDef("drawerOptionColor", 0xff444444)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, AndroidUtilities.getIntDef("drawerOptionSize", 15)); + //Drawable[] drawables = textView.getCompoundDrawables(); + //if(drawables[0].getConstantState().equals(getResources().getDrawable(R.drawable.menu_themes).getConstantState())){ + // return; + //} + //int color = AndroidUtilities.getIntDef("drawerIconColor", 0xff737373); + //if(drawables[0] != null)drawables[0].setColorFilter(color, PorterDuff.Mode.SRC_IN); } - - public void setTextSize(int size) { - textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, size); - } -/* - public void setIconColor(int color) { - Drawable[] drawables = textView.getCompoundDrawables(); - if(drawables[0] != null)drawables[0].setColorFilter(color, PorterDuff.Mode.SRC_IN); - }*/ } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ResourceLoader.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ResourceLoader.java index da447a05..e59bb015 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ResourceLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ResourceLoader.java @@ -167,6 +167,24 @@ public class ResourceLoader { backgroundMediaDrawableInSelected = context.getResources().getDrawable(R.drawable.msg_in_4_photo_selected); backgroundMediaDrawableOut = context.getResources().getDrawable(R.drawable.msg_out_4_photo); backgroundMediaDrawableOutSelected = context.getResources().getDrawable(R.drawable.msg_out_4_photo_selected); + } else if(bubble.equals(ImageListActivity.getBubbleName(4))){ + backgroundDrawableIn = context.getResources().getDrawable(R.drawable.msg_in_5); + backgroundDrawableInSelected = context.getResources().getDrawable(R.drawable.msg_in_5_selected); + backgroundDrawableOut = context.getResources().getDrawable(R.drawable.msg_out_5); + backgroundDrawableOutSelected = context.getResources().getDrawable(R.drawable.msg_out_5_selected); + backgroundMediaDrawableIn = context.getResources().getDrawable(R.drawable.msg_in_5_photo); + backgroundMediaDrawableInSelected = context.getResources().getDrawable(R.drawable.msg_in_5_photo_selected); + backgroundMediaDrawableOut = context.getResources().getDrawable(R.drawable.msg_out_5_photo); + backgroundMediaDrawableOutSelected = context.getResources().getDrawable(R.drawable.msg_out_5_photo_selected); + } else if(bubble.equals(ImageListActivity.getBubbleName(5))){ + backgroundDrawableIn = context.getResources().getDrawable(R.drawable.msg_in_6); + backgroundDrawableInSelected = context.getResources().getDrawable(R.drawable.msg_in_6_selected); + backgroundDrawableOut = context.getResources().getDrawable(R.drawable.msg_out_6); + backgroundDrawableOutSelected = context.getResources().getDrawable(R.drawable.msg_out_6_selected); + backgroundMediaDrawableIn = context.getResources().getDrawable(R.drawable.msg_in_6_photo); + backgroundMediaDrawableInSelected = context.getResources().getDrawable(R.drawable.msg_in_6_photo_selected); + backgroundMediaDrawableOut = context.getResources().getDrawable(R.drawable.msg_out_6_photo); + backgroundMediaDrawableOutSelected = context.getResources().getDrawable(R.drawable.msg_out_6_photo_selected); } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java index 5fa21591..ccfc1f93 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java @@ -120,6 +120,9 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter @Override public void onFragmentDestroy() { super.onFragmentDestroy(); + //Plus to paint drawerAction icons (refresh drawerLayoutAdapter) + NotificationCenter.getInstance().postNotificationName(NotificationCenter.mainUserInfoChanged); + // NotificationCenter.getInstance().removeObserver(this, NotificationCenter.contactsDidLoaded); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.updateInterfaces); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.encryptedChatCreated); @@ -171,7 +174,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter } @Override - public void onSearchCollapse() { + public void onSearchCollapse() { searchListViewAdapter.searchDialogs(null); searching = false; searchWas = false; @@ -196,7 +199,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (listView != null) { listView.setAdapter(searchListViewAdapter); searchListViewAdapter.notifyDataSetChanged(); - if (android.os.Build.VERSION.SDK_INT >= 11) { + if (android.os.Build.VERSION.SDK_INT >= 11) { listView.setFastScrollAlwaysVisible(false); } listView.setFastScrollEnabled(false); @@ -309,7 +312,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (row < 0 || section < 0) { return; } - if ((!onlyUsers || chat_id != 0) && section == 0) { + if ((!onlyUsers || chat_id != 0) && section == 0) { if (needPhonebook) { if (row == 0) { try { @@ -321,10 +324,10 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter FileLog.e("tmessages", e); } } - } else if (chat_id != 0) { - if (row == 0) { - presentFragment(new GroupInviteActivity(chat_id)); - } + } else if (chat_id != 0) { + if (row == 0) { + presentFragment(new GroupInviteActivity(chat_id)); + } } else { if (row == 0) { if (!MessagesController.isFeatureEnabled("chat_create", ContactsActivity.this)) { @@ -392,7 +395,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter } }); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); - showDialog(builder.create()); + showDialog(builder.create()); } } } @@ -414,7 +417,6 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter } } }); - return fragmentView; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ImageListActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ImageListActivity.java index 8601ca91..c2de1ce4 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ImageListActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ImageListActivity.java @@ -27,7 +27,9 @@ public class ImageListActivity extends BaseFragment { "Telegram", "Lex", "Hangouts", - "Notepad" + "Notepad", + "Ed", + "Edge" }; Integer[] imgid ={ @@ -35,10 +37,14 @@ public class ImageListActivity extends BaseFragment { R.drawable.msg_in_2, R.drawable.msg_in_3, R.drawable.msg_in_4, + R.drawable.msg_in_5, + R.drawable.msg_in_6, R.drawable.msg_out, R.drawable.msg_out_2, R.drawable.msg_out_3, - R.drawable.msg_out_4 + R.drawable.msg_out_4, + R.drawable.msg_out_5, + R.drawable.msg_out_6 }; public static String getBubbleName(int i){ diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index ea696c55..0cacf3ed 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -1471,7 +1471,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa @Override @SuppressWarnings("unchecked") public void didReceivedNotification(int id, Object... args) { - //Log.e("didReceivedNotification",id+""); + //Log.e("didReceivedNotification", id + ""); if (id == NotificationCenter.appDidLogout) { if (drawerLayoutAdapter != null) { drawerLayoutAdapter.notifyDataSetChanged(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java index 87297541..56333b0c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java @@ -77,6 +77,8 @@ public class ThemingActivity extends BaseFragment { private int saveThemeRow; private int applyThemeRow; + private int dialogColorRow; + private int rowCount; public final static int CENTER = 0; @@ -88,6 +90,7 @@ public class ThemingActivity extends BaseFragment { rowCount = 0; generalSection2Row = rowCount++; themeColorRow = rowCount++; + dialogColorRow = rowCount++; screensSectionRow = rowCount++; screensSection2Row = rowCount++; @@ -161,11 +164,14 @@ public class ThemingActivity extends BaseFragment { @Override public void onItemClick(AdapterView adapterView, View view, final int i, long l) { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int defColor = preferences.getInt("themeColor", AndroidUtilities.defColor); + if (i == themeColorRow) { if (getParentActivity() == null) { return; } - SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + //SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); li.inflate(R.layout.colordialog, null, false); @@ -176,8 +182,22 @@ public class ThemingActivity extends BaseFragment { commitInt(color); } - },preferences.getInt("themeColor", AndroidUtilities.defColor), CENTER, 0, false); + }, defColor, CENTER, 0, false); + colorDialog.show(); + } else if (i == dialogColorRow) { + if (getParentActivity() == null) { + return; + } + //SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + 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("dialogColor", color); + } + },preferences.getInt("dialogColor", defColor), CENTER, 0, false); colorDialog.show(); } else if(i == saveThemeRow){ LayoutInflater li = LayoutInflater.from(getParentActivity()); @@ -187,7 +207,7 @@ public class ThemingActivity extends BaseFragment { final EditText userInput = (EditText) promptsView.findViewById(R.id.editTextDialogUserInput); userInput.setHint(LocaleController.getString("EnterName", R.string.EnterName)); userInput.setHintTextColor(0xff979797); - userInput.getBackground().setColorFilter(AndroidUtilities.getIntColor("themeColor"), PorterDuff.Mode.SRC_IN); + userInput.getBackground().setColorFilter(preferences.getInt("dialogColor", defColor), PorterDuff.Mode.SRC_IN); AndroidUtilities.clearCursorDrawable(userInput); //builder.setMessage(LocaleController.getString("EnterName", R.string.EnterName)); builder.setTitle(LocaleController.getString("SaveTheme", R.string.SaveTheme)); @@ -204,7 +224,7 @@ public class ThemingActivity extends BaseFragment { saving = false; if (getParentActivity() != null) { String pName = userInput.getText().toString(); - AndroidUtilities.setStringPref(getParentActivity(),"themeName", pName); + AndroidUtilities.setStringPref(getParentActivity(), "themeName", pName); try{ PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0); AndroidUtilities.setStringPref(getParentActivity(),"version", pInfo.versionName); @@ -349,6 +369,8 @@ public class ThemingActivity extends BaseFragment { } if (i == themeColorRow) { commitInt(AndroidUtilities.defColor); + } else if(i == dialogColorRow){ + resetPref("dialogColor"); } return true; } @@ -365,6 +387,26 @@ public class ThemingActivity extends BaseFragment { return fragmentView; } + private void resetPref(String key){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + SharedPreferences.Editor editor = preferences.edit(); + editor.remove(key); + editor.commit(); + if (listView != null) { + listView.invalidateViews(); + } + } + + private void commitInt(String key, int value){ + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt(key, value); + editor.commit(); + if (listView != null) { + listView.invalidateViews(); + } + } + private void commitInt(int i){ SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); SharedPreferences.Editor editor = preferences.edit(); @@ -395,6 +437,8 @@ public class ThemingActivity extends BaseFragment { editor.putInt("prefHeaderColor", i); + editor.putInt("dialogColor", i); + editor.commit(); fixLayout(); AndroidUtilities.themeColor = i; @@ -460,7 +504,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 == settingsRow || i == resetThemeRow || i == saveThemeRow || i == applyThemeRow; + return i == themeColorRow || i == dialogColorRow || i == chatsRow || i == chatRow || i == contactsRow || i == drawerRow || i == profileRow || i == settingsRow || i == resetThemeRow || i == saveThemeRow || i == applyThemeRow; } @Override @@ -545,8 +589,14 @@ public class ThemingActivity extends BaseFragment { view = new TextColorCell(mContext); } TextColorCell textCell = (TextColorCell) view; + + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE); + int defColor = preferences.getInt("themeColor", AndroidUtilities.defColor); + if (i == themeColorRow) { - textCell.setTextAndColor(LocaleController.getString("themeColor", R.string.themeColor), AndroidUtilities.getIntColor("themeColor"), false); + textCell.setTextAndColor(LocaleController.getString("themeColor", R.string.themeColor), defColor, true); + } else if (i == dialogColorRow) { + textCell.setTextAndColor(LocaleController.getString("DialogColor", R.string.DialogColor), preferences.getInt("dialogColor", defColor), false); } } @@ -567,7 +617,7 @@ public class ThemingActivity extends BaseFragment { else if ( i == resetThemeRow || i == saveThemeRow || i == applyThemeRow) { return 3; } - else if ( i == themeColorRow) { + else if ( i == themeColorRow || i == dialogColorRow) { return 4; } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java index 17080859..4ab6c1fb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java @@ -91,8 +91,14 @@ public class ThemingChatActivity extends BaseFragment { private int bubblesRow; private int avatarSizeRow; private int avatarAlignTopRow; + private int ownAvatarAlignTopRow; private int avatarMarginLeftRow; private int contactNameColorRow; + private int attachBGColorRow; + private int attachTextColorRow; + private int showContactAvatar; + private int showOwnAvatar; + private int showOwnAvatarGroup; private int rowCount; @@ -118,10 +124,17 @@ public class ThemingChatActivity extends BaseFragment { solidBGColorCheckRow = rowCount++; solidBGColorRow = rowCount++; + + showContactAvatar = rowCount++; + avatarAlignTopRow = rowCount++; + showOwnAvatar = rowCount++; + showOwnAvatarGroup = rowCount++; + ownAvatarAlignTopRow = rowCount++; avatarRadiusRow = rowCount++; avatarSizeRow = rowCount++; avatarMarginLeftRow = rowCount++; - avatarAlignTopRow = rowCount++; + + textSizeRow = rowCount++; rTextColorRow = rowCount++; rLinkColorRow = rowCount++; @@ -153,6 +166,9 @@ public class ThemingChatActivity extends BaseFragment { editTextBGColorRow = rowCount++; editTextIconsColorRow = rowCount++; + attachBGColorRow = rowCount++; + attachTextColorRow = rowCount++; + emojiViewBGColorRow = rowCount++; emojiViewTabColorRow = rowCount++; @@ -267,6 +283,50 @@ public class ThemingChatActivity extends BaseFragment { if (listView != null) { listView.invalidateViews(); } + } else if (i == ownAvatarAlignTopRow) { + boolean b = themePrefs.getBoolean( key, true); + SharedPreferences.Editor editor = themePrefs.edit(); + editor.putBoolean( key, !b); + editor.commit(); + if (view instanceof TextCheckCell) { + ((TextCheckCell) view).setChecked(!b); + } + if (listView != null) { + listView.invalidateViews(); + } + } else if (i == showContactAvatar) { + boolean b = themePrefs.getBoolean( key, true); + SharedPreferences.Editor editor = themePrefs.edit(); + editor.putBoolean( key, !b); + editor.commit(); + if (view instanceof TextCheckCell) { + ((TextCheckCell) view).setChecked(!b); + } + if (listView != null) { + listView.invalidateViews(); + } + } else if (i == showOwnAvatar) { + boolean b = themePrefs.getBoolean( key, true); + SharedPreferences.Editor editor = themePrefs.edit(); + editor.putBoolean( key, !b); + editor.commit(); + if (view instanceof TextCheckCell) { + ((TextCheckCell) view).setChecked(!b); + } + if (listView != null) { + listView.invalidateViews(); + } + } else if (i == showOwnAvatarGroup) { + boolean b = themePrefs.getBoolean( key, true); + SharedPreferences.Editor editor = themePrefs.edit(); + editor.putBoolean( key, !b); + editor.commit(); + if (view instanceof TextCheckCell) { + ((TextCheckCell) view).setChecked(!b); + } + if (listView != null) { + listView.invalidateViews(); + } } else if (i == solidBGColorRow) { if (getParentActivity() == null) { return; @@ -584,6 +644,34 @@ public class ThemingChatActivity extends BaseFragment { },themePrefs.getInt("chatEditTextBGColor", 0xffffffff), CENTER, 0, true); + colorDialog.show(); + } else if (i == attachBGColorRow) { + 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("chatAttachBGColor", color); + } + + },themePrefs.getInt("chatAttachBGColor", 0xffffffff), CENTER, 0, true); + colorDialog.show(); + } else if (i == attachTextColorRow) { + 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("chatAttachTextColor", color); + } + + },themePrefs.getInt("chatAttachTextColor", 0xff757575), CENTER, 0, true); colorDialog.show(); } else if (i == editTextIconsColorRow) { if (getParentActivity() == null) { @@ -931,6 +1019,10 @@ public class ThemingChatActivity extends BaseFragment { resetPref("chatEditTextSize"); } else if (i == editTextBGColorRow) { resetPref("chatEditTextBGColor"); + } else if (i == attachBGColorRow) { + resetPref("chatAttachBGColor"); + } else if (i == attachTextColorRow) { + resetPref("chatAttachTextColor"); } else if (i == emojiViewBGColorRow) { resetPref("chatEmojiViewBGColor"); } else if (i == emojiViewTabColorRow) { @@ -1045,10 +1137,10 @@ public class ThemingChatActivity extends BaseFragment { @Override public boolean isEnabled(int i) { 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 == solidBGColorCheckRow || AndroidUtilities.getBoolPref("chatSolidBGColorCheck") && i == solidBGColorRow || i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow || i == avatarAlignTopRow || i == ownAvatarAlignTopRow || i == showContactAvatar || i == showOwnAvatar || i == showOwnAvatarGroup || 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 == contactNameColorRow || i == forwardRightNameColorRow || i == forwardLeftNameColorRow || - i == editTextSizeRow || i == editTextColorRow || i == editTextIconsColorRow || i == sendColorRow || i == editTextBGColorRow || + i == editTextSizeRow || i == editTextColorRow || i == editTextIconsColorRow || i == sendColorRow || i == editTextBGColorRow || i == attachBGColorRow || i == attachTextColorRow || i == emojiViewBGColorRow || i == emojiViewTabColorRow; } @@ -1145,6 +1237,18 @@ public class ThemingChatActivity extends BaseFragment { } else if (i == avatarAlignTopRow) { textCell.setTag("chatAvatarAlignTop"); textCell.setTextAndCheck(LocaleController.getString("AvatarAlignTop", R.string.AvatarAlignTop), themePrefs.getBoolean("chatAvatarAlignTop", false), true); + } else if (i == ownAvatarAlignTopRow) { + textCell.setTag("chatOwnAvatarAlignTop"); + textCell.setTextAndCheck(LocaleController.getString("OwnAvatarAlignTop", R.string.OwnAvatarAlignTop), themePrefs.getBoolean("chatOwnAvatarAlignTop", false), true); + } else if (i == showContactAvatar) { + textCell.setTag("chatShowContactAvatar"); + textCell.setTextAndCheck(LocaleController.getString("ShowContactAvatar", R.string.ShowContactAvatar), themePrefs.getBoolean("chatShowContactAvatar", false), true); + } else if (i == showOwnAvatar) { + textCell.setTag("chatShowOwnAvatar"); + textCell.setTextAndCheck(LocaleController.getString("ShowOwnAvatar", R.string.ShowOwnAvatar), themePrefs.getBoolean("chatShowOwnAvatar", false), true); + } else if (i == showOwnAvatarGroup) { + textCell.setTag("chatShowOwnAvatarGroup"); + textCell.setTextAndCheck(LocaleController.getString("ShowOwnAvatarGroup", R.string.ShowOwnAvatarGroup), themePrefs.getBoolean("chatShowOwnAvatarGroup", false), true); } } else if (type == 3){ @@ -1212,6 +1316,10 @@ public class ThemingChatActivity extends BaseFragment { textCell.setTextAndColor(LocaleController.getString("EditTextColor", R.string.EditTextColor), themePrefs.getInt("chatEditTextColor", 0xff000000), true); } else if (i == editTextBGColorRow) { textCell.setTextAndColor(LocaleController.getString("EditTextBGColor", R.string.EditTextBGColor), themePrefs.getInt("chatEditTextBGColor", 0xffffffff), true); + } else if (i == attachBGColorRow) { + textCell.setTextAndColor(LocaleController.getString("AttachBGColor", R.string.AttachBGColor), themePrefs.getInt("chatAttachBGColor", 0xffffffff), true); + } else if (i == attachTextColorRow) { + textCell.setTextAndColor(LocaleController.getString("AttachTextColor", R.string.AttachTextColor), themePrefs.getInt("chatAttachTextColor", 0xff757575), true); } else if (i == editTextIconsColorRow) { textCell.setTag("chatEditTextIconsColor"); textCell.setTextAndColor(LocaleController.getString("EditTextIconsColor", R.string.EditTextIconsColor), themePrefs.getInt("chatEditTextIconsColor", 0xffadadad), true); @@ -1239,10 +1347,10 @@ 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 == contactNameColorRow || i == forwardRightNameColorRow || i == forwardLeftNameColorRow || - i == sendColorRow || i == editTextColorRow || i == editTextBGColorRow || i == editTextIconsColorRow || + i == sendColorRow || i == editTextColorRow || i == editTextBGColorRow || i == editTextIconsColorRow || i == attachBGColorRow || i == attachTextColorRow || i == emojiViewBGColorRow || i == emojiViewTabColorRow) { return 3; - } else if (i == solidBGColorCheckRow || i == memberColorCheckRow || i == avatarAlignTopRow) { + } else if (i == solidBGColorCheckRow || i == memberColorCheckRow || i == avatarAlignTopRow || i == ownAvatarAlignTopRow || i == showContactAvatar || i == showOwnAvatar || i == showOwnAvatarGroup) { return 4; } else { diff --git a/TMessagesProj/src/main/res/drawable-hdpi/Thumbs.db b/TMessagesProj/src/main/res/drawable-hdpi/Thumbs.db index 414c179f..f7ed22e0 100644 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/Thumbs.db and b/TMessagesProj/src/main/res/drawable-hdpi/Thumbs.db differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/Thumbs.db b/TMessagesProj/src/main/res/drawable-mdpi/Thumbs.db index 9c426f6f..7338b4aa 100644 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/Thumbs.db and b/TMessagesProj/src/main/res/drawable-mdpi/Thumbs.db differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/Thumbs.db b/TMessagesProj/src/main/res/drawable-xhdpi/Thumbs.db index ab3f3987..eb66f5ba 100644 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/Thumbs.db and b/TMessagesProj/src/main/res/drawable-xhdpi/Thumbs.db differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/Thumbs.db b/TMessagesProj/src/main/res/drawable-xxhdpi/Thumbs.db index ec307594..380295e7 100644 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/Thumbs.db and b/TMessagesProj/src/main/res/drawable-xxhdpi/Thumbs.db differ diff --git a/TMessagesProj/src/main/res/drawable-xxxhdpi/Thumbs.db b/TMessagesProj/src/main/res/drawable-xxxhdpi/Thumbs.db index a64b9e82..0dfd537d 100644 Binary files a/TMessagesProj/src/main/res/drawable-xxxhdpi/Thumbs.db and b/TMessagesProj/src/main/res/drawable-xxxhdpi/Thumbs.db differ diff --git a/TMessagesProj/src/main/res/values-ar/strings.xml b/TMessagesProj/src/main/res/values-ar/strings.xml index cdffbf72..e0e6962e 100644 --- a/TMessagesProj/src/main/res/values-ar/strings.xml +++ b/TMessagesProj/src/main/res/values-ar/strings.xml @@ -835,7 +835,7 @@ %1$s الساعة %2$s تم تحديث تيليجرام نسخة الأندرويد. الجديد في النسخة رقم 3.1:\n\n- بحث عن الرسائل داخل محادثات محددة. \n- إعادة تصميم كاملة لشاشة ارفاق الملفات. إرسال جهات اتصال وملفات صوتية مباشرة من خيار المرفقات. \n- تطوير لتشغيل الوسائط داخل التطبيق (يوتيوب, ڤيميو, ساوندكلاود وغيرها.),.\n\nللاستزادة، اطلع هنا:\nhttps://telegram.org/blog/search-and-media - 583 + 586 بلاس مسنجر للأندرويد diff --git a/TMessagesProj/src/main/res/values-ca/strings.xml b/TMessagesProj/src/main/res/values-ca/strings.xml index a2e3667b..3d62e882 100644 --- a/TMessagesProj/src/main/res/values-ca/strings.xml +++ b/TMessagesProj/src/main/res/values-ca/strings.xml @@ -953,4 +953,8 @@ Color del resum/subtítol Color del text «Foto/Adhesiu» Voleu veure alguns temes creats per altes usuaris de Plus Messenger? + Usa la font del dispositiu + Plus Messenger es reiniciarà + Color de la icona de grup + Color del nom de contacte compartit diff --git a/TMessagesProj/src/main/res/values-de/strings.xml b/TMessagesProj/src/main/res/values-de/strings.xml index 8ebca550..f5816297 100644 --- a/TMessagesProj/src/main/res/values-de/strings.xml +++ b/TMessagesProj/src/main/res/values-de/strings.xml @@ -835,10 +835,10 @@ %1$s um %2$s Plus Messenger für Android wurde aktualisiert. Neu in Version 3.1:\n\n- Direkte Suche in Chats.\n- In Chats versteckt sich ein komplett neues Menü hinter der Büroklammer. Nun kann man dort auch Musik und Kontakte versenden.\n- In-App Medienwiedergabe für YouTube, Vimeo, SoundCloud, etc. optimiert und neuer Player für Audiodateien.\n\nMehr dazu unter:\nhttps://telegram.org/blog/search-and-media - 583 - -\n\nNew in 3.0.1.3:\n\n- Option in den Einstellungen Systemschrift verwenden\n- Option Suchen im Chat/Gruppe\n- Hinzugefügt: MOD Farbe Kopfzeile , Titelfarbe Kopfzeile und Symbolefarbe in Farbeinstellungen ändern / Themen bearbeiten\n- MOD Gruppen Symbol Farbe in der Chatübersicht ändern\n- MOD Symbolgröße in Navigationsmenü ändern \n- Fehlerbehebung--> +\n\nNeu in 3.1.1.6:\n\n- Neuer MOD Zeige eigenes Profilbild im Gruppenchat \n- Neuer MOD eigenes Profilbild nach oben ausrichten\n- Hinzugefügt MOD Farbe der Dialogtitel/Taste ändern\n- Fehlerbehebung Plus Messenger für Android Themen bearbeiten Ungültiger Hex-Code! @@ -867,8 +867,8 @@ Benachrichtigungszähler Hintergrund Hintergrund Benachrichtigungszähler - Onlinestatus - Onlinestatus + Online Status + Online Status rechte Sprechblasen linke Sprechblasen Datum @@ -884,7 +884,7 @@ Hintergrund Texteingabefeld Hintergrund Emojis Tab Emojis - Onlinestatus + Online Musik Thema speichern Thema im Ordner Telegram/Themen speichern @@ -941,9 +941,9 @@ Sprechblasen Form original Dateinamen speichern Statt Zahlen wird Dateiname_Datum gespeichert - Profilbild Gruppenchat - Profilbild Gruppenchat nach oben - Profilbild Randabstand Gruppenchat + Profilbild Rand + Kontakt Profibild nach oben + Profilbild Rand Gruppenname Gruppenname Name (unbekannte Nummer) @@ -965,4 +965,12 @@ Systemschrift verwenden Der Plus Messenger wird neu gestartet Gruppensymbole + gemeinsame Kontaktnamen + Hintergrundfarbe Anhang + Textfarbe Anhang + Zeigt Kontakt Profilbild im Chat + Zeige eigenes Profilbild im Chat + Zeige eigenes Profilbild im Gruppenchat + Eigenes Profilbild nach oben + Dialog Titel/Schaltfläche \ 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 36da5c70..3e147645 100644 --- a/TMessagesProj/src/main/res/values-es/strings.xml +++ b/TMessagesProj/src/main/res/values-es/strings.xml @@ -835,9 +835,9 @@ %1$s a las %2$s Plus Messenger para Android fue actualizada. Novedades en la versión 3.1:\n\n- Busca mensajes dentro de un chat en específico.\n- Menú para adjuntar completamente rediseñado. Envía contactos y archivos de audio directamente desde el menú para adjuntar.\n- Reproducción de multimedia dentro de la aplicación mejorada (YouTube, Vimeo, SoundCloud etc.), nuevo reproductor para archivos de audio largos.\n\nMás sobre esta actualización:\nhttps://telegram.org/blog/search-and-media - 583 + 586 - \n\nNovedades en 3.1.1.3:\n\n- Nuevo MOD para ajustar color de estado en pantalla Ajustes\n- Solución de errores + \n\nNovedades en 3.1.1.6:\n\n- Nuevo MOD para mostrar foto de contacto en pantalla chat\n- Nuevo MOD para mostrar foto propia en pantalla de chat y grupo\n- Nuevo MOD para alinear foto propia arriba de bocadillo en chat\n- Añadidos nuevos bocadillos Ed y Edge (gracias a Edwin Macalopu)\n- Nuevo MOD para ajustar color de fondo y de texto en vista adjuntar en pantalla chat\n- Nuevo MOD para ajustar color de título y botón de diálogo\n- Solución de errores Plus Messenger para Android Tematización ¡Color hexadecimal inválido! @@ -941,8 +941,8 @@ Mantener nombre de archivo original En lugar de solo números los archivos se guardarán usando el formato nombre_fecha Tamaño de avatar - Alinear avatar arriba - Margen izquierdo de avatar + Alinear foto de contacto arriba + Margen lateral de avatar Color de nombre de grupo Tamaño de nombre de grupo Color de nombre (nº desconocido) @@ -965,4 +965,11 @@ Plus Messenger se reiniciará Color de icono de grupo Color de nombre de contacto compartido + Color de fondo de adjuntar + Color de texto de adjuntar + Muestra foto de contacto en chat + Muestra foto propia en chat + Muestra foto propia en grupo + Alinear foto propia arriba + Color de título/botón de diálogo \ 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 19f7879a..e2407822 100644 --- a/TMessagesProj/src/main/res/values-fr/strings.xml +++ b/TMessagesProj/src/main/res/values-fr/strings.xml @@ -832,7 +832,7 @@ %1$s à %2$s - 583 + 586 Plus Messenger pour Android Thème diff --git a/TMessagesProj/src/main/res/values-hi/strings.xml b/TMessagesProj/src/main/res/values-hi/strings.xml index 3d7bacae..20a9f5ff 100644 --- a/TMessagesProj/src/main/res/values-hi/strings.xml +++ b/TMessagesProj/src/main/res/values-hi/strings.xml @@ -515,7 +515,7 @@ %1$s पर %2$s Plus Messenger for Android has been updated. New in Version 3.0:\n\n\n\n- Dedicated tabs for each one of your custom sticker sets in the sticker panel. Add custom stickers like https://telegram.me/addstickers/Animals\n- New bot API, free for everyone. If you\'re an engineer, create your own bots for games, services or integrations. Learn more at https://telegram.org/blog/bot-revolution\n https://play.google.com/store/apps/details?id=es.rafalense.themes - 583 + 586 Android के लिए प्लस मैसेंजर @@ -535,7 +535,7 @@ वार्तालाप की सूची वार्तालापों की सूची संपर्क लिस्ट - हैडर रंग + हैडर का रंग नाम का रंग नाम का माप संदेश का रंग @@ -641,4 +641,7 @@ सारांश/उपशीर्षक का रंग फोटो/स्टीकर के शब्दों का रंग क्या आप प्लस मैसेंजर के दूसरे उपभोग्ताओं द्वारा बनायीं गयी थीम देखना पसंद करेंगे? + फ़ोन की लिपि दिखाए + प्लस मैसेंजर पुनप्रारंभ होरहा है + समूह चिह्नों का रंग diff --git a/TMessagesProj/src/main/res/values-it/strings.xml b/TMessagesProj/src/main/res/values-it/strings.xml index 34340b36..6a6c924b 100644 --- a/TMessagesProj/src/main/res/values-it/strings.xml +++ b/TMessagesProj/src/main/res/values-it/strings.xml @@ -835,9 +835,10 @@ %1$s alle %2$s Plus Messenger per Android si è aggiornato. Nuovo nella versione 3.1:\n\n- Cerca messaggi all\'interno di una specifica chat.\n- Menu degli allegati completamente ridisegnato. Invia contatti e audio direttamente dal menu degli allegati.\n- Riproduzione in-app migliorata (YouTube, Vimeo, SoundCloud etc.), nuovo player per i file audio.\n\nMaggiori informazioni su questo aggiornamento:\nhttps://telegram.org/blog/search-and-media - 583 - + 586 + + +\n\nNovità 3.1.1.6:\n\n- Nuova MOD per visualizzare il proprio avatar nella schermata del gruppo\n- Nuova MOD per allineare il proprio avatar all\'intestazione\n- Aggiunta MOD per cambiare il colore di titolo e pulsante dei dialog\n- Correzioni bug Plus Messenger per Android Personalizzazione Codice del colore esadecimale non valido! @@ -941,8 +942,8 @@ Mantieni il nome originale del file I file verranno salvati usando il formato nome_data anziché solo il numero Dimensione avatar - Allinea l\'avatar in cima - Margine a sinistra dell\'avatar + Allinea l\'avatar del contatto all\'intestazione + Margine avatar Colore del nome del gruppo Dimensione del nome del gruppo Colore del nome (numero sconosciuto) @@ -964,4 +965,12 @@ Usa il font di sistema Plus Messenger si riavvierà Colore dell\'icona del gruppo + Colore del nome del contatto condiviso + Colore di sfondo del pannello degli allegati + Colore del testo del pannello degli allegati + Mostra l\'avatar del contatto nella schermata delle chat + Mostra il proprio avatar nella schermata della chat + Visualizza il proprio avatar nella schermata del gruppo + Allinea il proprio avatar all\'intestazione + Colore titolo/pulsante dei dialog \ 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 1d288d64..930bba57 100644 --- a/TMessagesProj/src/main/res/values-ko/strings.xml +++ b/TMessagesProj/src/main/res/values-ko/strings.xml @@ -835,5 +835,5 @@ %1$s %2$s 텔레그램 안드로이드 버전이 업데이트 되었습니다. 새로운 버전은 3.1 입니다:\n\n- 특정 대화창에서 검색. \n- 첨부 메뉴 개선. 해당 메뉴에서 바로 연락처, 오디오를 전송 가능. \n- 인앱 미디어 재생 기능 향상 (YouTube, Vimeo, SoundCloud etc). 대용량 오디오 파일 별도 플레이어 기능. \n\nhttps://telegram.org/blog/search-and-media에서 자세한 사항을 알아보세요. - 583 + 586 \ 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 8c3bd697..0cd09169 100644 --- a/TMessagesProj/src/main/res/values-nl/strings.xml +++ b/TMessagesProj/src/main/res/values-nl/strings.xml @@ -835,7 +835,7 @@ %1$s om %2$s Plus Messenger voor Android is bijgewerkt. Nieuw in versie 3.1:\n\n- Zoek naar berichten in een specifieke chat.\n- Volledig opnieuw ontworpen bijlagemenu. Verstuur contacten en audiobestanden rechtstreeks vanuit het bijlagemenu.\n- Afspelen van media in de app verbeterd (YouTube, Vimeo, SoundCloud, etc.), nieuwe speler voor grote audiobestanden.\n\nMeer weten? Kijk op:\nhttps://telegram.org/blog/search-and-media - 583 + 586 Plus Messenger voor Android diff --git a/TMessagesProj/src/main/res/values-pt-rBR/strings.xml b/TMessagesProj/src/main/res/values-pt-rBR/strings.xml index e5be1c22..da848a2c 100644 --- a/TMessagesProj/src/main/res/values-pt-rBR/strings.xml +++ b/TMessagesProj/src/main/res/values-pt-rBR/strings.xml @@ -835,9 +835,9 @@ %1$s às %2$s Plus Messenger para Android foi atualizado. Novo na versão 3.1:\n\n- Busca por mensagens dentro de um chat específico.\n-Menu de anexo totalmente redesenhado. Envie contatos e arquivos de áudio diretamente do menu de anexo.\n- Reprodução melhorada de mídia dentro do aplicativo (YouTube, Vimeo, SoundCloud, etc.), novo player para grandes arquivos de áudio.\n\nMais sobre a atualização:\nhttps://telegram.org/blog/search-and-media - 583 + 586 - \n\nNovidades na versão 3.1.1.3:\n\n- Novo MOD para mudar a cor, tamanho e arredondamento do avatar nas configurações\n- Novo MOD para mudar a cor do nome de contatos compartilhados na tela de conversas\n- Correção de bugs + \n\nNovo em 3.1.1.6:\n\n- Novo MOD para mostrar o próprio avatar na tela de grupos\n- Novo MOD para alinhar o próprio avatar no topo\n- Adicionado o MOD para mudar a cor do titulo do dialogo e botão\n- Concertos de Bugs Plus Messenger para Android Personalização Código de cor hexadecimal inválido! @@ -941,8 +941,8 @@ Manter Nome de Arquivo Original Ao invés de apenas números, os arquivos serão salvos no formato nome_data Tamanho do Avatar - Alinhar Avatar ao Topo - Margem Esquerda do Avatar + Alinhar avatar do contato no topo + Margem do Avatar Cor do Nome do Grupo Tamanho do Nome do Grupo Cor do Nome (Número Desconhecido) @@ -965,4 +965,11 @@ O Plus Messenger irá reiniciar Cor do Ícone de Grupo Cor do Nome do Contato Compartilhado + Atribuir a cor do fundo + Atribuir à cor do texto + Mostrar avatar do contato na tela de conversa + Mostrar o próprio avatar na tela de conversa + Mostrar o próprio avatar na tela de grupo + Alinhar o próprio avatar no topo + Cor do titulo/botão de dialogo \ 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 b91f4e55..e67a663e 100644 --- a/TMessagesProj/src/main/res/values-pt-rPT/strings.xml +++ b/TMessagesProj/src/main/res/values-pt-rPT/strings.xml @@ -835,7 +835,7 @@ %1$s às %2$s Plus Messenger para Android foi atualizado. Novo na versão 3.1:\n\n- Busca por mensagens dentro de um chat específico.\n-Menu de anexo totalmente redesenhado. Envie contatos e arquivos de áudio diretamente do menu de anexo.\n- Reprodução melhorada de mídia dentro do aplicativo (YouTube, Vimeo, SoundCloud, etc.), novo player para grandes arquivos de áudio.\n\nMais sobre a atualização:\nhttps://telegram.org/blog/search-and-media - 583 + 586 Plus Messenger para Android Temas diff --git a/TMessagesProj/src/main/res/values-ru/strings.xml b/TMessagesProj/src/main/res/values-ru/strings.xml index 13f907a8..8f709aad 100644 --- a/TMessagesProj/src/main/res/values-ru/strings.xml +++ b/TMessagesProj/src/main/res/values-ru/strings.xml @@ -832,7 +832,7 @@ %1$s в %2$s Plus Messenger для Android обновлён. Новое в версии 3.1:\n\n- Поиск сообщений внутри конкретного чата.\n- Полностью переработано меню вложений. Отправка контактов и аудиофайлов прямо из меню вложений.\n- Улучшено воспроизведение медиа в приложении (YouTube, Vimeo, SoundCloud и др.), новый плеер для больших аудиофайлов.\n\nБольше об этом обновлении:\nhttps://telegram.org/blog/search-and-media - 583 + 586 Plus Messenger для Android Кастомизация diff --git a/TMessagesProj/src/main/res/values-tr/strings.xml b/TMessagesProj/src/main/res/values-tr/strings.xml index 7b4767d5..50c0c36f 100644 --- a/TMessagesProj/src/main/res/values-tr/strings.xml +++ b/TMessagesProj/src/main/res/values-tr/strings.xml @@ -395,10 +395,10 @@ SS:dd Plus Messenger için temalar indirin ve uygulayın. Hergün yeni temalar ekleniyor:\n https://play.google.com/store/apps/details?id=es.rafalense.themes - 583 + 586 +\n\nNew in 3.1.1.6:\n\n- Yeni MOD sohbet ekranında konuşmacıların profil fotoğrafları artık görünür olarak ayarlanıyor\n- Yeni balon eklendi (Teşekkürler bay Edwin Macalopu)\n- Yeni MOD sohbet ekranına duvar kağıdı ve yazı rengi eklenebiliniyor.\n- Küçük hata düzeltmeleri yapıldı ama Türkler sizin için saatin düzeldiği sözünü henüz veremem k bakmayın, ihsan.--> Android için Plus Messenger Tema Geçersiz renk hex kodu! @@ -502,7 +502,7 @@ Orijinal dosya ismini tut Dosyalar sadece sayısal değer yerine isim_tarih şeklinde isimlendirilerek kaydedilecek Avatar Boyutu - Avatarı Üste Hizala + Fotoğrafı başa hizala Avatar Sol Kenar Boşluğu Grup isim rengi Grup isim boyutu @@ -525,4 +525,12 @@ Aygıt yazı tipini kullan Plus Messenger yeniden başlayacak Grup ikon rengi + Paylaşılan kişi ismi rengi + Arka plan rengi ekle + Metin rengi ekle + Kişi fotoğrafını sohbet ekranda göster + Sohbette kendi fotoğrafını göster + Grupta kendi fotoğrafını göster + Fotoğrafını başa hizala + Başlık/buton rengi diff --git a/TMessagesProj/src/main/res/values-zh-rCN/strings.xml b/TMessagesProj/src/main/res/values-zh-rCN/strings.xml index ae14b622..df3c170b 100644 --- a/TMessagesProj/src/main/res/values-zh-rCN/strings.xml +++ b/TMessagesProj/src/main/res/values-zh-rCN/strings.xml @@ -804,7 +804,7 @@ %1$s 的 %2$s Android 版的 Plus Messenger 已更新。最新版本 3.1 的新增功能有:\n\n- 在特定聊天中搜索消息内容。\n- 全新设计的附件选择菜单。从附件选择菜单中直接发送联系人资料或语音文件。\n- 改进的程序内媒体播放功能 (YouTube, Vimoe, Soundcloud 等), 新播放器适用于大型语音文件。\n\n更多更新请查看:\nhttps://telegram.org/blog/search-and-media - 583 + 586 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 0accde7b..872335fc 100644 --- a/TMessagesProj/src/main/res/values-zh-rTW/strings.xml +++ b/TMessagesProj/src/main/res/values-zh-rTW/strings.xml @@ -808,10 +808,10 @@ %1$s 於時間 %2$s Android 版的 Plus Messenger 已經更新。在版本 3.1 的新功能:\n\n- 在特定的聊天室裡搜尋訊息。\n- 完全重新設計的附件選單。從附件選單直接傳送「聯絡人」資訊和「音訊檔」。\n- 改進的程式內媒體播放( YouTube、Vimoe、SoundCloud 等 ),新的播放器適用於大型音訊檔。\n\n更多關於這次的更新:\nhttps://telegram.org/blog/search-and-media - 583 - -\n\n在 3.0.1.3 版的新功能:\n\n- 在「設定」中使用手機字型的選項\n- 在聊天室/群組聊天室內部搜尋的選項\n- 加入模組以變更在「設定」與「自製佈景主題」中的標頭顏色、標頭標題顏色和標頭圖示顏色\n- 模組用於變更在主畫面中群組圖示的顏色\n- 模組用於在導航選單變更大頭照大小\n- 錯誤修正--> +\n\n在 3.1.1.6 版的新功能:\n\n- 新的模組在聊天畫面顯示擁有的大頭照\n- 加入新的泡泡邊緣 (感謝 Edwin Macalopu)\n- 錯誤修復 適用於 Android 的 Plus Messenger 自製佈景主題 無效的十六進位顏色代碼! @@ -938,4 +938,10 @@ 使用裝置字型 Plus Messenger 將重新啟動 群組圖示顏色 + 共享聯絡人名稱的顏色 + 附加背景顏色 + 附加文字顏色 + 在聊天畫面中顯示聯絡人大頭照 + 在聊天畫面中顯示擁有的大頭照 + 對齊擁有的大頭照到頂端 diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index 62c52db1..9f8fad6f 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -836,9 +836,9 @@ %1$s at %2$s Plus Messenger for Android has been updated. New in version 3.1:\n\n- Search for messages inside a specific chat.\n- Fully redesigned attachment menu. Send contacts and audio files straight from the attachment menu.\n- Improved in-app media playback (YouTube, Vimeo, SoundCloud etc.), new player for large audio files.\n\nMore about this update:\nhttps://telegram.org/blog/search-and-media - 583 + 586 - \n\nNew in 3.1.1.3:\n\n- New MOD to change status color in Settings screen\n- Bug fixes + \n\nNew in 3.1.1.6:\n\n- New MOD to show contact avatar in chat screen\n- New MOD to show own avatar in chat and group screen\n- New MOD to align own avatar to top\n- Added new bubbles Ed and Edge (thanks to Edwin Macalopu)\n- New MOD to change background and text color in attach view in chat screen\n- Added MOD to change color of dialog title and button\n- Bug fixes Plus Messenger for Android Theming Invalid color hex code! @@ -942,8 +942,8 @@ Keep original filename Instead of just numbers files will be saved using name_date format Avatar size - Align avatar to top - Avatar left margin + Align contact avatar to top + Avatar margin Group name color Group name size Name color (unknown number) @@ -966,4 +966,11 @@ Plus Messenger will restart Group icon color Shared contact name color + Attach background color + Attach text color + Show contact avatar in chat screen + Show own avatar in chat screen + Show own avatar in group screen + Align own avatar to top + Dialog title/button color \ No newline at end of file