- Added gradient option to header and list color in chats, chat, contacts, menu and profile
- Added gradient option to text entry box, emoji view and attach view - MOD to change 'online' text color in profile and chat - MOD to change avatars radius in profile - Bug fixes
This commit is contained in:
parent
2bed49fee0
commit
30f85a08f3
@ -82,8 +82,8 @@ android {
|
||||
applicationId "org.telegram.plus"
|
||||
minSdkVersion 8
|
||||
targetSdkVersion 22
|
||||
versionCode 594
|
||||
versionName "3.1.3.0"
|
||||
versionCode 597
|
||||
versionName "3.1.3.3"
|
||||
multiDexEnabled true
|
||||
}
|
||||
}
|
||||
|
@ -1089,6 +1089,7 @@ public class AndroidUtilities {
|
||||
}
|
||||
|
||||
public static int setDarkColor(int color, int factor){
|
||||
int alpha = Color.alpha(color);
|
||||
int red = Color.red(color) - factor;
|
||||
int green = Color.green(color) - factor;
|
||||
int blue = Color.blue(color) - factor;
|
||||
@ -1112,8 +1113,37 @@ public class AndroidUtilities {
|
||||
blue = factor;
|
||||
}
|
||||
}
|
||||
return Color.argb(0xff, red, green, blue);
|
||||
//return Color.argb(0xff, red, green, blue);
|
||||
return Color.argb(alpha, red, green, blue);
|
||||
}
|
||||
//Same as setDarkColor but maintains alpha
|
||||
/*public static int setDarkWithAlphaColor(int color, int factor){
|
||||
int alpha = Color.alpha(color);
|
||||
int red = Color.red(color) - factor;
|
||||
int green = Color.green(color) - factor;
|
||||
int blue = Color.blue(color) - factor;
|
||||
if(factor < 0){
|
||||
red = (red > 0xff) ? 0xff : red;
|
||||
green = (green > 0xff) ? 0xff : green;
|
||||
blue = (blue > 0xff) ? 0xff : blue;
|
||||
if(red == 0xff && green == 0xff && blue == 0xff){
|
||||
red = factor;
|
||||
green = factor;
|
||||
blue = factor;
|
||||
}
|
||||
}
|
||||
if(factor > 0){
|
||||
red = (red < 0) ? 0 : red;
|
||||
green = (green < 0) ? 0 : green;
|
||||
blue = (blue < 0) ? 0 : blue;
|
||||
if(red == 0 && green == 0 && blue == 0){
|
||||
red = factor;
|
||||
green = factor;
|
||||
blue = factor;
|
||||
}
|
||||
}
|
||||
return Color.argb(alpha, red, green, blue);
|
||||
}*/
|
||||
|
||||
public static void setIntColor(String key, int value){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(THEME_PREFS, THEME_PREFS_MODE);
|
||||
|
@ -19,6 +19,7 @@ import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
@ -126,7 +127,32 @@ public class ApplicationLoader extends MultiDexApplication {
|
||||
if (selectedColor == 0) {
|
||||
selectedColor = -2693905;
|
||||
}
|
||||
|
||||
cachedWallpaper = new ColorDrawable(selectedColor);
|
||||
|
||||
}
|
||||
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int orientation = themePrefs.getInt("chatGradientBG", 0);
|
||||
if(orientation > 0 && themePrefs.getBoolean("chatSolidBGColorCheck", false)) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(orientation) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
int mainColor = selectedColor = themePrefs.getInt("chatSolidBGColor", 0xffffffff);
|
||||
int gradColor = themePrefs.getInt("chatGradientBGColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
cachedWallpaper = new GradientDrawable(go, colors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,9 +10,11 @@ package org.telegram.ui.ActionBar;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
@ -25,6 +27,7 @@ import android.widget.FrameLayout;
|
||||
import android.widget.ListView;
|
||||
|
||||
import org.telegram.android.AndroidUtilities;
|
||||
import org.telegram.messenger.ApplicationLoader;
|
||||
import org.telegram.messenger.FileLog;
|
||||
import org.telegram.messenger.R;
|
||||
import org.telegram.android.AnimationCompat.AnimatorListenerAdapterProxy;
|
||||
@ -451,7 +454,38 @@ public class DrawerLayoutContainer extends FrameLayout {
|
||||
child.measure(drawerWidthSpec, drawerHeightSpec);
|
||||
}
|
||||
}
|
||||
getDrawerLayout().setBackgroundColor(AndroidUtilities.getIntDef("drawerListColor",0xffffffff)); //Plus
|
||||
//getDrawerLayout().setBackgroundColor(AndroidUtilities.getIntDef("drawerListColor",0xffffffff)); //Plus
|
||||
updateListBG();
|
||||
}
|
||||
|
||||
private void updateListBG(){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int mainColor = themePrefs.getInt("drawerListColor", 0xffffffff);
|
||||
int value = themePrefs.getInt("drawerRowGradient", 0);
|
||||
boolean b = true;//themePrefs.getBoolean("drawerRowGradientListCheck", false);
|
||||
if(value > 0 && b) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
|
||||
int gradColor = themePrefs.getInt("drawerRowGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
getDrawerLayout().setBackgroundDrawable(gd);
|
||||
}else{
|
||||
getDrawerLayout().setBackgroundColor(mainColor);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,6 +12,7 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -199,6 +200,7 @@ public class ContactsAdapter extends BaseSectionsAdapter {
|
||||
convertView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 28 : 72), 0, AndroidUtilities.dp(LocaleController.isRTL ? 72 : 28), 0);
|
||||
convertView.setTag("contactsRowColor"); //Plus
|
||||
}
|
||||
updateViewColor(convertView);
|
||||
} else if (type == 3) {
|
||||
if (convertView == null) {
|
||||
convertView = new GreySectionCell(mContext);
|
||||
@ -207,10 +209,12 @@ public class ContactsAdapter extends BaseSectionsAdapter {
|
||||
((GreySectionCell) convertView).setBackgroundColor(themePrefs.getInt("contactsRowColor", 0xffffffff));
|
||||
((GreySectionCell) convertView).setTextColor(cColorGrey);
|
||||
}
|
||||
updateViewColor(convertView);
|
||||
} else if (type == 2) {
|
||||
if (convertView == null) {
|
||||
convertView = new TextCell(mContext);
|
||||
}
|
||||
updateViewColor(convertView);
|
||||
TextCell actionCell = (TextCell) convertView;
|
||||
actionCell.setTextColor(cColorBlack);
|
||||
if (needPhonebook) {
|
||||
@ -247,6 +251,7 @@ public class ContactsAdapter extends BaseSectionsAdapter {
|
||||
((TextCell) convertView).setTextColor(cColorBlack);
|
||||
((TextCell) convertView).setTextSize(themePrefs.getInt("contactsNameSize", 16));
|
||||
}
|
||||
updateViewColor(convertView);
|
||||
ContactsController.Contact contact = ContactsController.getInstance().phoneBookContacts.get(position);
|
||||
if (contact.first_name != null && contact.last_name != null) {
|
||||
((TextCell) convertView).setText(contact.first_name + " " + contact.last_name);
|
||||
@ -260,7 +265,7 @@ public class ContactsAdapter extends BaseSectionsAdapter {
|
||||
convertView = new UserCell(mContext, 58);
|
||||
convertView.setTag("Contacts");
|
||||
}
|
||||
|
||||
updateViewColor(convertView);
|
||||
ArrayList<TLRPC.TL_contact> arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section - (onlyUsers && !isAdmin ? 0 : 1)));
|
||||
TLRPC.User user = MessagesController.getInstance().getUser(arr.get(position).user_id);
|
||||
((UserCell) convertView).setData(user, null, null, 0);
|
||||
@ -281,10 +286,72 @@ public class ContactsAdapter extends BaseSectionsAdapter {
|
||||
//((UserCell) convertView).setStatusSize(themePrefs.getInt("contactsStatusSize", 14));
|
||||
//((UserCell) convertView).setAvatarRadius(themePrefs.getInt("contactsAvatarRadius", 32));
|
||||
}
|
||||
parent.setBackgroundColor(themePrefs.getInt("contactsRowColor", 0xffffffff)); //Plus
|
||||
//parent.setBackgroundColor(themePrefs.getInt("contactsRowColor", 0xffffffff)); //Plus
|
||||
updateListBG(parent);
|
||||
return convertView;
|
||||
}
|
||||
|
||||
private void updateListBG(ViewGroup vg){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int mainColor = themePrefs.getInt("contactsRowColor", 0xffffffff);
|
||||
int value = themePrefs.getInt("contactsRowGradient", 0);
|
||||
boolean b = true;//themePrefs.getBoolean("contactsRowGradientListCheck", false);
|
||||
if(value > 0 && b) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
|
||||
int gradColor = themePrefs.getInt("contactsRowGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
vg.setBackgroundDrawable(gd);
|
||||
}else{
|
||||
vg.setBackgroundColor(mainColor);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateViewColor(View v){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int mainColor = themePrefs.getInt("contactsRowColor", 0xffffffff);
|
||||
int value = themePrefs.getInt("contactsRowGradient", 0);
|
||||
boolean b = true;//themePrefs.getBoolean("contactsRowGradientListCheck", false);
|
||||
if(value > 0 && !b) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
|
||||
int gradColor = themePrefs.getInt("contactsRowGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
v.setBackgroundDrawable(gd);
|
||||
} else if(b){
|
||||
v.setBackgroundColor(0x00000000);
|
||||
}
|
||||
if(value > 0)v.setTag("Contacts00");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int section, int position) {
|
||||
if (onlyUsers && !isAdmin) {
|
||||
|
@ -10,6 +10,7 @@ package org.telegram.ui.Adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@ -96,8 +97,35 @@ public class DialogsAdapter extends RecyclerView.Adapter {
|
||||
} else if (viewType == 1) {
|
||||
view = new LoadingCell(mContext);
|
||||
}
|
||||
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
viewGroup.setBackgroundColor(themePrefs.getInt("chatsRowColor", 0xffffffff));
|
||||
int mainColor = themePrefs.getInt("chatsRowColor", 0xffffffff);
|
||||
int value = themePrefs.getInt("chatsRowGradient", 0);
|
||||
boolean b = true;//themePrefs.getBoolean("chatsRowGradientListCheck", false);
|
||||
if(value > 0 && b) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
|
||||
int gradColor = themePrefs.getInt("chatsRowGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
viewGroup.setBackgroundDrawable(gd);
|
||||
}else{
|
||||
viewGroup.setBackgroundColor(mainColor);
|
||||
}
|
||||
//viewGroup.setBackgroundColor(mainColor);
|
||||
return new Holder(view);
|
||||
}
|
||||
|
||||
@ -112,6 +140,34 @@ public class DialogsAdapter extends RecyclerView.Adapter {
|
||||
cell.setDialogSelected(dialog.id == openedDialogId);
|
||||
}
|
||||
}
|
||||
//Plus
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int mainColor = themePrefs.getInt("chatsRowColor", 0xffffffff);
|
||||
//cell.setBackgroundColor(mainColor);
|
||||
int value = themePrefs.getInt("chatsRowGradient", 0);
|
||||
boolean b = true;//themePrefs.getBoolean("chatsRowGradientListCheck", false);
|
||||
if(value > 0 && !b) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
|
||||
int gradColor = themePrefs.getInt("chatsRowGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
cell.setBackgroundDrawable(gd);
|
||||
}
|
||||
//
|
||||
cell.setDialog(dialog, i, dialogsType);
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
@ -94,15 +95,18 @@ public class DrawerLayoutAdapter extends BaseAdapter {
|
||||
if (view == null) {
|
||||
view = new EmptyCell(mContext, AndroidUtilities.dp(8));
|
||||
}
|
||||
updateViewColor(view);
|
||||
} else if (type == 2) {
|
||||
if (view == null) {
|
||||
view = new DividerCell(mContext);
|
||||
view.setTag("drawerListDividerColor");
|
||||
}
|
||||
updateViewColor(view);
|
||||
} else if (type == 3) {
|
||||
if (view == null) {
|
||||
view = new DrawerActionCell(mContext);
|
||||
}
|
||||
updateViewColor(view);
|
||||
DrawerActionCell actionCell = (DrawerActionCell) view;
|
||||
//actionCell.setTextColor(themePrefs.getInt("drawerOptionColor", 0xff444444));
|
||||
//actionCell.setTextSize(themePrefs.getInt("drawerOptionSize", 15));
|
||||
@ -143,6 +147,7 @@ public class DrawerLayoutAdapter extends BaseAdapter {
|
||||
}*/
|
||||
} else if (type == versionType) {
|
||||
view = new TextInfoCell(mContext);
|
||||
updateViewColor(view);
|
||||
if (i == versionRow) {
|
||||
try {
|
||||
PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
|
||||
@ -157,6 +162,34 @@ public class DrawerLayoutAdapter extends BaseAdapter {
|
||||
return view;
|
||||
}
|
||||
|
||||
private void updateViewColor(View v){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int mainColor = themePrefs.getInt("drawerListColor", 0xffffffff);
|
||||
int value = themePrefs.getInt("drawerRowGradient", 0);
|
||||
boolean b = true;//themePrefs.getBoolean("drawerRowGradientListCheck", false);
|
||||
if(value > 0 && !b) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
|
||||
int gradColor = themePrefs.getInt("drawerRowGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
v.setBackgroundDrawable(gd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int i) {
|
||||
if (i == 0) {
|
||||
|
@ -388,7 +388,7 @@ public class DialogCell extends BaseCell {
|
||||
}
|
||||
checkMessage = false;
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
//int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
//String hexColor = String.format("#%08X", (0xffffffff & defColor));
|
||||
String hexMsgColor = String.format("#%08X", (0xffffffff & themePrefs.getInt("chatsMessageColor", 0xff808080)));
|
||||
int darkColor = themePrefs.getInt("chatsMemberColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15));
|
||||
|
@ -34,6 +34,9 @@ public class DividerCell extends BaseCell {
|
||||
if(key != null){
|
||||
int color = AndroidUtilities.getIntDef(key, 0xffd9d9d9);
|
||||
paint.setColor(color);
|
||||
if(key.contains("00")){
|
||||
paint.setColor(0x00000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ import android.graphics.Rect;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Build;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
@ -270,8 +271,32 @@ public class DrawerProfileCell extends FrameLayout implements PhotoViewer.PhotoV
|
||||
private void updateTheme(){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int tColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
int dColor = AndroidUtilities.getIntDarkerColor("themeColor",-0x40);
|
||||
setBackgroundColor(themePrefs.getInt("drawerHeaderColor", tColor));
|
||||
int dColor = AndroidUtilities.getIntDarkerColor("themeColor", -0x40);
|
||||
|
||||
int hColor = themePrefs.getInt("drawerHeaderColor", tColor);
|
||||
setBackgroundColor(hColor);
|
||||
int value = themePrefs.getInt("drawerHeaderGradient", 0);
|
||||
if(value > 0) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
int gradColor = themePrefs.getInt("drawerHeaderGradientColor", tColor);
|
||||
int[] colors = new int[]{hColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
setBackgroundDrawable(gd);
|
||||
}
|
||||
|
||||
nameTextView.setTextColor(themePrefs.getInt("drawerNameColor", 0xffffffff));
|
||||
nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, themePrefs.getInt("drawerNameSize", 15));
|
||||
phoneTextView.setTextColor(themePrefs.getInt("drawerPhoneColor", dColor));
|
||||
@ -296,4 +321,8 @@ public class DrawerProfileCell extends FrameLayout implements PhotoViewer.PhotoV
|
||||
avatarImageView.setImage(photo, "50_50", avatarDrawable);
|
||||
|
||||
}
|
||||
|
||||
private void updateHeaderBG(){
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -117,12 +117,13 @@ public class UserCell extends FrameLayout {
|
||||
setStatusSize(themePrefs.getInt("contactsStatusSize", 14));
|
||||
setAvatarRadius(themePrefs.getInt("contactsAvatarRadius", 32));
|
||||
}else if(tag.contains("Profile")){
|
||||
setStatusColors(themePrefs.getInt("profileSummaryColor", 0xff8a8a8a), AndroidUtilities.getIntDarkerColor("themeColor", -0x40));
|
||||
setStatusColors(themePrefs.getInt("profileSummaryColor", 0xff8a8a8a), themePrefs.getInt("profileOnlineColor", AndroidUtilities.getIntDarkerColor("themeColor", -0x40)));
|
||||
nameColor = themePrefs.getInt("profileTitleColor", 0xff212121);
|
||||
nameTextView.setTextColor(nameColor);
|
||||
nameTextView.setTextSize(17);
|
||||
setStatusSize(14);
|
||||
setAvatarRadius(32);
|
||||
//setAvatarRadius(32);
|
||||
setAvatarRadius(themePrefs.getInt("profileRowAvatarRadius", 32));
|
||||
if(currentDrawable != 0) {
|
||||
int dColor = themePrefs.getInt("profileIconsColor", 0xff737373);
|
||||
Drawable d = getResources().getDrawable(currentDrawable);
|
||||
|
@ -21,6 +21,7 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.media.ExifInterface;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
@ -3090,6 +3091,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
if (onlineTextView == null) {
|
||||
return;
|
||||
}
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int lightColor = AndroidUtilities.getIntDarkerColor("themeColor", -0x40);
|
||||
onlineTextView.setTextColor(themePrefs.getInt("chatStatusColor", lightColor));
|
||||
CharSequence printString = MessagesController.getInstance().printingStrings.get(dialog_id);
|
||||
if (printString != null) {
|
||||
printString = TextUtils.replace(printString, new String[]{"..."}, new String[]{""});
|
||||
@ -3129,6 +3133,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
lastStatus = newStatus;
|
||||
onlineTextView.setText(newStatus);
|
||||
}
|
||||
|
||||
if(newStatus.equals(LocaleController.getString("Online", R.string.Online))){
|
||||
onlineTextView.setTextColor(themePrefs.getInt("chatOnlineColor", themePrefs.getInt("chatStatusColor", lightColor)));
|
||||
}
|
||||
}
|
||||
lastPrintString = null;
|
||||
} else {
|
||||
@ -4744,10 +4752,34 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
try{
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int def = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
actionBar.setBackgroundColor(themePrefs.getInt("chatHeaderColor", def));
|
||||
|
||||
int hColor = themePrefs.getInt("chatHeaderColor", def);
|
||||
actionBar.setBackgroundColor(hColor);
|
||||
int val = themePrefs.getInt("chatHeaderGradient", 0);
|
||||
if(val > 0) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(val) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
int gradColor = themePrefs.getInt("chatHeaderGradientColor", def);
|
||||
int[] colors = new int[]{hColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
actionBar.setBackgroundDrawable(gd);
|
||||
}
|
||||
|
||||
nameTextView.setTextColor(themePrefs.getInt("chatNameColor", 0xffffffff));
|
||||
nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, themePrefs.getInt("chatNameSize", 18));
|
||||
onlineTextView.setTextColor(themePrefs.getInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor", -0x40)));
|
||||
//onlineTextView.setTextColor(themePrefs.getInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor", -0x40)));
|
||||
onlineTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, themePrefs.getInt("chatStatusSize", 14));
|
||||
int iColor = themePrefs.getInt("chatHeaderIconsColor", 0xffffffff);
|
||||
Drawable mute = getParentActivity().getResources().getDrawable(R.drawable.mute_blue);
|
||||
|
@ -13,6 +13,7 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.media.AudioManager;
|
||||
import android.os.PowerManager;
|
||||
import android.text.Editable;
|
||||
@ -523,9 +524,33 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||
messageEditText.setTextColor(themePrefs.getInt("chatEditTextColor", 0xff000000));
|
||||
messageEditText.setHintTextColor(AndroidUtilities.getIntAlphaColor("chatEditTextColor", 0xff000000, 0.35f));
|
||||
messageEditText.setTextSize(themePrefs.getInt("chatEditTextSize", 18));
|
||||
|
||||
int color = themePrefs.getInt("chatEditTextBGColor", 0xffffffff);
|
||||
setBackgroundColor(color);
|
||||
textFieldContainer.setBackgroundColor(color);
|
||||
int val = themePrefs.getInt("chatEditTextBGGradient", 0);
|
||||
if(val > 0) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(val) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
int gradColor = themePrefs.getInt("chatEditTextBGGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{color, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
setBackgroundDrawable(gd);
|
||||
textFieldContainer.setBackgroundDrawable(gd);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
package org.telegram.ui.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
@ -19,6 +20,8 @@ import android.view.View;
|
||||
|
||||
import org.telegram.android.AndroidUtilities;
|
||||
import org.telegram.android.AnimationCompat.ObjectAnimatorProxy;
|
||||
import org.telegram.messenger.ApplicationLoader;
|
||||
import org.telegram.messenger.R;
|
||||
|
||||
public class CheckBox extends View {
|
||||
|
||||
@ -65,6 +68,10 @@ public class CheckBox extends View {
|
||||
backgroundPaint.setColor(0xffffffff);
|
||||
backgroundPaint.setStyle(Paint.Style.STROKE);
|
||||
backgroundPaint.setStrokeWidth(AndroidUtilities.dp(2));
|
||||
if(resId == R.drawable.checkbig){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
backgroundPaint.setColor(themePrefs.getInt("chatAttachBGColor", 0xffffffff));
|
||||
}
|
||||
}
|
||||
|
||||
checkDrawable = context.getResources().getDrawable(resId);
|
||||
|
@ -14,6 +14,7 @@ import android.content.SharedPreferences;
|
||||
import android.database.DataSetObserver;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Build;
|
||||
import android.support.v4.view.PagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
@ -425,6 +426,27 @@ public class EmojiView extends FrameLayout implements NotificationCenter.Notific
|
||||
|
||||
//setBackgroundColor(0xfff5f6f7);
|
||||
setBackgroundColor(bgColor);
|
||||
int val = themePrefs.getInt("chatEmojiViewBGGradient", 0);
|
||||
if(val > 0) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(val) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
int gradColor = themePrefs.getInt("chatEmojiViewBGGradientColor", 0xfff5f6f7);
|
||||
int[] colors = new int[]{bgColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
setBackgroundDrawable(gd);
|
||||
}
|
||||
|
||||
pager = new ViewPager(context) {
|
||||
@Override
|
||||
|
@ -15,6 +15,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -527,7 +528,31 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
|
||||
private void updateTheme(){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int def = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
actionBar.setBackgroundColor(themePrefs.getInt("contactsHeaderColor", def));
|
||||
|
||||
int hColor = themePrefs.getInt("contactsHeaderColor", def);
|
||||
actionBar.setBackgroundColor(hColor);
|
||||
int val = themePrefs.getInt("contactsHeaderGradient", 0);
|
||||
if(val > 0) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(val) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
int gradColor = themePrefs.getInt("contactsHeaderGradientColor", def);
|
||||
int[] colors = new int[]{hColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
actionBar.setBackgroundDrawable(gd);
|
||||
}
|
||||
|
||||
actionBar.setTitleColor(themePrefs.getInt("contactsHeaderTitleColor", 0xffffffff));
|
||||
|
||||
Drawable search = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_search);
|
||||
|
@ -25,6 +25,7 @@ import android.graphics.RectF;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -898,7 +899,31 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
||||
actionBar.setBackgroundColor(0x7F000000);
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int def = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
actionBar.setBackgroundColor(themePrefs.getInt("chatHeaderColor", def));
|
||||
|
||||
int hColor = themePrefs.getInt("chatHeaderColor", def);
|
||||
actionBar.setBackgroundColor(hColor);
|
||||
int val = themePrefs.getInt("chatHeaderGradient", 0);
|
||||
if(val > 0) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(val) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
int gradColor = themePrefs.getInt("chatHeaderGradientColor", def);
|
||||
int[] colors = new int[]{hColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
actionBar.setBackgroundDrawable(gd);
|
||||
}
|
||||
|
||||
actionBar.setOccupyStatusBar(false);
|
||||
actionBar.setItemsBackground(R.drawable.bar_selector_white);
|
||||
//actionBar.setBackButtonImage(R.drawable.ic_ab_back);
|
||||
|
@ -22,6 +22,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -1401,7 +1402,33 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int def = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
int dark = themePrefs.getInt("profileStatusColor", AndroidUtilities.getIntDarkerColor("themeColor", -0x40));
|
||||
actionBar.setBackgroundColor(themePrefs.getInt("profileHeaderColor", def));
|
||||
|
||||
//actionBar.setBackgroundColor(themePrefs.getInt("profileHeaderColor", def));
|
||||
|
||||
int hColor = themePrefs.getInt("profileHeaderColor", def);
|
||||
actionBar.setBackgroundColor(hColor);
|
||||
int val = themePrefs.getInt("profileHeaderGradient", 0);
|
||||
if(val > 0) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(val) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
int gradColor = themePrefs.getInt("profileHeaderGradientColor", def);
|
||||
int[] colors = new int[]{hColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
actionBar.setBackgroundDrawable(gd);
|
||||
}
|
||||
|
||||
nameTextView.setTextColor(themePrefs.getInt("profileNameColor", 0xffffffff));
|
||||
nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, themePrefs.getInt("profileNameSize", 18));
|
||||
onlineTextView.setTextColor(dark);
|
||||
@ -1547,6 +1574,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
if (view == null) {
|
||||
view = new EmptyCell(mContext);
|
||||
}
|
||||
|
||||
if (i == overscrollRow) {
|
||||
((EmptyCell) view).setHeight(AndroidUtilities.dp(88));
|
||||
} else if (i == emptyRowChat || i == emptyRowChat2) {
|
||||
@ -1554,17 +1582,20 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
} else {
|
||||
((EmptyCell) view).setHeight(AndroidUtilities.dp(36));
|
||||
}
|
||||
updateViewColor(view);
|
||||
} else if (type == 1) {
|
||||
if (view == null) {
|
||||
view = new DividerCell(mContext);
|
||||
view.setPadding(AndroidUtilities.dp(72), 0, 0, 0);
|
||||
view.setTag("profileRowColor");
|
||||
}
|
||||
updateViewColor(view);
|
||||
} else if (type == 2) {
|
||||
final TLRPC.User user = MessagesController.getInstance().getUser(user_id);
|
||||
if (view == null) {
|
||||
view = new TextDetailCell(mContext);
|
||||
}
|
||||
updateViewColor(view);
|
||||
TextDetailCell textDetailCell = (TextDetailCell) view;
|
||||
textDetailCell.setTextColor(tColor);
|
||||
textDetailCell.setValueColor(themePrefs.getInt("profileSummaryColor", 0xff8a8a8a));
|
||||
@ -1592,6 +1623,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
if (view == null) {
|
||||
view = new TextCell(mContext);
|
||||
}
|
||||
updateViewColor(view);
|
||||
TextCell textCell = (TextCell) view;
|
||||
//textCell.setTextColor(0xff212121);
|
||||
textCell.setTextColor(tColor);
|
||||
@ -1644,7 +1676,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
view = new UserCell(mContext, 61);
|
||||
view.setTag("Profile");
|
||||
}
|
||||
|
||||
updateViewColor(view);
|
||||
TLRPC.TL_chatParticipant part = info.participants.get(sortedUsers.get(i - emptyRowChat2 - 1));
|
||||
//((UserCell)view).setData(MessagesController.getInstance().getUser(part.user_id), null, null, i == emptyRowChat2 + 1 ? R.drawable.menu_newgroup : 0);
|
||||
int icon = 0;
|
||||
@ -1661,6 +1693,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
view = new ShadowSectionCell(mContext, false);
|
||||
}
|
||||
view.setBackgroundColor(themePrefs.getInt("profileRowColor", 0xffffffff));
|
||||
updateViewColor(view);
|
||||
} else if (type == 6) {
|
||||
if (view == null) {
|
||||
view = new AddMemberCell(mContext);
|
||||
@ -1670,10 +1703,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
((AddMemberCell) view).setText(LocaleController.getString("AddRecipient", R.string.AddRecipient));
|
||||
}
|
||||
}
|
||||
updateViewColor(view);
|
||||
((AddMemberCell) view).setTextColor(tColor);
|
||||
((AddMemberCell) view).setDrawableColor(dColor);
|
||||
}
|
||||
viewGroup.setBackgroundColor(themePrefs.getInt("profileRowColor", 0xffffffff));
|
||||
//viewGroup.setBackgroundColor(themePrefs.getInt("profileRowColor", 0xffffffff));
|
||||
updateListBG(viewGroup);
|
||||
return view;
|
||||
}
|
||||
|
||||
@ -1707,4 +1742,65 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateListBG(ViewGroup vg){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int mainColor = themePrefs.getInt("profileRowColor", 0xffffffff);
|
||||
int value = themePrefs.getInt("profileRowGradient", 0);
|
||||
boolean b = true;//themePrefs.getBoolean("profileRowGradientListCheck", false);
|
||||
if(value > 0 && b) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
|
||||
int gradColor = themePrefs.getInt("profileRowGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
vg.setBackgroundDrawable(gd);
|
||||
}else{
|
||||
vg.setBackgroundColor(mainColor);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateViewColor(View v){
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int mainColor = themePrefs.getInt("profileRowColor", 0xffffffff);
|
||||
int value = themePrefs.getInt("profileRowGradient", 0);
|
||||
boolean b = true;//themePrefs.getBoolean("profileRowGradientListCheck", false);
|
||||
if(value > 0 && !b) {
|
||||
GradientDrawable.Orientation go;
|
||||
switch(value) {
|
||||
case 2:
|
||||
go = GradientDrawable.Orientation.LEFT_RIGHT;
|
||||
break;
|
||||
case 3:
|
||||
go = GradientDrawable.Orientation.TL_BR;
|
||||
break;
|
||||
case 4:
|
||||
go = GradientDrawable.Orientation.BL_TR;
|
||||
break;
|
||||
default:
|
||||
go = GradientDrawable.Orientation.TOP_BOTTOM;
|
||||
}
|
||||
|
||||
int gradColor = themePrefs.getInt("profileRowGradientColor", 0xffffffff);
|
||||
int[] colors = new int[]{mainColor, gradColor};
|
||||
GradientDrawable gd = new GradientDrawable(go, colors);
|
||||
v.setBackgroundDrawable(gd);
|
||||
} else if(b){
|
||||
v.setBackgroundColor(0x00000000);
|
||||
}
|
||||
if(value > 0)v.setTag("Profile00");
|
||||
}
|
||||
}
|
||||
|
@ -37,11 +37,15 @@ 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.TextDetailSettingsCell;
|
||||
import org.telegram.ui.Cells.TextSettingsCell;
|
||||
import org.telegram.ui.Components.AvatarDrawable;
|
||||
import org.telegram.ui.Components.ColorSelectorDialog;
|
||||
import org.telegram.ui.Components.NumberPicker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.telegram.ui.Components.ColorSelectorDialog.OnColorChangedListener;
|
||||
|
||||
public class ThemingChatActivity extends BaseFragment {
|
||||
@ -101,6 +105,19 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
private int showOwnAvatar;
|
||||
private int showOwnAvatarGroup;
|
||||
private int showUsernameCheckRow;
|
||||
private int gradientBGRow;
|
||||
private int gradientBGColorRow;
|
||||
|
||||
private int headerGradientRow;
|
||||
private int headerGradientColorRow;
|
||||
private int onlineColorRow;
|
||||
|
||||
private int editTextBGGradientRow;
|
||||
private int editTextBGGradientColorRow;
|
||||
private int attachBGGradientRow;
|
||||
private int attachBGGradientColorRow;
|
||||
private int emojiViewBGGradientRow;
|
||||
private int emojiViewBGGradientColorRow;
|
||||
|
||||
private int rowCount;
|
||||
|
||||
@ -113,6 +130,8 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
rowCount = 0;
|
||||
headerSection2Row = rowCount++;
|
||||
headerColorRow = rowCount++;
|
||||
headerGradientRow = rowCount++;
|
||||
headerGradientColorRow = rowCount++;
|
||||
headerIconsColorRow = rowCount++;
|
||||
//muteColorRow = rowCount++;
|
||||
|
||||
@ -120,6 +139,7 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
nameColorRow = rowCount++;
|
||||
statusSizeRow = rowCount++;
|
||||
statusColorRow = rowCount++;
|
||||
onlineColorRow = rowCount++;
|
||||
|
||||
rowsSectionRow = rowCount++;
|
||||
rowsSection2Row = rowCount++;
|
||||
@ -127,6 +147,9 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
solidBGColorCheckRow = rowCount++;
|
||||
solidBGColorRow = rowCount++;
|
||||
|
||||
//gradientBGRow = rowCount++;
|
||||
//gradientBGColorRow = rowCount++;
|
||||
|
||||
showContactAvatar = rowCount++;
|
||||
avatarAlignTopRow = rowCount++;
|
||||
showOwnAvatar = rowCount++;
|
||||
@ -168,12 +191,18 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
editTextSizeRow = rowCount++;
|
||||
editTextColorRow = rowCount++;
|
||||
editTextBGColorRow = rowCount++;
|
||||
editTextBGGradientRow = rowCount++;
|
||||
editTextBGGradientColorRow = rowCount++;
|
||||
editTextIconsColorRow = rowCount++;
|
||||
|
||||
attachBGColorRow = rowCount++;
|
||||
attachBGGradientRow = rowCount++;
|
||||
attachBGGradientColorRow = rowCount++;
|
||||
attachTextColorRow = rowCount++;
|
||||
|
||||
emojiViewBGColorRow = rowCount++;
|
||||
emojiViewBGGradientRow = rowCount++;
|
||||
emojiViewBGGradientColorRow = rowCount++;
|
||||
emojiViewTabIconColorRow = rowCount++;
|
||||
emojiViewTabColorRow = rowCount++;
|
||||
|
||||
@ -234,6 +263,7 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
int darkColor = AndroidUtilities.getIntDarkerColor("themeColor", 0x15);
|
||||
int lightColor = AndroidUtilities.getIntDarkerColor("themeColor", -0x40);
|
||||
final String key = view.getTag() != null ? view.getTag().toString() : "";
|
||||
|
||||
if (i == headerColorRow) {
|
||||
@ -254,6 +284,112 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
},themePrefs.getInt("chatHeaderColor", defColor), CENTER, 0, false);
|
||||
|
||||
colorDialog.show();
|
||||
} else if (i == headerGradientColorRow) {
|
||||
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("chatHeaderGradientColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatHeaderGradientColor", defColor), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == headerGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("chatHeaderGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == editTextBGGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("chatEditTextBGGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == attachBGGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("chatAttachBGGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == emojiViewBGGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("chatEmojiViewBGGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == solidBGColorCheckRow) {
|
||||
boolean b = themePrefs.getBoolean( key, true);
|
||||
SharedPreferences.Editor editor = themePrefs.edit();
|
||||
@ -358,6 +494,44 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
|
||||
},themePrefs.getInt("chatSolidBGColor", 0xffffffff), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == gradientBGColorRow) {
|
||||
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("chatGradientBGColor", color);
|
||||
ApplicationLoader.reloadWallpaper();
|
||||
}
|
||||
},themePrefs.getInt( "chatGradientBGColor", 0xffffffff), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == gradientBGRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("chatGradientBG", which).commit();
|
||||
ApplicationLoader.reloadWallpaper();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == memberColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
@ -647,11 +821,8 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
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) {
|
||||
@ -659,7 +830,20 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatEditTextBGColor", 0xffffffff), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == editTextBGGradientColorRow) {
|
||||
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("chatEditTextBGGradientColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatEditTextBGGradientColor", 0xffffffff), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == attachBGColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
@ -673,7 +857,21 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
commitInt("chatAttachBGColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatAttachBGColor", 0xffffffff), CENTER, 0, true);
|
||||
},themePrefs.getInt("chatAttachBGColor", 0xffffffff), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == attachBGGradientColorRow) {
|
||||
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("chatAttachBGGradientColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatAttachBGGradientColor", 0xffffffff), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == attachTextColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
@ -708,19 +906,28 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
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("chatEmojiViewBGColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatEmojiViewBGColor", 0xfff5f6f7), CENTER, 0, true);
|
||||
|
||||
},themePrefs.getInt("chatEmojiViewBGColor", 0xfff5f6f7), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == emojiViewBGGradientColorRow) {
|
||||
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("chatEmojiViewBGGradientColor", color);
|
||||
}
|
||||
},themePrefs.getInt("chatEmojiViewBGGradientColor", 0xfff5f6f7), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == emojiViewTabIconColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
@ -733,25 +940,20 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
public void colorChanged(int color) {
|
||||
commitInt("chatEmojiViewTabIconColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatEmojiViewTabIconColor", 0xffa8a8a8), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == emojiViewTabColorRow) {
|
||||
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("chatEmojiViewTabColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatEmojiViewTabColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x15)), CENTER, 0, true);
|
||||
},themePrefs.getInt("chatEmojiViewTabColor", darkColor), CENTER, 0, true);
|
||||
|
||||
colorDialog.show();
|
||||
} else if (i == statusColorRow) {
|
||||
@ -766,8 +968,21 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
commitInt("chatStatusColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x40)), CENTER, 0, false);
|
||||
},themePrefs.getInt("chatStatusColor", lightColor), CENTER, 0, false);
|
||||
|
||||
colorDialog.show();
|
||||
} else if (i == onlineColorRow) {
|
||||
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("chatOnlineColor", color);
|
||||
}
|
||||
},themePrefs.getInt("chatOnlineColor", themePrefs.getInt("chatStatusColor", lightColor)), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == dateColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
@ -1006,9 +1221,18 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
//if(view.getTag() != null)resetPref(view.getTag().toString());
|
||||
if (i == headerColorRow) {
|
||||
resetPref("chatHeaderColor");
|
||||
} else if (i == headerGradientRow) {
|
||||
resetPref("chatHeaderGradient");
|
||||
} else if (i == headerGradientColorRow) {
|
||||
resetPref("chatHeaderGradientColor");
|
||||
} else if (i == solidBGColorRow) {
|
||||
resetPref("chatSolidBGColor");
|
||||
ApplicationLoader.reloadWallpaper();
|
||||
} else if (i == gradientBGColorRow) {
|
||||
resetPref("chatGradientBGColor");
|
||||
ApplicationLoader.reloadWallpaper();
|
||||
} else if (i == gradientBGRow) {
|
||||
resetPref("chatGradientBG");
|
||||
} else if (i == memberColorRow) {
|
||||
resetPref("chatMemberColor");
|
||||
} else if (i == contactNameColorRow) {
|
||||
@ -1023,6 +1247,8 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
resetPref("chatNameSize");
|
||||
} else if (i == statusColorRow) {
|
||||
resetPref("chatStatusColor");
|
||||
} else if (i == onlineColorRow) {
|
||||
resetPref("chatOnlineColor");
|
||||
} else if (i == statusSizeRow) {
|
||||
resetPref("chatStatusSize");
|
||||
} else if (i == rTimeColorRow) {
|
||||
@ -1049,12 +1275,24 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
resetPref("chatEditTextSize");
|
||||
} else if (i == editTextBGColorRow) {
|
||||
resetPref("chatEditTextBGColor");
|
||||
} else if (i == editTextBGGradientColorRow) {
|
||||
resetPref("chatEditTextBGGradentColor");
|
||||
} else if (i == editTextBGGradientRow) {
|
||||
resetPref("chatEditTextBGGradient");
|
||||
} else if (i == attachBGColorRow) {
|
||||
resetPref("chatAttachBGColor");
|
||||
} else if (i == attachBGGradientRow) {
|
||||
resetPref("chatAttachBGGradient");
|
||||
} else if (i == attachBGGradientColorRow) {
|
||||
resetPref("chatAttachBGGradientColor");
|
||||
} else if (i == attachTextColorRow) {
|
||||
resetPref("chatAttachTextColor");
|
||||
} else if (i == emojiViewBGColorRow) {
|
||||
resetPref("chatEmojiViewBGColor");
|
||||
} else if (i == emojiViewBGGradientRow) {
|
||||
resetPref("chatEmojiViewBGGradient");
|
||||
} else if (i == emojiViewBGGradientColorRow) {
|
||||
resetPref("chatEmojiViewBGGradientColor");
|
||||
} else if (i == emojiViewTabIconColorRow) {
|
||||
resetPref("chatEmojiViewTabIconColor");
|
||||
} else if (i == emojiViewTabColorRow) {
|
||||
@ -1168,12 +1406,14 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int i) {
|
||||
return i == headerColorRow || i == muteColorRow || i == headerIconsColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == bubblesRow ||
|
||||
i == solidBGColorCheckRow || AndroidUtilities.getBoolPref("chatSolidBGColorCheck") && i == solidBGColorRow || i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow || i == avatarAlignTopRow || i == ownAvatarAlignTopRow || i == showContactAvatar || i == showOwnAvatar || i == showOwnAvatarGroup || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow ||
|
||||
boolean b = AndroidUtilities.getBoolPref("chatSolidBGColorCheck");
|
||||
int g = AndroidUtilities.getIntDef("chatGradientBG", 0);
|
||||
return i == headerColorRow || i == headerGradientRow || AndroidUtilities.getIntDef("chatHeaderGradient", 0) != 0 && i == headerGradientColorRow || i == muteColorRow || i == headerIconsColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == bubblesRow ||
|
||||
i == solidBGColorCheckRow || b && i == solidBGColorRow || b && i == gradientBGRow || (g != 0 && i == gradientBGColorRow) || i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow || i == avatarAlignTopRow || i == ownAvatarAlignTopRow || i == showContactAvatar || i == showOwnAvatar || i == showOwnAvatarGroup || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == onlineColorRow || i == statusSizeRow ||
|
||||
i == textSizeRow || i == timeSizeRow || i == dateColorRow || i == dateSizeRow || i == dateBubbleColorRow || i == rTextColorRow || i == rLinkColorRow || i == lTextColorRow || i == lLinkColorRow ||
|
||||
i == rTimeColorRow|| i == lTimeColorRow || i == checksColorRow || i == memberColorCheckRow || AndroidUtilities.getBoolPref("chatMemberColorCheck") && i == memberColorRow || i == contactNameColorRow || i == forwardRightNameColorRow || i == forwardLeftNameColorRow || i == showUsernameCheckRow ||
|
||||
i == editTextSizeRow || i == editTextColorRow || i == editTextIconsColorRow || i == sendColorRow || i == editTextBGColorRow || i == attachBGColorRow || i == attachTextColorRow ||
|
||||
i == emojiViewBGColorRow || i == emojiViewTabIconColorRow || i == emojiViewTabColorRow;
|
||||
i == editTextSizeRow || i == editTextColorRow || i == editTextIconsColorRow || i == sendColorRow || i == editTextBGColorRow || i == editTextBGGradientRow || AndroidUtilities.getIntDef("chatEditTextBGGradient", 0) != 0 && i == editTextBGGradientColorRow || i == attachBGColorRow || i == attachBGGradientRow || AndroidUtilities.getIntDef("chatAttachBGGradient", 0) != 0 && i == attachBGGradientColorRow || i == attachTextColorRow ||
|
||||
i == emojiViewBGColorRow || i == emojiViewBGGradientRow || AndroidUtilities.getIntDef("chatEmojiViewBGGradient", 0) != 0 && i == emojiViewBGGradientColorRow || i == emojiViewTabIconColorRow || i == emojiViewTabColorRow;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1295,13 +1535,18 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
|
||||
int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
int darkColor = AndroidUtilities.getIntDarkerColor("themeColor", 0x15);
|
||||
int lightColor = AndroidUtilities.getIntDarkerColor("themeColor", -0x40);
|
||||
if (i == headerColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("chatHeaderColor", defColor), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("chatHeaderColor", defColor), false);
|
||||
} else if (i == headerGradientColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.RowGradientColor), themePrefs.getInt("chatHeaderGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("chatHeaderGradientColor", defColor), true);
|
||||
} else if (i == headerIconsColorRow) {
|
||||
textCell.setTag("chatHeaderIconsColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderIconsColor", R.string.HeaderIconsColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true);
|
||||
} else if (i == solidBGColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("SolidBGColor", R.string.SolidBGColor), themePrefs.getBoolean("chatSolidBGColorCheck", false) ? themePrefs.getInt("chatSolidBGColor", 0xffffffff) : 0x00000000, true);
|
||||
} else if (i == gradientBGColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("chatGradientBG", 0) == 0 || !themePrefs.getBoolean("chatSolidBGColorCheck", false) ? 0x00000000 : themePrefs.getInt("chatGradientBGColor", 0xffffffff), true);
|
||||
} else if (i == memberColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("MemberColor", R.string.MemberColor), themePrefs.getBoolean("chatMemberColorCheck", false) ? themePrefs.getInt("chatMemberColor", darkColor) : 0x00000000, true);
|
||||
} else if (i == contactNameColorRow) {
|
||||
@ -1334,7 +1579,9 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
} else if (i == nameColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("NameColor", R.string.NameColor), themePrefs.getInt("chatNameColor", 0xffffffff), true);
|
||||
} else if (i == statusColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x40)), false);
|
||||
textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt("chatStatusColor", lightColor), true);
|
||||
} else if (i == onlineColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("OnlineColor", R.string.OnlineColor), themePrefs.getInt("chatOnlineColor", themePrefs.getInt("chatStatusColor", lightColor)), false);
|
||||
} else if (i == rTimeColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RTimeColor", R.string.RTimeColor), themePrefs.getInt("chatRTimeColor", darkColor), true);
|
||||
} else if (i == lTimeColorRow) {
|
||||
@ -1350,21 +1597,104 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
} else if (i == editTextColorRow) {
|
||||
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);
|
||||
textCell.setTextAndColor(LocaleController.getString("EditTextBGColor", R.string.EditTextBGColor), themePrefs.getInt("chatEditTextBGColor", 0xffffffff), false);
|
||||
} else if (i == editTextBGGradientColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("chatEditTextBGGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("chatEditTextBGGradientColor", 0xffffffff), true);
|
||||
} else if (i == attachBGColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("AttachBGColor", R.string.AttachBGColor), themePrefs.getInt("chatAttachBGColor", 0xffffffff), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("AttachBGColor", R.string.AttachBGColor), themePrefs.getInt("chatAttachBGColor", 0xffffffff), false);
|
||||
} else if (i == attachBGGradientColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("chatAttachBGGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("chatAttachBGGradientColor", 0xffffffff), true);
|
||||
} else if (i == attachTextColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("AttachTextColor", R.string.AttachTextColor), themePrefs.getInt("chatAttachTextColor", 0xff757575), true);
|
||||
} else if (i == editTextIconsColorRow) {
|
||||
textCell.setTag("chatEditTextIconsColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("EditTextIconsColor", R.string.EditTextIconsColor), themePrefs.getInt("chatEditTextIconsColor", 0xffadadad), true);
|
||||
} else if (i == emojiViewBGColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("EmojiViewBGColor", R.string.EmojiViewBGColor), themePrefs.getInt("chatEmojiViewBGColor", 0xfff5f6f7), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("EmojiViewBGColor", R.string.EmojiViewBGColor), themePrefs.getInt("chatEmojiViewBGColor", 0xfff5f6f7), false);
|
||||
} else if (i == emojiViewBGGradientColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("chatEmojiViewBGGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("chatEmojiViewBGGradientColor", 0xfff5f6f7), true);
|
||||
} else if (i == emojiViewTabIconColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("EmojiViewTabIconColor", R.string.EmojiViewTabIconColor), themePrefs.getInt("chatEmojiViewTabIconColor", 0xffa8a8a8), false);
|
||||
} else if (i == emojiViewTabColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("EmojiViewTabColor", R.string.EmojiViewTabColor), themePrefs.getInt("chatEmojiViewTabColor", AndroidUtilities.getIntDarkerColor("themeColor",-0x15)), false);
|
||||
}
|
||||
} else if (type == 5) {
|
||||
if (view == null) {
|
||||
view = new TextDetailSettingsCell(mContext);
|
||||
}
|
||||
|
||||
TextDetailSettingsCell textCell = (TextDetailSettingsCell) view;
|
||||
if(i == gradientBGRow){
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("chatGradientBG", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
} else if(i == headerGradientRow){
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("chatHeaderGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
} else if(i == editTextBGGradientRow){
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("chatEditTextBGGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
} else if(i == attachBGGradientRow){
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("chatAttachBGGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
} else if(i == emojiViewBGGradientRow){
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("chatEmojiViewBGGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return view;
|
||||
}
|
||||
@ -1381,14 +1711,16 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
return 2;
|
||||
}
|
||||
|
||||
else if ( i == headerColorRow || i == muteColorRow || i == headerIconsColorRow ||
|
||||
i == solidBGColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == nameColorRow || i == statusColorRow || i == dateColorRow || i == dateBubbleColorRow ||
|
||||
else if ( i == headerColorRow || i == headerGradientColorRow || i == muteColorRow || i == headerIconsColorRow ||
|
||||
i == solidBGColorRow || i == gradientBGColorRow || i == rBubbleColorRow || i == lBubbleColorRow || i == nameColorRow || i == statusColorRow || i == onlineColorRow || i == dateColorRow || i == dateBubbleColorRow ||
|
||||
i == rTextColorRow || i == rLinkColorRow || i == lTextColorRow || i == lLinkColorRow || i == rLinkColorRow || i == rTimeColorRow || i == lTimeColorRow || i == checksColorRow || i == memberColorRow || i == contactNameColorRow || i == forwardRightNameColorRow || i == forwardLeftNameColorRow ||
|
||||
i == sendColorRow || i == editTextColorRow || i == editTextBGColorRow || i == editTextIconsColorRow || i == attachBGColorRow || i == attachTextColorRow ||
|
||||
i == emojiViewBGColorRow || i == emojiViewTabIconColorRow || i == emojiViewTabColorRow) {
|
||||
i == sendColorRow || i == editTextColorRow || i == editTextBGColorRow || i == editTextBGGradientColorRow || i == editTextIconsColorRow || i == attachBGColorRow || i == attachBGGradientColorRow || i == attachTextColorRow ||
|
||||
i == emojiViewBGColorRow || i == emojiViewBGGradientColorRow || i == emojiViewTabIconColorRow || i == emojiViewTabColorRow) {
|
||||
return 3;
|
||||
} else if (i == solidBGColorCheckRow || i == memberColorCheckRow || i == showUsernameCheckRow || i == avatarAlignTopRow || i == ownAvatarAlignTopRow || i == showContactAvatar || i == showOwnAvatar || i == showOwnAvatarGroup) {
|
||||
return 4;
|
||||
} else if (i == headerGradientRow || i == gradientBGRow || i == editTextBGGradientRow || i == attachBGGradientRow || i == emojiViewBGGradientRow) {
|
||||
return 5;
|
||||
}
|
||||
else {
|
||||
return 2;
|
||||
@ -1397,7 +1729,7 @@ public class ThemingChatActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public int getViewTypeCount() {
|
||||
return 5;
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -15,7 +15,6 @@ import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -29,6 +28,7 @@ import org.telegram.android.AndroidUtilities;
|
||||
import org.telegram.android.ContactsController;
|
||||
import org.telegram.android.LocaleController;
|
||||
import org.telegram.android.MessagesController;
|
||||
import org.telegram.android.NotificationCenter;
|
||||
import org.telegram.messenger.ApplicationLoader;
|
||||
import org.telegram.messenger.R;
|
||||
import org.telegram.messenger.TLRPC;
|
||||
@ -38,6 +38,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.TextDetailSettingsCell;
|
||||
import org.telegram.ui.Cells.TextSettingsCell;
|
||||
@ -88,6 +89,11 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
private int groupNameSizeRow;
|
||||
private int mediaColorRow;
|
||||
private int groupIconColorRow;
|
||||
private int rowGradientRow;
|
||||
private int rowGradientColorRow;
|
||||
private int rowGradientListCheckRow;
|
||||
private int headerGradientRow;
|
||||
private int headerGradientColorRow;
|
||||
|
||||
private int rowCount;
|
||||
|
||||
@ -100,6 +106,8 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
rowCount = 0;
|
||||
headerSection2Row = rowCount++;
|
||||
headerColorRow = rowCount++;
|
||||
headerGradientRow = rowCount++;
|
||||
headerGradientColorRow = rowCount++;
|
||||
headerTitleColorRow = rowCount++;
|
||||
headerTitleRow = rowCount++;
|
||||
headerIconsColorRow = rowCount++;
|
||||
@ -107,6 +115,9 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
rowsSectionRow = rowCount++;
|
||||
rowsSection2Row = rowCount++;
|
||||
rowColorRow = rowCount++;
|
||||
rowGradientRow = rowCount++;
|
||||
rowGradientColorRow = rowCount++;
|
||||
//rowGradientListCheckRow = rowCount++;
|
||||
dividerColorRow = rowCount++;
|
||||
|
||||
avatarRadiusRow = rowCount++;
|
||||
@ -208,7 +219,7 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
|
||||
},themePrefs.getInt( key, defColor), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == headerTitleColorRow) {
|
||||
} else if (i == headerGradientColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
}
|
||||
@ -219,6 +230,20 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
public void colorChanged(int color) {
|
||||
commitInt( key, color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt( key, defColor), CENTER, 0, true);
|
||||
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, true);
|
||||
colorDialog.show();
|
||||
} else if (i == headerIconsColorRow) {
|
||||
@ -230,7 +255,7 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() {
|
||||
@Override
|
||||
public void colorChanged(int color) {
|
||||
commitInt( key, color);
|
||||
commitInt(key, color);
|
||||
}
|
||||
},themePrefs.getInt( key, 0xffffffff), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
@ -244,10 +269,37 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
@Override
|
||||
public void colorChanged(int color) {
|
||||
commitInt( key, color);
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
}
|
||||
|
||||
},themePrefs.getInt( key, 0xffffffff), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == rowGradientColorRow) {
|
||||
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);
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
}
|
||||
},themePrefs.getInt( key, 0xffffffff), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == rowGradientListCheckRow) {
|
||||
boolean b = themePrefs.getBoolean( key, false);
|
||||
SharedPreferences.Editor editor = themePrefs.edit();
|
||||
editor.putBoolean(key, !b);
|
||||
editor.commit();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(!b);
|
||||
}
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
} else if (i == dividerColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
@ -302,6 +354,54 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == headerGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("chatsHeaderGradient", which).commit();
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == rowGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("chatsRowGradient", which).commit();
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == nameColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
@ -554,7 +654,7 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (numberPicker.getValue() != currentValue) {
|
||||
commitInt( key, numberPicker.getValue());
|
||||
commitInt(key, numberPicker.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -645,7 +745,7 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (numberPicker.getValue() != currentValue) {
|
||||
commitInt( key, numberPicker.getValue());
|
||||
commitInt(key, numberPicker.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -803,8 +903,9 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int i) {
|
||||
return i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == headerTitleRow ||
|
||||
i == rowColorRow || i == dividerColorRow || i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow ||
|
||||
int g = AndroidUtilities.getIntDef("chatsRowGradient",0);
|
||||
return i == headerColorRow || i == headerGradientRow || (AndroidUtilities.getIntDef("chatsHeaderGradient", 0) != 0 && i == headerGradientColorRow) || i == headerTitleColorRow || i == headerIconsColorRow || i == headerTitleRow ||
|
||||
i == rowColorRow || i == rowGradientRow || (g != 0 && i == rowGradientColorRow) || (g != 0 && i == rowGradientListCheckRow) || i == dividerColorRow || i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow ||
|
||||
i == nameColorRow || i == groupNameColorRow || i == unknownNameColorRow || i == groupIconColorRow || i == muteColorRow || i == checksColorRow || i == nameSizeRow || i == groupNameSizeRow || i == messageColorRow || i == memberColorRow || i == mediaColorRow || i == typingColorRow || i == messageSizeRow ||
|
||||
i == timeColorRow || i == timeSizeRow || i == countColorRow || i == countSizeRow || i == countBGColorRow || i == floatingPencilColorRow || i == floatingBGColorRow;
|
||||
}
|
||||
@ -897,7 +998,10 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
|
||||
if (i == headerColorRow) {
|
||||
textCell.setTag("chatsHeaderColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("chatsHeaderColor", defColor), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("chatsHeaderColor", defColor), false);
|
||||
} else if (i == headerGradientColorRow) {
|
||||
textCell.setTag("chatsHeaderGradientColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("chatsHeaderGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("chatsHeaderGradientColor", defColor), true);
|
||||
} else if (i == headerTitleColorRow) {
|
||||
textCell.setTag("chatsHeaderTitleColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderTitleColor", R.string.HeaderTitleColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true);
|
||||
@ -906,7 +1010,10 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderIconsColor", R.string.HeaderIconsColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), false);
|
||||
} else if (i == rowColorRow) {
|
||||
textCell.setTag("chatsRowColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt("chatsRowColor", 0xffffffff), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt("chatsRowColor", 0xffffffff), false);
|
||||
} else if (i == rowGradientColorRow) {
|
||||
textCell.setTag("chatsRowGradientColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("chatsRowGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("chatsRowGradientColor", 0xffffffff), true);
|
||||
} else if (i == dividerColorRow) {
|
||||
textCell.setTag("chatsDividerColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("DividerColor", R.string.DividerColor), themePrefs.getInt("chatsDividerColor", 0xffdcdcdc), true);
|
||||
@ -956,17 +1063,17 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
textCell.setTag("chatsFloatingBGColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("FloatingBGColor", R.string.FloatingBGColor), themePrefs.getInt("chatsFloatingBGColor", defColor), false);
|
||||
}
|
||||
} /*else if (type == 4) {
|
||||
} 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);
|
||||
if (i == rowGradientListCheckRow) {
|
||||
textCell.setTag("chatsRowGradientListCheck");
|
||||
int value = AndroidUtilities.getIntDef("chatsRowGradient", 0);
|
||||
textCell.setTextAndCheck(LocaleController.getString("RowGradientList", R.string.RowGradientList), value == 0 ? false : themePrefs.getBoolean("chatsRowGradientListCheck", false), true);
|
||||
}
|
||||
}*/ else if (type == 5) {
|
||||
} else if (type == 5) {
|
||||
if (view == null) {
|
||||
view = new TextDetailSettingsCell(mContext);
|
||||
}
|
||||
@ -975,9 +1082,7 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
if (i == headerTitleRow) {
|
||||
textCell.setTag("chatsHeaderTitle");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = 0;
|
||||
value = themePrefs.getInt("chatsHeaderTitle", 0);
|
||||
Log.e("chatsHeaderTitle", "" + value);
|
||||
int value = themePrefs.getInt("chatsHeaderTitle", 0);
|
||||
int user_id = UserConfig.getClientUserId();
|
||||
TLRPC.User user = MessagesController.getInstance().getUser(user_id);
|
||||
String text;
|
||||
@ -997,6 +1102,36 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("HeaderTitle", R.string.HeaderTitle), "", true);
|
||||
}
|
||||
} else if(i == headerGradientRow){
|
||||
textCell.setTag("chatsHeaderGradient");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("chatsHeaderGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
} else if(i == rowGradientRow){
|
||||
textCell.setTag("chatsRowGradient");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("chatsRowGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return view;
|
||||
@ -1010,13 +1145,13 @@ public class ThemingChatsActivity extends BaseFragment {
|
||||
return 1;
|
||||
} else if ( i == avatarRadiusRow || i == avatarSizeRow || i == avatarMarginLeftRow || i == nameSizeRow || i == groupNameSizeRow || i == messageSizeRow || i == timeSizeRow || i == countSizeRow ) {
|
||||
return 2;
|
||||
} else if ( i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow ||
|
||||
i == rowColorRow || i == dividerColorRow || i == nameColorRow || i == groupNameColorRow || i == unknownNameColorRow || i == groupIconColorRow || i == muteColorRow || i == checksColorRow || i == messageColorRow || i == memberColorRow || i == mediaColorRow || i == typingColorRow || i == timeColorRow || i == countColorRow ||
|
||||
} else if ( i == headerColorRow || i == headerGradientColorRow || i == headerTitleColorRow || i == headerIconsColorRow ||
|
||||
i == rowColorRow || i == rowGradientColorRow || i == dividerColorRow || i == nameColorRow || i == groupNameColorRow || i == unknownNameColorRow || i == groupIconColorRow || i == muteColorRow || i == checksColorRow || i == messageColorRow || i == memberColorRow || i == mediaColorRow || i == typingColorRow || i == timeColorRow || i == countColorRow ||
|
||||
i == countBGColorRow || i == floatingPencilColorRow || i == floatingBGColorRow) {
|
||||
return 3;
|
||||
}/* else if (i == usernameTitleRow) {
|
||||
} else if (i == rowGradientListCheckRow) {
|
||||
return 4;
|
||||
}*/ else if (i == headerTitleRow) {
|
||||
} else if (i == headerTitleRow || i == headerGradientRow || i == rowGradientRow) {
|
||||
return 5;
|
||||
} else {
|
||||
return 2;
|
||||
|
@ -33,12 +33,17 @@ 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.TextDetailSettingsCell;
|
||||
import org.telegram.ui.Cells.TextSettingsCell;
|
||||
import org.telegram.ui.Components.AvatarDrawable;
|
||||
import org.telegram.ui.Components.ColorSelectorDialog;
|
||||
import org.telegram.ui.Components.NumberPicker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.telegram.ui.Components.ColorSelectorDialog.OnColorChangedListener;
|
||||
|
||||
public class ThemingContactsActivity extends BaseFragment {
|
||||
@ -62,6 +67,13 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
private int onlineColorRow;
|
||||
private int iconsColorRow;
|
||||
|
||||
private int rowGradientRow;
|
||||
private int rowGradientColorRow;
|
||||
private int rowGradientListCheckRow;
|
||||
|
||||
private int headerGradientRow;
|
||||
private int headerGradientColorRow;
|
||||
|
||||
private int rowCount;
|
||||
|
||||
public final static int CENTER = 0;
|
||||
@ -73,12 +85,17 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
rowCount = 0;
|
||||
headerSection2Row = rowCount++;
|
||||
headerColorRow = rowCount++;
|
||||
headerGradientRow = rowCount++;
|
||||
headerGradientColorRow = rowCount++;
|
||||
headerTitleColorRow = rowCount++;
|
||||
headerIconsColorRow = rowCount++;
|
||||
|
||||
rowsSectionRow = rowCount++;
|
||||
rowsSection2Row = rowCount++;
|
||||
rowColorRow = rowCount++;
|
||||
rowGradientRow = rowCount++;
|
||||
rowGradientColorRow = rowCount++;
|
||||
//rowGradientListCheckRow = rowCount++;
|
||||
avatarRadiusRow = rowCount++;
|
||||
iconsColorRow = rowCount++;
|
||||
nameColorRow = rowCount++;
|
||||
@ -158,6 +175,20 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
|
||||
},themePrefs.getInt("contactsHeaderColor", AndroidUtilities.getIntColor("themeColor")), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == headerGradientColorRow) {
|
||||
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("contactsHeaderGradientColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("contactsHeaderGradientColor", AndroidUtilities.getIntColor("themeColor")), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == headerTitleColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
@ -211,6 +242,76 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
|
||||
},themePrefs.getInt("contactsRowColor", 0xffffffff), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == rowGradientColorRow) {
|
||||
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("contactsRowGradientColor", color);
|
||||
}
|
||||
},themePrefs.getInt( "contactsRowGradientColor", 0xffffffff), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == rowGradientListCheckRow) {
|
||||
boolean b = themePrefs.getBoolean("contactsRowGradientListCheck", false);
|
||||
SharedPreferences.Editor editor = themePrefs.edit();
|
||||
editor.putBoolean("contactsRowGradientListCheck", !b);
|
||||
editor.commit();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(!b);
|
||||
}
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
} else if (i == headerGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("contactsHeaderGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == rowGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("contactsRowGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == nameColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
@ -327,6 +428,8 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
}
|
||||
if (i == headerColorRow) {
|
||||
resetInt("contactsHeaderColor");
|
||||
} else if (i == headerGradientColorRow) {
|
||||
resetInt("contactsHeaderGradientColor");
|
||||
} else if (i == headerTitleColorRow) {
|
||||
resetInt("contactsHeaderTitleColor");
|
||||
} else if (i == headerIconsColorRow) {
|
||||
@ -335,6 +438,12 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
resetInt("contactsIconsColor");
|
||||
} else if (i == rowColorRow) {
|
||||
resetInt("contactsRowColor");
|
||||
} else if (i == rowGradientColorRow) {
|
||||
resetInt("contactsRowGradientColor");
|
||||
} else if (i == headerGradientRow) {
|
||||
resetInt("contactsHeaderGradient");
|
||||
} else if (i == rowGradientRow) {
|
||||
resetInt("contactsRowGradient");
|
||||
} else if (i == avatarRadiusRow) {
|
||||
resetInt("contactsAvatarRadius");
|
||||
} else if (i == nameColorRow) {
|
||||
@ -347,7 +456,10 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
resetInt("contactsStatusSize");
|
||||
} else if (i == onlineColorRow) {
|
||||
resetInt("contactsOnlineColor");
|
||||
} else{
|
||||
if(view.getTag() != null)resetPref(view.getTag().toString());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -362,6 +474,16 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
return fragmentView;
|
||||
}
|
||||
|
||||
private void resetPref(String key){
|
||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
if(key != null)editor.remove(key);
|
||||
editor.commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
|
||||
private void resetInt(String key){
|
||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
@ -441,7 +563,8 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int i) {
|
||||
return i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == iconsColorRow || i == rowColorRow || i == avatarRadiusRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow ||
|
||||
int g = AndroidUtilities.getIntDef("contactsRowGradient", 0);
|
||||
return i == headerColorRow || i == headerGradientRow || AndroidUtilities.getIntDef("contactsHeaderGradient", 0) != 0 && i == headerGradientColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == iconsColorRow || i == rowColorRow || i == rowGradientRow || (g != 0 && i == rowGradientColorRow) || (g != 0 && i == rowGradientListCheckRow) || i == avatarRadiusRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow ||
|
||||
i == onlineColorRow ;
|
||||
}
|
||||
|
||||
@ -510,7 +633,9 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
TextColorCell textCell = (TextColorCell) view;
|
||||
|
||||
if (i == headerColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("contactsHeaderColor", AndroidUtilities.getIntColor("themeColor")), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("contactsHeaderColor", AndroidUtilities.getIntColor("themeColor")), false);
|
||||
} else if (i == headerGradientColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("contactsHeaderGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("contactsHeaderGradientColor", AndroidUtilities.getIntColor("themeColor")), true);
|
||||
} else if (i == headerTitleColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderTitleColor", R.string.HeaderTitleColor), themePrefs.getInt("contactsHeaderTitleColor", 0xffffffff), true);
|
||||
} else if (i == headerIconsColorRow) {
|
||||
@ -518,7 +643,9 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
} else if (i == iconsColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("IconsColor", R.string.IconsColor), themePrefs.getInt("contactsIconsColor", 0xff737373), true);
|
||||
} else if (i == rowColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt("contactsRowColor", 0xffffffff), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt("contactsRowColor", 0xffffffff), false);
|
||||
} else if (i == rowGradientColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("contactsRowGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("contactsRowGradientColor", 0xffffffff), true);
|
||||
} else if (i == nameColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("NameColor", R.string.NameColor), themePrefs.getInt("contactsNameColor", 0xff000000), true);
|
||||
} else if (i == statusColorRow) {
|
||||
@ -526,6 +653,53 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
} else if (i == onlineColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("OnlineColor", R.string.OnlineColor), themePrefs.getInt("contactsOnlineColor", AndroidUtilities.getIntDarkerColor("themeColor",0x15)), false);
|
||||
}
|
||||
} else if (type == 4) {
|
||||
if (view == null) {
|
||||
view = new TextCheckCell(mContext);
|
||||
}
|
||||
TextCheckCell textCell = (TextCheckCell) view;
|
||||
if (i == rowGradientListCheckRow) {
|
||||
textCell.setTag("contactsRowGradientListCheck");
|
||||
int value = AndroidUtilities.getIntDef("contactsRowGradient", 0);
|
||||
textCell.setTextAndCheck(LocaleController.getString("RowGradientList", R.string.RowGradientList), value == 0 ? false : themePrefs.getBoolean("contactsRowGradientListCheck", false), true);
|
||||
}
|
||||
} else if (type == 5) {
|
||||
if (view == null) {
|
||||
view = new TextDetailSettingsCell(mContext);
|
||||
}
|
||||
|
||||
TextDetailSettingsCell textCell = (TextDetailSettingsCell) view;
|
||||
if(i == headerGradientRow){
|
||||
textCell.setTag("contactsHeaderGradient");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("contactsHeaderGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
} else if(i == rowGradientRow){
|
||||
textCell.setTag("contactsRowGradient");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("contactsRowGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return view;
|
||||
}
|
||||
@ -541,10 +715,15 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
else if ( i == avatarRadiusRow || i == nameSizeRow || i == statusSizeRow ) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
else if ( i == headerColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == iconsColorRow || i == rowColorRow || i == nameColorRow || i == statusColorRow || i == onlineColorRow) {
|
||||
else if ( i == headerColorRow || i == headerGradientColorRow || i == headerTitleColorRow || i == headerIconsColorRow || i == iconsColorRow || i == rowColorRow || i == rowGradientColorRow || i == nameColorRow || i == statusColorRow || i == onlineColorRow) {
|
||||
return 3;
|
||||
}
|
||||
else if (i == rowGradientListCheckRow) {
|
||||
return 4;
|
||||
}
|
||||
else if ( i == headerGradientRow || i == rowGradientRow) {
|
||||
return 5;
|
||||
}
|
||||
else {
|
||||
return 2;
|
||||
}
|
||||
@ -552,7 +731,7 @@ public class ThemingContactsActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public int getViewTypeCount() {
|
||||
return 4;
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,11 +37,15 @@ 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.TextDetailSettingsCell;
|
||||
import org.telegram.ui.Cells.TextSettingsCell;
|
||||
import org.telegram.ui.Components.AvatarDrawable;
|
||||
import org.telegram.ui.Components.ColorSelectorDialog;
|
||||
import org.telegram.ui.Components.NumberPicker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.telegram.ui.Components.ColorSelectorDialog.OnColorChangedListener;
|
||||
|
||||
public class ThemingDrawerActivity extends BaseFragment {
|
||||
@ -71,6 +75,12 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
private int listDividerColorRow;
|
||||
private int centerAvatarRow;
|
||||
|
||||
private int rowGradientRow;
|
||||
private int rowGradientColorRow;
|
||||
private int rowGradientListCheckRow;
|
||||
private int headerGradientRow;
|
||||
private int headerGradientColorRow;
|
||||
|
||||
private int rowCount;
|
||||
|
||||
public final static int CENTER = 0;
|
||||
@ -87,6 +97,8 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
headerBackgroundCheckRow = rowCount++;
|
||||
hideBackgroundShadowRow = rowCount++;
|
||||
headerColorRow = rowCount++;
|
||||
headerGradientRow = rowCount++;
|
||||
headerGradientColorRow = rowCount++;
|
||||
avatarColorRow = rowCount++;
|
||||
avatarRadiusRow = rowCount++;
|
||||
avatarSizeRow = rowCount++;
|
||||
@ -99,6 +111,9 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
rowsSectionRow = rowCount++;
|
||||
rowsSection2Row = rowCount++;
|
||||
listColorRow = rowCount++;
|
||||
rowGradientRow = rowCount++;
|
||||
rowGradientColorRow = rowCount++;
|
||||
//rowGradientListCheckRow = rowCount++;
|
||||
listDividerColorRow = rowCount++;
|
||||
iconColorRow = rowCount++;
|
||||
optionColorRow = rowCount++;
|
||||
@ -167,6 +182,7 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
final String key = view.getTag() != null ? view.getTag().toString() : "";
|
||||
int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
|
||||
if (i == headerColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
@ -180,7 +196,43 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
commitInt("drawerHeaderColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("drawerHeaderColor", AndroidUtilities.getIntColor("themeColor")), CENTER, 0, false);
|
||||
},themePrefs.getInt("drawerHeaderColor", defColor), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == headerGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("drawerHeaderGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == headerGradientColorRow) {
|
||||
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("drawerHeaderGradientColor", color);
|
||||
}
|
||||
},themePrefs.getInt("drawerHeaderGradientColor", defColor), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == headerBackgroundCheckRow) {
|
||||
boolean b = themePrefs.getBoolean( key, true);
|
||||
@ -230,6 +282,53 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
|
||||
},themePrefs.getInt("drawerListColor", 0xffffffff), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == rowGradientColorRow) {
|
||||
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("drawerRowGradientColor", color);
|
||||
}
|
||||
},themePrefs.getInt( "drawerRowGradientColor", 0xffffffff), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == rowGradientListCheckRow) {
|
||||
boolean b = themePrefs.getBoolean( "drawerRowGradientListCheck", false);
|
||||
SharedPreferences.Editor editor = themePrefs.edit();
|
||||
editor.putBoolean("drawerRowGradientListCheck", !b);
|
||||
editor.commit();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(!b);
|
||||
}
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
} else if (i == rowGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("drawerRowGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == listDividerColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
@ -243,7 +342,7 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
player = true;
|
||||
}
|
||||
|
||||
},themePrefs.getInt("drawerListDividerColor", 0xffd9d9d9), CENTER, 0, false);
|
||||
},themePrefs.getInt("drawerListDividerColor", 0xffd9d9d9), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == iconColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
@ -288,7 +387,7 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
commitInt("drawerVersionColor", color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt("drawerVersionColor", 0xffa3a3a3), CENTER, 0, false);
|
||||
},themePrefs.getInt("drawerVersionColor", 0xffa3a3a3), CENTER, 0, true);
|
||||
colorDialog.show();
|
||||
} else if (i == avatarColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
@ -472,9 +571,22 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
}
|
||||
if (i == headerColorRow) {
|
||||
resetInt("drawerHeaderColor");
|
||||
} else if (i == headerGradientRow) {
|
||||
resetInt("drawerHeaderGradient");
|
||||
} else if (i == headerGradientColorRow) {
|
||||
resetInt("drawerHeaderGradientColor");
|
||||
} else if (i == listColorRow) {
|
||||
resetInt("drawerListColor");
|
||||
player = true;
|
||||
} else if (i == rowGradientColorRow) {
|
||||
resetInt("drawerRowGradientColor");
|
||||
player = true;
|
||||
} else if (i == rowGradientRow) {
|
||||
resetInt("drawerRowGradient");
|
||||
player = true;
|
||||
} else if (i == rowGradientListCheckRow) {
|
||||
resetInt("drawerRowGradientListCheck");
|
||||
player = true;
|
||||
} else if (i == listDividerColorRow) {
|
||||
resetInt("drawerListDividerColor");
|
||||
} else if (i == avatarColorRow) {
|
||||
@ -616,7 +728,10 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int i) {
|
||||
return i == headerColorRow || i == headerBackgroundCheckRow || i == hideBackgroundShadowRow || i == centerAvatarRow || i == listColorRow || i == listDividerColorRow || i == iconColorRow || i == optionColorRow || i == optionSizeRow || i == avatarColorRow || i == avatarRadiusRow || i == nameColorRow || i == avatarSizeRow || i == nameSizeRow || i == phoneColorRow || i == phoneSizeRow ||
|
||||
int h = AndroidUtilities.getIntDef("drawerHeaderGradient", 0);
|
||||
int g = AndroidUtilities.getIntDef("drawerRowGradient", 0);
|
||||
return i == headerColorRow || i == headerGradientRow || h > 0 && i == headerGradientColorRow || i == headerBackgroundCheckRow || i == hideBackgroundShadowRow || i == centerAvatarRow ||
|
||||
i == listColorRow || i == rowGradientRow || g != 0 && i == rowGradientColorRow || g != 0 && i == rowGradientListCheckRow || i == listDividerColorRow || i == iconColorRow || i == optionColorRow || i == optionSizeRow || i == avatarColorRow || i == avatarRadiusRow || i == nameColorRow || i == avatarSizeRow || i == nameSizeRow || i == phoneColorRow || i == phoneSizeRow ||
|
||||
i == versionColorRow || i == versionSizeRow;
|
||||
}
|
||||
|
||||
@ -644,6 +759,8 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
int type = getItemViewType(i);
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
int darkColor = AndroidUtilities.getIntDarkerColor("themeColor", 0x15);
|
||||
if (type == 0) {
|
||||
if (view == null) {
|
||||
view = new ShadowSectionCell(mContext);
|
||||
@ -694,9 +811,13 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
TextColorCell textCell = (TextColorCell) view;
|
||||
|
||||
if (i == headerColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("drawerHeaderColor", AndroidUtilities.getIntColor("themeColor")), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("drawerHeaderColor", defColor), false);
|
||||
} else if (i == headerGradientColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("drawerHeaderGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("drawerHeaderGradientColor", defColor), true);
|
||||
} else if (i == listColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("ListColor", R.string.ListColor), themePrefs.getInt("drawerListColor", 0xffffffff), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("ListColor", R.string.ListColor), themePrefs.getInt("drawerListColor", 0xffffffff), false);
|
||||
} else if (i == rowGradientColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("drawerRowGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("drawerRowGradientColor", 0xffffffff), true);
|
||||
} else if (i == listDividerColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("ListDividerColor", R.string.ListDividerColor), themePrefs.getInt("drawerListDividerColor", 0xffd9d9d9), true);
|
||||
} else if (i == iconColorRow) {
|
||||
@ -706,7 +827,7 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
} else if (i == versionColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("VersionColor", R.string.VersionColor), themePrefs.getInt("drawerVersionColor", 0xffa3a3a3), true);
|
||||
} else if (i == avatarColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("AvatarColor", R.string.AvatarColor), themePrefs.getInt("drawerAvatarColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15)), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("AvatarColor", R.string.AvatarColor), themePrefs.getInt("drawerAvatarColor", darkColor), true);
|
||||
} else if (i == nameColorRow) {
|
||||
textCell.setTextAndColor(LocaleController.getString("NameColor", R.string.NameColor), themePrefs.getInt("drawerNameColor", 0xffffffff), true);
|
||||
} else if (i == phoneColorRow) {
|
||||
@ -726,6 +847,47 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
} else if (i == centerAvatarRow) {
|
||||
textCell.setTag("drawerCenterAvatarCheck");
|
||||
textCell.setTextAndCheck(LocaleController.getString("CenterAvatar", R.string.CenterAvatar), themePrefs.getBoolean("drawerCenterAvatarCheck", false), false);
|
||||
} else if (i == rowGradientListCheckRow) {
|
||||
textCell.setTag("drawerRowGradientListCheck");
|
||||
int value = AndroidUtilities.getIntDef("drawerRowGradient", 0);
|
||||
textCell.setTextAndCheck(LocaleController.getString("RowGradientList", R.string.RowGradientList), value == 0 ? false : themePrefs.getBoolean("drawerRowGradientListCheck", false), true);
|
||||
}
|
||||
} else if (type == 5) {
|
||||
if (view == null) {
|
||||
view = new TextDetailSettingsCell(mContext);
|
||||
}
|
||||
TextDetailSettingsCell textCell = (TextDetailSettingsCell) view;
|
||||
|
||||
if(i == headerGradientRow){
|
||||
textCell.setTag("drawerHeaderGradient");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("drawerHeaderGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
} else if(i == rowGradientRow){
|
||||
textCell.setTag("drawerRowGradient");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("drawerRowGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return view;
|
||||
@ -742,12 +904,15 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
else if ( i == avatarRadiusRow || i == avatarSizeRow || i == nameSizeRow || i == phoneSizeRow || i == optionSizeRow || i == versionSizeRow) {
|
||||
return 2;
|
||||
}
|
||||
else if ( i == headerColorRow || i == listColorRow || i == listDividerColorRow || i == iconColorRow || i == optionColorRow || i == versionColorRow || i == avatarColorRow || i == nameColorRow || i == phoneColorRow) {
|
||||
else if ( i == headerColorRow || i == headerGradientColorRow || i == listColorRow || i == rowGradientColorRow || i == listDividerColorRow || i == iconColorRow || i == optionColorRow || i == versionColorRow || i == avatarColorRow || i == nameColorRow || i == phoneColorRow) {
|
||||
return 3;
|
||||
}
|
||||
else if (i == headerBackgroundCheckRow || i == hideBackgroundShadowRow || i == centerAvatarRow) {
|
||||
else if (i == headerBackgroundCheckRow || i == hideBackgroundShadowRow || i == centerAvatarRow || i == rowGradientListCheckRow) {
|
||||
return 4;
|
||||
}
|
||||
else if (i == headerGradientRow || i == rowGradientRow) {
|
||||
return 5;
|
||||
}
|
||||
else {
|
||||
return 2;
|
||||
}
|
||||
@ -755,7 +920,7 @@ public class ThemingDrawerActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public int getViewTypeCount() {
|
||||
return 5;
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,12 +33,17 @@ 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.TextDetailSettingsCell;
|
||||
import org.telegram.ui.Cells.TextSettingsCell;
|
||||
import org.telegram.ui.Components.AvatarDrawable;
|
||||
import org.telegram.ui.Components.ColorSelectorDialog;
|
||||
import org.telegram.ui.Components.NumberPicker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.telegram.ui.Components.ColorSelectorDialog.OnColorChangedListener;
|
||||
|
||||
public class ThemingProfileActivity extends BaseFragment {
|
||||
@ -61,8 +66,16 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
|
||||
private int titleColorRow;
|
||||
private int summaryColorRow;
|
||||
private int avatarRadiusRow;
|
||||
private int headerAvatarRadiusRow;
|
||||
private int iconsColorRow;
|
||||
private int onlineColorRow;
|
||||
|
||||
private int rowGradientRow;
|
||||
private int rowGradientColorRow;
|
||||
private int rowGradientListCheckRow;
|
||||
private int headerGradientRow;
|
||||
private int headerGradientColorRow;
|
||||
private int avatarRadiusRow;
|
||||
|
||||
private int rowCount;
|
||||
|
||||
@ -75,8 +88,10 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
rowCount = 0;
|
||||
headerSection2Row = rowCount++;
|
||||
headerColorRow = rowCount++;
|
||||
headerGradientRow = rowCount++;
|
||||
headerGradientColorRow = rowCount++;
|
||||
headerIconsColorRow = rowCount++;
|
||||
avatarRadiusRow = rowCount++;
|
||||
headerAvatarRadiusRow = rowCount++;
|
||||
|
||||
nameSizeRow = rowCount++;
|
||||
nameColorRow = rowCount++;
|
||||
@ -86,9 +101,13 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
rowsSectionRow = rowCount++;
|
||||
rowsSection2Row = rowCount++;
|
||||
rowColorRow = rowCount++;
|
||||
|
||||
rowGradientRow = rowCount++;
|
||||
rowGradientColorRow = rowCount++;
|
||||
//rowGradientListCheckRow = rowCount++;
|
||||
avatarRadiusRow = rowCount++;
|
||||
titleColorRow = rowCount++;
|
||||
summaryColorRow = rowCount++;
|
||||
onlineColorRow = rowCount++;
|
||||
iconsColorRow = rowCount++;
|
||||
|
||||
return true;
|
||||
@ -147,6 +166,7 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
final String key = view.getTag() != null ? view.getTag().toString() : "";
|
||||
int defColor = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
|
||||
|
||||
if (i == headerColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
@ -160,7 +180,79 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
commitInt(key, color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt(key, AndroidUtilities.getIntColor("themeColor")), CENTER, 0, false);
|
||||
},themePrefs.getInt(key, defColor), CENTER, 0, false);
|
||||
|
||||
colorDialog.show();
|
||||
} else if (i == headerGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("profileHeaderGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == rowGradientRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setTitle(LocaleController.getString("RowGradient", R.string.RowGradient));
|
||||
List<CharSequence> array = new ArrayList<>();
|
||||
array.add( LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled));
|
||||
array.add(LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom));
|
||||
array.add( LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight));
|
||||
array.add( LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR));
|
||||
array.add( LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR));
|
||||
String[] simpleArray = new String[ array.size() ];
|
||||
array.toArray( new String[ array.size() ]);
|
||||
builder.setItems(array.toArray(simpleArray), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
|
||||
themePrefs.edit().putInt("profileRowGradient", which).commit();
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showDialog(builder.create());
|
||||
} else if (i == rowGradientListCheckRow) {
|
||||
boolean b = themePrefs.getBoolean( "profileRowGradientListCheck", false);
|
||||
SharedPreferences.Editor editor = themePrefs.edit();
|
||||
editor.putBoolean("profileRowGradientListCheck", !b);
|
||||
editor.commit();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(!b);
|
||||
}
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
} else if (i == headerGradientColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
}
|
||||
LayoutInflater li = (LayoutInflater)getParentActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
li.inflate(R.layout.colordialog, null, false);
|
||||
ColorSelectorDialog colorDialog = new ColorSelectorDialog(getParentActivity(), new OnColorChangedListener() {
|
||||
@Override
|
||||
public void colorChanged(int color) {
|
||||
commitInt(key, color);
|
||||
}
|
||||
|
||||
},themePrefs.getInt(key, defColor), CENTER, 0, false);
|
||||
|
||||
colorDialog.show();
|
||||
} else if (i == headerIconsColorRow) {
|
||||
@ -273,7 +365,21 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
|
||||
},themePrefs.getInt( key, 0xffffffff), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == avatarRadiusRow) {
|
||||
} else if (i == rowGradientColorRow) {
|
||||
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 == headerAvatarRadiusRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
}
|
||||
@ -294,6 +400,27 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
}
|
||||
});
|
||||
showDialog(builder.create());
|
||||
} 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( "profileRowAvatarRadius", 32);
|
||||
numberPicker.setMinValue(1);
|
||||
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("profileRowAvatarRadius", numberPicker.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
showDialog(builder.create());
|
||||
} else if (i == titleColorRow) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
@ -320,6 +447,19 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
}
|
||||
},themePrefs.getInt(key, 0xff8a8a8a), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
} else if (i == onlineColorRow) {
|
||||
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.getIntDarkerColor("themeColor", -0x40)), CENTER, 0, false);
|
||||
colorDialog.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -426,8 +566,10 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int i) {
|
||||
return i == headerColorRow || i == headerIconsColorRow || i == iconsColorRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow ||
|
||||
i == rowColorRow || i == titleColorRow || i == summaryColorRow || i == avatarRadiusRow;
|
||||
int h = AndroidUtilities.getIntDef("profileHeaderGradient", 0);
|
||||
int g = AndroidUtilities.getIntDef("profileRowGradient", 0);
|
||||
return i == headerColorRow || i == headerGradientRow || h > 0 && i == headerGradientColorRow || i == headerIconsColorRow || i == iconsColorRow || i == nameColorRow || i == nameSizeRow || i == statusColorRow || i == statusSizeRow ||
|
||||
i == rowColorRow || i == rowGradientRow || g != 0 && i == rowGradientColorRow || g != 0 && i == rowGradientListCheckRow || i == titleColorRow || i == summaryColorRow || i == onlineColorRow || i == headerAvatarRadiusRow || i == avatarRadiusRow;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -483,10 +625,14 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
textCell.setTag("profileStatusSize");
|
||||
int size = themePrefs.getInt("profileStatusSize", AndroidUtilities.isTablet() ? 16 : 14);
|
||||
textCell.setTextAndValue(LocaleController.getString("StatusSize", R.string.StatusSize), String.format("%d", size), true);
|
||||
} else if (i == avatarRadiusRow) {
|
||||
} else if (i == headerAvatarRadiusRow) {
|
||||
textCell.setTag("profileAvatarRadius");
|
||||
int size = themePrefs.getInt("profileAvatarRadius", AndroidUtilities.isTablet() ? 35 : 32);
|
||||
textCell.setTextAndValue(LocaleController.getString("AvatarRadius", R.string.AvatarRadius), String.format("%d", size), true);
|
||||
} else if (i == avatarRadiusRow) {
|
||||
textCell.setTag("profileRowAvatarRadius");
|
||||
int size = themePrefs.getInt("profileRowAvatarRadius", AndroidUtilities.isTablet() ? 35 : 32);
|
||||
textCell.setTextAndValue(LocaleController.getString("AvatarRadius", R.string.AvatarRadius), String.format("%d", size), true);
|
||||
}
|
||||
}
|
||||
else if (type == 3){
|
||||
@ -495,10 +641,14 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
}
|
||||
|
||||
TextColorCell textCell = (TextColorCell) view;
|
||||
int defColor = AndroidUtilities.getIntColor("themeColor");
|
||||
|
||||
if (i == headerColorRow) {
|
||||
textCell.setTag("profileHeaderColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt(textCell.getTag().toString(), AndroidUtilities.getIntColor("themeColor")), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderColor", R.string.HeaderColor), themePrefs.getInt("profileHeaderColor", defColor), false);
|
||||
} else if (i == headerGradientColorRow) {
|
||||
textCell.setTag("profileHeaderGradientColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("profileHeaderGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("profileHeaderGradientColor", defColor), true);
|
||||
} else if (i == headerIconsColorRow) {
|
||||
textCell.setTag("profileHeaderIconsColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("HeaderIconsColor", R.string.HeaderIconsColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true);
|
||||
@ -513,13 +663,67 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt(textCell.getTag().toString(), AndroidUtilities.getIntDarkerColor("themeColor",-0x40)), false);
|
||||
} else if (i == rowColorRow) {
|
||||
textCell.setTag("profileRowColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), true);
|
||||
textCell.setTextAndColor(LocaleController.getString("RowColor", R.string.RowColor), themePrefs.getInt(textCell.getTag().toString(), 0xffffffff), false);
|
||||
} else if (i == rowGradientColorRow) {
|
||||
textCell.setTag("profileRowGradientColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("RowGradientColor", R.string.RowGradientColor), themePrefs.getInt("profileRowGradient", 0) == 0 ? 0x00000000 : themePrefs.getInt("profileRowGradientColor", 0xffffffff), true);
|
||||
} else if (i == titleColorRow) {
|
||||
textCell.setTag("profileTitleColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("NameColor", R.string.NameColor), themePrefs.getInt(textCell.getTag().toString(), 0xff000000), true);
|
||||
} else if (i == summaryColorRow) {
|
||||
textCell.setTag("profileSummaryColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("StatusColor", R.string.StatusColor), themePrefs.getInt(textCell.getTag().toString(), 0xff8a8a8a), true);
|
||||
} else if (i == onlineColorRow) {
|
||||
textCell.setTag("profileOnlineColor");
|
||||
textCell.setTextAndColor(LocaleController.getString("OnlineColor", R.string.OnlineColor), themePrefs.getInt("profileOnlineColor", AndroidUtilities.getIntDarkerColor("themeColor", -0x40)), true);
|
||||
}
|
||||
} else if (type == 4) {
|
||||
if (view == null) {
|
||||
view = new TextCheckCell(mContext);
|
||||
}
|
||||
TextCheckCell textCell = (TextCheckCell) view;
|
||||
|
||||
if (i == rowGradientListCheckRow) {
|
||||
textCell.setTag("profileRowGradientListCheck");
|
||||
int value = AndroidUtilities.getIntDef("profileRowGradient", 0);
|
||||
textCell.setTextAndCheck(LocaleController.getString("RowGradientList", R.string.RowGradientList), value == 0 ? false : themePrefs.getBoolean("profileRowGradientListCheck", false), true);
|
||||
}
|
||||
} else if (type == 5) {
|
||||
if (view == null) {
|
||||
view = new TextDetailSettingsCell(mContext);
|
||||
}
|
||||
TextDetailSettingsCell textCell = (TextDetailSettingsCell) view;
|
||||
|
||||
if(i == headerGradientRow){
|
||||
textCell.setTag("profileHeaderGradient");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("profileHeaderGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
} else if(i == rowGradientRow){
|
||||
textCell.setTag("profileRowGradient");
|
||||
textCell.setMultilineDetail(false);
|
||||
int value = themePrefs.getInt("profileRowGradient", 0);
|
||||
if (value == 0) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
|
||||
} else if (value == 1) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
|
||||
} else if (value == 2) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
|
||||
} else if (value == 3) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
|
||||
} else if (value == 4) {
|
||||
textCell.setTextAndValue(LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return view;
|
||||
@ -533,14 +737,19 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
else if ( i == headerSection2Row || i == rowsSection2Row ) {
|
||||
return 1;
|
||||
}
|
||||
else if ( i == nameSizeRow || i == statusSizeRow || i == avatarRadiusRow ) {
|
||||
else if ( i == nameSizeRow || i == statusSizeRow || i == headerAvatarRadiusRow || i == avatarRadiusRow) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
else if ( i == headerColorRow || i == headerIconsColorRow || i == iconsColorRow || i == nameColorRow || i == statusColorRow ||
|
||||
i == rowColorRow || i == titleColorRow || i == summaryColorRow) {
|
||||
else if ( i == headerColorRow || i == headerGradientColorRow || i == headerIconsColorRow || i == iconsColorRow || i == nameColorRow || i == statusColorRow ||
|
||||
i == rowColorRow || i == rowGradientColorRow || i == titleColorRow || i == summaryColorRow || i == onlineColorRow) {
|
||||
return 3;
|
||||
}
|
||||
else if (i == rowGradientListCheckRow) {
|
||||
return 4;
|
||||
}
|
||||
else if (i == headerGradientRow || i == rowGradientRow) {
|
||||
return 5;
|
||||
}
|
||||
else {
|
||||
return 2;
|
||||
}
|
||||
@ -548,7 +757,7 @@ public class ThemingProfileActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public int getViewTypeCount() {
|
||||
return 4;
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Binary file not shown.
@ -842,7 +842,7 @@
|
||||
<string name="formatDateAtTime">%1$s الساعة %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">تم تحديث تيليجرام نسخة الآندرويد. الجديد في نسخة 3.1.3:\n\n- قسم جديد للروابط المشاركة في معلومات المحادثة \n- استعراض لروابط الصور داخل التطبيق.</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText"></string>-->
|
||||
<string name="TelegramForAndroid">بلاس مسنجر للأندرويد</string>
|
||||
|
@ -839,7 +839,7 @@
|
||||
<string name="formatDateAtTime">%1$s a les %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">S\'ha actualitzat el Telegram per a l\'Android. Novetats a la versió 3.1.3:\n\n- Nova secció \'Enllaços compartits\' a la informació del xat\n- Previsualització, dins de l\'aplicació, per a enllaços a fotos</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText">\n\nNovetats a la versió 3.1.1.6\n\n- Nou MOD per mostrar l\'avatar dels contactes als xats\n- Nou MOD per mostrar l\'avatar propi als xats i grups\n- Nou MOD per alinear l\'avatar propi a dalt\n- S\'han afegit les noves bombolles Ed i Edge (gràcies a Edwin Macalopu)\n- Nou MOD per canviar el color de fons i de text del menú d\'adjuntar als xats\n- Nou MOD per canviar el color del títol i botons dels diàlegs\n- Correcció d\'errors</string>-->
|
||||
<string name="TelegramForAndroid">Plus Messenger per Android</string>
|
||||
@ -886,7 +886,8 @@
|
||||
<string name="EditTextSize">Mida de l\'entrada de text</string>
|
||||
<string name="EditTextBGColor">Color de fons de l\'entrada de text</string>
|
||||
<string name="EmojiViewBGColor">Color de fons dels emoji</string>
|
||||
<string name="EmojiViewTabColor">Color de la pestanya dels emoji</string>
|
||||
<string name="EmojiViewTabColor">Color de la pestanya d\'emojis activa</string>
|
||||
<string name="EmojiViewTabIconColor">Color de la icona de la pestanya d\'emojis</string>
|
||||
<string name="OnlineColor">Color de «en línia»</string>
|
||||
<string name="ChatMusic">Música</string>
|
||||
<string name="SaveTheme">Desa el tema</string>
|
||||
|
@ -839,10 +839,10 @@
|
||||
<string name="formatDateAtTime">%1$s um %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger für Android wurde aktualisiert. Neu in Version 3.1.3:\n\n- Neuer \"Geteilte Links\" Bereich in der Chat Info\n- In-App Vorschau für Links von Bildern.</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="updatePlusText">
|
||||
\n\nNeu in Version 3.1.3.0:\n\n- Neuer MOD ändert Standard Emoji Tab Symbol Farbe\n- Fehlerbeseitigung</string>
|
||||
\n\nNeu in Version 3.1.3.3:\n\n- Option Farbverlauf in Kopf- und Listenzeile, in Chatübersicht, Chat, Kontakten, Profile und Hauptmenü\n- Hinzugefügt Option Farbverlauf in Texteingabefeld, Emoji Ansicht und einfügen Ansicht\n- MOD Wechsel \'online\' Textfarbe in Profile und Text\n- MOD Profilbildradius im Profil ändern\n- Fehlerbeseitigung</string>
|
||||
<string name="TelegramForAndroid">Plus Messenger für Android</string>
|
||||
<string name="Theming">Themen bearbeiten</string>
|
||||
<string name="colorHexInvalid">Ungültiger Hex-Code!</string>
|
||||
@ -982,4 +982,12 @@
|
||||
<string name="DisableAudioStop">Audio nicht stoppen</string>
|
||||
<string name="ListDividerColor">Optionliste Trennstrich</string>
|
||||
<string name="CenterAvatar">Profilbild, Name und Telefonnummer zentriert</string>
|
||||
<string name="RowGradient">Verlauf</string>
|
||||
<string name="RowGradientColor">Verlauf</string>
|
||||
<string name="RowGradientDisabled">Deaktiviert</string>
|
||||
<string name="RowGradientTopBottom">von Oben</string>
|
||||
<string name="RowGradientLeftRight">Links nach Rechts</string>
|
||||
<string name="RowGradientTLBR">von oben Links nach unten Rechts</string>
|
||||
<string name="RowGradientBLTR">von unten Links nach oben Rechts</string>
|
||||
<string name="RowGradientList">Hintergrund Farbverlauf Liste oder Seite</string>
|
||||
</resources>
|
@ -839,9 +839,9 @@
|
||||
<string name="formatDateAtTime">%1$s a las %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger para Android ha sido actualizada. Novedades en la versión 3.1.3:\n\n- Nueva sección de \'Enlaces\' en la información del chat\n- Vista previa en la app para enlaces a fotos</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="updatePlusText">\n\nNovedades en 3.1.3.0:\n\n- Nuevo MOD para ajustar color por defecto de icono de pestaña de emoticonos\n- Solución de errores</string>
|
||||
<string name="updatePlusText">"\n\nNovedades en 3.1.3.3:\n\n- Añadida opción de gradiente al color de lista y cabecera de chats, chat, contactos, menu y perfil\n- Opción de gradiente en entrada de texto, vista de emoticonos y en vista adjuntar en chat\n- MOD para ajustar color de texto \'en línea\' en perfil y en chat\n- MOD para ajustar radio de avatares en perfil\n- Solución de errores"</string>
|
||||
<string name="TelegramForAndroid">Plus Messenger para Android</string>
|
||||
<string name="Theming">Tematización</string>
|
||||
<string name="colorHexInvalid">¡Color hexadecimal inválido!</string>
|
||||
@ -981,4 +981,12 @@
|
||||
<string name="DisableAudioStop">No parar audio</string>
|
||||
<string name="ListDividerColor">Color de divisor de lista</string>
|
||||
<string name="CenterAvatar">Centrar avatar, nombre y móvil</string>
|
||||
<string name="RowGradient">Gradiente</string>
|
||||
<string name="RowGradientColor">Color de gradiente</string>
|
||||
<string name="RowGradientDisabled">Desactivado</string>
|
||||
<string name="RowGradientTopBottom">Arriba Abajo</string>
|
||||
<string name="RowGradientLeftRight">Izquierda Derecha</string>
|
||||
<string name="RowGradientTLBR">Arriba-Izquierda Abajo-Derecha</string>
|
||||
<string name="RowGradientBLTR">Abajo-Izquierda Arriba-Derecha</string>
|
||||
<string name="RowGradientList">Aplicar gradiente a fondo de lista</string>
|
||||
</resources>
|
@ -841,7 +841,7 @@
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger pour Android a été mis à jour. Nouveautés de la version 3.1.3:\n\n- Nouvelle section \"Liens partagés\" dans les informations de la conversation\n
|
||||
- Prévisualistaion In-app pour les liens des images</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="TelegramForAndroid">Plus Messenger pour Android</string>
|
||||
<string name="Theming">Thème</string>
|
||||
|
@ -840,7 +840,7 @@ e introduce o teu número.</string>
|
||||
<string name="formatDateAtTime">%1$s ás %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Telegram para Android foi actualizada. Novidades na versión 3.1.3:\n\n - Nova sección de \'Enlaces\' na información do chat\n - Vista previa na app para enlaces a fotos</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText">\nnNovidades en 3.1.1.9:\nn - Novo MOD para centrar foto, nome e número en menú de navegación - Novo MOD para non parar audio (desactiva actuación de sensor de proximidad) - Novo MOD para cambiar cor de iconas en pantalla perfil - Solución de erros</string>-->
|
||||
<string name="TelegramForAndroid">Plus Messenger para Android</string>
|
||||
|
@ -515,7 +515,7 @@
|
||||
<string name="formatDateAtTime">%1$s पर %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger for Android has been updated. New in Version 3.0:\n\n\n\n- Dedicated tabs for each one of your custom sticker sets in the sticker panel. Add custom stickers like https://telegram.me/addstickers/Animals\n- New bot API, free for everyone. If you\'re an engineer, create your own bots for games, services or integrations. Learn more at https://telegram.org/blog/bot-revolution\n https://play.google.com/store/apps/details?id=es.rafalense.themes</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText"></string>-->
|
||||
<string name="TelegramForAndroid">Android के लिए प्लस मैसेंजर</string>
|
||||
|
@ -750,7 +750,7 @@
|
||||
<string name="formatterDay12H">h:mm a</string>
|
||||
<string name="formatDateAtTime">%1$s u %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="TelegramForAndroid">Plus Messenger za Android</string>
|
||||
<string name="Theming">Izrada teme</string>
|
||||
|
@ -839,10 +839,10 @@
|
||||
<string name="formatDateAtTime">%1$s alle %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger per Android si è aggiornato. Nuovo nella versione 3.1.3:\n\n- Nuova sezione \"Link condivisi\" nelle info della chat\n- Anteprima in-app delle foto dei link</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="updatePlusText">
|
||||
\n\nNovità nella versione 3.1.3.0:\n\n- Nuova MOD per cambiare il colore predefinito della icona della linguetta degli emoji\n- Correzione di Bug</string>
|
||||
\n\nNovità nella versione 3.1.3.3:\n\n- Aggiunta opzione per il colore gradiente nell\'intestazione e nelle liste di chat, contatti, profilo e menu\n- Aggiunta opzione gradiente per il campo di testo, la vista degli emoji e la vista degli allegati\n- MOD per cambiare il colore del testo \"online\" nel profilo e nella chat\n- MOD per cambiare il raggio dell\'avatar nel profilo\n- Correzioni bug</string>
|
||||
<string name="TelegramForAndroid">Plus Messenger per Android</string>
|
||||
<string name="Theming">Personalizzazione</string>
|
||||
<string name="colorHexInvalid">Codice del colore esadecimale non valido!</string>
|
||||
@ -887,8 +887,8 @@
|
||||
<string name="EditTextSize">Dimensione del testo immesso</string>
|
||||
<string name="EditTextBGColor">Colore di sfondo del campo di testo</string>
|
||||
<string name="EmojiViewBGColor">Colore di sfondo degli Emoji</string>
|
||||
<string name="EmojiViewTabColor">Colore della linguetta dell\'Emoji selezionato</string>
|
||||
<string name="EmojiViewTabIconColor">Colore icona linguetta degli Emoji</string>
|
||||
<string name="EmojiViewTabColor">Colore della linguetta degli Emoji selezionata</string>
|
||||
<string name="EmojiViewTabIconColor">Colore dell\'icona nella linguetta degli Emoji</string>
|
||||
<string name="OnlineColor">Colore dello stato Online</string>
|
||||
<string name="ChatMusic">Musica</string>
|
||||
<string name="SaveTheme">Salva il tema</string>
|
||||
@ -982,4 +982,12 @@
|
||||
<string name="DisableAudioStop">Non interrompere l\'audio</string>
|
||||
<string name="ListDividerColor">Colore del divisore delle liste</string>
|
||||
<string name="CenterAvatar">Centra l\'avatar, il nome ed il numero di telefono</string>
|
||||
<string name="RowGradient">Gradiente</string>
|
||||
<string name="RowGradientColor">Colore gradiente</string>
|
||||
<string name="RowGradientDisabled">Disattivato</string>
|
||||
<string name="RowGradientTopBottom">Intestazione Fondo</string>
|
||||
<string name="RowGradientLeftRight">Sinistra Destra</string>
|
||||
<string name="RowGradientTLBR">Intestazione-sinistra Fondo-destra</string>
|
||||
<string name="RowGradientBLTR">Fondo-sinistra Intestazione-destra</string>
|
||||
<string name="RowGradientList">Applica il gradiente allo sfondo della lista</string>
|
||||
</resources>
|
@ -842,5 +842,5 @@
|
||||
<string name="formatDateAtTime">%1$s %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">텔레그램 안드로이드 버전이 업데이트 되었습니다. 새로운 버전은 3.1.3 입니다:\n\n- 채팅방 정보내 \'공유된 링크\' 추가 \n- 사진 링크 프리뷰 기능</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
</resources>
|
@ -839,7 +839,7 @@
|
||||
<string name="formatDateAtTime">%1$s om %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger voor Android is bijgewerkt. Nieuw in versie 3.1.3:\n\n- Nieuw \'Gedeelde links\'-gedeelte in chatinformatie\n- In-app voorvertoning voor links naar foto\'s</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText"></string>-->
|
||||
<string name="TelegramForAndroid">Plus Messenger voor Android</string>
|
||||
|
@ -838,11 +838,11 @@
|
||||
<string name="formatterDay12H">h:mm a</string>
|
||||
<string name="formatDateAtTime">%1$s às %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger para Android foi atualizado. Novidade na versão 3.1.3\n\n- Nova sessão \"Links Compartilhados\" na informação do chat\n- Pré-visualizaçãp de fotos em links no aplicativo.</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateText">Plus Messenger para Android foi atualizado. Novidade na versão 3.1.3\n\n- Nova seção \"Links Compartilhados\" na informação do chat\n- Pré-visualização de fotos em links no aplicativo.</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="updatePlusText">
|
||||
\n\nNovo na versão 3.1.3.0:\n\n- Novo MOD para mudar a cor do ícone padrão da aba de emoji\n- Concertos de Bugs</string>
|
||||
\n\nNovo na versão 3.1.3.3:\n\n- Adicionado opção Degradê para Cabeçalho e Cor das Colunas na Lista de Chats, Chat, Contatos, Perfil e Menu de Navegação\n- Correções de erros</string>
|
||||
<string name="TelegramForAndroid">Plus Messenger para Android</string>
|
||||
<string name="Theming">Personalização</string>
|
||||
<string name="colorHexInvalid">Código de cor HEX inválido!</string>
|
||||
@ -886,9 +886,9 @@
|
||||
<string name="EditTextColor">Cor do Texto Digitado</string>
|
||||
<string name="EditTextSize">Tamanho do Texto Digitado</string>
|
||||
<string name="EditTextBGColor">Cor da Caixa de Texto</string>
|
||||
<string name="EmojiViewBGColor">Cor do Fundo Emojis</string>
|
||||
<string name="EmojiViewTabColor">Cor selecionada da aba de emoji</string>
|
||||
<string name="EmojiViewTabIconColor">Cor do icone da aba de emoji</string>
|
||||
<string name="EmojiViewBGColor">Cor do Fundo Emoji</string>
|
||||
<string name="EmojiViewTabColor">Cor da Aba Emoji selecionada</string>
|
||||
<string name="EmojiViewTabIconColor">Cor do Ícone da Aba Emoji</string>
|
||||
<string name="OnlineColor">Cor do Status Online</string>
|
||||
<string name="ChatMusic">Música</string>
|
||||
<string name="SaveTheme">Salvar Tema</string>
|
||||
@ -982,4 +982,12 @@
|
||||
<string name="DisableAudioStop">Não Parar Áudio</string>
|
||||
<string name="ListDividerColor">Cor do Divisor de Lista</string>
|
||||
<string name="CenterAvatar">Centralizar Avatar, Nome e Número</string>
|
||||
<string name="RowGradient">Degradê</string>
|
||||
<string name="RowGradientColor">Cor Degradê</string>
|
||||
<string name="RowGradientDisabled">Desativado</string>
|
||||
<string name="RowGradientTopBottom">Superior Inferior</string>
|
||||
<string name="RowGradientLeftRight">Esquerda Direita</string>
|
||||
<string name="RowGradientTLBR">Superior-Esquerda Inferior-Direita</string>
|
||||
<string name="RowGradientBLTR">Inferior-Esquerda Superior-Direita</string>
|
||||
<string name="RowGradientList">Aplicar degradê para a lista de fundo</string>
|
||||
</resources>
|
@ -842,7 +842,7 @@
|
||||
<string name="formatDateAtTime">%1$s às %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger para Android foi atualizado. Novidade na versão 3.1.3\n\n- Nova sessão \"Links Compartilhados\" na informação do chat\n- Pré-visualizaçãp de fotos em links no aplicativo.</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="TelegramForAndroid">Plus Messenger para Android</string>
|
||||
<string name="Theming">Temas</string>
|
||||
|
@ -839,9 +839,9 @@
|
||||
<string name="formatDateAtTime">%1$s в %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger для Android обновлён. Новое в версии 3.1.3:\n\n- Новый раздел \'Общие ссылки\' в информации о части\n- Предварительный просмотр ссылок на фото в приложении</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText">\n\nНовое в 3.1.1.9:\n\n- Добавлен новый пузырь сообщений iOS (спасибо Edwin Macalopu)\n- Новый мод, показывающий имя пользователя вместе с именем члена группы\n- Отображение администратора группы в её профиле. Администратор группы имеет отдельный значок\n- Новый мод, центрирующий аватар, имя и номер телефона в меню навигации\n- Новый мод, позволяющий проигрывать аудио в чате игнорируя сенсор приближения\n- Новый мод, позволяющий менять цвет иконок на экране профиля\n- Исправления ошибок\n\nСмотрите и используйте темы для Plus Messenger: https://play.google.com/store/apps/details?id=es.rafalense.themes</string>-->
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="updatePlusText">\n\nНовое в версии 3.1.3.3:\n\n- Добавлена опция градиента в настройки цвета заголовка и строк для списка чатов, экрана чата, контактов и меню\n- Добавлена опция градиента в настройки поля ввода текста, emoji и аттача\n- Мод для смены цвета текста \"в сети\" в профиле и чате\n- Мод для смены закругления аватара в профиле\n- Исправление ошибок</string>
|
||||
<string name="TelegramForAndroid">Plus Messenger для Android</string>
|
||||
<string name="Theming">Кастомизация</string>
|
||||
<string name="colorHexInvalid">Неверный hex-код цвета!</string>
|
||||
@ -886,7 +886,8 @@
|
||||
<string name="EditTextSize">Размер вводимого текста</string>
|
||||
<string name="EditTextBGColor">Цвет фона для ввода текста</string>
|
||||
<string name="EmojiViewBGColor">Цвет фона Emoji</string>
|
||||
<string name="EmojiViewTabColor">Цвет вкладок Emoji</string>
|
||||
<string name="EmojiViewTabColor">Цвет выбранной вкладки emoji </string>
|
||||
<string name="EmojiViewTabIconColor">Цвет иконки на вклаке emoji</string>
|
||||
<string name="OnlineColor">Цвет статуса \"онлайн\"</string>
|
||||
<string name="ChatMusic">Музыка</string>
|
||||
<string name="SaveTheme">Сохранить тему</string>
|
||||
@ -980,4 +981,12 @@
|
||||
<string name="DisableAudioStop">Не останавливать аудио</string>
|
||||
<string name="ListDividerColor">Цвет разделителя списка</string>
|
||||
<string name="CenterAvatar">Центрировать аватар, имя и телефон</string>
|
||||
<string name="RowGradient">Градиент</string>
|
||||
<string name="RowGradientColor">Цвет градиента</string>
|
||||
<string name="RowGradientDisabled">Отключено</string>
|
||||
<string name="RowGradientTopBottom">Сверху вних</string>
|
||||
<string name="RowGradientLeftRight">Слева направо</string>
|
||||
<string name="RowGradientTLBR">Сверху налево, снизу направо</string>
|
||||
<string name="RowGradientBLTR">Снизу налево, сверху направо</string>
|
||||
<string name="RowGradientList">Применить градиент к фону списка</string>
|
||||
</resources>
|
||||
|
@ -461,7 +461,7 @@
|
||||
<string name="formatterDay24H">HH:mm</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger için temalar indirin ve uygulayın. Hergün yeni temalar ekleniyor:\n https://play.google.com/store/apps/details?id=es.rafalense.themes</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText">
|
||||
\n\n3.1.1.9\'daki Yenilikler\n\n- Yeni iOS baloncuğu eklendi (Edwin Macalopu\'ya teşekkürler)\n- Gruplarda kullanıcı adı iler beraber üye ismini birlikte gösteren yeni MOD eklendi\n- Grup profilinde admin gösterilir. Admin kendi ikonuna sahiptir\n- Sol menüde avatar,isim ve telefonu ortalamayı sağlayan yeni MOD eklendi\n- Sohbete yakınlık sensörü eylemlerini kapatmayı ve çalan sesleri devam ettirmeyi sağlayan yeni MOD eklendi \n- Profil ekranına ikon renklerini değiştirmeyi sağlayan yeni MOD eklendi\n- Hata düzeltmeleri \n\n Plus Messenger için temalar: https://play.google.com/store/apps/details?id=es.rafalense.themes</string>-->
|
||||
@ -509,7 +509,8 @@
|
||||
<string name="EditTextSize">Yazı Giriş Boyutu</string>
|
||||
<string name="EditTextBGColor">Yazı Giriş Arkaplan Rengi</string>
|
||||
<string name="EmojiViewBGColor">Emoji Arkaplan Rengi</string>
|
||||
<string name="EmojiViewTabColor">Emoji Sekme Rengi</string>
|
||||
<string name="EmojiViewTabColor">seçilmiş surat sekme rengi</string>
|
||||
<string name="EmojiViewTabIconColor">Surat simgesinin rengi</string>
|
||||
<string name="OnlineColor">Çevrimiçi Rengi</string>
|
||||
<string name="ChatMusic">Müzik</string>
|
||||
<string name="SaveTheme">Temayı Kaydet</string>
|
||||
@ -603,4 +604,12 @@
|
||||
<string name="DisableAudioStop">Sesi durdurma</string>
|
||||
<string name="ListDividerColor">Liste ayırıcı rengi</string>
|
||||
<string name="CenterAvatar">Avatarı, ismi ve telefonu ortala</string>
|
||||
<string name="RowGradient">Gradyan</string>
|
||||
<string name="RowGradientColor">Gradyan rengi</string>
|
||||
<string name="RowGradientDisabled">Devre dışı</string>
|
||||
<string name="RowGradientTopBottom">Üst Alt</string>
|
||||
<string name="RowGradientLeftRight">Sol sağ</string>
|
||||
<string name="RowGradientTLBR">Üst Sol Alt-Sağ</string>
|
||||
<string name="RowGradientBLTR">Alt Sol Üst Sağ</string>
|
||||
<string name="RowGradientList">Arkaplana gradyan uygula</string>
|
||||
</resources>
|
||||
|
@ -838,7 +838,7 @@
|
||||
<string name="formatDateAtTime">%1$s 的 %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Android 版的 Plus Messenger 已更新。最新版本 3.1 的新增功能有:\n\n- 在特定聊天中搜索消息内容。\n- 全新设计的附件选择菜单。从附件选择菜单中直接发送联系人资料或语音文件。\n- 改进的程序内媒体播放功能 (YouTube, Vimoe, Soundcloud 等), 新播放器适用于大型语音文件。\n\n更多更新请查看:\nhttps://telegram.org/blog/search-and-media</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText">\n\n在 3.0.1.3 版的新功能:\n\n- 添加设置使用手机字体选项\n- 添加聊天/群组聊天内搜索聊天记录选项\n- 在设置/主题调整界面里添加标头颜色、标题颜色和标头图标颜色的设置\n- 添加主界面群组图标颜色的设置\n- 添加导航栏中头像大小的设置\n- 错误修复</string>-->
|
||||
<string name="TelegramForAndroid">Plus Messenger for Android</string>
|
||||
|
@ -839,7 +839,7 @@
|
||||
<string name="formatDateAtTime">於時間 %1$s %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Android 版的 Plus Messenger 已經更新。在版本 3.1.3 中的新功能:\n\n- 在聊天室資訊中新增「共享的連結」部份\n- 程式內預覽照片連結</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+--><!--
|
||||
<string name="updatePlusText">
|
||||
\n\n在 3.1.1.9 版的新功能:\n\n- 新的模組在聊天畫面顯示擁有的大頭照\n- 加入新的泡泡邊緣 (感謝 Edwin Macalopu)\n- 錯誤修復</string>-->
|
||||
|
@ -840,9 +840,9 @@
|
||||
<string name="formatDateAtTime">%1$s at %2$s</string>
|
||||
<!--update text-->
|
||||
<string name="updateText">Plus Messenger for Android has been updated. New in version 3.1.3:\n\n- New \'Shared Links\' section in chat info\n- In-app preview for links to photos</string>
|
||||
<string name="updateBuild">594</string>
|
||||
<string name="updateBuild">597</string>
|
||||
<!--Telegram+-->
|
||||
<string name="updatePlusText">\n\nNew in version 3.1.3.0:\n\n- New MOD to change default emoji tab icon color\n- Bug fixes</string>
|
||||
<string name="updatePlusText">\n\nNew in version 3.1.3.3:\n\n- Added gradient option to header and list color in chats, chat, contacts, menu and profile\n- Added gradient option to text entry box, emoji view and attach view\n- MOD to change \'online\' text color in profile and chat\n- MOD to change avatars radius in profile\n- Bug fixes</string>
|
||||
<string name="TelegramForAndroid">Plus Messenger for Android</string>
|
||||
<string name="Theming">Theming</string>
|
||||
<string name="colorHexInvalid">Invalid color hex code!</string>
|
||||
@ -982,4 +982,12 @@
|
||||
<string name="DisableAudioStop">Don\'t stop audio</string>
|
||||
<string name="ListDividerColor">List divider color</string>
|
||||
<string name="CenterAvatar">Center avatar, name and phone</string>
|
||||
<string name="RowGradient">Gradient</string>
|
||||
<string name="RowGradientColor">Gradient color</string>
|
||||
<string name="RowGradientDisabled">Disabled</string>
|
||||
<string name="RowGradientTopBottom">Top Bottom</string>
|
||||
<string name="RowGradientLeftRight">Left Right</string>
|
||||
<string name="RowGradientTLBR">Top-Left Bottom-Right</string>
|
||||
<string name="RowGradientBLTR">Bottom-Left Top-Right</string>
|
||||
<string name="RowGradientList">Apply gradient to list background</string>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user