diff --git a/README.md b/README.md index d4ac7516..00bbc71a 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ It adds some extra features to the official Telegram app: **THEMING:** Change colors and sizes of many objects as texts, icons, headers... and create your own theme. Save your theme and share it easily with your friends. -Apply themes shared by other users +Apply themes shared by other users. **MEDIA:** Audio files can be shared easily from Chat Screen **PRIVACY:** Mobile number can be hidden from Menu Drawer and Settings menu -**SOCIAL:** Get in touch with other Telegram+ users trough [our Google+ community](https://plus.google.com/communities/106927015963860485525) +**SOCIAL:** Get in touch with other Telegram+ users through [our Google+ community](https://plus.google.com/communities/106927015963860485525) This repo contains the source code for [Telegram+ App for Android](https://play.google.com/store/apps/details?id=org.telegram.plus). @@ -22,3 +22,8 @@ This repo contains the source code for [Telegram+ App for Android](https://play. First of all, take a look at **src/main/java/org/telegram/messenger/BuildVars.java** and fill it with correct values. Import the root folder into your IDE (tested on Android Studio), then run project. + +### LOCALIZATION + +Join our translation project if you want to collaborate: https://www.transifex.com/projects/p/telegramplus/ + diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index d4442960..703f88bc 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -88,7 +88,7 @@ android { applicationId "org.telegram.plus" minSdkVersion 8 targetSdkVersion 21 - versionCode 458 - versionName "2.5.2.1" + versionCode 459 + versionName "2.5.2.2" } } diff --git a/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java b/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java index 56ae07aa..68284b3b 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java +++ b/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java @@ -613,9 +613,9 @@ public class AndroidUtilities { return themePrefs.getInt(key, def); } - public static int getIntAlphaColor(String key, float factor){ + public static int getIntAlphaColor(String key, int def, float factor){ SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(THEME_PREFS, Activity.MODE_PRIVATE); - int color = themePrefs.getInt(key, defColor); + int color = themePrefs.getInt(key, def); int alpha = Math.round(Color.alpha(color) * factor); int red = Color.red(color); int green = Color.green(color); @@ -677,9 +677,9 @@ public class AndroidUtilities { e.commit(); } - public static boolean getBoolPref(Context context,String key){ + public static boolean getBoolPref(String key){ boolean s = false; - if (context.getSharedPreferences(THEME_PREFS, 0).getBoolean(key, false)) s=true; + if (ApplicationLoader.applicationContext.getSharedPreferences(THEME_PREFS, 0).getBoolean(key, false)) s=true; return s; } @@ -746,7 +746,7 @@ public class AndroidUtilities { public static Drawable paintDrawable(Context c, int resId, int resIdW, String color){ Drawable d = c.getResources().getDrawable(resId); if(color.contains("_check")){ - if(getBoolPref(c, color)){ + if(getBoolPref(color)){ d = c.getResources().getDrawable(resIdW); d.setColorFilter(getIntPref(c, color.replace("_check", "_picker")), PorterDuff.Mode.MULTIPLY); } diff --git a/TMessagesProj/src/main/java/org/telegram/android/LocaleController.java b/TMessagesProj/src/main/java/org/telegram/android/LocaleController.java index 1d2094bc..8c75b94d 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/LocaleController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/LocaleController.java @@ -158,6 +158,22 @@ public class LocaleController { "tr", "vi", "wo", "yo", "zh", "bo", "dz", "id", "jv", "ka", "km", "kn", "ms", "th"}, new PluralRules_None()); LocaleInfo localeInfo = new LocaleInfo(); + localeInfo.name = "Català"; + localeInfo.nameEnglish = "Catalan"; + localeInfo.shortName = "ca"; + localeInfo.pathToFile = null; + sortedLanguages.add(localeInfo); + languagesDict.put(localeInfo.shortName, localeInfo); + + localeInfo = new LocaleInfo(); + localeInfo.name = "Deutsch"; + localeInfo.nameEnglish = "German"; + localeInfo.shortName = "de"; + localeInfo.pathToFile = null; + sortedLanguages.add(localeInfo); + languagesDict.put(localeInfo.shortName, localeInfo); + + localeInfo = new LocaleInfo(); localeInfo.name = "English"; localeInfo.nameEnglish = "English"; localeInfo.shortName = "en"; @@ -166,10 +182,9 @@ public class LocaleController { languagesDict.put(localeInfo.shortName, localeInfo); localeInfo = new LocaleInfo(); - localeInfo.name = "Italiano"; - localeInfo.nameEnglish = "Italian"; - localeInfo.shortName = "it"; - localeInfo.pathToFile = null; + localeInfo.name = "Français"; + localeInfo.nameEnglish = "French"; + localeInfo.shortName = "fr"; sortedLanguages.add(localeInfo); languagesDict.put(localeInfo.shortName, localeInfo); @@ -181,13 +196,20 @@ public class LocaleController { languagesDict.put(localeInfo.shortName, localeInfo); localeInfo = new LocaleInfo(); - localeInfo.name = "Deutsch"; - localeInfo.nameEnglish = "German"; - localeInfo.shortName = "de"; - localeInfo.pathToFile = null; + localeInfo.name = "Galego"; + localeInfo.nameEnglish = "Galician"; + localeInfo.shortName = "gl"; sortedLanguages.add(localeInfo); languagesDict.put(localeInfo.shortName, localeInfo); + localeInfo = new LocaleInfo(); + localeInfo.name = "Italiano"; + localeInfo.nameEnglish = "Italian"; + localeInfo.shortName = "it"; + localeInfo.pathToFile = null; + sortedLanguages.add(localeInfo); + languagesDict.put(localeInfo.shortName, localeInfo); + localeInfo = new LocaleInfo(); localeInfo.name = "Nederlands"; localeInfo.nameEnglish = "Dutch"; @@ -220,6 +242,21 @@ public class LocaleController { sortedLanguages.add(localeInfo); languagesDict.put(localeInfo.shortName, localeInfo); + localeInfo = new LocaleInfo(); + localeInfo.name = "русский"; + localeInfo.nameEnglish = "Russian"; + localeInfo.shortName = "ru"; + sortedLanguages.add(localeInfo); + languagesDict.put(localeInfo.shortName, localeInfo); + + localeInfo = new LocaleInfo(); + localeInfo.name = "Türkçe"; + localeInfo.nameEnglish = "Turkish"; + localeInfo.shortName = "tr"; + localeInfo.pathToFile = null; + sortedLanguages.add(localeInfo); + languagesDict.put(localeInfo.shortName, localeInfo); + localeInfo = new LocaleInfo(); localeInfo.name = "한국어"; localeInfo.nameEnglish = "Korean"; diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java b/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java index afc8fee5..4122b316 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MessageObject.java @@ -49,6 +49,8 @@ public class MessageObject { public ArrayList photoThumbs; private static TextPaint textPaint; + private static TextPaint textPaintRight = new TextPaint(Paint.ANTI_ALIAS_FLAG); + private static TextPaint textPaintLeft = new TextPaint(Paint.ANTI_ALIAS_FLAG); public int lastLineWidth; public int textWidth; public int textHeight; @@ -72,16 +74,21 @@ public class MessageObject { textPaint.linkColor = 0xff316f9f; } - int color = AndroidUtilities.getIntDef("chatRTextColor", 0xff000000); - textPaint.setColor(color); - if(color != 0xff000000){ - textPaint.linkColor = AndroidUtilities.getIntDarkerColor("chatRTextColor", -0x50); - } - textPaint.setTextSize(AndroidUtilities.dp(MessagesController.getInstance().fontSize)); - messageOwner = message; + textPaintLeft.setColor(AndroidUtilities.getIntDef("chatLTextColor", 0xff000000)); + textPaintLeft.linkColor = AndroidUtilities.getIntDarkerColor("chatLTextColor", -0x10); + textPaintLeft.setTextSize(AndroidUtilities.dp(MessagesController.getInstance().fontSize)); + textPaint = textPaintLeft; + textPaintRight.setColor(AndroidUtilities.getIntDef("chatRTextColor", 0xff000000)); + textPaintRight.linkColor = AndroidUtilities.getIntDarkerColor("chatRTextColor", -0x10); + textPaintRight.setTextSize(AndroidUtilities.dp(MessagesController.getInstance().fontSize)); + + messageOwner = message; + if(isOut()){ + textPaint = textPaintRight; + } if (message instanceof TLRPC.TL_messageService) { if (message.action != null) { TLRPC.User fromUser = null; diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java index a7c97325..6e0c597c 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java @@ -3399,7 +3399,13 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (dialog != null) { dialog.notify_settings.mute_until = 0; } - editor.remove("notify2_" + dialog_id); + //editor.remove("notify2_" + dialog_id); + //Smart Notifications + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + if (preferences.getInt("notify2_" + dialog_id, 0) != 4) { + editor.remove("notify2_" + dialog_id); + } + // MessagesStorage.getInstance().setDialogFlags(dialog_id, 0); } diff --git a/TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java b/TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java index cef1faa8..23f15495 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java @@ -43,7 +43,9 @@ import org.telegram.ui.PopupNotificationActivity; import java.util.ArrayList; import java.util.Calendar; +import java.util.Date; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; public class NotificationsController { @@ -352,7 +354,32 @@ public class NotificationsController { if (!notifyAboutLast || notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || chat_id != 0 && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0) { notifyDisabled = true; } - + //Smart notifications + boolean use_smart_notify = preferences.getBoolean("smart_notify_" + dialog_id, false); + Long smart_notify_timeframe = preferences.getLong("smart_notify_timeframe_" + dialog_id, 1); + int smart_notify_max_count = preferences.getInt("smart_notify_max_count_" + dialog_id, 1); + if (chat_id != 0 && use_smart_notify) + { + if (chat.sound_timestamps == null) + chat.sound_timestamps = new LinkedList<>(); + boolean shouldAdd = true; + Date firstNotification = chat.sound_timestamps.peek(); + Date currentDate = new Date(); + if (firstNotification != null) { + if (currentDate.getTime() - firstNotification.getTime() < smart_notify_timeframe * 1000 && chat.sound_timestamps.size () >= smart_notify_max_count) { + shouldAdd = false; + } + } + if (!shouldAdd) { + notifyDisabled = true; + } + else { + if (chat.sound_timestamps.size() >= smart_notify_max_count) + chat.sound_timestamps.poll(); + chat.sound_timestamps.add(currentDate); + } + } + // String defaultPath = Settings.System.DEFAULT_NOTIFICATION_URI.getPath(); if (!notifyDisabled) { inAppSounds = preferences.getBoolean("EnableInAppSounds", true); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java b/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java index 6ce1e519..e75fe422 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java @@ -5857,6 +5857,9 @@ public class TLRPC { public boolean checked_in; public int version; public boolean left; + //Smart Notifications + public java.util.Queue sound_timestamps = null; + // } public static class TL_chatForbidden extends Chat { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java index c01b464b..a4277a9b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java @@ -294,6 +294,15 @@ public class ActionBar extends FrameLayout { titleTextView.setCompoundDrawablePadding(padding); } + public void setTitleColor(int color) { + if (titleTextView == null) { + createTitleTextView(); + } + if (titleTextView != null) { + titleTextView.setTextColor(color); + } + } + public Drawable getSubTitleIcon() { return subTitleTextView.getCompoundDrawables()[0]; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java index fa19aa49..9dca678e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java @@ -9,7 +9,9 @@ package org.telegram.ui.ActionBar; import android.content.Context; +import android.graphics.PorterDuff; import android.graphics.Rect; +import android.graphics.drawable.Drawable; import android.os.Build; import android.text.Editable; import android.text.TextWatcher; @@ -497,6 +499,11 @@ public class ActionBarMenuItem extends FrameLayoutFixed { popupWindow.update(this, -AndroidUtilities.dp(8), getOffsetY(), -1, -1); } } + if(clearButton!=null){ + Drawable clear = getResources().getDrawable(R.drawable.ic_close_white); + clear.setColorFilter(AndroidUtilities.getIntDef("chatsHeaderIconsColor", 0xffffffff), PorterDuff.Mode.MULTIPLY); + clearButton.setImageDrawable(clear); + } } public void hideSubItem(int id) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java index 600807d1..ecaf719e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java @@ -14,6 +14,7 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.drawable.Drawable; import android.os.Build; +import android.util.Log; import android.view.Gravity; import android.view.MotionEvent; import android.view.VelocityTracker; @@ -437,6 +438,7 @@ public class DrawerLayoutContainer extends FrameLayout { child.measure(drawerWidthSpec, drawerHeightSpec); } } + getDrawerLayout().setBackgroundColor(AndroidUtilities.getIntDef("drawerListColor",0xffffffff)); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MenuDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MenuDrawable.java index 46f60170..811143c8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MenuDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MenuDrawable.java @@ -87,6 +87,11 @@ public class MenuDrawable extends Drawable { canvas.drawLine(startXDiff, -startYDiff, endXDiff, -endYDiff, paint); canvas.drawLine(startXDiff, startYDiff, endXDiff, endYDiff, paint); canvas.restore(); + updateTheme(); + } + + private void updateTheme(){ + paint.setColor(AndroidUtilities.getIntDef("chatsHeaderIconsColor", 0xffffffff)); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java index c3b27858..9bfcd1d0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java @@ -126,11 +126,11 @@ public class DialogsAdapter extends BaseFragmentAdapter { ((DialogCell) view).setDialog(dialog, i, serverOnly); } } - updateColors(viewGroup); + updateTheme(viewGroup); return view; } - private void updateColors(ViewGroup viewGroup){ + private void updateTheme(ViewGroup viewGroup){ SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, Activity.MODE_PRIVATE); viewGroup.setBackgroundColor(themePrefs.getInt("chatsRowColor", 0xffffffff)); } 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 75892c2b..489d6f33 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java @@ -14,6 +14,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; +import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; import org.telegram.android.MessagesController; import org.telegram.messenger.ApplicationLoader; @@ -95,21 +96,21 @@ public class DrawerLayoutAdapter extends BaseAdapter { } DrawerActionCell actionCell = (DrawerActionCell) view; if (i == 2) { - actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), R.drawable.menu_newgroup); + actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), R.drawable.menu_newgroup_white); } else if (i == 3) { - actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), R.drawable.menu_secret); + actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), R.drawable.menu_secret_white); } else if (i == 4) { - actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), R.drawable.menu_broadcast); + actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), R.drawable.menu_broadcast_white); } else if (i == 6) { - actionCell.setTextAndIcon(LocaleController.getString("Contacts", R.string.Contacts), R.drawable.menu_contacts); + actionCell.setTextAndIcon(LocaleController.getString("Contacts", R.string.Contacts), R.drawable.menu_contacts_white); }/* else if (i == 7) { actionCell.setTextAndIcon(LocaleController.getString("InviteFriends", R.string.InviteFriends), R.drawable.menu_invite); }*/ else if (i == themingRow) { - actionCell.setTextAndIcon(LocaleController.getString("Theming", R.string.Theming), R.drawable.menu_theming); + actionCell.setTextAndIcon(LocaleController.getString("Theming", R.string.Theming), R.drawable.menu_theming_white); } else if (i == 8) { - actionCell.setTextAndIcon(LocaleController.getString("Settings", R.string.Settings), R.drawable.menu_settings); + actionCell.setTextAndIcon(LocaleController.getString("Settings", R.string.Settings), R.drawable.menu_settings_white); } else if (i == communityRow) { - actionCell.setTextAndIcon(LocaleController.getString("Community", R.string.Community), R.drawable.menu_forum); + actionCell.setTextAndIcon(LocaleController.getString("Community", R.string.Community), R.drawable.menu_forum_white); } /*else if (i == 10) { actionCell.setTextAndIcon(LocaleController.getString("TelegramFaq", R.string.TelegramFaq), R.drawable.menu_help); }*/ @@ -119,12 +120,13 @@ public class DrawerLayoutAdapter extends BaseAdapter { try { PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0); ((TextInfoCell) view).setText(String.format(Locale.US, LocaleController.getString("TelegramForAndroid", R.string.TelegramForAndroid)+" v%s (%d)", pInfo.versionName, pInfo.versionCode)); + //((TextInfoCell) view).setTextColor(AndroidUtilities.getIntDef("drawerVersionColor",0xffa3a3a3)); + //((TextInfoCell) view).setTextSize(AndroidUtilities.getIntDef("drawerVersionSize",13)); } catch (Exception e) { FileLog.e("tmessages", e); } } } - return view; } @@ -154,4 +156,5 @@ public class DrawerLayoutAdapter extends BaseAdapter { public boolean isEmpty() { return !UserConfig.isClientActivated(); } + } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java index f1073509..5ba4f54e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java @@ -73,7 +73,6 @@ public class ChatActionCell extends BaseCell { backgroundBlue = getResources().getDrawable(R.drawable.system_blue); backgroundWhite = getResources().getDrawable(R.drawable.system_white); - backgroundBlue = backgroundWhite; textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); textPaint.setColor(0xffffffff); @@ -226,7 +225,7 @@ public class ChatActionCell extends BaseCell { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - updateColor(); + updateTheme(); if (currentMessageObject == null) { setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), textHeight + AndroidUtilities.dp(14)); return; @@ -275,9 +274,9 @@ public class ChatActionCell extends BaseCell { Drawable backgroundDrawable = null; if (useBlackBackground) { - backgroundDrawable = backgroundBlack; + backgroundDrawable = backgroundWhite;//backgroundBlack; } else { - backgroundDrawable = backgroundBlue; + backgroundDrawable = backgroundWhite;//backgroundBlue; } backgroundDrawable.setBounds(textX - AndroidUtilities.dp(5), AndroidUtilities.dp(5), textX + textWidth + AndroidUtilities.dp(5), AndroidUtilities.dp(9) + textHeight); backgroundDrawable.draw(canvas); @@ -294,13 +293,13 @@ public class ChatActionCell extends BaseCell { } } - private void updateColor(){ + private void updateTheme(){ int color = AndroidUtilities.getIntDef("chatDateColor", 0xffffffff); textPaint.setColor(color); if(color != 0xffffffff){ textPaint.linkColor = AndroidUtilities.getIntDarkerColor("chatDateColor", -0x50); } - textPaint.setTextSize(AndroidUtilities.dp(AndroidUtilities.getIntDef("chatDateSize",16)));//16 - backgroundWhite.setColorFilter(AndroidUtilities.getIntDef("chatDateBubbleColor",0x59000000), PorterDuff.Mode.MULTIPLY); + textPaint.setTextSize(AndroidUtilities.dp(AndroidUtilities.getIntDef("chatDateSize", 16)));//16 + backgroundWhite.setColorFilter(AndroidUtilities.getIntDef("chatDateBubbleColor", 0x59000000), PorterDuff.Mode.MULTIPLY); } } 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 4a2c1fba..a1549472 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java @@ -179,7 +179,7 @@ public class ChatBaseCell extends BaseCell { avatarDrawable = new AvatarDrawable(); } - private void updateColors(){ + private void updateTheme(){ int tColor = AndroidUtilities.getIntColor("themeColor"); int lColor = AndroidUtilities.getIntDarkerColor("themeColor",-0x80); int dColor = AndroidUtilities.getIntDarkerColor("themeColor",0x15); @@ -465,7 +465,7 @@ public class ChatBaseCell extends BaseCell { @Override protected void onDraw(Canvas canvas) { - updateColors(); + updateTheme(); if (currentMessageObject == null) { return; } @@ -524,7 +524,11 @@ public class ChatBaseCell extends BaseCell { if (drawName && nameLayout != null) { canvas.save(); canvas.translate(currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(19) - nameOffsetX, AndroidUtilities.dp(10)); - namePaint.setColor(AvatarDrawable.getNameColorForId(currentUser.id)); + if(AndroidUtilities.getBoolPref("chatMemberColorCheck")){ + namePaint.setColor(AndroidUtilities.getIntDef("chatMemberColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15))); + }else{ + namePaint.setColor(AvatarDrawable.getNameColorForId(currentUser.id)); + } nameLayout.draw(canvas); canvas.restore(); } @@ -532,11 +536,13 @@ public class ChatBaseCell extends BaseCell { if (drawForwardedName && forwardedNameLayout != null) { canvas.save(); if (currentMessageObject.isOut()) { - forwardNamePaint.setColor(0xff4a923c); + //forwardNamePaint.setColor(0xff4a923c); + forwardNamePaint.setColor(AndroidUtilities.getIntDef("chatForwardColor", 0xff4a923c)); forwardNameX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(10); forwardNameY = AndroidUtilities.dp(10 + (drawName ? 18 : 0)); } else { - forwardNamePaint.setColor(0xff006fc8); + //forwardNamePaint.setColor(0xff006fc8); + forwardNamePaint.setColor(AndroidUtilities.getIntDef("chatForwardColor", 0xff006fc8)); forwardNameX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(19); forwardNameY = AndroidUtilities.dp(10 + (drawName ? 18 : 0)); } 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 db40b041..a247816c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java @@ -12,6 +12,7 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; +import android.graphics.PorterDuff; import android.graphics.RectF; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; @@ -53,6 +54,7 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD private static Drawable videoIconDrawable; private static Drawable docMenuInDrawable; private static Drawable docMenuOutDrawable; + private static Drawable docMenuWhiteDrawable; private static Drawable[] buttonStatesDrawables = new Drawable[8]; private static Drawable[][] buttonStatesDrawablesDoc = new Drawable[3][2]; private static TextPaint infoPaint; @@ -121,11 +123,15 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD docMenuInDrawable = getResources().getDrawable(R.drawable.doc_actions_b); docMenuOutDrawable = getResources().getDrawable(R.drawable.doc_actions_g); + docMenuWhiteDrawable = getResources().getDrawable(R.drawable.doc_actions_w); + docMenuWhiteDrawable.setColorFilter(AndroidUtilities.getIntDef("chatFileInfoColor", 0xff70b15c), PorterDuff.Mode.MULTIPLY); + infoPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); infoPaint.setTextSize(AndroidUtilities.dp(12)); namePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); - namePaint.setColor(0xff212121); + //namePaint.setColor(0xff212121); + namePaint.setColor(AndroidUtilities.getIntDef("chatFileInfoColor", 0xff212121)); namePaint.setTextSize(AndroidUtilities.dp(16)); docBackPaint = new Paint(); @@ -864,14 +870,22 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD if (currentMessageObject.type == 9) { Drawable menuDrawable = null; + int color = AndroidUtilities.getIntDef("chatRTextColor", 0xff000000); if (currentMessageObject.isOut()) { - infoPaint.setColor(0xff70b15c); + //infoPaint.setColor(0xff70b15c); + infoPaint.setColor(color); docBackPaint.setColor(0xffdaf5c3); - menuDrawable = docMenuOutDrawable; + docMenuWhiteDrawable.setColorFilter(AndroidUtilities.getIntDef("chatRTimeColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)), PorterDuff.Mode.MULTIPLY); + menuDrawable = docMenuOutDrawable = docMenuWhiteDrawable; + namePaint.setColor(color); } else { - infoPaint.setColor(0xffa1adbb); + color = AndroidUtilities.getIntDef("chatLTextColor", 0xff000000); + //infoPaint.setColor(0xffa1adbb); + infoPaint.setColor(color); docBackPaint.setColor(0xffebf0f5); - menuDrawable = docMenuInDrawable; + docMenuWhiteDrawable.setColorFilter(AndroidUtilities.getIntDef("chatLTimeColor", 0xffa1adbb), PorterDuff.Mode.MULTIPLY); + menuDrawable = docMenuInDrawable = docMenuWhiteDrawable; + namePaint.setColor(color); } setDrawableBounds(menuDrawable, photoImage.getImageX() + backgroundWidth - AndroidUtilities.dp(44), AndroidUtilities.dp(10)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java index 1f799a2e..b9dcb350 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java @@ -20,6 +20,7 @@ import android.text.Layout; import android.text.StaticLayout; import android.text.TextPaint; import android.text.TextUtils; +import android.util.Log; import org.telegram.android.AndroidUtilities; import org.telegram.PhoneFormat.PhoneFormat; @@ -43,6 +44,7 @@ public class DialogCell extends BaseCell { private static TextPaint nameUnknownPaint; private static TextPaint messagePaint; private static TextPaint messagePrintingPaint; + private static TextPaint messageTypingPaint; private static TextPaint timePaint; private static TextPaint countPaint; @@ -152,6 +154,10 @@ public class DialogCell extends BaseCell { messagePrintingPaint.setTextSize(AndroidUtilities.dp(16)); messagePrintingPaint.setColor(0xff4d83b3); + messageTypingPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); + messageTypingPaint.setTextSize(AndroidUtilities.dp(16)); + messageTypingPaint.setColor(0xff4d83b3); + timePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); timePaint.setTextSize(AndroidUtilities.dp(13)); timePaint.setColor(0xff999999); @@ -185,7 +191,7 @@ public class DialogCell extends BaseCell { broadcastDrawable = broadcastWhiteDrawable; muteWhiteDrawable = getResources().getDrawable(R.drawable.mute_white); muteDrawable = muteWhiteDrawable; - updateColors(); + updateTheme(); } } @@ -194,10 +200,9 @@ public class DialogCell extends BaseCell { init(); avatarImage = new ImageReceiver(this); avatarImage.setRoundRadius(AndroidUtilities.dp(26)); - //avatarImage.setRoundRadius(AndroidUtilities.dp(5)); avatarDrawable = new AvatarDrawable(); - //avatarDrawable.setRadius(5); } + public void setDialog(TLRPC.TL_dialog dialog, int i, boolean server) { currentDialogId = dialog.id; isDialogCell = true; @@ -303,7 +308,8 @@ public class DialogCell extends BaseCell { if (message == null) { if (printingString != null) { lastPrintString = messageString = printingString; - currentMessagePaint = messagePrintingPaint; + //currentMessagePaint = messagePrintingPaint; + currentMessagePaint = messageTypingPaint; } else { lastPrintString = null; if (encryptedChat != null) { @@ -349,7 +355,8 @@ public class DialogCell extends BaseCell { } if (printingString != null) { lastPrintString = messageString = printingString; - currentMessagePaint = messagePrintingPaint; + //currentMessagePaint = messagePrintingPaint; + currentMessagePaint = messageTypingPaint; } else { lastPrintString = null; if (message.messageOwner instanceof TLRPC.TL_messageService) { @@ -372,7 +379,7 @@ public class DialogCell extends BaseCell { checkMessage = false; String hexColor = String.format("#%06X", (0xFFFFFF & AndroidUtilities.getIntColor("themeColor"))); String hexMsgColor = String.format("#%06X", (0xFFFFFF & AndroidUtilities.getIntDef("chatsMessageColor",0xff8f8f8f))); - String hexDarkColor = String.format("#%06X", (0xFFFFFF & AndroidUtilities.getIntDef("chatsParticipantColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)))); + String hexDarkColor = String.format("#%06X", (0xFFFFFF & AndroidUtilities.getIntDef("chatsMemberColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)))); if (message.messageOwner.media != null && !(message.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty)) { currentMessagePaint = messagePrintingPaint; //messageString = Emoji.replaceEmoji(Html.fromHtml(String.format("%s: %s", name, message.messageText)), messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20)); @@ -654,7 +661,7 @@ public class DialogCell extends BaseCell { } public void update(int mask) { - updateColors(); + updateTheme(); if (isDialogCell) { TLRPC.TL_dialog dialog = MessagesController.getInstance().dialogs_dict.get(currentDialogId); if (dialog != null && mask == 0) { @@ -846,7 +853,7 @@ public class DialogCell extends BaseCell { avatarImage.draw(canvas); } - private void updateColors(){ + private void updateTheme(){ SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, Activity.MODE_PRIVATE); int tColor = AndroidUtilities.getIntColor("themeColor"); int dColor = AndroidUtilities.getIntDarkerColor("themeColor",0x15); @@ -862,9 +869,12 @@ public class DialogCell extends BaseCell { messagePaint.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatsMessageSize", 16))); messagePaint.setColor(themePrefs.getInt("chatsMessageColor", 0xff8f8f8f)); - //Audio Archivo ... te expulsó + messagePrintingPaint.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatsMessageSize", 16))); - messagePrintingPaint.setColor(themePrefs.getInt("chatsMessageColor", tColor));//0xff4d83b3 + messagePrintingPaint.setColor(AndroidUtilities.getIntDef("chatsMessageColor", tColor)); + + messageTypingPaint.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatsMessageSize", 16))); + messageTypingPaint.setColor(AndroidUtilities.getIntDef("chatsTypingColor", tColor)); timePaint.setTextSize(AndroidUtilities.dp(themePrefs.getInt("chatsTimeSize", 13))); timePaint.setColor(themePrefs.getInt("chatsTimeColor", 0xff999999)); @@ -884,5 +894,11 @@ public class DialogCell extends BaseCell { int mColor = themePrefs.getInt("chatsMuteColor", 0xffa8a8a8); muteWhiteDrawable.setColorFilter(mColor, PorterDuff.Mode.MULTIPLY); + + linePaint.setColor(themePrefs.getInt("chatsDividerColor", 0xffdcdcdc)); + + //int radius = AndroidUtilities.dp(AndroidUtilities.getIntDef("chatsAvatarRadius", 32)); + //if(avatarImage != null)avatarImage.setRoundRadius(radius); + //if(avatarDrawable != null)avatarDrawable.setRadius(radius/3); } } 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 2a4d708f..2e9d7b12 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java @@ -9,12 +9,15 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.util.TypedValue; import android.view.Gravity; import android.widget.FrameLayout; import android.widget.TextView; import org.telegram.android.AndroidUtilities; +import org.telegram.messenger.R; public class DrawerActionCell extends FrameLayout { @@ -45,10 +48,32 @@ public class DrawerActionCell extends FrameLayout { @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); + textView.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(resId), null, null, null); + } + + private void updateTheme(){ + textView.setTextColor(AndroidUtilities.getIntDef("drawerOptionColor", 0xff444444)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, AndroidUtilities.getIntDef("drawerOptionSize", 15)); + int color = AndroidUtilities.getIntDef("drawerIconColor", 0xff737373); + Drawable icon = getResources().getDrawable(R.drawable.menu_newgroup_white); + icon.setColorFilter(color, PorterDuff.Mode.MULTIPLY); + icon = getResources().getDrawable(R.drawable.menu_secret_white); + icon.setColorFilter(color, PorterDuff.Mode.MULTIPLY); + icon = getResources().getDrawable(R.drawable.menu_broadcast_white); + icon.setColorFilter(color, PorterDuff.Mode.MULTIPLY); + icon = getResources().getDrawable(R.drawable.menu_contacts_white); + icon.setColorFilter(color, PorterDuff.Mode.MULTIPLY); + icon = getResources().getDrawable(R.drawable.menu_theming_white); + icon.setColorFilter(color, PorterDuff.Mode.MULTIPLY); + icon = getResources().getDrawable(R.drawable.menu_settings_white); + icon.setColorFilter(color, PorterDuff.Mode.MULTIPLY); + icon = getResources().getDrawable(R.drawable.menu_forum_white); + icon.setColorFilter(color, PorterDuff.Mode.MULTIPLY); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java index 053af150..e9f7d059 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerProfileCell.java @@ -10,25 +10,26 @@ package org.telegram.ui.Cells; import android.app.Activity; import android.content.Context; -import android.content.SharedPreferences; -import android.graphics.PorterDuff; -import android.graphics.drawable.Drawable; +import android.graphics.Bitmap; import android.os.Build; import android.util.TypedValue; import android.view.Gravity; +import android.view.View; import android.widget.FrameLayout; import android.widget.TextView; import org.telegram.PhoneFormat.PhoneFormat; import org.telegram.android.AndroidUtilities; import org.telegram.android.ContactsController; +import org.telegram.android.MessageObject; import org.telegram.android.MessagesController; import org.telegram.messenger.TLRPC; import org.telegram.messenger.UserConfig; import org.telegram.ui.Components.AvatarDrawable; import org.telegram.ui.Components.BackupImageView; +import org.telegram.ui.PhotoViewer; -public class DrawerProfileCell extends FrameLayout { +public class DrawerProfileCell extends FrameLayout implements PhotoViewer.PhotoViewerProvider{ private BackupImageView avatarImageView; private TextView nameTextView; @@ -48,6 +49,20 @@ public class DrawerProfileCell extends FrameLayout { layoutParams.leftMargin = AndroidUtilities.dp(16); layoutParams.bottomMargin = AndroidUtilities.dp(67); avatarImageView.setLayoutParams(layoutParams); + final Activity activity = (Activity) context; + avatarImageView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (activity == null) { + return; + } + TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId()); + if (user.photo != null && user.photo.photo_big != null) { + PhotoViewer.getInstance().setParentActivity(activity); + PhotoViewer.getInstance().openPhoto(user.photo.photo_big, DrawerProfileCell.this); + } + } + }); nameTextView = new TextView(context); nameTextView.setTextColor(0xffffffff); @@ -92,7 +107,7 @@ public class DrawerProfileCell extends FrameLayout { } else { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(148), MeasureSpec.EXACTLY)); } - updateColors(); + updateTheme(); } public void setUser(TLRPC.User user) { @@ -110,18 +125,82 @@ public class DrawerProfileCell extends FrameLayout { avatarImageView.setImage(photo, "50_50", avatarDrawable); } - private void updateColors(){ - setBackgroundColor(AndroidUtilities.getIntColor("themeColor")); - phoneTextView.setTextColor(AndroidUtilities.getIntDarkerColor("themeColor",-0x40)); + @Override + public void updatePhotoAtIndex(int index) {} + + @Override + public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { + if (fileLocation == null) { + return null; + } + TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId()); + if (user != null && user.photo != null && user.photo.photo_big != null) { + TLRPC.FileLocation photoBig = user.photo.photo_big; + if (photoBig.local_id == fileLocation.local_id && photoBig.volume_id == fileLocation.volume_id && photoBig.dc_id == fileLocation.dc_id) { + int coords[] = new int[2]; + avatarImageView.getLocationInWindow(coords); + PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject(); + object.viewX = coords[0]; + object.viewY = coords[1] - AndroidUtilities.statusBarHeight; + object.parentView = avatarImageView; + object.imageReceiver = avatarImageView.imageReceiver; + object.user_id = UserConfig.getClientUserId(); + object.thumb = object.imageReceiver.getBitmap(); + object.size = -1; + object.radius = avatarImageView.imageReceiver.getRoundRadius(); + return object; + } + } + return null; + } + + @Override + public Bitmap getThumbForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { + return null; + } + + @Override + public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { } + + @Override + public void willHidePhotoViewer() { + avatarImageView.imageReceiver.setVisible(true, true); + } + + @Override + public boolean isPhotoChecked(int index) { return false; } + + @Override + public void setPhotoChecked(int index) { } + + @Override + public void cancelButtonPressed() { } + + @Override + public void sendButtonPressed(int index) { } + + @Override + public int getSelectedCount() { return 0; } + + private void updateTheme(){ + int tColor = AndroidUtilities.getIntColor("themeColor"); + int dColor = AndroidUtilities.getIntDarkerColor("themeColor",-0x40); + setBackgroundColor(AndroidUtilities.getIntDef("drawerHeaderColor", tColor)); + nameTextView.setTextColor(AndroidUtilities.getIntDef("drawerNameColor", 0xffffffff)); + nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, AndroidUtilities.getIntDef("drawerNameSize", 15)); + phoneTextView.setTextColor(AndroidUtilities.getIntDef("drawerPhoneColor", dColor)); + phoneTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, AndroidUtilities.getIntDef("drawerPhoneSize", 13)); TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId()); TLRPC.FileLocation photo = null; if (user.photo != null) { photo = user.photo.photo_small; } AvatarDrawable avatarDrawable = new AvatarDrawable(user); - avatarDrawable.setColor(AndroidUtilities.getIntDarkerColor("themeColor",0x15)); + avatarDrawable.setColor(AndroidUtilities.getIntDef("drawerAvatarColor",AndroidUtilities.getIntDarkerColor("themeColor", 0x15))); + //int radius = AndroidUtilities.dp(AndroidUtilities.getIntDef("drawerAvatarRadius", 32)); + //avatarDrawable.setRadius(radius/2); + //avatarImageView.imageReceiver.setRoundRadius(AndroidUtilities.dp(radius)); avatarImageView.setImage(photo, "50_50", avatarDrawable); - if(AndroidUtilities.getBoolMain("hideMobile")){ phoneTextView.setVisibility(GONE); }else{ diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextInfoCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextInfoCell.java index 5125a3c7..270ad15c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextInfoCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextInfoCell.java @@ -9,12 +9,18 @@ package org.telegram.ui.Cells; import android.content.Context; +import android.util.Log; import android.util.TypedValue; import android.view.Gravity; import android.widget.FrameLayout; import android.widget.TextView; import org.telegram.android.AndroidUtilities; +import org.telegram.android.LocaleController; +import org.telegram.messenger.R; +import org.telegram.ui.LaunchActivity; + +import java.util.Locale; public class TextInfoCell extends FrameLayout { @@ -41,9 +47,21 @@ public class TextInfoCell extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); + if( textView.getContext() instanceof LaunchActivity ){ + textView.setTextColor(AndroidUtilities.getIntDef("drawerVersionColor", 0xffa3a3a3)); + textView.setTextSize(AndroidUtilities.getIntDef("drawerVersionSize", 13)); + } } public void setText(String text) { textView.setText(text); } +/* + public void setTextColor(int color) { + textView.setTextColor(color); + } + + public void setTextSize(int size) { + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP,size); + }*/ } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java index 7136d2c3..6c10bb62 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java @@ -239,6 +239,9 @@ public class UserCell extends FrameLayout { statusTextView.setTextSize(AndroidUtilities.getIntDef("contactsStatusSize", 14)); imageView.setVisibility(currentDrawable == 0 ? GONE : VISIBLE); imageView.setImageResource(currentDrawable); + //int radius = AndroidUtilities.dp(AndroidUtilities.getIntDef("contactsAvatarRadius", 32)); + //avatarImageView.imageReceiver.setRoundRadius(radius); + //avatarDrawable.setRadius(radius/3); avatarImageView.setImage(photo, "50_50", avatarDrawable); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 1bbd3576..811ad1a7 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -18,7 +18,9 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.graphics.Bitmap; +import android.graphics.PorterDuff; import android.graphics.Rect; +import android.graphics.drawable.Drawable; import android.media.ExifInterface; import android.net.Uri; import android.os.Build; @@ -276,6 +278,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not return false; } } + //Smart Notifications + if (chatId > 0){ + if (currentChat.sound_timestamps != null) + currentChat.sound_timestamps.clear(); + } + // if (chatId > 0) { dialog_id = -chatId; } else { @@ -968,7 +976,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not attachItem.addSubItem(attach_location, LocaleController.getString("ChatLocation", R.string.ChatLocation), R.drawable.ic_attach_location); attachItem.setVisibility(View.INVISIBLE); - menuItem = menu.addItem(chat_menu_attach, R.drawable.ic_ab_attach); + Drawable clip = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_attach_white); + clip.setColorFilter(AndroidUtilities.getIntDef("chatEditTextIconsColor", 0xffadadad), PorterDuff.Mode.MULTIPLY); + menuItem = menu.addItem(chat_menu_attach, clip); + //menuItem = menu.addItem(chat_menu_attach, R.drawable.ic_ab_attach); menuItem.addSubItem(attach_photo, LocaleController.getString("ChatTakePhoto", R.string.ChatTakePhoto), R.drawable.ic_attach_photo); menuItem.addSubItem(attach_gallery, LocaleController.getString("ChatGallery", R.string.ChatGallery), R.drawable.ic_attach_gallery); menuItem.addSubItem(attach_music, LocaleController.getString("ChatMusic", R.string.ChatMusic), R.drawable.ic_attach_music); @@ -3179,10 +3190,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not chatListView.setOnItemLongClickListener(onItemLongClickListener); chatListView.setOnItemClickListener(onItemClickListener); chatListView.setLongClickable(true); - updateColors(); + updateTheme(); } - private void updateColors(){ + private void updateTheme(){ actionBar.setBackgroundColor(AndroidUtilities.getIntDef("chatHeaderColor", AndroidUtilities.getIntColor("themeColor"))); nameTextView.setTextColor(AndroidUtilities.getIntDef("chatNameColor", 0xffffffff)); nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, AndroidUtilities.getIntDef("chatNameSize", 18)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarDrawable.java index a98cf669..ed0e1803 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/AvatarDrawable.java @@ -53,7 +53,7 @@ public class AvatarDrawable extends Drawable { private boolean isProfile; private boolean drawBrodcast; private boolean drawPhoto; - private int radius; + //private int radius; public AvatarDrawable() { super(); @@ -65,7 +65,7 @@ public class AvatarDrawable extends Drawable { broadcastDrawable = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.broadcast_w); } - radius = 26; + //radius = 32; } public AvatarDrawable(TLRPC.User user) { @@ -158,11 +158,15 @@ public class AvatarDrawable extends Drawable { public void setColor(int value) { color = value; } - +/* public void setRadius(int value) { radius = value; } + public int getRadius() { + return radius; + } +*/ public void setInfo(int id, String firstName, String lastName, boolean isBroadcast) { if (isProfile) { color = arrColorsProfiles[getColorIndex(id)]; @@ -244,9 +248,10 @@ public class AvatarDrawable extends Drawable { canvas.save(); canvas.translate(bounds.left, bounds.top); canvas.drawCircle(size / 2, size / 2, size / 2, paint); - //Rect rect = new Rect(0, 0, size, size); - //RectF rectF = new RectF(rect); - //canvas.drawRoundRect( rectF, AndroidUtilities.dp(26), AndroidUtilities.dp(26), paint); + /*Rect rect = new Rect(0, 0, size, size); + RectF rectF = new RectF(rect); + int r = getRadius(); + canvas.drawRoundRect( rectF, AndroidUtilities.dp(r), AndroidUtilities.dp(r), paint);*/ if (drawBrodcast && broadcastDrawable != null) { int x = (size - broadcastDrawable.getIntrinsicWidth()) / 2; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java index 82f30679..5f784ef1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java @@ -136,7 +136,10 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC frameLayout.setLayoutParams(layoutParams); emojiButton = new ImageView(context); - emojiButton.setImageResource(R.drawable.ic_msg_panel_smiles); + //emojiButton.setImageResource(R.drawable.ic_msg_panel_smiles); + Drawable emoji = parentActivity.getResources().getDrawable(R.drawable.ic_msg_panel_smiles_white); + emoji.setColorFilter(AndroidUtilities.getIntDef("chatEditTextIconsColor", 0xffadadad), PorterDuff.Mode.MULTIPLY); + emojiButton.setImageDrawable(emoji); emojiButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE); emojiButton.setPadding(AndroidUtilities.dp(4), AndroidUtilities.dp(1), 0, 0); frameLayout.addView(emojiButton); @@ -362,8 +365,12 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC audioSendButton = new ImageView(context); audioSendButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE); - audioSendButton.setImageResource(R.drawable.mic_button_states); - audioSendButton.setBackgroundColor(0xffffffff); + //audioSendButton.setImageResource(R.drawable.mic_button_states); + //audioSendButton.setBackgroundColor(0xffffffff); + Drawable mic = parentActivity.getResources().getDrawable(R.drawable.mic_white); + mic.setColorFilter(AndroidUtilities.getIntDef("chatEditTextIconsColor", 0xffadadad), PorterDuff.Mode.MULTIPLY); + audioSendButton.setImageDrawable(mic); + audioSendButton.setBackgroundColor(0x00000000); audioSendButton.setPadding(0, 0, AndroidUtilities.dp(4), 0); frameLayout1.addView(audioSendButton); layoutParams1 = (FrameLayout.LayoutParams) audioSendButton.getLayoutParams(); @@ -373,7 +380,11 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC audioSendButton.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { + Drawable mic = parentActivity.getResources().getDrawable(R.drawable.mic_white); + if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { + mic.setColorFilter(0xffda564d, PorterDuff.Mode.MULTIPLY); + audioSendButton.setImageDrawable(mic); if (parentFragment != null) { String action = null; TLRPC.Chat currentChat = null; @@ -396,6 +407,8 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC updateAudioRecordIntefrace(); audioSendButton.getParent().requestDisallowInterceptTouchEvent(true); } else if (motionEvent.getAction() == MotionEvent.ACTION_UP || motionEvent.getAction() == MotionEvent.ACTION_CANCEL) { + mic.setColorFilter(AndroidUtilities.getIntDef("chatEditTextIconsColor", 0xffadadad), PorterDuff.Mode.MULTIPLY); + audioSendButton.setImageDrawable(mic); startedDraggingX = -1; MediaController.getInstance().stopRecording(true); recordingAudio = false; @@ -467,18 +480,18 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC checkSendButton(false); - updateColors(); + updateTheme(); } - private void updateColors() { + private void updateTheme() { Drawable send = parentActivity.getResources().getDrawable(R.drawable.ic_send_white); send.setColorFilter(AndroidUtilities.getIntDef("chatSendIconColor", AndroidUtilities.getIntColor("themeColor")), PorterDuff.Mode.MULTIPLY); sendButton.setImageDrawable(send); messsageEditText.setTextColor(AndroidUtilities.getIntDef("chatEditTextColor",0xff000000)); + messsageEditText.setHintTextColor(AndroidUtilities.getIntAlphaColor("chatEditTextColor", 0xff000000, 0.35f)); messsageEditText.setTextSize(AndroidUtilities.getIntDef("chatEditTextSize",18)); int color = AndroidUtilities.getIntDef("chatEditTextBGColor", 0xffffffff); setBackgroundColor(color); - audioSendButton.setBackgroundColor(0x00000000); } public void onDestroy() { @@ -878,18 +891,27 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC if (!keyboardVisible) { if (sizeNotifierRelativeLayout != null) { sizeNotifierRelativeLayout.setPadding(0, 0, 0, currentHeight); - emojiButton.setImageResource(R.drawable.ic_msg_panel_hide); + //emojiButton.setImageResource(R.drawable.ic_msg_panel_hide); + Drawable hide = parentActivity.getResources().getDrawable(R.drawable.ic_msg_panel_hide_white); + hide.setColorFilter(AndroidUtilities.getIntDef("chatEditTextIconsColor", 0xffadadad), PorterDuff.Mode.MULTIPLY); + emojiButton.setImageDrawable(hide); if (delegate != null) { delegate.onWindowSizeChanged(sizeNotifierRelativeLayout.getHeight() - sizeNotifierRelativeLayout.getPaddingBottom()); } } return; } - emojiButton.setImageResource(R.drawable.ic_msg_panel_kb); + //emojiButton.setImageResource(R.drawable.ic_msg_panel_kb); + Drawable kb = parentActivity.getResources().getDrawable(R.drawable.ic_msg_panel_kb_white); + kb.setColorFilter(AndroidUtilities.getIntDef("chatEditTextIconsColor", 0xffadadad), PorterDuff.Mode.MULTIPLY); + emojiButton.setImageDrawable(kb); return; } if (emojiButton != null) { - emojiButton.setImageResource(R.drawable.ic_msg_panel_smiles); + //emojiButton.setImageResource(R.drawable.ic_msg_panel_smiles); + Drawable emoji = parentActivity.getResources().getDrawable(R.drawable.ic_msg_panel_smiles_white); + emoji.setColorFilter(AndroidUtilities.getIntDef("chatEditTextIconsColor", 0xffadadad), PorterDuff.Mode.MULTIPLY); + emojiButton.setImageDrawable(emoji); } if (emojiPopup != null) { try { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/EmojiView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/EmojiView.java index e3ea7753..031f6314 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/EmojiView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/EmojiView.java @@ -159,10 +159,10 @@ public class EmojiView extends LinearLayout { pager.setCurrentItem(1); } - updateColors(tabs); + updateTheme(tabs); } - private void updateColors(PagerSlidingTabStrip tabs) { + private void updateTheme(PagerSlidingTabStrip tabs) { setBackgroundColor(AndroidUtilities.getIntDef("chatEmojiViewBGColor",0xff222222)); tabs.setIndicatorColor(AndroidUtilities.getIntDef("chatEmojiViewTabColor",AndroidUtilities.getIntDarkerColor("themeColor",0x15)));//0xff33b5e5 } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/Switch.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/Switch.java index 524dfd0c..4dbbdab2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/Switch.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/Switch.java @@ -419,7 +419,7 @@ public class Switch extends CompoundButton { if (mTrackDrawable != null) { //mTrackDrawable.setColorFilter(new PorterDuffColorFilter(checked ? 0xffa0d6fa : 0xffc7c7c7, PorterDuff.Mode.MULTIPLY)); - mTrackDrawable.setColorFilter(new PorterDuffColorFilter(checked ? AndroidUtilities.getIntAlphaColor("themeColor",0.5f) : 0xffc7c7c7, PorterDuff.Mode.MULTIPLY)); + mTrackDrawable.setColorFilter(new PorterDuffColorFilter(checked ? AndroidUtilities.getIntAlphaColor("themeColor", AndroidUtilities.defColor, 0.5f) : 0xffc7c7c7, PorterDuff.Mode.MULTIPLY)); } if (mThumbDrawable != null) { //mThumbDrawable.setColorFilter(new PorterDuffColorFilter(checked ? 0xff45abef : 0xffededed, PorterDuff.Mode.MULTIPLY)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java index b21c4294..aa3e588f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java @@ -450,10 +450,10 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (listViewAdapter != null) { listViewAdapter.notifyDataSetChanged(); } - updateColors(); + updateTheme(); } - private void updateColors(){ + private void updateTheme(){ actionBar.setBackgroundColor(AndroidUtilities.getIntDef("contactsHeaderColor", AndroidUtilities.getIntColor("themeColor"))); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index 23faa576..4497a5b4 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -22,6 +22,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Parcelable; import android.provider.ContactsContract; +import android.util.Log; import android.view.ActionMode; import android.view.KeyEvent; import android.view.MotionEvent; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java index a9777d0c..b3bdd187 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java @@ -15,9 +15,11 @@ import android.app.AlertDialog; import android.content.DialogInterface; import android.content.SharedPreferences; import android.content.res.Configuration; +import android.content.res.Resources; import android.graphics.Color; import android.graphics.Outline; import android.graphics.PorterDuff; +import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; @@ -164,7 +166,9 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter passcodeItem = menu.addItem(passcode_menu_item, R.drawable.lock_close); updatePasscodeButton(); } - ActionBarMenuItem item = menu.addItem(0, R.drawable.ic_ab_search).setIsSearchField(true).setActionBarMenuItemSearchListener(new ActionBarMenuItem.ActionBarMenuItemSearchListener() { + //ActionBarMenuItem item = menu.addItem(0, R.drawable.ic_ab_search).setIsSearchField(true).setActionBarMenuItemSearchListener(new ActionBarMenuItem.ActionBarMenuItemSearchListener() { + Drawable search = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_search); + ActionBarMenuItem item = menu.addItem(0, search).setIsSearchField(true).setActionBarMenuItemSearchListener(new ActionBarMenuItem.ActionBarMenuItemSearchListener() { @Override public void onSearchExpand() { searching = true; @@ -232,8 +236,12 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter } }); item.getSearchField().setHint(LocaleController.getString("Search", R.string.Search)); + item.getSearchField().setTextColor(AndroidUtilities.getIntDef("chatsHeaderTitleColor", 0xffffffff)); if (onlySelect) { - actionBar.setBackButtonImage(R.drawable.ic_ab_back); + //actionBar.setBackButtonImage(R.drawable.ic_ab_back); + Drawable back = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_back); + back.setColorFilter(AndroidUtilities.getIntDef("chatsHeaderIconsColor", 0xffffffff), PorterDuff.Mode.MULTIPLY); + actionBar.setBackButtonDrawable(back); actionBar.setTitle(LocaleController.getString("SelectChat", R.string.SelectChat)); } else { actionBar.setBackButtonDrawable(new MenuDrawable()); @@ -558,10 +566,11 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter if (dialogsSearchAdapter != null) { dialogsSearchAdapter.notifyDataSetChanged(); } - updateColors(); + updateTheme(); } - private void updateColors(){ + private void updateTheme(){ + updateActionBarTitle(); actionBar.setBackgroundColor(AndroidUtilities.getIntDef("chatsHeaderColor", AndroidUtilities.getIntColor("themeColor"))); Drawable floatingDrawableWhite = fragmentView.getResources().getDrawable(R.drawable.floating_white); floatingDrawableWhite.setColorFilter(AndroidUtilities.getIntDef("chatsFloatingBGColor", AndroidUtilities.getIntColor("themeColor")), PorterDuff.Mode.MULTIPLY); @@ -569,6 +578,20 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter Drawable pencilDrawableWhite = fragmentView.getResources().getDrawable(R.drawable.floating_pencil); pencilDrawableWhite.setColorFilter(AndroidUtilities.getIntDef("chatsFloatingPencilColor", 0xffffffff), PorterDuff.Mode.MULTIPLY); floatingButton.setImageDrawable(pencilDrawableWhite); + Drawable search = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_search); + search.setColorFilter(AndroidUtilities.getIntDef("chatsHeaderIconsColor", 0xffffffff), PorterDuff.Mode.MULTIPLY); + } + + private void updateActionBarTitle(){ + String value = LocaleController.getString("AppName", R.string.AppName); + if(AndroidUtilities.getBoolPref("chatsUsernameTitle")){ + TLRPC.User user = UserConfig.getCurrentUser(); + if (user != null && user.username != null && user.username.length() != 0) { + value = user.username; + } + } + actionBar.setTitle(value); + actionBar.setTitleColor(AndroidUtilities.getIntDef("chatsHeaderTitleColor", 0xffffffff)); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java index 9e30daad..8d868653 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java @@ -24,27 +24,30 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; +import android.widget.ArrayAdapter; import android.widget.FrameLayout; import android.widget.ListView; +import android.widget.Spinner; import org.telegram.android.AndroidUtilities; +import org.telegram.android.LocaleController; import org.telegram.android.MessagesController; import org.telegram.android.MessagesStorage; +import org.telegram.android.NotificationCenter; import org.telegram.android.NotificationsController; import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.FileLog; -import org.telegram.android.LocaleController; -import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Adapters.BaseFragmentAdapter; import org.telegram.ui.Cells.TextColorCell; import org.telegram.ui.Cells.TextDetailSettingsCell; -import org.telegram.ui.ActionBar.ActionBar; -import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Components.AvatarDrawable; import org.telegram.ui.Components.ColorPickerView; +import org.telegram.ui.Components.NumberPicker; public class ProfileNotificationsActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { @@ -55,6 +58,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi private int settingsVibrateRow; private int settingsSoundRow; private int settingsPriorityRow; + private int settingsSmartNotifyRow; private int settingsLedRow; private int rowCount = 0; @@ -66,6 +70,12 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi @Override public boolean onFragmentCreate() { settingsNotificationsRow = rowCount++; + if (dialog_id < 0) { + settingsSmartNotifyRow = rowCount++; + } + else { + settingsSmartNotifyRow = -1; + } settingsVibrateRow = rowCount++; settingsSoundRow = rowCount++; if (Build.VERSION.SDK_INT >= 21) { @@ -155,7 +165,8 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi } AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); - builder.setItems(new CharSequence[] { + //Smart Notifications + /*builder.setItems(new CharSequence[] { LocaleController.getString("Default", R.string.Default), LocaleController.getString("Enabled", R.string.Enabled), LocaleController.getString("NotificationsDisabled", R.string.NotificationsDisabled) @@ -179,7 +190,69 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi } NotificationsController.updateServerNotificationsSettings(dialog_id); } - }); + });*/ + if (dialog_id < 0) { + builder.setItems(new CharSequence[]{ + LocaleController.getString("Default", R.string.Default), + LocaleController.getString("Enabled", R.string.Enabled), + LocaleController.getString("NotificationsDisabled", R.string.NotificationsDisabled), + LocaleController.getString("Smart Notification", R.string.SmartNotification) + }, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + if (which == 3) { + which = 4; //Leave space for "Mute group for D duration" + editor.putBoolean("smart_notify_" + dialog_id, true); + } else { + editor.putBoolean("smart_notify_" + dialog_id, false); + } + editor.putInt("notify2_" + dialog_id, which); + MessagesStorage.getInstance().setDialogFlags(dialog_id, which == 2 ? 1 : 0); + editor.commit(); + TLRPC.TL_dialog tl_dialog = MessagesController.getInstance().dialogs_dict.get(dialog_id); + if (tl_dialog != null) { + tl_dialog.notify_settings = new TLRPC.TL_peerNotifySettings(); + if (which == 2) { + tl_dialog.notify_settings.mute_until = Integer.MAX_VALUE; + } + } + if (listView != null) { + listView.invalidateViews(); + } + NotificationsController.updateServerNotificationsSettings(dialog_id); + } + }); + } + else { + builder.setItems(new CharSequence[]{ + LocaleController.getString("Default", R.string.Default), + LocaleController.getString("Enabled", R.string.Enabled), + LocaleController.getString("NotificationsDisabled", R.string.NotificationsDisabled), + }, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt("notify2_" + dialog_id, which); + MessagesStorage.getInstance().setDialogFlags(dialog_id, which == 2 ? 1 : 0); + editor.commit(); + TLRPC.TL_dialog tl_dialog = MessagesController.getInstance().dialogs_dict.get(dialog_id); + if (tl_dialog != null) { + tl_dialog.notify_settings = new TLRPC.TL_peerNotifySettings(); + if (which == 2) { + tl_dialog.notify_settings.mute_until = Integer.MAX_VALUE; + } + } + if (listView != null) { + listView.invalidateViews(); + } + NotificationsController.updateServerNotificationsSettings(dialog_id); + } + }); + } + // builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); showAlertDialog(builder); } else if (i == settingsSoundRow) { @@ -291,6 +364,73 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); showAlertDialog(builder); } + //Smart Notifications + else if (i == settingsSmartNotifyRow) { + if (getParentActivity() == null) { + return; + } + + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + view = li.inflate(R.layout.settings_smart_notify, null, false); + + String[] timeUnits = { + LocaleController.getString("Seconds", R.string.TimeUnitSeconds), + LocaleController.getString("Minutes", R.string.TimeUnitMinutes), + LocaleController.getString("Hours", R.string.TimeUnitHours), + LocaleController.getString("Days", R.string.TimeUnitDays) + }; + final Spinner timeframeUnitSpinner = (Spinner) view.findViewById(R.id.timeframeunitSpinner); + ArrayAdapter adapter = new ArrayAdapter (li.getContext(), android.R.layout.simple_spinner_item, timeUnits); + adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + timeframeUnitSpinner.setAdapter(adapter); + + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + + final NumberPicker maxcountNumberPicker = (NumberPicker) view.findViewById(R.id.maxcountNumberPicker); + maxcountNumberPicker.setMinValue(1); + maxcountNumberPicker.setMaxValue(10); + maxcountNumberPicker.setValue(preferences.getInt ("smart_notify_max_count_" + dialog_id, 1)); + + final NumberPicker timeframeNumberPicker = (NumberPicker) view.findViewById(R.id.timeframeNumberPicker); + timeframeNumberPicker.setMinValue(1); + timeframeNumberPicker.setMaxValue(100); + + long timeframe = preferences.getLong("smart_notify_timeframe_" + dialog_id, 1); + long multiplier = (timeframe % 86400L == 0L) ? 86400L : ((timeframe % 3600L == 0L) ? 3600L : ((timeframe % 60L == 0L) ? 60L : 1L)); + timeframe = timeframe / multiplier; + timeframeUnitSpinner.setSelection((multiplier == 1L) ? 0 : ((multiplier == 60L) ? 1 : (multiplier == 3600L) ? 2 : 3)); + timeframeNumberPicker.setValue((int)timeframe); + + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setTitle(LocaleController.getString("Smart Notification", R.string.SmartNotification)); + builder.setView(view); + builder.setPositiveButton(LocaleController.getString("Set", R.string.Set), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int which) { + final SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + int unit = timeframeUnitSpinner.getSelectedItemPosition(); + long multiplier = (unit == 0) ? 1L : ((unit == 1) ? 60L : ((unit == 2) ? 3600L : 86400L)); + editor.putInt("smart_notify_max_count_" + dialog_id, maxcountNumberPicker.getValue()); + editor.putLong("smart_notify_timeframe_" + dialog_id, timeframeNumberPicker.getValue() * multiplier); + editor.commit(); + listView.invalidateViews(); + } + }); + builder.setNegativeButton(LocaleController.getString("Default", R.string.Default), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + final SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt("smart_notify_max_count_" + dialog_id, 1); + editor.putLong("smart_notify_timeframe_" + dialog_id, 1); + editor.commit(); + listView.invalidateViews(); + } + }); + showAlertDialog(builder); + } + // } }); } else { @@ -355,11 +495,23 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi @Override public boolean areAllItemsEnabled() { - return true; + //return true; + //Smart Notifications + return false; + // } @Override public boolean isEnabled(int i) { + //Smart Notifications + if (i < 0) + return false; + if (i == settingsSmartNotifyRow) { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + if (!preferences.getBoolean("smart_notify_" + dialog_id, false)) + return false; + } + // return true; } @@ -436,6 +588,11 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi textCell.setTextAndValue(LocaleController.getString("Notifications", R.string.Notifications), LocaleController.getString("NotificationsDisabled", R.string.NotificationsDisabled), true); } } + //Smart Notifications + else if (value == 4) { + textCell.setTextAndValue(LocaleController.getString("Notifications", R.string.Notifications), LocaleController.getString("Smart Notification", R.string.SmartNotification), true); + } + // } else if (i == settingsSoundRow) { String value = preferences.getString("sound_" + dialog_id, LocaleController.getString("Default", R.string.Default)); if (value.equals("NoSound")) { @@ -454,6 +611,36 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi textCell.setTextAndValue(LocaleController.getString("NotificationsPriority", R.string.NotificationsPriority), LocaleController.getString("SettingsDefault", R.string.SettingsDefault), true); } } + //Smart Notifications + else if (i == settingsSmartNotifyRow) { + String value = LocaleController.getString("Disabled", R.string.Disabled); + if (preferences.getBoolean("smart_notify_" + dialog_id, false)) { + long timeframe = preferences.getLong("smart_notify_timeframe_" + dialog_id, 1); + long multiplier = (timeframe % 86400L == 0L) ? 86400L : ((timeframe % 3600L == 0L) ? 3600L : ((timeframe % 60L == 0L) ? 60L : 1L)); + timeframe = timeframe / multiplier; + String[] timeUnits = { + LocaleController.getString("Seconds", R.string.TimeUnitSeconds), + LocaleController.getString("Minutes", R.string.TimeUnitMinutes), + LocaleController.getString("Hours", R.string.TimeUnitHours), + LocaleController.getString("Days", R.string.TimeUnitDays) + }; + value = LocaleController.getString("Sound at most", R.string.settings_smart_notify_begin); + value += " "; + value += preferences.getInt("smart_notify_max_count_" + dialog_id, 1); + value += " "; + value += preferences.getInt("smart_notify_max_count_" + dialog_id, 1) == 1 ? LocaleController.getString("time", R.string.settings_smart_notify_mid11) : LocaleController.getString("time(s)", R.string.settings_smart_notify_mid1); + value += " "; + value += LocaleController.getString("within", R.string.settings_smart_notify_mid2); + value += " "; + value += timeframe; + value += " "; + value += timeUnits [((multiplier == 1L)? 0: (multiplier == 60L)? 1 : (multiplier == 3600L)? 2 : 3)]; + //value += " "; + //value += LocaleController.getString(".", R.string.settings_smart_notify_end); + } + textCell.setTextAndValue(LocaleController.getString("Smart Notification", R.string.SmartNotification), value, true); + } + // } else if (type == 1) { if (view == null) { view = new TextColorCell(mContext); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index dc8be64a..3d5dcd62 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -341,6 +341,30 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter if (user.photo != null && user.photo.photo_big != null) { PhotoViewer.getInstance().setParentActivity(getParentActivity()); PhotoViewer.getInstance().openPhoto(user.photo.photo_big, SettingsActivity.this); + } else{ + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + CharSequence[] items; + boolean fullMenu = false; + if (user.photo != null && user.photo.photo_big != null && !(user.photo instanceof TLRPC.TL_userProfilePhotoEmpty)) { + items = new CharSequence[] {LocaleController.getString("FromCamera", R.string.FromCamera), LocaleController.getString("FromGalley", R.string.FromGalley), LocaleController.getString("DeletePhoto", R.string.DeletePhoto)}; + fullMenu = true; + } else { + items = new CharSequence[] {LocaleController.getString("FromCamera", R.string.FromCamera), LocaleController.getString("FromGalley", R.string.FromGalley)}; + } + + builder.setItems(items, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + if (i == 0) { + avatarUpdater.openCamera(); + } else if (i == 1) { + avatarUpdater.openGallery(); + } else if (i == 2) { + MessagesController.getInstance().deleteUserPhoto(null); + } + } + }); + showAlertDialog(builder); } } }); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java index a844e655..d9b0c8e1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingActivity.java @@ -62,6 +62,7 @@ public class ThemingActivity extends BaseFragment { private int chatsRow; private int chatRow; private int contactsRow; + private int drawerRow; private int themesSectionRow; private int themesSection2Row; @@ -86,6 +87,7 @@ public class ThemingActivity extends BaseFragment { chatsRow = rowCount++; chatRow = rowCount++; contactsRow = rowCount++; + drawerRow = rowCount++; themesSectionRow = rowCount++; themesSection2Row = rowCount++; @@ -311,6 +313,8 @@ public class ThemingActivity extends BaseFragment { presentFragment(new ThemingChatActivity()); } else if (i == contactsRow) { presentFragment(new ThemingContactsActivity()); + } else if (i == drawerRow) { + presentFragment(new ThemingDrawerActivity()); } } }); @@ -411,7 +415,7 @@ public class ThemingActivity extends BaseFragment { editor.putInt("chatsHeaderColor", i); editor.putInt("chatsCountBGColor", i); editor.putInt("chatsChecksColor", i); - editor.putInt("chatsParticipantColor", AndroidUtilities.setDarkColor(i, 0x15)); + editor.putInt("chatsMemberColor", AndroidUtilities.setDarkColor(i, 0x15)); editor.putInt("chatsFloatingBGColor", i); editor.putInt("chatHeaderColor", i); @@ -421,6 +425,7 @@ public class ThemingActivity extends BaseFragment { editor.putInt("chatEmojiViewTabColor", AndroidUtilities.setDarkColor(i, 0x15)); editor.putInt("chatChecksColor", i); editor.putInt("chatSendIconColor", i); + editor.putInt("chatMemberColor", AndroidUtilities.setDarkColor(i, 0x15)); editor.putInt("contactsHeaderColor", i); editor.putInt("contactsOnlineColor", AndroidUtilities.setDarkColor(i, 0x15)); @@ -478,7 +483,7 @@ public class ThemingActivity extends BaseFragment { @Override public boolean isEnabled(int i) { - return i == themeColorRow || i == chatsRow || i == chatRow || i == contactsRow || i == resetThemeRow || i == saveThemeRow || i == applyThemeRow; + return i == themeColorRow || i == chatsRow || i == chatRow || i == contactsRow || i == drawerRow || i == resetThemeRow || i == saveThemeRow || i == applyThemeRow; } @Override @@ -533,6 +538,8 @@ public class ThemingActivity extends BaseFragment { textCell.setText(LocaleController.getString("ChatScreen", R.string.ChatScreen), true); } else if (i == contactsRow) { textCell.setText(LocaleController.getString("ContactsScreen", R.string.ContactsScreen), true); + } else if (i == drawerRow) { + textCell.setText(LocaleController.getString("NavigationDrawer", R.string.NavigationDrawer), true); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java index f7c80765..63b55de0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatActivity.java @@ -33,6 +33,7 @@ import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Adapters.BaseFragmentAdapter; import org.telegram.ui.Cells.HeaderCell; import org.telegram.ui.Cells.ShadowSectionCell; +import org.telegram.ui.Cells.TextCheckCell; import org.telegram.ui.Cells.TextColorCell; import org.telegram.ui.Cells.TextSettingsCell; import org.telegram.ui.Components.AvatarDrawable; @@ -46,9 +47,8 @@ public class ThemingChatActivity extends BaseFragment { private ListView listView; private ListAdapter listAdapter; - private static final String TAG = "ThemingChatsActivity"; - private int headerSection2Row; + private int muteColorRow; private int headerColorRow; private int rowsSectionRow; private int rowsSection2Row; @@ -71,9 +71,13 @@ public class ThemingChatActivity extends BaseFragment { private int editTextColorRow; private int editTextSizeRow; private int editTextBGColorRow; + private int editTextIconsColorRow; private int emojiViewBGColorRow; private int emojiViewTabColorRow; private int sendColorRow; + private int memberColorCheckRow; + private int memberColorRow; + private int forwardNameColorRow; private int rowCount; @@ -86,6 +90,7 @@ public class ThemingChatActivity extends BaseFragment { rowCount = 0; headerSection2Row = rowCount++; headerColorRow = rowCount++; + //muteColorRow = rowCount++; nameSizeRow = rowCount++; nameColorRow = rowCount++; @@ -97,7 +102,7 @@ public class ThemingChatActivity extends BaseFragment { textSizeRow = rowCount++; rTextColorRow = rowCount++; - //lTextColorRow = rowCount++; + lTextColorRow = rowCount++; timeSizeRow = rowCount++; rTimeColorRow = rowCount++; @@ -111,10 +116,15 @@ public class ThemingChatActivity extends BaseFragment { lBubbleColorRow = rowCount++; dateBubbleColorRow = rowCount++; + memberColorCheckRow = rowCount++; + memberColorRow = rowCount++; + forwardNameColorRow = rowCount++; + sendColorRow = rowCount++; editTextSizeRow = rowCount++; editTextColorRow = rowCount++; editTextBGColorRow = rowCount++; + editTextIconsColorRow = rowCount++; emojiViewBGColorRow = rowCount++; emojiViewTabColorRow = rowCount++; @@ -172,6 +182,7 @@ public class ThemingChatActivity extends BaseFragment { public void onItemClick(AdapterView adapterView, View view, final int i, long l) { SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, Activity.MODE_PRIVATE); + final String key = view.getTag() != null ? view.getTag().toString() : ""; if (i == headerColorRow) { if (getParentActivity() == null) { @@ -180,7 +191,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -190,6 +201,59 @@ public class ThemingChatActivity extends BaseFragment { },themePrefs.getInt("chatHeaderColor", AndroidUtilities.getIntColor("themeColor")), CENTER, 0, false); + colorDialog.show(); + } else if (i == memberColorCheckRow) { + 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 == memberColorRow) { + 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("chatMemberColor", color); + } + + },themePrefs.getInt("chatMemberColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15)), CENTER, 0, true); + colorDialog.show(); + } else if (i == forwardNameColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt(key, color); + } + + },themePrefs.getInt(key, 0xff4a923c), CENTER, 0, true); + colorDialog.show(); + } else if (i == muteColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt( key, color); + } + + },themePrefs.getInt( key, 0xffffffff), CENTER, 0, true); colorDialog.show(); } else if (i == rBubbleColorRow) { if (getParentActivity() == null) { @@ -198,7 +262,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -216,7 +280,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -231,11 +295,8 @@ public class ThemingChatActivity extends BaseFragment { if (getParentActivity() == null) { return; } - LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - view = li.inflate(R.layout.colordialog, null, false); - + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { @@ -243,7 +304,6 @@ public class ThemingChatActivity extends BaseFragment { } },themePrefs.getInt("chatRTextColor", 0xff000000), CENTER, 0, true); - colorDialog.show(); } else if (i == lTextColorRow) { if (getParentActivity() == null) { @@ -252,7 +312,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -270,7 +330,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -288,7 +348,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -306,7 +366,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -324,7 +384,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -342,7 +402,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -360,7 +420,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -378,7 +438,7 @@ public class ThemingChatActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override @@ -388,6 +448,21 @@ public class ThemingChatActivity extends BaseFragment { },themePrefs.getInt("chatEditTextBGColor", 0xffffffff), CENTER, 0, true); + colorDialog.show(); + } else if (i == editTextIconsColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt( key, color); + } + + },themePrefs.getInt( key, 0xffadadad), CENTER, 0, false); colorDialog.show(); } else if (i == emojiViewBGColorRow) { if (getParentActivity() == null) { @@ -609,52 +684,59 @@ public class ThemingChatActivity extends BaseFragment { if (getParentActivity() == null) { return false; } + if(view.getTag() != null)resetPref(view.getTag().toString()); if (i == headerColorRow) { - resetInt("chatHeaderColor", AndroidUtilities.getIntColor("themeColor")); + resetPref("chatHeaderColor"); + } else if (i == memberColorRow) { + resetPref("chatMemberColor"); } else if (i == rBubbleColorRow) { - resetInt("chatRBubbleColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x80)); + resetPref("chatRBubbleColor"); } else if (i == lBubbleColorRow) { - resetInt("chatLBubbleColor", 0xffffffff); + resetPref("chatLBubbleColor"); } else if (i == rTextColorRow) { - resetInt("chatRTextColor", 0xff000000); + resetPref("chatRTextColor"); } else if (i == lTextColorRow) { - resetInt("chatLTextColor", 0xff000000); + resetPref("chatLTextColor"); } else if (i == nameColorRow) { - resetInt("chatNameColor", 0xffffffff); + resetPref("chatNameColor"); } else if (i == nameSizeRow) { - resetInt("chatNameSize", 17); + resetPref("chatNameSize"); } else if (i == statusColorRow) { - resetInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x40)); + resetPref("chatStatusColor"); } else if (i == statusSizeRow) { - resetInt("chatStatusSize", 14); + resetPref("chatStatusSize"); } else if (i == rTimeColorRow) { - resetInt("chatRTimeColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)); + resetPref("chatRTimeColor"); } else if (i == lTimeColorRow) { - resetInt("chatLTimeColor", 0xffa1aab3); + resetPref("chatLTimeColor"); } else if (i == dateColorRow) { - resetInt("chatDateColor", 0xffffffff); + resetPref("chatDateColor"); } else if (i == checksColorRow) { - resetInt("chatChecksColor", AndroidUtilities.getIntColor("themeColor")); + resetPref("chatChecksColor"); } else if (i == textSizeRow) { resetInt("chatTextSize", 16); } else if (i == timeSizeRow) { - resetInt("chatTimeSize", 12); + resetPref("chatTimeSize"); } else if (i == dateSizeRow) { - resetInt("chatDateSize", 16); + resetPref("chatDateSize"); } else if (i == dateBubbleColorRow) { - resetInt("chatDateBubbleColor", 0x59000000); + resetPref("chatDateBubbleColor"); } else if (i == sendColorRow) { - resetInt("chatSendIconColor", AndroidUtilities.getIntColor("themeColor")); + resetPref("chatSendIconColor"); } else if (i == editTextColorRow) { - resetInt("chatEditTextColor", 0xff000000); + resetPref("chatEditTextColor"); } else if (i == editTextSizeRow) { - resetInt("chatEditTextSize", 18); + resetPref("chatEditTextSize"); } else if (i == editTextBGColorRow) { - resetInt("chatEditTextBGColor", 0xffffffff); + resetPref("chatEditTextBGColor"); } else if (i == emojiViewBGColorRow) { - resetInt("chatEmojiViewBGColor", 0xff222222); + resetPref("chatEmojiViewBGColor"); } else if (i == emojiViewTabColorRow) { - resetInt("chatEmojiViewTabColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)); + resetPref("chatEmojiViewTabColor"); + } else{ + if(view.getTag() != null){ + resetPref(view.getTag().toString()); + } } return true; } @@ -670,21 +752,25 @@ public class ThemingChatActivity extends BaseFragment { return fragmentView; } - private void resetInt(String key, int value){ + private void resetPref(String key){ SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.remove(key); editor.commit(); + if (listView != null) { + listView.invalidateViews(); + } + } + + private void resetInt(String key, int value){ + resetPref(key); if(key.equals("chatTextSize")){ - preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); - editor = preferences.edit(); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); editor.putInt("fons_size", value); MessagesController.getInstance().fontSize = value; editor.commit(); } - if (listView != null) { - listView.invalidateViews(); - } } private void commitInt(String key, int value){ @@ -744,9 +830,10 @@ public class ThemingChatActivity extends BaseFragment { @Override public boolean isEnabled(int i) { - return i == headerColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow || + return i == headerColorRow || i == muteColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow || i == textSizeRow || i == timeSizeRow || i == dateColorRow || i == dateSizeRow || i == dateBubbleColorRow || i == rTextColorRow || i == lTextColorRow || - i == rTimeColorRow|| i == lTimeColorRow || i == checksColorRow || i == editTextSizeRow || i == editTextColorRow || i == sendColorRow || i == editTextBGColorRow || + i == rTimeColorRow|| i == lTimeColorRow || i == checksColorRow || i == memberColorCheckRow || AndroidUtilities.getBoolPref("chatMemberColorCheck") && i == memberColorRow || i == forwardNameColorRow || + i == editTextSizeRow || i == editTextColorRow || i == editTextIconsColorRow || i == sendColorRow || i == editTextBGColorRow || i == emojiViewBGColorRow || i == emojiViewTabColorRow; } @@ -814,6 +901,15 @@ public class ThemingChatActivity extends BaseFragment { int size = themePrefs.getInt("chatEditTextSize", AndroidUtilities.isTablet() ? 20 : 18); textCell.setTextAndValue(LocaleController.getString("EditTextSize", R.string.EditTextSize), String.format("%d", size), true); } + } else if (type == 4) { + if (view == null) { + view = new TextCheckCell(mContext); + } + TextCheckCell textCell = (TextCheckCell) view; + if (i == memberColorCheckRow) { + textCell.setTag("chatMemberColorCheck"); + textCell.setTextAndCheck(LocaleController.getString("SetMemberColor", R.string.SetMemberColor), themePrefs.getBoolean("chatMemberColorCheck", false), false); + } } else if (type == 3){ if (view == null) { @@ -824,6 +920,14 @@ public class ThemingChatActivity extends BaseFragment { if (i == headerColorRow) { textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("chatHeaderColor", AndroidUtilities.getIntColor("themeColor")), true); + } else if (i == memberColorRow) { + textCell.setTextAndColor(LocaleController.getString("MemberColor", R.string.MemberColor), AndroidUtilities.getBoolPref("chatMemberColorCheck") ? themePrefs.getInt("chatMemberColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15)) : 0x00000000, true); + } else if (i == forwardNameColorRow) { + textCell.setTag("chatForwardColor"); + textCell.setTextAndColor(LocaleController.getString("ForwardNameColor", R.string.ForwardNameColor), themePrefs.getInt("chatForwardColor", 0xff4a923c), true); + } else if (i == muteColorRow) { + textCell.setTag("chatMuteColor"); + textCell.setTextAndColor(LocaleController.getString("MuteColor", R.string.MuteColor), themePrefs.getInt("chatMuteColor", 0xffffffff), true); } else if (i == rBubbleColorRow) { textCell.setTextAndColor(LocaleController.getString("RBubbleColor", R.string.RBubbleColor), themePrefs.getInt("chatRBubbleColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x80)), true); } else if (i == lBubbleColorRow) { @@ -852,6 +956,9 @@ 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 == editTextIconsColorRow) { + textCell.setTag("chatEditTextIconsColor"); + textCell.setTextAndColor(LocaleController.getString("EditTextIconsColor", R.string.EditTextIconsColor), themePrefs.getInt("chatEditTextIconsColor", 0xffadadad), true); } else if (i == emojiViewBGColorRow) { textCell.setTextAndColor(LocaleController.getString("EmojiViewBGColor", R.string.EmojiViewBGColor), themePrefs.getInt("chatEmojiViewBGColor", 0xff222222), true); } else if (i == emojiViewTabColorRow) { @@ -873,10 +980,14 @@ public class ThemingChatActivity extends BaseFragment { return 2; } - else if ( i == headerColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == nameColorRow || i == statusColorRow || i == dateColorRow || i == dateBubbleColorRow || - i == rTextColorRow || i == lTextColorRow || i == rTimeColorRow || i == lTimeColorRow || i == checksColorRow || i == sendColorRow || i == editTextColorRow || i == editTextBGColorRow || + else if ( i == headerColorRow || i == muteColorRow || + i == rBubbleColorRow || i == lBubbleColorRow || i == nameColorRow || i == statusColorRow || i == dateColorRow || i == dateBubbleColorRow || + i == rTextColorRow || i == lTextColorRow || i == rTimeColorRow || i == lTimeColorRow || i == checksColorRow || i == memberColorRow || i == forwardNameColorRow || + i == sendColorRow || i == editTextColorRow || i == editTextBGColorRow || i == editTextIconsColorRow || i == emojiViewBGColorRow || i == emojiViewTabColorRow) { return 3; + } else if (i == memberColorCheckRow) { + return 4; } else { return 2; @@ -885,7 +996,7 @@ public class ThemingChatActivity extends BaseFragment { @Override public int getViewTypeCount() { - return 4; + return 5; } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatsActivity.java index 801dc5c8..458b4f0d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingChatsActivity.java @@ -22,6 +22,7 @@ import android.view.ViewTreeObserver; import android.widget.AdapterView; import android.widget.FrameLayout; import android.widget.ListView; +import android.widget.Toast; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; @@ -32,6 +33,7 @@ import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Adapters.BaseFragmentAdapter; import org.telegram.ui.Cells.HeaderCell; import org.telegram.ui.Cells.ShadowSectionCell; +import org.telegram.ui.Cells.TextCheckCell; import org.telegram.ui.Cells.TextColorCell; import org.telegram.ui.Cells.TextSettingsCell; import org.telegram.ui.Components.AvatarDrawable; @@ -45,19 +47,23 @@ public class ThemingChatsActivity extends BaseFragment { private ListView listView; private ListAdapter listAdapter; - //private static final String TAG = "ThemingChatsActivity"; - private int headerSection2Row; private int headerColorRow; + private int headerTitleColorRow; + private int headerIconsColorRow; private int rowsSectionRow; private int rowsSection2Row; private int rowColorRow; + private int dividerColorRow; + private int usernameTitleRow; + private int nameSizeRow; private int nameColorRow; private int checksColorRow; private int muteColorRow; - private int nameSizeRow; + private int avatarRadiusRow; private int messageColorRow; - private int participantColorRow; + private int memberColorRow; + private int typingColorRow; private int messageSizeRow; private int timeColorRow; private int timeSizeRow; @@ -78,11 +84,16 @@ public class ThemingChatsActivity extends BaseFragment { rowCount = 0; headerSection2Row = rowCount++; headerColorRow = rowCount++; + headerTitleColorRow = rowCount++; + usernameTitleRow = rowCount++; + headerIconsColorRow = rowCount++; rowsSectionRow = rowCount++; rowsSection2Row = rowCount++; rowColorRow = rowCount++; + dividerColorRow = rowCount++; + //avatarRadiusRow = rowCount++; nameColorRow = rowCount++; nameSizeRow = rowCount++; muteColorRow = rowCount++; @@ -90,7 +101,8 @@ public class ThemingChatsActivity extends BaseFragment { messageColorRow = rowCount++; messageSizeRow = rowCount++; - participantColorRow = rowCount++; + memberColorRow = rowCount++; + typingColorRow = rowCount++; timeColorRow = rowCount++; timeSizeRow = rowCount++; countColorRow = rowCount++; @@ -153,43 +165,84 @@ public class ThemingChatsActivity extends BaseFragment { public void onItemClick(AdapterView adapterView, View view, final int i, long l) { SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, Activity.MODE_PRIVATE); + final String key = view.getTag().toString(); if (i == headerColorRow) { if (getParentActivity() == null) { return; } - LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - view = li.inflate(R.layout.colordialog, null, false); - + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsHeaderColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsHeaderColor", AndroidUtilities.getIntColor("themeColor")), CENTER, 0, false); - + },themePrefs.getInt( key, AndroidUtilities.getIntColor("themeColor")), CENTER, 0, false); + colorDialog.show(); + } else if (i == headerTitleColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt( key, color); + } + },themePrefs.getInt( key, 0xffffffff), CENTER, 0, false); + colorDialog.show(); + } else if (i == headerIconsColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt( key, color); + } + },themePrefs.getInt( key, 0xffffffff), CENTER, 0, false); colorDialog.show(); } else if (i == rowColorRow) { if (getParentActivity() == null) { return; } - LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - view = li.inflate(R.layout.colordialog, null, false); - + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsRowColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsRowColor", 0xffffffff), CENTER, 0, false); - + },themePrefs.getInt( key, 0xffffffff), CENTER, 0, false); colorDialog.show(); + } else if (i == dividerColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt( key, color); + } + + },themePrefs.getInt( key, 0xffdcdcdc), CENTER, 0, false); + colorDialog.show(); + } else if (i == usernameTitleRow) { + 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); + } } else if (i == nameColorRow) { if (getParentActivity() == null) { return; @@ -197,15 +250,15 @@ public class ThemingChatsActivity extends BaseFragment { LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsNameColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsNameColor", 0xff000000), CENTER, 0, false); + },themePrefs.getInt( key, 0xff000000), CENTER, 0, false); colorDialog.show(); } else if (i == muteColorRow) { @@ -213,57 +266,72 @@ public class ThemingChatsActivity extends BaseFragment { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsMuteColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsMuteColor", 0xffa8a8a8), CENTER, 0, true); + },themePrefs.getInt( key, 0xffa8a8a8), CENTER, 0, true); colorDialog.show(); } else if (i == checksColorRow) { if (getParentActivity() == null) { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsChecksColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsChecksColor", AndroidUtilities.getIntColor("themeColor")), CENTER, 0, true); + },themePrefs.getInt( key, AndroidUtilities.getIntColor("themeColor")), CENTER, 0, true); colorDialog.show(); } else if (i == messageColorRow) { if (getParentActivity() == null) { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsMessageColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsMessageColor", 0xff8f8f8f), CENTER, 0, false); + },themePrefs.getInt( key, 0xff8f8f8f), CENTER, 0, false); colorDialog.show(); - } else if (i == participantColorRow) { + } else if (i == memberColorRow) { if (getParentActivity() == null) { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsParticipantColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsParticipantColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)), CENTER, 0, false); + },themePrefs.getInt( key, AndroidUtilities.getIntDarkerColor("themeColor",0x15)), CENTER, 0, false); + + colorDialog.show(); + } else if (i == typingColorRow) { + if (getParentActivity() == null) { + return; + } + LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + li.inflate(R.layout.colordialog, null, false); + ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { + @Override + public void colorChanged(int color) { + commitInt( key, color); + } + + },themePrefs.getInt( key, AndroidUtilities.getIntColor("themeColor")), CENTER, 0, false); colorDialog.show(); } else if (i == timeColorRow) { @@ -271,43 +339,64 @@ public class ThemingChatsActivity extends BaseFragment { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsTimeColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsTimeColor", 0xff999999), CENTER, 0, false); + },themePrefs.getInt( key, 0xff999999), CENTER, 0, false); colorDialog.show(); } else if (i == countColorRow) { if (getParentActivity() == null) { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsCountColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsCountColor", 0xffffffff), CENTER, 0, false); + },themePrefs.getInt( key, 0xffffffff), CENTER, 0, false); colorDialog.show(); } else if (i == countBGColorRow) { if (getParentActivity() == null) { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsCountBGColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsCountBGColor", AndroidUtilities.getIntColor("themeColor")), CENTER, 0, true); + },themePrefs.getInt( key, AndroidUtilities.getIntColor("themeColor")), CENTER, 0, true); colorDialog.show(); + } else if (i == avatarRadiusRow) { + if (getParentActivity() == null) { + return; + } + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setTitle(LocaleController.getString("AvatarRadius", R.string.AvatarRadius)); + final NumberPicker numberPicker = new NumberPicker(getParentActivity()); + final int currentValue = themePrefs.getInt( key, 32); + numberPicker.setMinValue(0); + numberPicker.setMaxValue(32); + numberPicker.setValue(currentValue); + builder.setView(numberPicker); + builder.setNegativeButton(LocaleController.getString("Done", R.string.Done), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + if (numberPicker.getValue() != currentValue) { + commitInt( key, numberPicker.getValue()); + } + } + }); + showAlertDialog(builder); } else if (i == nameSizeRow) { if (getParentActivity() == null) { return; @@ -315,7 +404,7 @@ public class ThemingChatsActivity extends BaseFragment { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("NameSize", R.string.NameSize)); final NumberPicker numberPicker = new NumberPicker(getParentActivity()); - final int currentValue = themePrefs.getInt("chatsNameSize", 17); + final int currentValue = themePrefs.getInt( key, 17); numberPicker.setMinValue(12); numberPicker.setMaxValue(30); numberPicker.setValue(currentValue); @@ -324,7 +413,7 @@ public class ThemingChatsActivity extends BaseFragment { @Override public void onClick(DialogInterface dialog, int which) { if (numberPicker.getValue() != currentValue) { - commitInt("chatsNameSize", numberPicker.getValue()); + commitInt( key, numberPicker.getValue()); } } }); @@ -336,7 +425,7 @@ public class ThemingChatsActivity extends BaseFragment { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("MessageSize", R.string.MessageSize)); final NumberPicker numberPicker = new NumberPicker(getParentActivity()); - final int currentValue = themePrefs.getInt("chatsMessageSize", 16); + final int currentValue = themePrefs.getInt( key, 16); numberPicker.setMinValue(12); numberPicker.setMaxValue(30); numberPicker.setValue(currentValue); @@ -345,7 +434,7 @@ public class ThemingChatsActivity extends BaseFragment { @Override public void onClick(DialogInterface dialog, int which) { if(numberPicker.getValue() != currentValue){ - commitInt("chatsMessageSize", numberPicker.getValue()); + commitInt( key, numberPicker.getValue()); } } }); @@ -357,7 +446,7 @@ public class ThemingChatsActivity extends BaseFragment { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("TimeDateSize", R.string.TimeDateSize)); final NumberPicker numberPicker = new NumberPicker(getParentActivity()); - final int currentValue = themePrefs.getInt("chatsTimeSize", 13); + final int currentValue = themePrefs.getInt( key, 13); numberPicker.setMinValue(5); numberPicker.setMaxValue(25); numberPicker.setValue(currentValue); @@ -366,7 +455,7 @@ public class ThemingChatsActivity extends BaseFragment { @Override public void onClick(DialogInterface dialog, int which) { if (numberPicker.getValue() != currentValue) { - commitInt("chatsTimeSize", numberPicker.getValue()); + commitInt( key, numberPicker.getValue()); } } }); @@ -378,7 +467,7 @@ public class ThemingChatsActivity extends BaseFragment { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("CountSize", R.string.CountSize)); final NumberPicker numberPicker = new NumberPicker(getParentActivity()); - final int currentValue = themePrefs.getInt("chatsCountSize", 13); + final int currentValue = themePrefs.getInt( key, 13); numberPicker.setMinValue(8); numberPicker.setMaxValue(20); numberPicker.setValue(currentValue); @@ -387,7 +476,7 @@ public class ThemingChatsActivity extends BaseFragment { @Override public void onClick(DialogInterface dialog, int which) { if (numberPicker.getValue() != currentValue) { - commitInt("chatsCountSize", numberPicker.getValue()); + commitInt( key, numberPicker.getValue()); } } }); @@ -397,28 +486,28 @@ public class ThemingChatsActivity extends BaseFragment { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsFloatingPencilColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsFloatingPencilColor", 0xffffffff), CENTER, 0, true); + },themePrefs.getInt( key, 0xffffffff), CENTER, 0, true); colorDialog.show(); } else if (i == floatingBGColorRow) { if (getParentActivity() == null) { return; } LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.colordialog, null, false); + li.inflate(R.layout.colordialog, null, false); ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() { @Override public void colorChanged(int color) { - commitInt("chatsFloatingBGColor", color); + commitInt( key, color); } - },themePrefs.getInt("chatsFloatingBGColor", AndroidUtilities.getIntColor("themeColor")), CENTER, 0, true); + },themePrefs.getInt( key, AndroidUtilities.getIntColor("themeColor")), CENTER, 0, true); colorDialog.show(); } } @@ -430,39 +519,7 @@ public class ThemingChatsActivity extends BaseFragment { if (getParentActivity() == null) { return false; } - if (i == headerColorRow) { - resetInt("chatsHeaderColor", AndroidUtilities.getIntColor("themeColor")); - } else if (i == rowColorRow) { - resetInt("chatsRowColor", 0xffffffff); - } else if (i == nameColorRow) { - resetInt("chatsNameColor", 0xff000000); - } else if (i == muteColorRow) { - resetInt("chatsMuteColor", 0xffa8a8a8); - } else if (i == checksColorRow) { - resetInt("chatsChecksColor", AndroidUtilities.getIntColor("themeColor")); - } else if (i == nameSizeRow) { - resetInt("chatsNameSize", 17); - } else if (i == messageColorRow) { - resetInt("chatsMessageColor", 0xff8f8f8f); - } else if (i == participantColorRow) { - resetInt("chatsParticipantColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)); - } else if (i == messageSizeRow) { - resetInt("chatsMessageSize", 16); - } else if (i == timeColorRow) { - resetInt("chatsTimeColor", 0xff999999); - } else if (i == timeSizeRow) { - resetInt("chatsTimeSize", 13); - } else if (i == countColorRow) { - resetInt("chatsCountColor", 0xffffffff); - } else if (i == countSizeRow) { - resetInt("chatsCountSize", 13); - } else if (i == countBGColorRow) { - resetInt("chatsCountBGColor", AndroidUtilities.getIntColor("themeColor")); - } else if (i == floatingPencilColorRow) { - resetInt("chatsFloatingPencilColor", 0xffffffff); - } else if (i == floatingBGColorRow) { - resetInt("chatsFloatingBGColor", AndroidUtilities.getIntColor("themeColor")); - } + resetPref(view.getTag().toString()); return true; } }); @@ -477,10 +534,10 @@ public class ThemingChatsActivity extends BaseFragment { return fragmentView; } - private void resetInt(String key, int value){ + private void resetPref(String key){ SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); - editor.remove(key); + if(key != null)editor.remove(key); editor.commit(); if (listView != null) { listView.invalidateViews(); @@ -544,7 +601,9 @@ public class ThemingChatsActivity extends BaseFragment { @Override public boolean isEnabled(int i) { - return i == headerColorRow || i == rowColorRow || i == nameColorRow || i == muteColorRow || i == checksColorRow || i == nameSizeRow || i == messageColorRow || i == participantColorRow || i == messageSizeRow || + return i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == usernameTitleRow || + i == rowColorRow || i == dividerColorRow || i == avatarRadiusRow || + i == nameColorRow || i == muteColorRow || i == checksColorRow || i == nameSizeRow || i == messageColorRow || i == memberColorRow || i == typingColorRow || i == messageSizeRow || i == timeColorRow || i == timeSizeRow || i == countColorRow || i == countSizeRow || i == countBGColorRow || i == floatingPencilColorRow || i == floatingBGColorRow; } @@ -576,8 +635,7 @@ public class ThemingChatsActivity extends BaseFragment { if (view == null) { view = new ShadowSectionCell(mContext); } - } - else if (type == 1) { + } else if (type == 1) { if (view == null) { view = new HeaderCell(mContext); view.setBackgroundColor(0xffffffff); @@ -587,28 +645,34 @@ public class ThemingChatsActivity extends BaseFragment { } else if (i == rowsSection2Row) { ((HeaderCell) view).setText(LocaleController.getString("ChatsList", R.string.ChatsList)); } - } - else if (type == 2) { + } else if (type == 2) { if (view == null) { view = new TextSettingsCell(mContext); } TextSettingsCell textCell = (TextSettingsCell) view; - if (i == nameSizeRow) { + if (i == avatarRadiusRow) { + textCell.setTag("chatsAvatarRadius"); + int size = themePrefs.getInt("chatsAvatarRadius", AndroidUtilities.isTablet() ? 35 : 32); + textCell.setTextAndValue(LocaleController.getString("AvatarRadius", R.string.AvatarRadius), String.format("%d", size), true); + } else if (i == nameSizeRow) { + textCell.setTag("chatsNameSize"); int size = themePrefs.getInt("chatsNameSize", AndroidUtilities.isTablet() ? 19 : 17); textCell.setTextAndValue(LocaleController.getString("NameSize", R.string.NameSize), String.format("%d", size), true); } else if (i == messageSizeRow) { + textCell.setTag("chatsMessageSize"); int size = themePrefs.getInt("chatsMessageSize", AndroidUtilities.isTablet() ? 18 : 16); textCell.setTextAndValue(LocaleController.getString("MessageSize", R.string.MessageSize), String.format("%d", size), true); } else if (i == timeSizeRow) { + textCell.setTag("chatsTimeSize"); int size = themePrefs.getInt("chatsTimeSize", AndroidUtilities.isTablet() ? 15 : 13); textCell.setTextAndValue(LocaleController.getString("TimeDateSize", R.string.TimeDateSize), String.format("%d", size), true); } else if (i == countSizeRow) { + textCell.setTag("chatsCountSize"); int size = themePrefs.getInt("chatsCountSize", AndroidUtilities.isTablet() ? 15 : 13); textCell.setTextAndValue(LocaleController.getString("CountSize", R.string.CountSize), String.format("%d", size), true); } - } - else if (type == 3){ + } else if (type == 3){ if (view == null) { view = new TextColorCell(mContext); } @@ -616,30 +680,64 @@ public class ThemingChatsActivity extends BaseFragment { TextColorCell textCell = (TextColorCell) view; if (i == headerColorRow) { + textCell.setTag("chatsHeaderColor"); textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("chatsHeaderColor", AndroidUtilities.getIntColor("themeColor")), true); + } else if (i == headerTitleColorRow) { + textCell.setTag("chatsHeaderTitleColor"); + textCell.setTextAndColor(LocaleController.getString("HeaderTitleColor", R.string.HeaderTitleColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true); + } else if (i == headerIconsColorRow) { + textCell.setTag("chatsHeaderIconsColor"); + textCell.setTextAndColor(LocaleController.getString("HeaderTitleColor", R.string.HeaderIconsColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true); } else if (i == rowColorRow) { + textCell.setTag("chatsRowColor"); textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt("chatsRowColor", 0xffffffff), true); + } else if (i == dividerColorRow) { + textCell.setTag("chatsDividerColor"); + textCell.setTextAndColor(LocaleController.getString("DividerColor", R.string.DividerColor), themePrefs.getInt("chatsDividerColor", 0xffdcdcdc), true); } else if (i == nameColorRow) { + textCell.setTag("chatsNameColor"); textCell.setTextAndColor(LocaleController.getString("NameColor", R.string.NameColor), themePrefs.getInt("chatsNameColor", 0xff000000), true); } else if (i == muteColorRow) { + textCell.setTag("chatsMuteColor"); textCell.setTextAndColor(LocaleController.getString("MuteColor", R.string.MuteColor), themePrefs.getInt("chatsMuteColor", 0xffa8a8a8), true); } else if (i == checksColorRow) { + textCell.setTag("chatsChecksColor"); textCell.setTextAndColor(LocaleController.getString("ChecksColor", R.string.ChecksColor), themePrefs.getInt("chatsChecksColor", AndroidUtilities.getIntColor("themeColor")), true); } else if (i == messageColorRow) { + textCell.setTag("chatsMessageColor"); textCell.setTextAndColor(LocaleController.getString("MessageColor", R.string.MessageColor), themePrefs.getInt("chatsMessageColor", 0xff8f8f8f), true); - } else if (i == participantColorRow) { - textCell.setTextAndColor(LocaleController.getString("ParticipantColor", R.string.ParticipantColor), themePrefs.getInt("chatsParticipantColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)), true); + } else if (i == memberColorRow) { + textCell.setTag("chatsMemberColor"); + textCell.setTextAndColor(LocaleController.getString("MemberColor", R.string.MemberColor), themePrefs.getInt("chatsMemberColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)), true); + } else if (i == typingColorRow) { + textCell.setTag("chatsTypingColor"); + textCell.setTextAndColor(LocaleController.getString("TypingColor", R.string.TypingColor), themePrefs.getInt(textCell.getTag().toString(), AndroidUtilities.getIntColor("themeColor")), true); } else if (i == timeColorRow) { + textCell.setTag("chatsTimeColor"); textCell.setTextAndColor(LocaleController.getString("TimeDateColor", R.string.TimeDateColor), themePrefs.getInt("chatsTimeColor", 0xff999999), true); } else if (i == countColorRow) { + textCell.setTag("chatsCountColor"); textCell.setTextAndColor(LocaleController.getString("CountColor", R.string.CountColor), themePrefs.getInt("chatsCountColor", 0xffffffff), true); } else if (i == countBGColorRow) { + textCell.setTag("chatsCountBGColor"); textCell.setTextAndColor(LocaleController.getString("CountBGColor", R.string.CountBGColor), themePrefs.getInt("chatsCountBGColor", AndroidUtilities.getIntColor("themeColor")), true); } else if (i == floatingPencilColorRow) { + textCell.setTag("chatsFloatingPencilColor"); textCell.setTextAndColor(LocaleController.getString("FloatingPencilColor", R.string.FloatingPencilColor), themePrefs.getInt("chatsFloatingPencilColor", 0xffffffff), true); } else if (i == floatingBGColorRow) { + textCell.setTag("chatsFloatingBGColor"); textCell.setTextAndColor(LocaleController.getString("FloatingBGColor", R.string.FloatingBGColor), themePrefs.getInt("chatsFloatingBGColor", AndroidUtilities.getIntColor("themeColor")), true); } + } else if (type == 4) { + if (view == null) { + view = new TextCheckCell(mContext); + } + TextCheckCell textCell = (TextCheckCell) view; + + if (i == usernameTitleRow) { + textCell.setTag("chatsUsernameTitle"); + textCell.setTextAndCheck(LocaleController.getString("UsernameTitle", R.string.UsernameTitle), themePrefs.getBoolean("chatsUsernameTitle", false), false); + } } return view; } @@ -648,26 +746,24 @@ public class ThemingChatsActivity extends BaseFragment { public int getItemViewType(int i) { if ( i == rowsSectionRow ) { return 0; - } - else if ( i == headerSection2Row || i == rowsSection2Row ) { + } else if ( i == headerSection2Row || i == rowsSection2Row ) { return 1; - } - else if ( i == nameSizeRow || i == messageSizeRow || i == timeSizeRow || i == countSizeRow ) { + } else if ( i == avatarRadiusRow || i == nameSizeRow || i == messageSizeRow || i == timeSizeRow || i == countSizeRow ) { return 2; - } - - else if ( i == headerColorRow || i == rowColorRow || i == nameColorRow || i == muteColorRow || i == checksColorRow || i == messageColorRow || i == participantColorRow || i == timeColorRow || i == countColorRow - || i == countBGColorRow || i == floatingPencilColorRow || i == floatingBGColorRow) { + } else if ( i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || + i == rowColorRow || i == dividerColorRow || i == nameColorRow || i == muteColorRow || i == checksColorRow || i == messageColorRow || i == memberColorRow || i == typingColorRow || i == timeColorRow || i == countColorRow || + i == countBGColorRow || i == floatingPencilColorRow || i == floatingBGColorRow) { return 3; - } - else { + } else if (i == usernameTitleRow) { + return 4; + } else { return 2; } } @Override public int getViewTypeCount() { - return 4; + return 5; } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ThemingContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ThemingContactsActivity.java index f86304bc..0ca28276 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ThemingContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ThemingContactsActivity.java @@ -45,20 +45,18 @@ public class ThemingContactsActivity extends BaseFragment { private ListView listView; private ListAdapter listAdapter; - //private static final String TAG = "ThemingContactsActivity"; - private int headerSection2Row; private int headerColorRow; private int rowsSectionRow; private int rowsSection2Row; private int rowColorRow; + private int avatarRadiusRow; private int nameColorRow; private int nameSizeRow; private int statusColorRow; private int statusSizeRow; private int onlineColorRow; - private int rowCount; public final static int CENTER = 0; @@ -74,6 +72,7 @@ public class ThemingContactsActivity extends BaseFragment { rowsSectionRow = rowCount++; rowsSection2Row = rowCount++; rowColorRow = rowCount++; + //avatarRadiusRow = rowCount++; nameColorRow = rowCount++; nameSizeRow = rowCount++; statusColorRow = rowCount++; @@ -99,7 +98,7 @@ public class ThemingContactsActivity extends BaseFragment { if (AndroidUtilities.isTablet()) { actionBar.setOccupyStatusBar(false); } - actionBar.setTitle(LocaleController.getString("MainScreen", R.string.MainScreen)); + actionBar.setTitle(LocaleController.getString("ContactsScreen", R.string.ContactsScreen)); actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override @@ -217,6 +216,27 @@ public class ThemingContactsActivity extends BaseFragment { },themePrefs.getInt("contactsOnlineColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)), CENTER, 0, false); colorDialog.show(); + } else if (i == avatarRadiusRow) { + if (getParentActivity() == null) { + return; + } + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setTitle(LocaleController.getString("AvatarRadius", R.string.AvatarRadius)); + final NumberPicker numberPicker = new NumberPicker(getParentActivity()); + final int currentValue = themePrefs.getInt("contactsAvatarRadius", 32); + numberPicker.setMinValue(0); + numberPicker.setMaxValue(32); + numberPicker.setValue(currentValue); + builder.setView(numberPicker); + builder.setNegativeButton(LocaleController.getString("Done", R.string.Done), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + if (numberPicker.getValue() != currentValue) { + commitInt("contactsAvatarRadius", numberPicker.getValue()); + } + } + }); + showAlertDialog(builder); } else if (i == nameSizeRow) { if (getParentActivity() == null) { return; @@ -270,19 +290,21 @@ public class ThemingContactsActivity extends BaseFragment { return false; } if (i == headerColorRow) { - resetInt("contactsHeaderColor", AndroidUtilities.getIntColor("themeColor")); + resetInt("contactsHeaderColor"); } else if (i == rowColorRow) { - resetInt("contactsRowColor", 0xffffffff); + resetInt("contactsRowColor"); + } else if (i == avatarRadiusRow) { + resetInt("contactsAvatarSize"); } else if (i == nameColorRow) { - resetInt("contactsNameColor", 0xff000000); + resetInt("contactsNameColor"); } else if (i == nameSizeRow) { - resetInt("contactsNameSize", 17); + resetInt("contactsNameSize"); } else if (i == statusColorRow) { - resetInt("contactsStatusColor", 0xffa8a8a8); + resetInt("contactsStatusColor"); } else if (i == statusSizeRow) { - resetInt("contactsStatusSize", 14); + resetInt("contactsStatusSize"); } else if (i == onlineColorRow) { - resetInt("contactsOnlineColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)); + resetInt("contactsOnlineColor"); } return true; } @@ -298,7 +320,7 @@ public class ThemingContactsActivity extends BaseFragment { return fragmentView; } - private void resetInt(String key, int value){ + private void resetInt(String key){ SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.remove(key); @@ -365,7 +387,7 @@ public class ThemingContactsActivity extends BaseFragment { @Override public boolean isEnabled(int i) { - return i == headerColorRow || i == rowColorRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow || + return i == headerColorRow || i == rowColorRow || i == avatarRadiusRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow || i == onlineColorRow ; } @@ -414,7 +436,10 @@ public class ThemingContactsActivity extends BaseFragment { view = new TextSettingsCell(mContext); } TextSettingsCell textCell = (TextSettingsCell) view; - if (i == nameSizeRow) { + if (i == avatarRadiusRow) { + int size = themePrefs.getInt("contactsAvatarRadius", AndroidUtilities.isTablet() ? 35 : 32); + textCell.setTextAndValue(LocaleController.getString("AvatarRadius", R.string.AvatarRadius), String.format("%d", size), true); + } else if (i == nameSizeRow) { int size = themePrefs.getInt("contactsNameSize", AndroidUtilities.isTablet() ? 19 : 17); textCell.setTextAndValue(LocaleController.getString("NameSize", R.string.NameSize), String.format("%d", size), true); } else if (i == statusSizeRow) { @@ -453,7 +478,7 @@ public class ThemingContactsActivity extends BaseFragment { else if ( i == headerSection2Row || i == rowsSection2Row ) { return 1; } - else if ( i == nameSizeRow || i == statusSizeRow ) { + else if ( i == avatarRadiusRow || i == nameSizeRow || i == statusSizeRow ) { return 2; } diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/docload_g.png b/TMessagesProj/src/main/res/drawable-xxhdpi/docload_g.png index 5da89c78..6b5f8bc4 100644 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/docload_g.png and b/TMessagesProj/src/main/res/drawable-xxhdpi/docload_g.png differ diff --git a/TMessagesProj/src/main/res/values-ar/strings.xml b/TMessagesProj/src/main/res/values-ar/strings.xml index d144ae03..4e390e35 100644 --- a/TMessagesProj/src/main/res/values-ar/strings.xml +++ b/TMessagesProj/src/main/res/values-ar/strings.xml @@ -627,4 +627,74 @@ HH:mm h:mm a %1$s الساعة %2$s + + تلغرام للاندرويد + Theming + Invalid color hex code! + لون الثيم + اعاة الضبط الافتراضي + التراجع عن كافة ضبط الثيمات + اعادة ضبط الثيمات الي الافتراضي + عام + شاشات + الشاشة الرئيسية + شاشة المحادثة + شاشة الاسماء + الشريط العلوي + الصفوف + قائمة المحادثة + قائمة المحادثات + قائمة الاسماء + لون الشريط العلوي + لون جهات الاتصال + حجم اسماء جهات الاتصال + لون الرسالة + حجم الرسالة + لون الزمن/التاريخ + حجم الزمن/التاريخ + لون العداد + حجم العداد + لون الصف + لون خلفية العداد + لون الحالة + حجم الحالة + لون الفقاعة اليمين + لون الفقاعة اليسار + لون التريخ + حجم التاريخ + لون فقاعة التاريخ + لون الخط + لون الخط اليسار + لون الزمن اليمين + لون الزمن اليسار + حجم الزمن + لون نص الادخال + حجم نص الادخال + لون خلفية نص الادخال + لون خلفية الفيسات + لون تبويب الفيسات + لون حالة الاتصال + موسيقى + حفظ الثيم + حفظ الثيمات في مجلد Telegram/Themes + تم حفظ الثيم + %1$s saved to %2$s + Theme not created yet. Apply any Telegram+ MOD first, please + Preferences restored from sdcard + No preferences file found in %s + لاتوجد بطاقة ذاكرة + ادخل الاسم + الثيمات + تطبيق الثيم + Apply xml theme from local folder + Participant Color + Ticks Color + Mute Color + Send Logs + There aren\'t logs + Send Icon + Hide Mobile Number + Floating Pencil Color + Floating Background Color + G+ Community \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-de/strings.xml b/TMessagesProj/src/main/res/values-de/strings.xml index 034bb3ac..f2ae55b6 100644 --- a/TMessagesProj/src/main/res/values-de/strings.xml +++ b/TMessagesProj/src/main/res/values-de/strings.xml @@ -212,7 +212,7 @@ Ein Benutzername benötigt mindestens 5 Zeichen. Ein Benutzername darf maximal 32 Zeichen haben. Benutzernamen dürfen leider nicht mit einer Zahl anfangen. - Wähle einen für jeden sichtbaren Benutzernamen, wenn du von anderen bei ]]>Telegram]]> gefunden werden willst — ohne, dass sie deine Nummer kennen müssen.
]]>Erlaubt sind ]]>a-z]]>, ]]>0-9]]> und Unterstriche. Die Mindestlänge beträgt ]]>5]]> Zeichen.
+ Wähle einen für jeden sichtbaren Benutzernamen, wenn du von anderen bei ]]>Telegram+]]> gefunden werden willst — ohne, dass sie deine Nummer kennen müssen.
]]>Erlaubt sind ]]>a-z]]>, ]]>0-9]]> und Unterstriche. Die Mindestlänge beträgt ]]>5]]> Zeichen.
Prüfe Benutzername... %1$s ist verfügbar. Keiner @@ -504,7 +504,7 @@ Weiterleiten an %1$s? Verzeihung, diese Funktion ist derzeit in deinem Land nicht verfügbar. - Telegram + Telegram+ Schnell Kostenlos Sicher @@ -627,4 +627,74 @@ HH:mm h:mm a %1$s um %2$s + + Telegram+ für Android + Design + Ungültiger Farb Hex-Code! + Design Farbe + Design Einstellungen zurücksetzen + Alle Design Einstellungen rückgängig machen + Design Einstellungen auf Standardwerte zurücksetzen!! + Allgemein + Bildschirme + Hauptübersicht + Chatübersicht + Kontaktübersicht + Kopfzeile + Zeilen + Chat Liste + Chat Verlauf + Kontakt Liste + Kopfzeile Farbe + Farbe des Kontaktnames + Größe des Kontaktnamens + Nachrichten Farbe + Nachrichten Größe + Farbe Zeit/Datum + Größe Zeit/Datum + Farbe ungelesene Nachrichten + Größe ungelesene Nachrichten + Zeilen Farbe + Hintergrundfarbe ungelesene Nachrichten + Status Farbe + Status Größe + Farbe der rechten Sprechblase + Farbe der linken Sprechblase + Datum Farbe + Datum Größe + Datumsfarbe Sprechblase + Textfarbe + Textfarbe linke Sprechblase + Uhrzeitfarbe Rechte Sprechblase + Uhrzeit Farbe linke Sprechblase + Zeit Größe + Farbe Texteingabefeld + Textgröße Texteingabefeld + Hintergrundfarbe Texteingabefeld + Emoji Hintergrundfarbe + Emoji Tab Farbe + Online Farbe + Musik + Speichere Design + Speichern Sie Ihr Design im Telegram/Themes Ordner + Design Gespeichert!! + %1$s auf %2$s gespeichert + Design wurde noch nicht erstellt. Bitte wende Dich zuerst an einen Telegram+ Mod + Einstellungen von SD-Karte wiederhergestellt + Keine Voreinstellungsdatei in %s gefunden + Keine SD-Karte gefunden. + Name eingeben + Designs + Thema anwenden + xml Thema aus einem lokalen Ordner anwenden + Farbe Gruppenteilnehmer + Haken Farbe + Farbe Stummschaltungssymbol + Sende Protokolle + \"Es gibt keine Protokolle\" + Sende Symbol + Mobil Nummer verbergen + Schwebende Stift Farbe + Schwebende Hintergrund Farbe + G+ Community \ 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 b55af5bc..37f0858c 100644 --- a/TMessagesProj/src/main/res/values-es/strings.xml +++ b/TMessagesProj/src/main/res/values-es/strings.xml @@ -627,72 +627,105 @@ HH:mm h:mm a %1$s a las %2$s - + Telegram+ para Android Tematización - Color de Tema - ¡Color hex inváldo! - Resetear Tema - Deshace todos los cambios del tema actual - ¡Tema reseteado a valores por defecto! + ¡Color hexadecimal inválido! + Color de tema + Restablecer tema + Deshacer todos los cambios del tema actual + ¡Tema restablecido a valores por defecto! General Pantallas - Pantalla Principal - Pantalla Chat - Pantalla Contactos + Pantalla principal + Pantalla de chat + Pantalla de contactos Cabecera Lista - Lista de Chat - Lista de Chats - Lista de Contactos - Color de Cabecera - Color de Nombre - Tamaño de Nombre - Color de Mensaje - Tamaño de Mensaje - Color de Hora/Fecha - Tamaño de Hora/Fecha - Color de Contador - Tamaño de Contador - Color de Panel - Color de Fondo de Contador - Color de Estado - Tamaño de Estado - Color de Bocadillo Derecho - Color de Bocadillo Izquierdo - Color de Fecha - Tamaño de Fecha - Color de Bocadillo de Fecha - Color de Texto - Color de Texto Izquierdo - Color Hora Derecha - Color Hora Izquierda - Tamaño de Hora - Color de Entrada de Texto - Tamaño de Entrada de Texto - Color de Fondo de Entrada de Texto - Color de Fondo de Emoticonos - Color de Pestaña de Emoticonos - Color En Línea + Lista de chat + Lista de chats + Lista de contactos + Color de cabecera + Color de nombre + Tamaño de nombre + Color de mensaje + Tamaño de mensaje + Color de hora/fecha + Tamaño de hora/fecha + Color de contador + Tamaño de contador + Color de panel + Color de fondo de contador + Color de estado + Tamaño de estado + Color de globo de diálogo derecho + Color de globo de diálogo izquierdo + Color de fecha + Tamaño de fecha + Color de globo de fecha + Color de texto derecho + Color de texto izquierdo + Color hora derecha + Color hora izquierda + Tamaño de hora + Color de entrada de texto + Tamaño de entrada de texto + Color de fondo de entrada de texto + Color de fondo de emoticonos + Color de pestaña de emoticonos + Color en línea Música - Oculta Aviso Captura de Pantalla - Chat Secreto - Guardar Tema - Guarda tu tema en la carpeta Telegram/Themes - Tema Guardado!! + Guardar tema + Guardar tu tema en la carpeta Telegram/Themes + ¡Tema guardado! %1$s guardado en %2$s + Tema no creado todavía. Aplica primero algún MOD + Tema cargado desde la SD + No se encontró ningún archivo de preferencias en %s + No se encontró tarjeta SD Introduce nombre Temas - Aplicar Tema + Aplicar tema Aplicar tema desde carpeta local - Color de Participante - Color de Ticks - Color de Silencio - Enviar Logs + Color de miembro + Color de ticks + Color de silencio + Enviar logs No hay logs - Icono Enviar - Oculta Número de Móvil - Lápiz de Botón Flotante - Fondo de Botón Flotante + Icono enviar + Ocultar número de teléfono + Color de botón lápiz flotante + Color de fondo de botón flotante Comunidad G+ + Mostrar apodo en título de cabecera + Color \'escribiendo\' + Color de iconos de entrada de texto + Menú de navegación + Lista de opciones + Color de lista + Tamaño de nombre + Color de teléfono + Tamaño de teléfono + Color de avatar + Color de icono de opción + Color de opción + Tamaño de opción + Color de versión + Tamaño de versión + Color de título de cabecera + Color de iconos de cabecera + Color de divisor + Radio de avatar + Cambiar color de miembro + Color de nombre de reenvío + + Notificación inteligente + segundo(s) + minuto(s) + hora(s) + día(s) + Suena máximo + veces + vez + cada \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-it/strings.xml b/TMessagesProj/src/main/res/values-it/strings.xml index 15ef92c8..c42314fc 100644 --- a/TMessagesProj/src/main/res/values-it/strings.xml +++ b/TMessagesProj/src/main/res/values-it/strings.xml @@ -627,4 +627,90 @@ HH:mm h:mm a %1$s alle %2$s + + Telegram+ per Android + Theming + Codice del colore esadecimale non valido! + Colore del tema + Resetta le impostazioni del tema + Resetta tutte le impostazioni del tema + Resetta le impostazioni del tema a quelle predefinite! + Generale + Schermate + Schermata principale + Schermata chat + Schermata contatti + Testata + Righe + Chat + Lista delle chat + Lista contatti + Colore della testata + Colore del nome del contatto + Dimensione del nome del contatto + Colore del messaggio + Dimensione del messaggio + Colore Orario/Data + Dimensione Orario/Data + Colore del contatore + Dimensione del contatore + Colore della riga + Colore di sfondo del contatore + Colore dello stato + Dimensione dello stato + Colore nuvoletta a destra + Colore nuvoletta a sinistra + Colore della data + Dimensione della data + Colore nuvoletta della data + Colore del testo a destra + Colore del testo a sinistra + Colore dell\'ora a destra + Colore dell\'ora a sinistra + Dimensione orario + Colore del testo immesso + Dimensione del testo immesso + Colore di sfondo del campo di testo + Colore di sfondo degli Emoji + Colore della linguetta degli Emoji + Colore dello stato Online + Musica + Salva il tema + Salva il tuo tema nella cartella \"Telegram/Themes\". + Tema salvato! + %1$s salvato in %2$s + Tema non ancora creato. Prima applica una MOD di Telegram+, per favore. + Preferenze ripristinate dalla scheda SD. + Nessun file di preferenze trovato in %s. + Scheda SD non trovata. + Inserisci il nome + Temi + Applica tema + Applica un tema xml dalla cartella locale. + Colore del partecipante + Colore delle spunte + Colore dell\'icona \"Muto\" + Invia log + Non ci sono log + Icona di invio + Nascondi il numero di telefono + Colore della matita flottante + Colore di sfondo del pulsante flottante + Community G+ + Mostra il nome utente nella barra del titolo + Colore di digitazione + Dimensione del nome + Colore del telefono + Dimensione del telefono + Colore dell\'avatar + Colore dell\'icona delle opzioni + Colore opzioni + Dimensione opzioni + Colore della versione + Dimensione della versione + Colore dell\'header del titolo + Colore delle icone della testata + Colore del divisore + Raggio dell\'avatar + \ 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 91981a94..01735f71 100644 --- a/TMessagesProj/src/main/res/values-nl/strings.xml +++ b/TMessagesProj/src/main/res/values-nl/strings.xml @@ -627,4 +627,74 @@ HH:mm h:mm a %1$s om %2$s + + Telegram+ voor Android + Uiterlijk + Ongeldige kleurhexcode! + Themakleur + Thema-instellingen herstellen + Alle thema-instellingen ongedaan make + Alle thema-instellingen naar de standaardwaarden herstellen!! + Algemeen + Schermen + Hoofdscherm + Chatgesprek-scherm + Contactpersonen-scherm + Banier + Rijen + Chatlijst + Chatslijst + Contactpersonenlijst + Banierkleur + Kleur van de naam van de contactpersoon + Grootte van de naam van de contactpersoon + Berichtkleur + Berichtgrootte + Kleur van datum en tijd + Grootte van datum en tijd + Tellerkleur + Tellergrootte + Rijkleur + Achtergrondkleur van teller + Statuskleur + Statusgrootte + Kleur van rechterballon + Kleur van linkerballon + Datumkleur + Datumgrootte + Kleur van datumballon + Tekstkleur + Linkertekstkleur + Rechtertekstkleur + Rechtertijdskleur + Tijdgrootte + Kleur van tekstinvoer + Grootte van tekstinvoer + Achtergrondkleur van tekstinvoer + Achtergrondkleur van emoticon + Tabbladkleur van emoticon + Online-kleur + Muziek + Thema opslaan + Sla uw thema op in de Telegram/Thema\'s-map + Thema is opgeslagen!! + %1$s is opgeslagen naar %2$s + Het thema is nog niet gecreëerd. Pas eerst de Telegram+ MOD toe. + De voorkeuren zijn hersteld vanaf de SD-kaart + Er is geen voorkeurenbestand aangetroffen in %s + Er is geen SD-kaart gevonden. + Vul een naam in + Thema\'s + Thema toepassen + XML-thema uit lokale map toepassen + Kleur van deelnemer + Kleur van tikken + Kleur van gedempt + Logbestanden versturen + Er zijn geen logbestanden + Verzendpictogram + Mobiel nummer verbergen + Kleur van zwevend potlood + Zwevende achtergrondkleur + Google+-gemeenschap \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-pt-rBR/strings.xml b/TMessagesProj/src/main/res/values-pt-rBR/strings.xml index 86dbc15e..f7b8eb57 100644 --- a/TMessagesProj/src/main/res/values-pt-rBR/strings.xml +++ b/TMessagesProj/src/main/res/values-pt-rBR/strings.xml @@ -627,4 +627,74 @@ HH:mm h:mm a %1$s às %2$s + + Telegram+ para Android + Personalização + Código de cor hexadecimal inválido! + Cor do Tema + Redefinir Tema + Reverter todas as personalizações + Seu tema foi revertido ao tema padrão! + Geral + Telas + Tela Principal + Tela de Conversas + Tela de Contatos + Cabeçalho + Linhas + Lista de Conversas + Lista de Conversas + Lista de Contatos + Cor do Cabeçalho + Cor do Nome do Contato + Tamanho do Nome do Contato + Cor das Mensagens + Tamanho das Mensagens + Cor da Data/Hora + Tamanho da Data/Hora + Cor do Contador + Tamanho do Contador + Cor das Colunas + Cor de Fundo do Contador + Cor do Status + Tamanho do Status + Cor da Bolha Direita + Cor da Bolha Esquerda + Cor da Data + Tamanho da Data + Cor da Bolha de Data + Cor do Texto + Cor do Texto Esquerdo + Cor da Hora Direita + Cor da Hora Esquerda + Tamanho da Data + Cor do Texto Digitado + Tamanho do Texto Digitado + Cor de Fundo da Caixa de Texto + Cor do Fundo dos Emojis + Cor da Aba de Emojis + Cor do Status Online + Música + Salvar Tema + Salvar seu tema na pasta Telegram/Themes + Tema Salvo! + %1$s salvo em %2$s + O tema ainda não criado. Por favor, aplique algum MOD primeiro + Preferências restauradas do cartão SD + Nenhum arquivo de preferências encontrado em %s + Nenhum cartão SD foi encontrado. + Digite o Nome + Temas + Aplicar Tema + Aplicar tema em xml a partir de uma pasta local + Cor dos Participantes + Cor dos Ticks + Cor do Ícone de Mudo + Enviar Logs + "Não existem logs ainda" + Ícone de Enviar + Ocultar Número do Celular + Cor do Lápis Flutuante + Cor do Fundo do Botão Flutuante + Comunidade no G+ \ 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 0625680e..144d9cef 100644 --- a/TMessagesProj/src/main/res/values-pt-rPT/strings.xml +++ b/TMessagesProj/src/main/res/values-pt-rPT/strings.xml @@ -212,7 +212,7 @@ O nome de usuário deve ter pelo menos 5 caracteres. O nome de usuário não pode exceder 32 caracteres. Desculpe, o nome de usuário não pode começar com um número. - Você pode escolher um nome de usuário no ]]>Telegram]]>. Assim, outras pessoas poderão te encontrar pelo nome de usuário e entrar em contato sem precisar saber seu telefone.
]]>Você pode usar ]]>a–z]]>, ]]>0–9]]> e underline. O tamanho mínimo é ]]>5]]> caracteres.
+ Você pode escolher um nome de usuário no ]]>Telegram+]]>. Assim, outras pessoas poderão te encontrar pelo nome de usuário e entrar em contato sem precisar saber seu telefone.
]]>Você pode usar ]]>a–z]]>, ]]>0–9]]> e underline. O tamanho mínimo é ]]>5]]> caracteres.
Verificando nome de usuário... %1$s está disponível. Nenhum @@ -627,4 +627,74 @@ HH:mm h:mm a %1$s às %2$s + + Telegram+ para Android + Personalização + Código hexadecimal da cor é inválido! + Cor do Tema + Redefinir Tema + Reverter todas as personalizações + O tema foi redefinido para o tema padrão! + Geral + Ecrãs + Ecrã Principal + Ecrã de chat + Ecrã de Contactos + Cabeçalho + Linhas + Lista de Conversas + Lista de Conversas + Lista de Contactos + Cor de Cabeçalho + Cor do Nome do Contato + Tamanho do Nome do Contato + Cor das Mensagens + Tamanho das Mensagens + Cor da Data/Hora + Tamanho da Data/Hora + Cor da Contagem + Tamanho da Contagem + Cor da Linha + Cor de fundo da Contagem + Cor do Status + Tamanho do Status + Cor da Bolha Direita + Cor da Bolha Esquerda + Cor da Data + Tamanho da Data + Cor da Bolha da Data + Cor do Texto + Cor do Texto da Esquerdaa + Cor do Texto da Direita + Cor da Hora da Esquerda + Tamanho da Hora + Cor do Texto Introduzido + Tamanho do Texto Introduzido + Cor de Fundo do Texto Introduzido + Cor de Fundo dos Emoji + Cor da Tab dos Emoji + Cor do Status Online + Música + Guardar Tema + Guarda o teu tema na pasta Telegram/Themes + Tema Guardado!! + %1$s guardado em %2$s + Tema ainda não criado. Por favor aplica algum MOD do Telegram+ primeiro. + Preferências restauradas do cartão SD + Nenhum ficheiro de preferências encontrado em %s + Não foi encontrado nenhum cartão SD. + Introduzo Nome + Temas + Aplicar Tema + Aplicar tema .xml de um ficheiro local + Cor de Participantes + Cor de Ticks + Cor de Silênciar + Enviar Registos + Não existem registos + Enviar Ícon + Esconder Número de Telemóvel + Cor do Lápis Flutuante + Cor de Fundo do Botão Flutuante + Comunidade G+ \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index 1c52e992..69cb7113 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -627,75 +627,106 @@ HH:mm h:mm a %1$s at %2$s - + Telegram+ for Android Theming Invalid color hex code! - Theme Color - Reset Theme Settings + Theme color + Reset theme settings Undo all theme settings Reset theme settings to default!! General Screens - Main Screen - Chat Screen - Contacts Screen + Main screen + Chat screen + Contacts screen Header Rows - Chat List - Chats List - Contacts List - Header Color - Contact Name Color - Contact Name Size - Message Color - Message Size - Time/Date Color - Time/Date Size - Count Color - Count Size - Row Color - Count Background Color - Status Color - Status Size - Right Bubble Color - Left Bubble Color - Date Color - Date Size - Date Bubble Color - Text Color - Left Text Color - Right Time Color - Left Time Color - Time Size - Text Input Color - Text Input Size - Text Input Background Color - Emoji Background Color - Emoji Tab Color - Online Color + Chat list + Chats list + Contacts list + Header color + Contact name color + Contact name size + Message color + Message size + Time/Date color + Time/Date size + Count color + Count size + Row color + Count background color + Status color + Status size + Right bubble color + Left bubble color + Date color + Date size + Date bubble color + Right text color + Left text color + Right time color + Left time color + Time size + Text input color + Text input size + Text input background color + Emoji background color + Emoji tab color + Online color Music - Secret Chat - Save Theme + Save theme Save your theme to Telegram/Themes folder - Theme Saved!! + Theme saved! %1$s saved to %2$s Theme not created yet. Apply any Telegram+ MOD first, please Preferences restored from sdcard No preferences file found in %s No SD card found. - Enter Name + Enter name Themes - Apply Theme + Apply theme Apply xml theme from local folder - Participant Color - Ticks Color - Mute Color - Send Logs - "There aren't logs" + Member color + Ticks color + Mute color + Send logs + There aren\'t logs Send Icon - Hide Mobile Number - Floating Pencil Color - Floating Background Color - G+ Community + Hide mobile number + Floating pencil color + Floating background color + G+ community + Show username on header title + Typing color + Text input icons color + Navigation drawer + Options list + List color + Name size + Phone color + Phone size + Avatar color + Option icon color + Option color + Option size + Version color + Version size + Header title color + Header icons color + Divider color + Avatar radius + Set member color + Forward name color + + Smart notification + second(s) + minute(s) + hour(s) + day(s) + Sound at most + times + time + within \ No newline at end of file