Update to 2.6.1
|
@ -22,7 +22,7 @@ dependencies {
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 22
|
compileSdkVersion 22
|
||||||
buildToolsVersion '22.0.0'
|
buildToolsVersion '22.0.1'
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
|
@ -82,7 +82,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
targetSdkVersion 22
|
targetSdkVersion 22
|
||||||
versionCode 469
|
versionCode 475
|
||||||
versionName "2.6.0"
|
versionName "2.6.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,10 +65,12 @@ public class AndroidUtilities {
|
||||||
public static Point displaySize = new Point();
|
public static Point displaySize = new Point();
|
||||||
public static Integer photoSize = null;
|
public static Integer photoSize = null;
|
||||||
public static DisplayMetrics displayMetrics = new DisplayMetrics();
|
public static DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||||
|
public static int leftBaseline;
|
||||||
private static Boolean isTablet = null;
|
private static Boolean isTablet = null;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density;
|
density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density;
|
||||||
|
leftBaseline = isTablet() ? 80 : 72;
|
||||||
checkDisplaySize();
|
checkDisplaySize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class MessageObject {
|
||||||
fromUser = MessagesController.getInstance().getUser(message.from_id);
|
fromUser = MessagesController.getInstance().getUser(message.from_id);
|
||||||
}
|
}
|
||||||
if (message.action instanceof TLRPC.TL_messageActionChatCreate) {
|
if (message.action instanceof TLRPC.TL_messageActionChatCreate) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.getString("ActionYouCreateGroup", R.string.ActionYouCreateGroup);
|
messageText = LocaleController.getString("ActionYouCreateGroup", R.string.ActionYouCreateGroup);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -104,7 +104,7 @@ public class MessageObject {
|
||||||
}
|
}
|
||||||
} else if (message.action instanceof TLRPC.TL_messageActionChatDeleteUser) {
|
} else if (message.action instanceof TLRPC.TL_messageActionChatDeleteUser) {
|
||||||
if (message.action.user_id == message.from_id) {
|
if (message.action.user_id == message.from_id) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.getString("ActionYouLeftUser", R.string.ActionYouLeftUser);
|
messageText = LocaleController.getString("ActionYouLeftUser", R.string.ActionYouLeftUser);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -122,7 +122,7 @@ public class MessageObject {
|
||||||
whoUser = MessagesController.getInstance().getUser(message.action.user_id);
|
whoUser = MessagesController.getInstance().getUser(message.action.user_id);
|
||||||
}
|
}
|
||||||
if (whoUser != null && fromUser != null) {
|
if (whoUser != null && fromUser != null) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = replaceWithLink(LocaleController.getString("ActionYouKickUser", R.string.ActionYouKickUser), "un2", whoUser);
|
messageText = replaceWithLink(LocaleController.getString("ActionYouKickUser", R.string.ActionYouKickUser), "un2", whoUser);
|
||||||
} else if (message.action.user_id == UserConfig.getClientUserId()) {
|
} else if (message.action.user_id == UserConfig.getClientUserId()) {
|
||||||
messageText = replaceWithLink(LocaleController.getString("ActionKickUserYou", R.string.ActionKickUserYou), "un1", fromUser);
|
messageText = replaceWithLink(LocaleController.getString("ActionKickUserYou", R.string.ActionKickUserYou), "un1", fromUser);
|
||||||
|
@ -143,7 +143,7 @@ public class MessageObject {
|
||||||
whoUser = MessagesController.getInstance().getUser(message.action.user_id);
|
whoUser = MessagesController.getInstance().getUser(message.action.user_id);
|
||||||
}
|
}
|
||||||
if (whoUser != null && fromUser != null) {
|
if (whoUser != null && fromUser != null) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = replaceWithLink(LocaleController.getString("ActionYouAddUser", R.string.ActionYouAddUser), "un2", whoUser);
|
messageText = replaceWithLink(LocaleController.getString("ActionYouAddUser", R.string.ActionYouAddUser), "un2", whoUser);
|
||||||
} else if (message.action.user_id == UserConfig.getClientUserId()) {
|
} else if (message.action.user_id == UserConfig.getClientUserId()) {
|
||||||
messageText = replaceWithLink(LocaleController.getString("ActionAddUserYou", R.string.ActionAddUserYou), "un1", fromUser);
|
messageText = replaceWithLink(LocaleController.getString("ActionAddUserYou", R.string.ActionAddUserYou), "un1", fromUser);
|
||||||
|
@ -155,7 +155,7 @@ public class MessageObject {
|
||||||
messageText = LocaleController.getString("ActionAddUser", R.string.ActionAddUser).replace("un2", "").replace("un1", "");
|
messageText = LocaleController.getString("ActionAddUser", R.string.ActionAddUser).replace("un2", "").replace("un1", "");
|
||||||
}
|
}
|
||||||
} else if (message.action instanceof TLRPC.TL_messageActionChatEditPhoto) {
|
} else if (message.action instanceof TLRPC.TL_messageActionChatEditPhoto) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.getString("ActionYouChangedPhoto", R.string.ActionYouChangedPhoto);
|
messageText = LocaleController.getString("ActionYouChangedPhoto", R.string.ActionYouChangedPhoto);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -165,7 +165,7 @@ public class MessageObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (message.action instanceof TLRPC.TL_messageActionChatEditTitle) {
|
} else if (message.action instanceof TLRPC.TL_messageActionChatEditTitle) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.getString("ActionYouChangedTitle", R.string.ActionYouChangedTitle).replace("un2", message.action.title);
|
messageText = LocaleController.getString("ActionYouChangedTitle", R.string.ActionYouChangedTitle).replace("un2", message.action.title);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -175,7 +175,7 @@ public class MessageObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (message.action instanceof TLRPC.TL_messageActionChatDeletePhoto) {
|
} else if (message.action instanceof TLRPC.TL_messageActionChatDeletePhoto) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.getString("ActionYouRemovedPhoto", R.string.ActionYouRemovedPhoto);
|
messageText = LocaleController.getString("ActionYouRemovedPhoto", R.string.ActionYouRemovedPhoto);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -186,7 +186,7 @@ public class MessageObject {
|
||||||
}
|
}
|
||||||
} else if (message.action instanceof TLRPC.TL_messageActionTTLChange) {
|
} else if (message.action instanceof TLRPC.TL_messageActionTTLChange) {
|
||||||
if (message.action.ttl != 0) {
|
if (message.action.ttl != 0) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.formatString("MessageLifetimeChangedOutgoing", R.string.MessageLifetimeChangedOutgoing, AndroidUtilities.formatTTLString(message.action.ttl));
|
messageText = LocaleController.formatString("MessageLifetimeChangedOutgoing", R.string.MessageLifetimeChangedOutgoing, AndroidUtilities.formatTTLString(message.action.ttl));
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -196,7 +196,7 @@ public class MessageObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.getString("MessageLifetimeYouRemoved", R.string.MessageLifetimeYouRemoved);
|
messageText = LocaleController.getString("MessageLifetimeYouRemoved", R.string.MessageLifetimeYouRemoved);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -236,7 +236,7 @@ public class MessageObject {
|
||||||
}
|
}
|
||||||
} else if (message.action instanceof TLRPC.TL_messageEncryptedAction) {
|
} else if (message.action instanceof TLRPC.TL_messageEncryptedAction) {
|
||||||
if (message.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages) {
|
if (message.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.formatString("ActionTakeScreenshootYou", R.string.ActionTakeScreenshootYou);
|
messageText = LocaleController.formatString("ActionTakeScreenshootYou", R.string.ActionTakeScreenshootYou);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -248,7 +248,7 @@ public class MessageObject {
|
||||||
} else if (message.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) {
|
} else if (message.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) {
|
||||||
TLRPC.TL_decryptedMessageActionSetMessageTTL action = (TLRPC.TL_decryptedMessageActionSetMessageTTL) message.action.encryptedAction;
|
TLRPC.TL_decryptedMessageActionSetMessageTTL action = (TLRPC.TL_decryptedMessageActionSetMessageTTL) message.action.encryptedAction;
|
||||||
if (action.ttl_seconds != 0) {
|
if (action.ttl_seconds != 0) {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.formatString("MessageLifetimeChangedOutgoing", R.string.MessageLifetimeChangedOutgoing, AndroidUtilities.formatTTLString(action.ttl_seconds));
|
messageText = LocaleController.formatString("MessageLifetimeChangedOutgoing", R.string.MessageLifetimeChangedOutgoing, AndroidUtilities.formatTTLString(action.ttl_seconds));
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -258,7 +258,7 @@ public class MessageObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isFromMe()) {
|
if (isOut()) {
|
||||||
messageText = LocaleController.getString("MessageLifetimeYouRemoved", R.string.MessageLifetimeYouRemoved);
|
messageText = LocaleController.getString("MessageLifetimeYouRemoved", R.string.MessageLifetimeYouRemoved);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -553,7 +553,7 @@ public class MessageObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Pattern pattern = Pattern.compile("(^|\\s)@[a-zA-Z\\d_]{5,32}|(^|\\s)#[\\w@\\.]+");
|
Pattern pattern = Pattern.compile("(^|\\s)@[a-zA-Z\\d_]{5,32}|(^|\\s)#[\\w\\.]+");
|
||||||
Matcher matcher = pattern.matcher(messageText);
|
Matcher matcher = pattern.matcher(messageText);
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
int start = matcher.start();
|
int start = matcher.start();
|
||||||
|
@ -571,13 +571,13 @@ public class MessageObject {
|
||||||
|
|
||||||
int maxWidth;
|
int maxWidth;
|
||||||
if (AndroidUtilities.isTablet()) {
|
if (AndroidUtilities.isTablet()) {
|
||||||
if (messageOwner.to_id.chat_id != 0) {
|
if (messageOwner.to_id.chat_id != 0 && !isOut()) {
|
||||||
maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122);
|
maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(122);
|
||||||
} else {
|
} else {
|
||||||
maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(80);
|
maxWidth = AndroidUtilities.getMinTabletSide() - AndroidUtilities.dp(80);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (messageOwner.to_id.chat_id != 0) {
|
if (messageOwner.to_id.chat_id != 0 && !isOut()) {
|
||||||
maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122);
|
maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122);
|
||||||
} else {
|
} else {
|
||||||
maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(80);
|
maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(80);
|
||||||
|
@ -727,10 +727,6 @@ public class MessageObject {
|
||||||
return (messageOwner.flags & TLRPC.MESSAGE_FLAG_OUT) != 0;
|
return (messageOwner.flags & TLRPC.MESSAGE_FLAG_OUT) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFromMe() {
|
|
||||||
return messageOwner.from_id == UserConfig.getClientUserId();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnread() {
|
public boolean isUnread() {
|
||||||
return (messageOwner.flags & TLRPC.MESSAGE_FLAG_UNREAD) != 0;
|
return (messageOwner.flags & TLRPC.MESSAGE_FLAG_UNREAD) != 0;
|
||||||
}
|
}
|
||||||
|
@ -776,7 +772,7 @@ public class MessageObject {
|
||||||
} else {
|
} else {
|
||||||
if (messageOwner.to_id.chat_id != 0) {
|
if (messageOwner.to_id.chat_id != 0) {
|
||||||
return -messageOwner.to_id.chat_id;
|
return -messageOwner.to_id.chat_id;
|
||||||
} else if (isFromMe()) {
|
} else if (isOut()) {
|
||||||
return messageOwner.to_id.user_id;
|
return messageOwner.to_id.user_id;
|
||||||
} else {
|
} else {
|
||||||
return messageOwner.from_id;
|
return messageOwner.from_id;
|
||||||
|
|
|
@ -1293,7 +1293,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
|
||||||
if (label.length() != 0) {
|
if (label.length() != 0) {
|
||||||
label += ", ";
|
label += ", ";
|
||||||
}
|
}
|
||||||
label += ContactsController.formatName(user.first_name, user.last_name);
|
if (user.first_name != null && user.first_name.length() > 0) {
|
||||||
|
label += user.first_name;
|
||||||
|
} else if (user.last_name != null && user.last_name.length() > 0) {
|
||||||
|
label += user.last_name;
|
||||||
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (count == 2) {
|
if (count == 2) {
|
||||||
|
@ -2597,7 +2601,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
|
||||||
|
|
||||||
public void getDifference() {
|
public void getDifference() {
|
||||||
registerForPush(UserConfig.pushString);
|
registerForPush(UserConfig.pushString);
|
||||||
if (MessagesStorage.lastDateValue == 0) {
|
if (MessagesStorage.lastPtsValue == 0) {
|
||||||
loadCurrentState();
|
loadCurrentState();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2713,7 +2717,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!obj.isFromMe() && obj.isUnread()) {
|
if (!obj.isOut() && obj.isUnread()) {
|
||||||
pushMessages.add(obj);
|
pushMessages.add(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2946,7 +2950,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
|
||||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!obj.isFromMe() && obj.isUnread()) {
|
if (!obj.isOut()) {
|
||||||
NotificationsController.getInstance().processNewMessages(objArr, true);
|
NotificationsController.getInstance().processNewMessages(objArr, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3192,7 +3196,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
|
||||||
messages.put(uid, arr);
|
messages.put(uid, arr);
|
||||||
}
|
}
|
||||||
arr.add(obj);
|
arr.add(obj);
|
||||||
if (!obj.isFromMe() && obj.isUnread()) {
|
if (!obj.isOut() && obj.isUnread()) {
|
||||||
pushMessages.add(obj);
|
pushMessages.add(obj);
|
||||||
}
|
}
|
||||||
} else if (update instanceof TLRPC.TL_updateReadMessages) {
|
} else if (update instanceof TLRPC.TL_updateReadMessages) {
|
||||||
|
|
|
@ -122,6 +122,7 @@ public class MessagesStorage {
|
||||||
database.executeFast("CREATE TABLE messages_seq(mid INTEGER PRIMARY KEY, seq_in INTEGER, seq_out INTEGER);").stepThis().dispose();
|
database.executeFast("CREATE TABLE messages_seq(mid INTEGER PRIMARY KEY, seq_in INTEGER, seq_out INTEGER);").stepThis().dispose();
|
||||||
database.executeFast("CREATE TABLE web_recent_v3(id TEXT, type INTEGER, image_url TEXT, thumb_url TEXT, local_url TEXT, width INTEGER, height INTEGER, size INTEGER, date INTEGER, PRIMARY KEY (id, type));").stepThis().dispose();
|
database.executeFast("CREATE TABLE web_recent_v3(id TEXT, type INTEGER, image_url TEXT, thumb_url TEXT, local_url TEXT, width INTEGER, height INTEGER, size INTEGER, date INTEGER, PRIMARY KEY (id, type));").stepThis().dispose();
|
||||||
database.executeFast("CREATE TABLE stickers(id INTEGER PRIMARY KEY, data BLOB, date INTEGER);").stepThis().dispose();
|
database.executeFast("CREATE TABLE stickers(id INTEGER PRIMARY KEY, data BLOB, date INTEGER);").stepThis().dispose();
|
||||||
|
database.executeFast("CREATE TABLE hashtag_recent_v2(id TEXT PRIMARY KEY, date INTEGER);").stepThis().dispose();
|
||||||
|
|
||||||
database.executeFast("CREATE TABLE user_contacts_v6(uid INTEGER PRIMARY KEY, fname TEXT, sname TEXT)").stepThis().dispose();
|
database.executeFast("CREATE TABLE user_contacts_v6(uid INTEGER PRIMARY KEY, fname TEXT, sname TEXT)").stepThis().dispose();
|
||||||
database.executeFast("CREATE TABLE user_phones_v6(uid INTEGER, phone TEXT, sphone TEXT, deleted INTEGER, PRIMARY KEY (uid, phone))").stepThis().dispose();
|
database.executeFast("CREATE TABLE user_phones_v6(uid INTEGER, phone TEXT, sphone TEXT, deleted INTEGER, PRIMARY KEY (uid, phone))").stepThis().dispose();
|
||||||
|
@ -162,7 +163,7 @@ public class MessagesStorage {
|
||||||
database.executeFast("CREATE TABLE keyvalue(id TEXT PRIMARY KEY, value TEXT)").stepThis().dispose();
|
database.executeFast("CREATE TABLE keyvalue(id TEXT PRIMARY KEY, value TEXT)").stepThis().dispose();
|
||||||
|
|
||||||
//version
|
//version
|
||||||
database.executeFast("PRAGMA user_version = 14").stepThis().dispose();
|
database.executeFast("PRAGMA user_version = 15").stepThis().dispose();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
SQLiteCursor cursor = database.queryFinalized("SELECT seq, pts, date, qts, lsv, sg, pbytes FROM params WHERE id = 1");
|
SQLiteCursor cursor = database.queryFinalized("SELECT seq, pts, date, qts, lsv, sg, pbytes FROM params WHERE id = 1");
|
||||||
|
@ -193,7 +194,7 @@ public class MessagesStorage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int version = database.executeInt("PRAGMA user_version");
|
int version = database.executeInt("PRAGMA user_version");
|
||||||
if (version < 14) {
|
if (version < 15) {
|
||||||
updateDbToLastVersion(version);
|
updateDbToLastVersion(version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -373,6 +374,11 @@ public class MessagesStorage {
|
||||||
database.executeFast("PRAGMA user_version = 14").stepThis().dispose();
|
database.executeFast("PRAGMA user_version = 14").stepThis().dispose();
|
||||||
version = 14;
|
version = 14;
|
||||||
}
|
}
|
||||||
|
if (version == 14 && version < 15) {
|
||||||
|
database.executeFast("CREATE TABLE IF NOT EXISTS hashtag_recent_v2(id TEXT PRIMARY KEY, date INTEGER);").stepThis().dispose();
|
||||||
|
database.executeFast("PRAGMA user_version = 15").stepThis().dispose();
|
||||||
|
version = 15;
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
|
@ -627,7 +633,7 @@ public class MessagesStorage {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
SQLiteCursor cursor = database.queryFinalized("SELECT id, image_url, thumb_url, local_url, width, height, size, date FROM web_recent_v3 wallpapers WHERE type = " + type);
|
SQLiteCursor cursor = database.queryFinalized("SELECT id, image_url, thumb_url, local_url, width, height, size, date FROM web_recent_v3 WHERE type = " + type);
|
||||||
final ArrayList<MediaController.SearchImage> arrayList = new ArrayList<>();
|
final ArrayList<MediaController.SearchImage> arrayList = new ArrayList<>();
|
||||||
while (cursor.next()) {
|
while (cursor.next()) {
|
||||||
MediaController.SearchImage searchImage = new MediaController.SearchImage();
|
MediaController.SearchImage searchImage = new MediaController.SearchImage();
|
||||||
|
@ -684,6 +690,19 @@ public class MessagesStorage {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearWebRecent(final int type) {
|
||||||
|
storageQueue.postRunnable(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
database.executeFast("DELETE FROM web_recent_v3 WHERE type = " + type).stepThis().dispose();
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void putWebRecent(final ArrayList<MediaController.SearchImage> arrayList) {
|
public void putWebRecent(final ArrayList<MediaController.SearchImage> arrayList) {
|
||||||
storageQueue.postRunnable(new Runnable() {
|
storageQueue.postRunnable(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,6 +19,8 @@ import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
|
import android.media.MediaPlayer;
|
||||||
|
import android.media.SoundPool;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
@ -64,6 +66,13 @@ public class NotificationsController {
|
||||||
private int personal_count = 0;
|
private int personal_count = 0;
|
||||||
private boolean notifyCheck = false;
|
private boolean notifyCheck = false;
|
||||||
private int lastOnlineFromOtherDevice = 0;
|
private int lastOnlineFromOtherDevice = 0;
|
||||||
|
private boolean inChatSoundEnabled = true;
|
||||||
|
|
||||||
|
private SoundPool soundPool;
|
||||||
|
private int inChatOutgoingSound;
|
||||||
|
private long lastSoundPlay;
|
||||||
|
private MediaPlayer mediaPlayer;
|
||||||
|
private String lastMediaPlayerUri;
|
||||||
|
|
||||||
private static volatile NotificationsController Instance = null;
|
private static volatile NotificationsController Instance = null;
|
||||||
public static NotificationsController getInstance() {
|
public static NotificationsController getInstance() {
|
||||||
|
@ -81,6 +90,16 @@ public class NotificationsController {
|
||||||
|
|
||||||
public NotificationsController() {
|
public NotificationsController() {
|
||||||
notificationManager = NotificationManagerCompat.from(ApplicationLoader.applicationContext);
|
notificationManager = NotificationManagerCompat.from(ApplicationLoader.applicationContext);
|
||||||
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE);
|
||||||
|
inChatSoundEnabled = preferences.getBoolean("EnableInChatSound", true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
soundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0);
|
||||||
|
inChatOutgoingSound = soundPool.load(ApplicationLoader.applicationContext, R.raw.sound_out, 1);
|
||||||
|
mediaPlayer = new MediaPlayer();
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cleanup() {
|
public void cleanup() {
|
||||||
|
@ -99,6 +118,10 @@ public class NotificationsController {
|
||||||
editor.commit();
|
editor.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setInChatSoundEnabled(boolean value) {
|
||||||
|
inChatSoundEnabled = value;
|
||||||
|
}
|
||||||
|
|
||||||
public void setOpennedDialogId(long dialog_id) {
|
public void setOpennedDialogId(long dialog_id) {
|
||||||
openned_dialog_id = dialog_id;
|
openned_dialog_id = dialog_id;
|
||||||
}
|
}
|
||||||
|
@ -797,6 +820,63 @@ public class NotificationsController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void playInChatSound() {
|
||||||
|
if (!inChatSoundEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (lastSoundPlay > System.currentTimeMillis() - 1800) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String choosenSoundPath = null;
|
||||||
|
String defaultPath = Settings.System.DEFAULT_NOTIFICATION_URI.getPath();
|
||||||
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE);
|
||||||
|
choosenSoundPath = preferences.getString("sound_path_" + openned_dialog_id, null);
|
||||||
|
boolean isChat = (int)(openned_dialog_id) < 0;
|
||||||
|
if (isChat) {
|
||||||
|
if (choosenSoundPath != null && choosenSoundPath.equals(defaultPath)) {
|
||||||
|
choosenSoundPath = null;
|
||||||
|
} else if (choosenSoundPath == null) {
|
||||||
|
choosenSoundPath = preferences.getString("GroupSoundPath", defaultPath);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (choosenSoundPath != null && choosenSoundPath.equals(defaultPath)) {
|
||||||
|
choosenSoundPath = null;
|
||||||
|
} else if (choosenSoundPath == null) {
|
||||||
|
choosenSoundPath = preferences.getString("GlobalSoundPath", defaultPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (choosenSoundPath != null && !choosenSoundPath.equals("NoSound")) {
|
||||||
|
if (lastMediaPlayerUri == null || !choosenSoundPath.equals(lastMediaPlayerUri)) {
|
||||||
|
lastMediaPlayerUri = choosenSoundPath;
|
||||||
|
mediaPlayer.reset();
|
||||||
|
mediaPlayer.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);
|
||||||
|
if (choosenSoundPath.equals(defaultPath)) {
|
||||||
|
mediaPlayer.setDataSource(ApplicationLoader.applicationContext, Settings.System.DEFAULT_NOTIFICATION_URI);
|
||||||
|
} else {
|
||||||
|
mediaPlayer.setDataSource(ApplicationLoader.applicationContext, Uri.parse(choosenSoundPath));
|
||||||
|
}
|
||||||
|
mediaPlayer.prepare();
|
||||||
|
}
|
||||||
|
mediaPlayer.start();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void playOutChatSound() {
|
||||||
|
if (!inChatSoundEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
soundPool.play(inChatOutgoingSound, 1, 1, 1, 0, 1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) {
|
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) {
|
||||||
if (messageObjects.isEmpty()) {
|
if (messageObjects.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -815,6 +895,7 @@ public class NotificationsController {
|
||||||
long dialog_id = messageObject.getDialogId();
|
long dialog_id = messageObject.getDialogId();
|
||||||
long original_dialog_id = dialog_id;
|
long original_dialog_id = dialog_id;
|
||||||
if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) {
|
if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) {
|
||||||
|
playInChatSound();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((messageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_MENTION) != 0) {
|
if ((messageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_MENTION) != 0) {
|
||||||
|
|
|
@ -1515,7 +1515,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, (req instanceof TLRPC.TL_messages_forwardMessages ? null : new RPCRequest.RPCQuickAckDelegate() {
|
}, new RPCRequest.RPCQuickAckDelegate() {
|
||||||
@Override
|
@Override
|
||||||
public void quickAck() {
|
public void quickAck() {
|
||||||
final int msg_id = newMsgObj.id;
|
final int msg_id = newMsgObj.id;
|
||||||
|
@ -1527,7 +1527,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}), true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassCanCompress, ConnectionsManager.DEFAULT_DATACENTER_ID);
|
}, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassCanCompress, ConnectionsManager.DEFAULT_DATACENTER_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processSentMessage(TLRPC.Message newMsg, TLRPC.Message sentMessage, String originalPath) {
|
private void processSentMessage(TLRPC.Message newMsg, TLRPC.Message sentMessage, String originalPath) {
|
||||||
|
@ -1811,6 +1811,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||||
}
|
}
|
||||||
if (bmOptions.outWidth != 0 && bmOptions.outHeight != 0 && bmOptions.outWidth <= 800 && bmOptions.outHeight <= 800) {
|
if (bmOptions.outWidth != 0 && bmOptions.outHeight != 0 && bmOptions.outWidth <= 800 && bmOptions.outHeight <= 800) {
|
||||||
TLRPC.TL_documentAttributeSticker attributeSticker = new TLRPC.TL_documentAttributeSticker();
|
TLRPC.TL_documentAttributeSticker attributeSticker = new TLRPC.TL_documentAttributeSticker();
|
||||||
|
attributeSticker.alt = "";
|
||||||
document.attributes.add(attributeSticker);
|
document.attributes.add(attributeSticker);
|
||||||
TLRPC.TL_documentAttributeImageSize attributeImageSize = new TLRPC.TL_documentAttributeImageSize();
|
TLRPC.TL_documentAttributeImageSize attributeImageSize = new TLRPC.TL_documentAttributeImageSize();
|
||||||
attributeImageSize.w = bmOptions.outWidth;
|
attributeImageSize.w = bmOptions.outWidth;
|
||||||
|
|
|
@ -237,7 +237,10 @@ public class MP4Builder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTimescale(Mp4Movie mp4Movie) {
|
public long getTimescale(Mp4Movie mp4Movie) {
|
||||||
long timescale = mp4Movie.getTracks().iterator().next().getTimeScale();
|
long timescale = 0;
|
||||||
|
if (!mp4Movie.getTracks().isEmpty()) {
|
||||||
|
timescale = mp4Movie.getTracks().iterator().next().getTimeScale();
|
||||||
|
}
|
||||||
for (Track track : mp4Movie.getTracks()) {
|
for (Track track : mp4Movie.getTracks()) {
|
||||||
timescale = gcd(track.getTimeScale(), timescale);
|
timescale = gcd(track.getTimeScale(), timescale);
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class FileUploadOperation {
|
||||||
if (estimatedSize != 0 && finalSize != 0) {
|
if (estimatedSize != 0 && finalSize != 0) {
|
||||||
estimatedSize = 0;
|
estimatedSize = 0;
|
||||||
totalFileSize = finalSize;
|
totalFileSize = finalSize;
|
||||||
totalPartsCount = (int) Math.ceil((float) totalFileSize / (float) uploadChunkSize);
|
totalPartsCount = (int) (totalFileSize + uploadChunkSize - 1) / uploadChunkSize;
|
||||||
if (started) {
|
if (started) {
|
||||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("uploadinfo", Activity.MODE_PRIVATE);
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("uploadinfo", Activity.MODE_PRIVATE);
|
||||||
storeFileUploadInfo(preferences);
|
storeFileUploadInfo(preferences);
|
||||||
|
@ -162,7 +162,7 @@ public class FileUploadOperation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadChunkSize = (int) Math.max(32, Math.ceil(totalFileSize / (1024.0f * 3000)));
|
uploadChunkSize = (int) Math.max(32, (totalFileSize + 1024 * 3000 - 1) / (1024 * 3000));
|
||||||
if (1024 % uploadChunkSize != 0) {
|
if (1024 % uploadChunkSize != 0) {
|
||||||
int chunkSize = 64;
|
int chunkSize = 64;
|
||||||
while (uploadChunkSize > chunkSize) {
|
while (uploadChunkSize > chunkSize) {
|
||||||
|
@ -172,7 +172,7 @@ public class FileUploadOperation {
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadChunkSize *= 1024;
|
uploadChunkSize *= 1024;
|
||||||
totalPartsCount = (int) Math.ceil((float) totalFileSize / (float) uploadChunkSize);
|
totalPartsCount = (int) (totalFileSize + uploadChunkSize - 1) / uploadChunkSize;
|
||||||
readBuffer = new byte[uploadChunkSize];
|
readBuffer = new byte[uploadChunkSize];
|
||||||
|
|
||||||
fileKey = Utilities.MD5(uploadingFilePath + (isEncrypted ? "enc" : ""));
|
fileKey = Utilities.MD5(uploadingFilePath + (isEncrypted ? "enc" : ""));
|
||||||
|
@ -355,7 +355,7 @@ public class FileUploadOperation {
|
||||||
if (error == null) {
|
if (error == null) {
|
||||||
if (response instanceof TLRPC.TL_boolTrue) {
|
if (response instanceof TLRPC.TL_boolTrue) {
|
||||||
currentPartNum++;
|
currentPartNum++;
|
||||||
delegate.didChangedUploadProgress(FileUploadOperation.this, (float) currentUploaded / (float) totalFileSize);
|
delegate.didChangedUploadProgress(FileUploadOperation.this, currentUploaded / (float) totalFileSize);
|
||||||
if (isLastPart) {
|
if (isLastPart) {
|
||||||
state = 3;
|
state = 3;
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
|
|
|
@ -464,8 +464,11 @@ public class TLClassStore {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FileLog.e("tmessages", String.format("unknown class %x", constructor));
|
FileLog.e("tmessages", String.format("unknown class %x", constructor));
|
||||||
|
if (BuildVars.DEBUG_VERSION) {
|
||||||
|
throw new RuntimeException(String.format("unknown class %x", constructor));
|
||||||
|
} else {
|
||||||
return null;
|
return null;
|
||||||
//throw new RuntimeException(String.format("unknown class %x", constructor));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -419,10 +419,10 @@ public class ActionBar extends FrameLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openSearchField(String text) {
|
public void openSearchField(String text) {
|
||||||
if (isSearchFieldVisible || menu == null) {
|
if (menu == null || text == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
menu.openSearchField(text);
|
menu.openSearchField(!isSearchFieldVisible, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -153,13 +153,15 @@ public class ActionBarMenu extends LinearLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openSearchField(String text) {
|
public void openSearchField(boolean toggle, String text) {
|
||||||
for (int a = 0; a < getChildCount(); a++) {
|
for (int a = 0; a < getChildCount(); a++) {
|
||||||
View view = getChildAt(a);
|
View view = getChildAt(a);
|
||||||
if (view instanceof ActionBarMenuItem) {
|
if (view instanceof ActionBarMenuItem) {
|
||||||
ActionBarMenuItem item = (ActionBarMenuItem)view;
|
ActionBarMenuItem item = (ActionBarMenuItem)view;
|
||||||
if (item.isSearchField()) {
|
if (item.isSearchField()) {
|
||||||
|
if (toggle) {
|
||||||
parentActionBar.onSearchFieldVisibilityChanged(item.toggleSearch());
|
parentActionBar.onSearchFieldVisibilityChanged(item.toggleSearch());
|
||||||
|
}
|
||||||
item.getSearchField().setText(text);
|
item.getSearchField().setText(text);
|
||||||
item.getSearchField().setSelection(text.length());
|
item.getSearchField().setSelection(text.length());
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
/*
|
|
||||||
* This is the source code of Telegram for Android v. 1.7.x.
|
|
||||||
* It is licensed under GNU GPL v. 2 or later.
|
|
||||||
* You should have received a copy of the license in this archive (see LICENSE).
|
|
||||||
*
|
|
||||||
* Copyright Nikolai Kudashov, 2013-2014.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.telegram.ui.Adapters;
|
|
||||||
|
|
||||||
import org.telegram.android.AndroidUtilities;
|
|
||||||
import org.telegram.messenger.ConnectionsManager;
|
|
||||||
import org.telegram.messenger.RPCRequest;
|
|
||||||
import org.telegram.messenger.TLObject;
|
|
||||||
import org.telegram.messenger.TLRPC;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class BaseContactsSearchAdapter extends BaseFragmentAdapter {
|
|
||||||
|
|
||||||
protected ArrayList<TLRPC.User> globalSearch = new ArrayList<>();
|
|
||||||
private long reqId = 0;
|
|
||||||
private int lastReqId;
|
|
||||||
protected String lastFoundUsername = null;
|
|
||||||
|
|
||||||
public void queryServerSearch(final String query) {
|
|
||||||
if (reqId != 0) {
|
|
||||||
ConnectionsManager.getInstance().cancelRpc(reqId, true);
|
|
||||||
reqId = 0;
|
|
||||||
}
|
|
||||||
if (query == null || query.length() < 5) {
|
|
||||||
globalSearch.clear();
|
|
||||||
lastReqId = 0;
|
|
||||||
notifyDataSetChanged();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
TLRPC.TL_contacts_search req = new TLRPC.TL_contacts_search();
|
|
||||||
req.q = query;
|
|
||||||
req.limit = 50;
|
|
||||||
final int currentReqId = ++lastReqId;
|
|
||||||
reqId = ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
|
|
||||||
@Override
|
|
||||||
public void run(final TLObject response, final TLRPC.TL_error error) {
|
|
||||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (currentReqId == lastReqId) {
|
|
||||||
if (error == null) {
|
|
||||||
TLRPC.TL_contacts_found res = (TLRPC.TL_contacts_found) response;
|
|
||||||
globalSearch = res.users;
|
|
||||||
lastFoundUsername = query;
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
reqId = 0;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,209 @@
|
||||||
|
/*
|
||||||
|
* This is the source code of Telegram for Android v. 1.7.x.
|
||||||
|
* It is licensed under GNU GPL v. 2 or later.
|
||||||
|
* You should have received a copy of the license in this archive (see LICENSE).
|
||||||
|
*
|
||||||
|
* Copyright Nikolai Kudashov, 2013-2014.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.telegram.ui.Adapters;
|
||||||
|
|
||||||
|
import org.telegram.SQLite.SQLiteCursor;
|
||||||
|
import org.telegram.SQLite.SQLitePreparedStatement;
|
||||||
|
import org.telegram.android.AndroidUtilities;
|
||||||
|
import org.telegram.android.MessagesStorage;
|
||||||
|
import org.telegram.messenger.ConnectionsManager;
|
||||||
|
import org.telegram.messenger.FileLog;
|
||||||
|
import org.telegram.messenger.RPCRequest;
|
||||||
|
import org.telegram.messenger.TLObject;
|
||||||
|
import org.telegram.messenger.TLRPC;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class BaseSearchAdapter extends BaseFragmentAdapter {
|
||||||
|
|
||||||
|
protected static class HashtagObject {
|
||||||
|
String hashtag;
|
||||||
|
int date;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ArrayList<TLRPC.User> globalSearch = new ArrayList<>();
|
||||||
|
private long reqId = 0;
|
||||||
|
private int lastReqId;
|
||||||
|
protected String lastFoundUsername = null;
|
||||||
|
|
||||||
|
protected ArrayList<HashtagObject> hashtags;
|
||||||
|
protected HashMap<String, HashtagObject> hashtagsByText;
|
||||||
|
protected boolean hashtagsLoadedFromDb = false;
|
||||||
|
|
||||||
|
public void queryServerSearch(final String query) {
|
||||||
|
if (reqId != 0) {
|
||||||
|
ConnectionsManager.getInstance().cancelRpc(reqId, true);
|
||||||
|
reqId = 0;
|
||||||
|
}
|
||||||
|
if (query == null || query.length() < 5) {
|
||||||
|
globalSearch.clear();
|
||||||
|
lastReqId = 0;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TLRPC.TL_contacts_search req = new TLRPC.TL_contacts_search();
|
||||||
|
req.q = query;
|
||||||
|
req.limit = 50;
|
||||||
|
final int currentReqId = ++lastReqId;
|
||||||
|
reqId = ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
|
||||||
|
@Override
|
||||||
|
public void run(final TLObject response, final TLRPC.TL_error error) {
|
||||||
|
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (currentReqId == lastReqId) {
|
||||||
|
if (error == null) {
|
||||||
|
TLRPC.TL_contacts_found res = (TLRPC.TL_contacts_found) response;
|
||||||
|
globalSearch = res.users;
|
||||||
|
lastFoundUsername = query;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reqId = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadRecentHashtags() {
|
||||||
|
MessagesStorage.getInstance().getStorageQueue().postRunnable(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
SQLiteCursor cursor = MessagesStorage.getInstance().getDatabase().queryFinalized("SELECT id, date FROM hashtag_recent_v2 WHERE 1");
|
||||||
|
final ArrayList<HashtagObject> arrayList = new ArrayList<>();
|
||||||
|
final HashMap<String, HashtagObject> hashMap = new HashMap<>();
|
||||||
|
while (cursor.next()) {
|
||||||
|
HashtagObject hashtagObject = new HashtagObject();
|
||||||
|
hashtagObject.hashtag = cursor.stringValue(0);
|
||||||
|
hashtagObject.date = cursor.intValue(1);
|
||||||
|
arrayList.add(hashtagObject);
|
||||||
|
hashMap.put(hashtagObject.hashtag, hashtagObject);
|
||||||
|
}
|
||||||
|
cursor.dispose();
|
||||||
|
Collections.sort(arrayList, new Comparator<HashtagObject>() {
|
||||||
|
@Override
|
||||||
|
public int compare(HashtagObject lhs, HashtagObject rhs) {
|
||||||
|
if (lhs.date < rhs.date) {
|
||||||
|
return 1;
|
||||||
|
} else if (lhs.date > rhs.date) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
setHashtags(arrayList, hashMap);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addHashtagsFromMessage(String message) {
|
||||||
|
if (message == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
boolean changed = false;
|
||||||
|
Pattern pattern = Pattern.compile("(^|\\s)#[\\w@\\.]+");
|
||||||
|
Matcher matcher = pattern.matcher(message);
|
||||||
|
while (matcher.find()) {
|
||||||
|
int start = matcher.start();
|
||||||
|
int end = matcher.end();
|
||||||
|
if (message.charAt(start) != '@' && message.charAt(start) != '#') {
|
||||||
|
start++;
|
||||||
|
}
|
||||||
|
String hashtag = message.substring(start, end);
|
||||||
|
if (hashtagsByText == null) {
|
||||||
|
hashtagsByText = new HashMap<>();
|
||||||
|
hashtags = new ArrayList<>();
|
||||||
|
}
|
||||||
|
HashtagObject hashtagObject = hashtagsByText.get(hashtag);
|
||||||
|
if (hashtagObject == null) {
|
||||||
|
hashtagObject = new HashtagObject();
|
||||||
|
hashtagObject.hashtag = hashtag;
|
||||||
|
hashtagsByText.put(hashtagObject.hashtag, hashtagObject);
|
||||||
|
} else {
|
||||||
|
hashtags.remove(hashtagObject);
|
||||||
|
}
|
||||||
|
hashtagObject.date = (int) (System.currentTimeMillis() / 1000);
|
||||||
|
hashtags.add(0, hashtagObject);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
if (changed) {
|
||||||
|
putRecentHashtags(hashtags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void putRecentHashtags(final ArrayList<HashtagObject> arrayList) {
|
||||||
|
MessagesStorage.getInstance().getStorageQueue().postRunnable(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
MessagesStorage.getInstance().getDatabase().beginTransaction();
|
||||||
|
SQLitePreparedStatement state = MessagesStorage.getInstance().getDatabase().executeFast("REPLACE INTO hashtag_recent_v2 VALUES(?, ?)");
|
||||||
|
for (int a = 0; a < arrayList.size(); a++) {
|
||||||
|
if (a == 100) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
HashtagObject hashtagObject = arrayList.get(a);
|
||||||
|
state.requery();
|
||||||
|
state.bindString(1, hashtagObject.hashtag);
|
||||||
|
state.bindInteger(2, hashtagObject.date);
|
||||||
|
state.step();
|
||||||
|
}
|
||||||
|
state.dispose();
|
||||||
|
MessagesStorage.getInstance().getDatabase().commitTransaction();
|
||||||
|
if (arrayList.size() >= 100) {
|
||||||
|
MessagesStorage.getInstance().getDatabase().beginTransaction();
|
||||||
|
for (int a = 100; a < arrayList.size(); a++) {
|
||||||
|
MessagesStorage.getInstance().getDatabase().executeFast("DELETE FROM hashtag_recent_v2 WHERE id = '" + arrayList.get(a).hashtag + "'").stepThis().dispose();
|
||||||
|
}
|
||||||
|
MessagesStorage.getInstance().getDatabase().commitTransaction();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearRecentHashtags() {
|
||||||
|
hashtags = new ArrayList<>();
|
||||||
|
hashtagsByText = new HashMap<>();
|
||||||
|
MessagesStorage.getInstance().getStorageQueue().postRunnable(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
MessagesStorage.getInstance().getDatabase().executeFast("DELETE FROM hashtag_recent_v2 WHERE 1").stepThis().dispose();
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setHashtags(ArrayList<HashtagObject> arrayList, HashMap<String, HashtagObject> hashMap) {
|
||||||
|
hashtags = arrayList;
|
||||||
|
hashtagsByText = hashMap;
|
||||||
|
hashtagsLoadedFromDb = true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,6 +33,7 @@ import org.telegram.messenger.UserConfig;
|
||||||
import org.telegram.messenger.Utilities;
|
import org.telegram.messenger.Utilities;
|
||||||
import org.telegram.ui.Cells.DialogCell;
|
import org.telegram.ui.Cells.DialogCell;
|
||||||
import org.telegram.ui.Cells.GreySectionCell;
|
import org.telegram.ui.Cells.GreySectionCell;
|
||||||
|
import org.telegram.ui.Cells.HashtagSearchCell;
|
||||||
import org.telegram.ui.Cells.LoadingCell;
|
import org.telegram.ui.Cells.LoadingCell;
|
||||||
import org.telegram.ui.Cells.ProfileSearchCell;
|
import org.telegram.ui.Cells.ProfileSearchCell;
|
||||||
|
|
||||||
|
@ -44,13 +45,14 @@ import java.util.Locale;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
public class DialogsSearchAdapter extends BaseSearchAdapter {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private Timer searchTimer;
|
private Timer searchTimer;
|
||||||
private ArrayList<TLObject> searchResult = new ArrayList<>();
|
private ArrayList<TLObject> searchResult = new ArrayList<>();
|
||||||
private ArrayList<CharSequence> searchResultNames = new ArrayList<>();
|
private ArrayList<CharSequence> searchResultNames = new ArrayList<>();
|
||||||
private ArrayList<MessageObject> searchResultMessages = new ArrayList<>();
|
private ArrayList<MessageObject> searchResultMessages = new ArrayList<>();
|
||||||
|
private ArrayList<String> searchResultHashtags = new ArrayList<>();
|
||||||
private String lastSearchText;
|
private String lastSearchText;
|
||||||
private long reqId = 0;
|
private long reqId = 0;
|
||||||
private int lastReqId;
|
private int lastReqId;
|
||||||
|
@ -87,6 +89,10 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
searchMessagesInternal(lastMessagesSearchString);
|
searchMessagesInternal(lastMessagesSearchString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLastSearchString() {
|
||||||
|
return lastMessagesSearchString;
|
||||||
|
}
|
||||||
|
|
||||||
private void searchMessagesInternal(final String query) {
|
private void searchMessagesInternal(final String query) {
|
||||||
if (needMessagesSearch == 0) {
|
if (needMessagesSearch == 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -188,8 +194,8 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
dialogSearchResult.date = cursor.intValue(1);
|
dialogSearchResult.date = cursor.intValue(1);
|
||||||
dialogsResult.put(id, dialogSearchResult);
|
dialogsResult.put(id, dialogSearchResult);
|
||||||
|
|
||||||
int lower_id = (int)id;
|
int lower_id = (int) id;
|
||||||
int high_id = (int)(id >> 32);
|
int high_id = (int) (id >> 32);
|
||||||
if (lower_id != 0) {
|
if (lower_id != 0) {
|
||||||
if (high_id == 1) {
|
if (high_id == 1) {
|
||||||
if (!serverOnly && !chatsToLoad.contains(lower_id)) {
|
if (!serverOnly && !chatsToLoad.contains(lower_id)) {
|
||||||
|
@ -389,7 +395,7 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
cursor = MessagesStorage.getInstance().getDatabase().queryFinalized("SELECT u.data, u.status, u.name, u.uid FROM users as u INNER JOIN contacts as c ON u.uid = c.uid");
|
cursor = MessagesStorage.getInstance().getDatabase().queryFinalized("SELECT u.data, u.status, u.name, u.uid FROM users as u INNER JOIN contacts as c ON u.uid = c.uid");
|
||||||
while (cursor.next()) {
|
while (cursor.next()) {
|
||||||
int uid = cursor.intValue(3);
|
int uid = cursor.intValue(3);
|
||||||
if (dialogsResult.containsKey((long)uid)) {
|
if (dialogsResult.containsKey((long) uid)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String name = cursor.stringValue(2);
|
String name = cursor.stringValue(2);
|
||||||
|
@ -477,6 +483,25 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
return i > searchResult.size() && i <= globalSearch.size() + searchResult.size();
|
return i > searchResult.size() && i <= globalSearch.size() + searchResult.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearRecentHashtags() {
|
||||||
|
super.clearRecentHashtags();
|
||||||
|
searchResultHashtags.clear();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setHashtags(ArrayList<HashtagObject> arrayList, HashMap<String, HashtagObject> hashMap) {
|
||||||
|
super.setHashtags(arrayList, hashMap);
|
||||||
|
for (HashtagObject hashtagObject : arrayList) {
|
||||||
|
searchResultHashtags.add(hashtagObject.hashtag);
|
||||||
|
}
|
||||||
|
if (delegate != null) {
|
||||||
|
delegate.searchStateChanged(false);
|
||||||
|
}
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
public void searchDialogs(final String query, final boolean serverOnly) {
|
public void searchDialogs(final String query, final boolean serverOnly) {
|
||||||
if (query != null && lastSearchText != null && query.equals(lastSearchText)) {
|
if (query != null && lastSearchText != null && query.equals(lastSearchText)) {
|
||||||
return;
|
return;
|
||||||
|
@ -489,14 +514,38 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
if (query == null || query.length() == 0) {
|
if (query == null || query.length() == 0) {
|
||||||
|
hashtagsLoadedFromDb = false;
|
||||||
searchResult.clear();
|
searchResult.clear();
|
||||||
searchResultNames.clear();
|
searchResultNames.clear();
|
||||||
|
searchResultHashtags.clear();
|
||||||
if (needMessagesSearch != 2) {
|
if (needMessagesSearch != 2) {
|
||||||
queryServerSearch(null);
|
queryServerSearch(null);
|
||||||
}
|
}
|
||||||
searchMessagesInternal(null);
|
searchMessagesInternal(null);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
} else {
|
} else {
|
||||||
|
if (query.startsWith("#") && query.length() == 1) {
|
||||||
|
messagesSearchEndReached = true;
|
||||||
|
if (!hashtagsLoadedFromDb) {
|
||||||
|
loadRecentHashtags();
|
||||||
|
if (delegate != null) {
|
||||||
|
delegate.searchStateChanged(true);
|
||||||
|
}
|
||||||
|
notifyDataSetChanged();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
searchResultHashtags.clear();
|
||||||
|
for (HashtagObject hashtagObject : hashtags) {
|
||||||
|
searchResultHashtags.add(hashtagObject.hashtag);
|
||||||
|
}
|
||||||
|
if (delegate != null) {
|
||||||
|
delegate.searchStateChanged(false);
|
||||||
|
}
|
||||||
|
notifyDataSetChanged();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
searchResultHashtags.clear();
|
||||||
|
}
|
||||||
final int searchId = ++lastSearchId;
|
final int searchId = ++lastSearchId;
|
||||||
searchTimer = new Timer();
|
searchTimer = new Timer();
|
||||||
searchTimer.schedule(new TimerTask() {
|
searchTimer.schedule(new TimerTask() {
|
||||||
|
@ -530,11 +579,27 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabled(int i) {
|
public boolean isEnabled(int i) {
|
||||||
return i != searchResult.size() && i != searchResult.size() + (globalSearch.isEmpty() ? 0 : globalSearch.size() + 1);
|
if (!searchResultHashtags.isEmpty()) {
|
||||||
|
return i != 0;
|
||||||
|
}
|
||||||
|
int localCount = searchResult.size();
|
||||||
|
int globalCount = globalSearch.isEmpty() ? 0 : globalSearch.size() + 1;
|
||||||
|
int messagesCount = searchResultMessages.isEmpty() ? 0 : searchResultMessages.size() + 1;
|
||||||
|
if (i >= 0 && i < localCount || i > localCount && i < globalCount + localCount) {
|
||||||
|
return true;
|
||||||
|
} else if (i > globalCount + localCount && i < globalCount + localCount + messagesCount) {
|
||||||
|
return true;
|
||||||
|
} else if (messagesCount != 0 && i == globalCount + localCount + messagesCount) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
|
if (!searchResultHashtags.isEmpty()) {
|
||||||
|
return searchResultHashtags.size() + 1;
|
||||||
|
}
|
||||||
int count = searchResult.size();
|
int count = searchResult.size();
|
||||||
int globalCount = globalSearch.size();
|
int globalCount = globalSearch.size();
|
||||||
int messagesCount = searchResultMessages.size();
|
int messagesCount = searchResultMessages.size();
|
||||||
|
@ -549,6 +614,9 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getItem(int i) {
|
public Object getItem(int i) {
|
||||||
|
if (!searchResultHashtags.isEmpty()) {
|
||||||
|
return searchResultHashtags.get(i - 1);
|
||||||
|
}
|
||||||
int localCount = searchResult.size();
|
int localCount = searchResult.size();
|
||||||
int globalCount = globalSearch.isEmpty() ? 0 : globalSearch.size() + 1;
|
int globalCount = globalSearch.isEmpty() ? 0 : globalSearch.size() + 1;
|
||||||
int messagesCount = searchResultMessages.isEmpty() ? 0 : searchResultMessages.size() + 1;
|
int messagesCount = searchResultMessages.isEmpty() ? 0 : searchResultMessages.size() + 1;
|
||||||
|
@ -580,7 +648,9 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
if (view == null) {
|
if (view == null) {
|
||||||
view = new GreySectionCell(mContext);
|
view = new GreySectionCell(mContext);
|
||||||
}
|
}
|
||||||
if (!globalSearch.isEmpty() && i == searchResult.size()) {
|
if (!searchResultHashtags.isEmpty()) {
|
||||||
|
((GreySectionCell) view).setText(LocaleController.getString("Hashtags", R.string.Hashtags).toUpperCase());
|
||||||
|
} else if (!globalSearch.isEmpty() && i == searchResult.size()) {
|
||||||
((GreySectionCell) view).setText(LocaleController.getString("GlobalSearch", R.string.GlobalSearch));
|
((GreySectionCell) view).setText(LocaleController.getString("GlobalSearch", R.string.GlobalSearch));
|
||||||
} else {
|
} else {
|
||||||
((GreySectionCell) view).setText(LocaleController.getString("SearchMessages", R.string.SearchMessages));
|
((GreySectionCell) view).setText(LocaleController.getString("SearchMessages", R.string.SearchMessages));
|
||||||
|
@ -646,6 +716,12 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
if (view == null) {
|
if (view == null) {
|
||||||
view = new LoadingCell(mContext);
|
view = new LoadingCell(mContext);
|
||||||
}
|
}
|
||||||
|
} else if (type == 4) {
|
||||||
|
if (view == null) {
|
||||||
|
view = new HashtagSearchCell(mContext);
|
||||||
|
}
|
||||||
|
((HashtagSearchCell) view).setText(searchResultHashtags.get(i - 1));
|
||||||
|
((HashtagSearchCell) view).setNeedDivider(i != searchResultHashtags.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
@ -653,6 +729,9 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemViewType(int i) {
|
public int getItemViewType(int i) {
|
||||||
|
if (!searchResultHashtags.isEmpty()) {
|
||||||
|
return i == 0 ? 1 : 4;
|
||||||
|
}
|
||||||
int localCount = searchResult.size();
|
int localCount = searchResult.size();
|
||||||
int globalCount = globalSearch.isEmpty() ? 0 : globalSearch.size() + 1;
|
int globalCount = globalSearch.isEmpty() ? 0 : globalSearch.size() + 1;
|
||||||
int messagesCount = searchResultMessages.isEmpty() ? 0 : searchResultMessages.size() + 1;
|
int messagesCount = searchResultMessages.isEmpty() ? 0 : searchResultMessages.size() + 1;
|
||||||
|
@ -668,11 +747,11 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getViewTypeCount() {
|
public int getViewTypeCount() {
|
||||||
return 4;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return searchResult.isEmpty() && globalSearch.isEmpty() && searchResultMessages.isEmpty();
|
return searchResult.isEmpty() && globalSearch.isEmpty() && searchResultMessages.isEmpty() && searchResultHashtags.isEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,9 @@ import org.telegram.ui.Cells.MentionCell;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class MentionsAdapter extends BaseFragmentAdapter {
|
public class MentionsAdapter extends BaseSearchAdapter {
|
||||||
|
|
||||||
public interface MentionsAdapterDelegate {
|
public interface MentionsAdapterDelegate {
|
||||||
void needChangePanelVisibility(boolean show);
|
void needChangePanelVisibility(boolean show);
|
||||||
|
@ -29,13 +30,15 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private TLRPC.ChatParticipants info;
|
private TLRPC.ChatParticipants info;
|
||||||
private ArrayList<TLRPC.User> searchResult = new ArrayList<>();
|
private ArrayList<TLRPC.User> searchResultUsernames;
|
||||||
|
private ArrayList<String> searchResultHashtags;
|
||||||
private MentionsAdapterDelegate delegate;
|
private MentionsAdapterDelegate delegate;
|
||||||
private int usernameStartPosition;
|
private int resultStartPosition;
|
||||||
private int usernameLength;
|
private int resultLength;
|
||||||
private String lastText;
|
private String lastText;
|
||||||
private int lastPosition;
|
private int lastPosition;
|
||||||
private ArrayList<MessageObject> messages;
|
private ArrayList<MessageObject> messages;
|
||||||
|
private boolean needUsernames = true;
|
||||||
|
|
||||||
public MentionsAdapter(Context context, MentionsAdapterDelegate delegate) {
|
public MentionsAdapter(Context context, MentionsAdapterDelegate delegate) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
@ -45,16 +48,57 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
public void setChatInfo(TLRPC.ChatParticipants chatParticipants) {
|
public void setChatInfo(TLRPC.ChatParticipants chatParticipants) {
|
||||||
info = chatParticipants;
|
info = chatParticipants;
|
||||||
if (lastText != null) {
|
if (lastText != null) {
|
||||||
searchUsername(lastText, lastPosition, messages);
|
searchUsernameOrHashtag(lastText, lastPosition, messages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void searchUsername(String text, int position, ArrayList<MessageObject> messageObjects) {
|
public void setNeedUsernames(boolean value) {
|
||||||
if (text == null || text.length() == 0 || position < text.length()) {
|
needUsernames = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearRecentHashtags() {
|
||||||
|
super.clearRecentHashtags();
|
||||||
|
searchResultHashtags.clear();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
if (delegate != null) {
|
||||||
|
delegate.needChangePanelVisibility(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setHashtags(ArrayList<HashtagObject> arrayList, HashMap<String, HashtagObject> hashMap) {
|
||||||
|
super.setHashtags(arrayList, hashMap);
|
||||||
|
if (lastText != null) {
|
||||||
|
searchUsernameOrHashtag(lastText, lastPosition, messages);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void searchUsernameOrHashtag(String text, int position, ArrayList<MessageObject> messageObjects) {
|
||||||
|
if (text == null || text.length() == 0) {
|
||||||
delegate.needChangePanelVisibility(false);
|
delegate.needChangePanelVisibility(false);
|
||||||
lastText = null;
|
lastText = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int searchPostion = position;
|
||||||
|
if (text.length() > 0) {
|
||||||
|
searchPostion--;
|
||||||
|
}
|
||||||
|
lastText = null;
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
int foundType = -1;
|
||||||
|
boolean hasIllegalUsernameCharacters = false;
|
||||||
|
for (int a = searchPostion; a >= 0; a--) {
|
||||||
|
if (a >= text.length()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
char ch = text.charAt(a);
|
||||||
|
if (a == 0 || text.charAt(a - 1) == ' ' || text.charAt(a - 1) == '\n') {
|
||||||
|
if (needUsernames && ch == '@') {
|
||||||
|
if (hasIllegalUsernameCharacters) {
|
||||||
|
delegate.needChangePanelVisibility(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
lastText = text;
|
lastText = text;
|
||||||
lastPosition = position;
|
lastPosition = position;
|
||||||
|
@ -62,30 +106,36 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
delegate.needChangePanelVisibility(false);
|
delegate.needChangePanelVisibility(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lastText = null;
|
foundType = 0;
|
||||||
StringBuilder username = new StringBuilder();
|
resultStartPosition = a;
|
||||||
boolean found = false;
|
resultLength = result.length() + 1;
|
||||||
for (int a = position; a >= 0; a--) {
|
break;
|
||||||
if (a >= text.length()) {
|
} else if (ch == '#') {
|
||||||
continue;
|
if (!hashtagsLoadedFromDb) {
|
||||||
|
loadRecentHashtags();
|
||||||
|
lastText = text;
|
||||||
|
lastPosition = position;
|
||||||
|
messages = messageObjects;
|
||||||
|
delegate.needChangePanelVisibility(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
char ch = text.charAt(a);
|
foundType = 1;
|
||||||
if (ch == '@' && (a == 0 || text.charAt(a - 1) == ' ' || text.charAt(a - 1) == '\n')) {
|
resultStartPosition = a;
|
||||||
found = true;
|
resultLength = result.length() + 1;
|
||||||
usernameStartPosition = a;
|
result.insert(0, ch);
|
||||||
usernameLength = username.length() + 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!(ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch == '_')) {
|
if (!(ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch == '_')) {
|
||||||
|
hasIllegalUsernameCharacters = true;
|
||||||
|
}
|
||||||
|
result.insert(0, ch);
|
||||||
|
}
|
||||||
|
if (foundType == -1) {
|
||||||
delegate.needChangePanelVisibility(false);
|
delegate.needChangePanelVisibility(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
username.insert(0, ch);
|
if (foundType == 0) {
|
||||||
}
|
|
||||||
if (!found) {
|
|
||||||
delegate.needChangePanelVisibility(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final ArrayList<Integer> users = new ArrayList<>();
|
final ArrayList<Integer> users = new ArrayList<>();
|
||||||
for (int a = 0; a < Math.min(100, messageObjects.size()); a++) {
|
for (int a = 0; a < Math.min(100, messageObjects.size()); a++) {
|
||||||
int from_id = messageObjects.get(a).messageOwner.from_id;
|
int from_id = messageObjects.get(a).messageOwner.from_id;
|
||||||
|
@ -93,7 +143,7 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
users.add(from_id);
|
users.add(from_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String usernameString = username.toString().toLowerCase();
|
String usernameString = result.toString().toLowerCase();
|
||||||
ArrayList<TLRPC.User> newResult = new ArrayList<>();
|
ArrayList<TLRPC.User> newResult = new ArrayList<>();
|
||||||
for (TLRPC.TL_chatParticipant chatParticipant : info.participants) {
|
for (TLRPC.TL_chatParticipant chatParticipant : info.participants) {
|
||||||
TLRPC.User user = MessagesController.getInstance().getUser(chatParticipant.user_id);
|
TLRPC.User user = MessagesController.getInstance().getUser(chatParticipant.user_id);
|
||||||
|
@ -104,8 +154,9 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
newResult.add(user);
|
newResult.add(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
searchResult = newResult;
|
searchResultHashtags = null;
|
||||||
Collections.sort(searchResult, new Comparator<TLRPC.User>() {
|
searchResultUsernames = newResult;
|
||||||
|
Collections.sort(searchResultUsernames, new Comparator<TLRPC.User>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(TLRPC.User lhs, TLRPC.User rhs) {
|
public int compare(TLRPC.User lhs, TLRPC.User rhs) {
|
||||||
int lhsNum = users.indexOf(lhs.id);
|
int lhsNum = users.indexOf(lhs.id);
|
||||||
|
@ -122,14 +173,27 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
});
|
});
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
delegate.needChangePanelVisibility(!newResult.isEmpty());
|
delegate.needChangePanelVisibility(!newResult.isEmpty());
|
||||||
|
} else {
|
||||||
|
ArrayList<String> newResult = new ArrayList<>();
|
||||||
|
String hashtagString = result.toString().toLowerCase();
|
||||||
|
for (HashtagObject hashtagObject : hashtags) {
|
||||||
|
if (hashtagString != null && hashtagObject.hashtag != null && hashtagObject.hashtag.startsWith(hashtagString)) {
|
||||||
|
newResult.add(hashtagObject.hashtag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
searchResultHashtags = newResult;
|
||||||
|
searchResultUsernames = null;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
delegate.needChangePanelVisibility(!newResult.isEmpty());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUsernameStartPosition() {
|
public int getResultStartPosition() {
|
||||||
return usernameStartPosition;
|
return resultStartPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUsernameLength() {
|
public int getResultLength() {
|
||||||
return usernameLength;
|
return resultLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -139,12 +203,22 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return searchResult.size();
|
if (searchResultUsernames != null) {
|
||||||
|
return searchResultUsernames.size();
|
||||||
|
} else if (searchResultHashtags != null) {
|
||||||
|
return searchResultHashtags.size();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return searchResult.isEmpty();
|
if (searchResultUsernames != null) {
|
||||||
|
return searchResultUsernames.isEmpty();
|
||||||
|
} else if (searchResultHashtags != null) {
|
||||||
|
return searchResultHashtags.isEmpty();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -168,11 +242,19 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TLRPC.User getItem(int i) {
|
public Object getItem(int i) {
|
||||||
if (i < 0 || i >= searchResult.size()) {
|
if (searchResultUsernames != null) {
|
||||||
|
if (i < 0 || i >= searchResultUsernames.size()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return searchResult.get(i);
|
return searchResultUsernames.get(i);
|
||||||
|
} else if (searchResultHashtags != null) {
|
||||||
|
if (i < 0 || i >= searchResultHashtags.size()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return searchResultHashtags.get(i);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -180,7 +262,11 @@ public class MentionsAdapter extends BaseFragmentAdapter {
|
||||||
if (view == null) {
|
if (view == null) {
|
||||||
view = new MentionCell(mContext);
|
view = new MentionCell(mContext);
|
||||||
}
|
}
|
||||||
((MentionCell) view).setUser(searchResult.get(i));
|
if (searchResultUsernames != null) {
|
||||||
|
((MentionCell) view).setUser(searchResultUsernames.get(i));
|
||||||
|
} else if (searchResultHashtags != null) {
|
||||||
|
((MentionCell) view).setText(searchResultHashtags.get(i));
|
||||||
|
}
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ import java.util.HashMap;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
public class ContactsSearchAdapter extends BaseContactsSearchAdapter {
|
public class SearchAdapter extends BaseSearchAdapter {
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private HashMap<Integer, TLRPC.User> ignoreUsers;
|
private HashMap<Integer, TLRPC.User> ignoreUsers;
|
||||||
private ArrayList<TLRPC.User> searchResult = new ArrayList<>();
|
private ArrayList<TLRPC.User> searchResult = new ArrayList<>();
|
||||||
|
@ -41,7 +41,7 @@ public class ContactsSearchAdapter extends BaseContactsSearchAdapter {
|
||||||
private boolean allowUsernameSearch;
|
private boolean allowUsernameSearch;
|
||||||
private boolean useUserCell;
|
private boolean useUserCell;
|
||||||
|
|
||||||
public ContactsSearchAdapter(Context context, HashMap<Integer, TLRPC.User> arg1, boolean usernameSearch) {
|
public SearchAdapter(Context context, HashMap<Integer, TLRPC.User> arg1, boolean usernameSearch) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
ignoreUsers = arg1;
|
ignoreUsers = arg1;
|
||||||
allowUsernameSearch = usernameSearch;
|
allowUsernameSearch = usernameSearch;
|
|
@ -10,6 +10,7 @@ package org.telegram.ui.Cells;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
@ -397,11 +398,15 @@ public class ChatBaseCell extends BaseCell {
|
||||||
if (messageObject.type == 13) {
|
if (messageObject.type == 13) {
|
||||||
int width;
|
int width;
|
||||||
if (AndroidUtilities.isTablet()) {
|
if (AndroidUtilities.isTablet()) {
|
||||||
|
if (AndroidUtilities.isSmallTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||||
|
width = AndroidUtilities.displaySize.x;
|
||||||
|
} else {
|
||||||
int leftWidth = AndroidUtilities.displaySize.x / 100 * 35;
|
int leftWidth = AndroidUtilities.displaySize.x / 100 * 35;
|
||||||
if (leftWidth < AndroidUtilities.dp(320)) {
|
if (leftWidth < AndroidUtilities.dp(320)) {
|
||||||
leftWidth = AndroidUtilities.dp(320);
|
leftWidth = AndroidUtilities.dp(320);
|
||||||
}
|
}
|
||||||
width = AndroidUtilities.displaySize.x - leftWidth;
|
width = AndroidUtilities.displaySize.x - leftWidth;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
width = AndroidUtilities.displaySize.x;
|
width = AndroidUtilities.displaySize.x;
|
||||||
}
|
}
|
||||||
|
@ -709,12 +714,20 @@ public class ChatBaseCell extends BaseCell {
|
||||||
if (currentMessageObject.isOut()) {
|
if (currentMessageObject.isOut()) {
|
||||||
replyLinePaint.setColor(0xff8dc97a);
|
replyLinePaint.setColor(0xff8dc97a);
|
||||||
replyNamePaint.setColor(0xff61a349);
|
replyNamePaint.setColor(0xff61a349);
|
||||||
|
if (currentMessageObject.replyMessageObject != null && currentMessageObject.replyMessageObject.type == 0) {
|
||||||
|
replyTextPaint.setColor(0xff000000);
|
||||||
|
} else {
|
||||||
replyTextPaint.setColor(0xff70b15c);
|
replyTextPaint.setColor(0xff70b15c);
|
||||||
|
}
|
||||||
replyStartX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(11);
|
replyStartX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(11);
|
||||||
} else {
|
} else {
|
||||||
replyLinePaint.setColor(0xff6c9fd2);
|
replyLinePaint.setColor(0xff6c9fd2);
|
||||||
replyNamePaint.setColor(0xff377aae);
|
replyNamePaint.setColor(0xff377aae);
|
||||||
|
if (currentMessageObject.replyMessageObject != null && currentMessageObject.replyMessageObject.type == 0) {
|
||||||
|
replyTextPaint.setColor(0xff000000);
|
||||||
|
} else {
|
||||||
replyTextPaint.setColor(0xff999999);
|
replyTextPaint.setColor(0xff999999);
|
||||||
|
}
|
||||||
if (currentMessageObject.contentType == 1 && media) {
|
if (currentMessageObject.contentType == 1 && media) {
|
||||||
replyStartX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(11);
|
replyStartX = currentBackgroundDrawable.getBounds().left + AndroidUtilities.dp(11);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -859,6 +859,7 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
|
||||||
protected void onAfterBackgroundDraw(Canvas canvas) {
|
protected void onAfterBackgroundDraw(Canvas canvas) {
|
||||||
boolean imageDrawn = false;
|
boolean imageDrawn = false;
|
||||||
if (gifDrawable != null) {
|
if (gifDrawable != null) {
|
||||||
|
drawTime = !gifDrawable.isPlaying();
|
||||||
canvas.save();
|
canvas.save();
|
||||||
gifDrawable.setBounds(photoImage.getImageX(), photoImage.getImageY(), photoImage.getImageX() + photoWidth, photoImage.getImageY() + photoHeight);
|
gifDrawable.setBounds(photoImage.getImageX(), photoImage.getImageY(), photoImage.getImageX() + photoWidth, photoImage.getImageY() + photoHeight);
|
||||||
gifDrawable.draw(canvas);
|
gifDrawable.draw(canvas);
|
||||||
|
|
|
@ -239,10 +239,10 @@ public class DialogCell extends BaseCell {
|
||||||
drawNameLock = true;
|
drawNameLock = true;
|
||||||
nameLockTop = AndroidUtilities.dp(16.5f);
|
nameLockTop = AndroidUtilities.dp(16.5f);
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
nameLockLeft = AndroidUtilities.dp(72);
|
nameLockLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
nameLeft = AndroidUtilities.dp(76) + lockDrawable.getIntrinsicWidth();
|
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline + 4) + lockDrawable.getIntrinsicWidth();
|
||||||
} else {
|
} else {
|
||||||
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(72) - lockDrawable.getIntrinsicWidth();
|
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline) - lockDrawable.getIntrinsicWidth();
|
||||||
nameLeft = AndroidUtilities.dp(14);
|
nameLeft = AndroidUtilities.dp(14);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -256,15 +256,15 @@ public class DialogCell extends BaseCell {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
nameLockLeft = AndroidUtilities.dp(72);
|
nameLockLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
nameLeft = AndroidUtilities.dp(76) + (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth());
|
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline + 4) + (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth());
|
||||||
} else {
|
} else {
|
||||||
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(72) - (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth());
|
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline) - (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth());
|
||||||
nameLeft = AndroidUtilities.dp(14);
|
nameLeft = AndroidUtilities.dp(14);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
nameLeft = AndroidUtilities.dp(72);
|
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
} else {
|
} else {
|
||||||
nameLeft = AndroidUtilities.dp(14);
|
nameLeft = AndroidUtilities.dp(14);
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ public class DialogCell extends BaseCell {
|
||||||
} else {
|
} else {
|
||||||
if (chat != null && chat.id > 0) {
|
if (chat != null && chat.id > 0) {
|
||||||
String name = "";
|
String name = "";
|
||||||
if (message.isFromMe()) {
|
if (message.isOut()) {
|
||||||
name = LocaleController.getString("FromYou", R.string.FromYou);
|
name = LocaleController.getString("FromYou", R.string.FromYou);
|
||||||
} else {
|
} else {
|
||||||
if (fromUser != null) {
|
if (fromUser != null) {
|
||||||
|
@ -370,7 +370,7 @@ public class DialogCell extends BaseCell {
|
||||||
drawCount = false;
|
drawCount = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.isFromMe() && message.isOut()) {
|
if (message.isOut() && message.isOut()) {
|
||||||
if (message.isSending()) {
|
if (message.isSending()) {
|
||||||
drawCheck1 = false;
|
drawCheck1 = false;
|
||||||
drawCheck2 = false;
|
drawCheck2 = false;
|
||||||
|
@ -439,7 +439,7 @@ public class DialogCell extends BaseCell {
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(14) - timeWidth;
|
nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(14) - timeWidth;
|
||||||
} else {
|
} else {
|
||||||
nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(72) - timeWidth;
|
nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(AndroidUtilities.leftBaseline) - timeWidth;
|
||||||
nameLeft += timeWidth;
|
nameLeft += timeWidth;
|
||||||
}
|
}
|
||||||
if (drawNameLock) {
|
if (drawNameLock) {
|
||||||
|
@ -497,14 +497,14 @@ public class DialogCell extends BaseCell {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
int messageWidth = getMeasuredWidth() - AndroidUtilities.dp(88);
|
int messageWidth = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline + 16);
|
||||||
int avatarLeft;
|
int avatarLeft;
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
messageLeft = AndroidUtilities.dp(72);
|
messageLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
avatarLeft = AndroidUtilities.dp(9);
|
avatarLeft = AndroidUtilities.dp(AndroidUtilities.isTablet() ? 13 : 9);
|
||||||
} else {
|
} else {
|
||||||
messageLeft = AndroidUtilities.dp(16);
|
messageLeft = AndroidUtilities.dp(16);
|
||||||
avatarLeft = getMeasuredWidth() - AndroidUtilities.dp(61);
|
avatarLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.isTablet() ? 65 : 61);
|
||||||
}
|
}
|
||||||
avatarImage.setImageCoords(avatarLeft, avatarTop, AndroidUtilities.dp(52), AndroidUtilities.dp(52));
|
avatarImage.setImageCoords(avatarLeft, avatarTop, AndroidUtilities.dp(52), AndroidUtilities.dp(52));
|
||||||
if (drawError) {
|
if (drawError) {
|
||||||
|
@ -802,9 +802,9 @@ public class DialogCell extends BaseCell {
|
||||||
|
|
||||||
if (useSeparator) {
|
if (useSeparator) {
|
||||||
if (LocaleController.isRTL) {
|
if (LocaleController.isRTL) {
|
||||||
canvas.drawLine(0, getMeasuredHeight() - 1, getMeasuredWidth() - AndroidUtilities.dp(72), getMeasuredHeight() - 1, linePaint);
|
canvas.drawLine(0, getMeasuredHeight() - 1, getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline), getMeasuredHeight() - 1, linePaint);
|
||||||
} else {
|
} else {
|
||||||
canvas.drawLine(AndroidUtilities.dp(72), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, linePaint);
|
canvas.drawLine(AndroidUtilities.dp(AndroidUtilities.leftBaseline), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, linePaint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,15 +9,25 @@
|
||||||
package org.telegram.ui.Cells;
|
package org.telegram.ui.Cells;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.telegram.PhoneFormat.PhoneFormat;
|
import org.telegram.PhoneFormat.PhoneFormat;
|
||||||
import org.telegram.android.AndroidUtilities;
|
import org.telegram.android.AndroidUtilities;
|
||||||
import org.telegram.android.ContactsController;
|
import org.telegram.android.ContactsController;
|
||||||
|
import org.telegram.messenger.ApplicationLoader;
|
||||||
|
import org.telegram.messenger.R;
|
||||||
import org.telegram.messenger.TLRPC;
|
import org.telegram.messenger.TLRPC;
|
||||||
import org.telegram.ui.Components.AvatarDrawable;
|
import org.telegram.ui.Components.AvatarDrawable;
|
||||||
import org.telegram.ui.Components.BackupImageView;
|
import org.telegram.ui.Components.BackupImageView;
|
||||||
|
@ -27,15 +37,30 @@ public class DrawerProfileCell extends FrameLayout {
|
||||||
private BackupImageView avatarImageView;
|
private BackupImageView avatarImageView;
|
||||||
private TextView nameTextView;
|
private TextView nameTextView;
|
||||||
private TextView phoneTextView;
|
private TextView phoneTextView;
|
||||||
|
private ImageView shadowView;
|
||||||
|
private Rect srcRect = new Rect();
|
||||||
|
private Rect destRect = new Rect();
|
||||||
|
private Paint paint = new Paint();
|
||||||
|
|
||||||
public DrawerProfileCell(Context context) {
|
public DrawerProfileCell(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
setBackgroundColor(0xff4c84b5);
|
setBackgroundColor(0xff4c84b5);
|
||||||
|
|
||||||
|
shadowView = new ImageView(context);
|
||||||
|
shadowView.setVisibility(INVISIBLE);
|
||||||
|
shadowView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||||
|
shadowView.setImageResource(R.drawable.bottom_shadow);
|
||||||
|
addView(shadowView);
|
||||||
|
LayoutParams layoutParams = (FrameLayout.LayoutParams) shadowView.getLayoutParams();
|
||||||
|
layoutParams.width = LayoutParams.MATCH_PARENT;
|
||||||
|
layoutParams.height = AndroidUtilities.dp(70);
|
||||||
|
layoutParams.gravity = Gravity.LEFT | Gravity.BOTTOM;
|
||||||
|
shadowView.setLayoutParams(layoutParams);
|
||||||
|
|
||||||
avatarImageView = new BackupImageView(context);
|
avatarImageView = new BackupImageView(context);
|
||||||
avatarImageView.imageReceiver.setRoundRadius(AndroidUtilities.dp(32));
|
avatarImageView.imageReceiver.setRoundRadius(AndroidUtilities.dp(32));
|
||||||
addView(avatarImageView);
|
addView(avatarImageView);
|
||||||
LayoutParams layoutParams = (LayoutParams) avatarImageView.getLayoutParams();
|
layoutParams = (LayoutParams) avatarImageView.getLayoutParams();
|
||||||
layoutParams.width = AndroidUtilities.dp(64);
|
layoutParams.width = AndroidUtilities.dp(64);
|
||||||
layoutParams.height = AndroidUtilities.dp(64);
|
layoutParams.height = AndroidUtilities.dp(64);
|
||||||
layoutParams.gravity = Gravity.LEFT | Gravity.BOTTOM;
|
layoutParams.gravity = Gravity.LEFT | Gravity.BOTTOM;
|
||||||
|
@ -88,6 +113,35 @@ public class DrawerProfileCell extends FrameLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
Drawable backgroundDrawable = ApplicationLoader.getCachedWallpaper();
|
||||||
|
if (ApplicationLoader.isCustomTheme() && backgroundDrawable != null) {
|
||||||
|
phoneTextView.setTextColor(0xffffffff);
|
||||||
|
shadowView.setVisibility(VISIBLE);
|
||||||
|
if (backgroundDrawable instanceof ColorDrawable) {
|
||||||
|
backgroundDrawable.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
|
||||||
|
backgroundDrawable.draw(canvas);
|
||||||
|
} else if (backgroundDrawable instanceof BitmapDrawable) {
|
||||||
|
Bitmap bitmap = ((BitmapDrawable) backgroundDrawable).getBitmap();
|
||||||
|
float scaleX = (float) getMeasuredWidth() / (float) bitmap.getWidth();
|
||||||
|
float scaleY = (float) getMeasuredHeight() / (float) bitmap.getHeight();
|
||||||
|
float scale = scaleX < scaleY ? scaleY : scaleX;
|
||||||
|
int width = (int) (getMeasuredWidth() / scale);
|
||||||
|
int height = (int) (getMeasuredHeight() / scale);
|
||||||
|
int x = (bitmap.getWidth() - width) / 2;
|
||||||
|
int y = (bitmap.getHeight() - height) / 2;
|
||||||
|
srcRect.set(x, y, x + width, y + height);
|
||||||
|
destRect.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
|
||||||
|
canvas.drawBitmap(bitmap, srcRect, destRect, paint);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
shadowView.setVisibility(INVISIBLE);
|
||||||
|
phoneTextView.setTextColor(0xffc2e5ff);
|
||||||
|
super.onDraw(canvas);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setUser(TLRPC.User user) {
|
public void setUser(TLRPC.User user) {
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
/*
|
||||||
|
* This is the source code of Telegram for Android v. 2.x
|
||||||
|
* It is licensed under GNU GPL v. 2 or later.
|
||||||
|
* You should have received a copy of the license in this archive (see LICENSE).
|
||||||
|
*
|
||||||
|
* Copyright Nikolai Kudashov, 2013-2015.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.telegram.ui.Cells;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import org.telegram.android.AndroidUtilities;
|
||||||
|
|
||||||
|
public class HashtagSearchCell extends TextView {
|
||||||
|
|
||||||
|
private boolean needDivider;
|
||||||
|
private static Paint paint;
|
||||||
|
|
||||||
|
public HashtagSearchCell(Context context) {
|
||||||
|
super(context);
|
||||||
|
setGravity(Gravity.CENTER_VERTICAL);
|
||||||
|
setPadding(AndroidUtilities.dp(16), 0, AndroidUtilities.dp(16), 0);
|
||||||
|
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 17);
|
||||||
|
setTextColor(0xff000000);
|
||||||
|
if (paint == null) {
|
||||||
|
paint = new Paint();
|
||||||
|
paint.setColor(0xffdcdcdc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNeedDivider(boolean value) {
|
||||||
|
needDivider = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), AndroidUtilities.dp(48) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
super.onDraw(canvas);
|
||||||
|
if (needDivider) {
|
||||||
|
canvas.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1, paint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -95,5 +95,13 @@ public class MentionCell extends LinearLayout {
|
||||||
}
|
}
|
||||||
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
usernameTextView.setText("@" + user.username);
|
usernameTextView.setText("@" + user.username);
|
||||||
|
imageView.setVisibility(VISIBLE);
|
||||||
|
usernameTextView.setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(String text) {
|
||||||
|
imageView.setVisibility(INVISIBLE);
|
||||||
|
usernameTextView.setVisibility(INVISIBLE);
|
||||||
|
nameTextView.setText(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,10 +149,10 @@ public class ProfileSearchCell extends BaseCell {
|
||||||
if (encryptedChat != null) {
|
if (encryptedChat != null) {
|
||||||
drawNameLock = true;
|
drawNameLock = true;
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
nameLockLeft = AndroidUtilities.dp(72);
|
nameLockLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
nameLeft = AndroidUtilities.dp(76) + lockDrawable.getIntrinsicWidth();
|
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline + 4) + lockDrawable.getIntrinsicWidth();
|
||||||
} else {
|
} else {
|
||||||
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(74) - lockDrawable.getIntrinsicWidth();
|
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline + 2) - lockDrawable.getIntrinsicWidth();
|
||||||
nameLeft = AndroidUtilities.dp(11);
|
nameLeft = AndroidUtilities.dp(11);
|
||||||
}
|
}
|
||||||
nameLockTop = AndroidUtilities.dp(16.5f);
|
nameLockTop = AndroidUtilities.dp(16.5f);
|
||||||
|
@ -167,15 +167,15 @@ public class ProfileSearchCell extends BaseCell {
|
||||||
nameLockTop = AndroidUtilities.dp(30);
|
nameLockTop = AndroidUtilities.dp(30);
|
||||||
}
|
}
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
nameLockLeft = AndroidUtilities.dp(72);
|
nameLockLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
nameLeft = AndroidUtilities.dp(76) + (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth());
|
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline + 4) + (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth());
|
||||||
} else {
|
} else {
|
||||||
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(74) - (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth());
|
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline + 2) - (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth());
|
||||||
nameLeft = AndroidUtilities.dp(11);
|
nameLeft = AndroidUtilities.dp(11);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
nameLeft = AndroidUtilities.dp(72);
|
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
} else {
|
} else {
|
||||||
nameLeft = AndroidUtilities.dp(11);
|
nameLeft = AndroidUtilities.dp(11);
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ public class ProfileSearchCell extends BaseCell {
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
onlineWidth = nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(14);
|
onlineWidth = nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(14);
|
||||||
} else {
|
} else {
|
||||||
onlineWidth = nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(72);
|
onlineWidth = nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
}
|
}
|
||||||
if (drawNameLock) {
|
if (drawNameLock) {
|
||||||
nameWidth -= AndroidUtilities.dp(6) + lockDrawable.getIntrinsicWidth();
|
nameWidth -= AndroidUtilities.dp(6) + lockDrawable.getIntrinsicWidth();
|
||||||
|
@ -226,7 +226,7 @@ public class ProfileSearchCell extends BaseCell {
|
||||||
|
|
||||||
if (chat == null) {
|
if (chat == null) {
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
onlineLeft = AndroidUtilities.dp(72);
|
onlineLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
} else {
|
} else {
|
||||||
onlineLeft = AndroidUtilities.dp(11);
|
onlineLeft = AndroidUtilities.dp(11);
|
||||||
}
|
}
|
||||||
|
@ -254,9 +254,9 @@ public class ProfileSearchCell extends BaseCell {
|
||||||
|
|
||||||
int avatarLeft;
|
int avatarLeft;
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
avatarLeft = AndroidUtilities.dp(9);
|
avatarLeft = AndroidUtilities.dp(AndroidUtilities.isTablet() ? 13 : 9);
|
||||||
} else {
|
} else {
|
||||||
avatarLeft = getMeasuredWidth() - AndroidUtilities.dp(61);
|
avatarLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.isTablet() ? 65 : 61);
|
||||||
}
|
}
|
||||||
|
|
||||||
avatarImage.setImageCoords(avatarLeft, AndroidUtilities.dp(10), AndroidUtilities.dp(52), AndroidUtilities.dp(52));
|
avatarImage.setImageCoords(avatarLeft, AndroidUtilities.dp(10), AndroidUtilities.dp(52), AndroidUtilities.dp(52));
|
||||||
|
@ -384,9 +384,9 @@ public class ProfileSearchCell extends BaseCell {
|
||||||
|
|
||||||
if (useSeparator) {
|
if (useSeparator) {
|
||||||
if (LocaleController.isRTL) {
|
if (LocaleController.isRTL) {
|
||||||
canvas.drawLine(0, getMeasuredHeight() - 1, getMeasuredWidth() - AndroidUtilities.dp(72), getMeasuredHeight() - 1, linePaint);
|
canvas.drawLine(0, getMeasuredHeight() - 1, getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline), getMeasuredHeight() - 1, linePaint);
|
||||||
} else {
|
} else {
|
||||||
canvas.drawLine(AndroidUtilities.dp(72), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, linePaint);
|
canvas.drawLine(AndroidUtilities.dp(AndroidUtilities.leftBaseline), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, linePaint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,6 +191,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
private int loadsCount = 0;
|
private int loadsCount = 0;
|
||||||
|
|
||||||
private int startLoadFromMessageId = 0;
|
private int startLoadFromMessageId = 0;
|
||||||
|
private boolean needSelectFromMessageId;
|
||||||
|
private int returnToMessageId = 0;
|
||||||
|
|
||||||
private int minDate = 0;
|
private int minDate = 0;
|
||||||
private boolean first = true;
|
private boolean first = true;
|
||||||
|
@ -419,6 +421,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
loading = true;
|
loading = true;
|
||||||
|
|
||||||
if (startLoadFromMessageId != 0) {
|
if (startLoadFromMessageId != 0) {
|
||||||
|
needSelectFromMessageId = true;
|
||||||
MessagesController.getInstance().loadMessages(dialog_id, AndroidUtilities.isTablet() ? 30 : 20, startLoadFromMessageId, true, 0, classGuid, 3, 0, 0, false);
|
MessagesController.getInstance().loadMessages(dialog_id, AndroidUtilities.isTablet() ? 30 : 20, startLoadFromMessageId, true, 0, classGuid, 3, 0, 0, false);
|
||||||
} else {
|
} else {
|
||||||
MessagesController.getInstance().loadMessages(dialog_id, AndroidUtilities.isTablet() ? 30 : 20, 0, true, 0, classGuid, 2, 0, 0, true);
|
MessagesController.getInstance().loadMessages(dialog_id, AndroidUtilities.isTablet() ? 30 : 20, 0, true, 0, classGuid, 2, 0, 0, true);
|
||||||
|
@ -1384,7 +1387,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
layoutParams2.gravity = Gravity.CENTER;
|
layoutParams2.gravity = Gravity.CENTER;
|
||||||
progressBar.setLayoutParams(layoutParams2);
|
progressBar.setLayoutParams(layoutParams2);
|
||||||
|
|
||||||
if (currentChat != null && !isBroadcast) {
|
if (currentEncryptedChat == null && !isBroadcast) {
|
||||||
mentionListView = new ListView(getParentActivity());
|
mentionListView = new ListView(getParentActivity());
|
||||||
mentionListView.setBackgroundResource(R.drawable.compose_panel);
|
mentionListView.setBackgroundResource(R.drawable.compose_panel);
|
||||||
mentionListView.setVisibility(View.GONE);
|
mentionListView.setVisibility(View.GONE);
|
||||||
|
@ -1408,8 +1411,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
public void needChangePanelVisibility(boolean show) {
|
public void needChangePanelVisibility(boolean show) {
|
||||||
if (show) {
|
if (show) {
|
||||||
RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) mentionListView.getLayoutParams();
|
RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) mentionListView.getLayoutParams();
|
||||||
layoutParams3.height = AndroidUtilities.dp(2 + 36 * Math.min(3, mentionsAdapter.getCount()));
|
int height = 36 * Math.min(3, mentionsAdapter.getCount()) + (mentionsAdapter.getCount() > 3 ? 18 : 0);
|
||||||
layoutParams3.topMargin = -AndroidUtilities.dp(36 * Math.min(3, mentionsAdapter.getCount()));
|
layoutParams3.height = AndroidUtilities.dp(2 + height);
|
||||||
|
layoutParams3.topMargin = -AndroidUtilities.dp(height);
|
||||||
mentionListView.setLayoutParams(layoutParams3);
|
mentionListView.setLayoutParams(layoutParams3);
|
||||||
|
|
||||||
if (mentionListAnimation != null) {
|
if (mentionListAnimation != null) {
|
||||||
|
@ -1477,16 +1481,44 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
mentionsAdapter.setChatInfo(info);
|
mentionsAdapter.setChatInfo(info);
|
||||||
|
mentionsAdapter.setNeedUsernames(currentChat != null);
|
||||||
|
|
||||||
mentionListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
mentionListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
TLRPC.User user = mentionsAdapter.getItem(position);
|
Object object = mentionsAdapter.getItem(position);
|
||||||
|
int start = mentionsAdapter.getResultStartPosition();
|
||||||
|
int len = mentionsAdapter.getResultLength();
|
||||||
|
if (object instanceof TLRPC.User) {
|
||||||
|
TLRPC.User user = (TLRPC.User) object;
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
int start = mentionsAdapter.getUsernameStartPosition();
|
|
||||||
int len = mentionsAdapter.getUsernameLength();
|
|
||||||
chatActivityEnterView.replaceWithText(start, len, "@" + user.username + " ");
|
chatActivityEnterView.replaceWithText(start, len, "@" + user.username + " ");
|
||||||
}
|
}
|
||||||
|
} else if (object instanceof String) {
|
||||||
|
chatActivityEnterView.replaceWithText(start, len, object + " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mentionListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
Object object = mentionsAdapter.getItem(position);
|
||||||
|
if (object instanceof String) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||||
|
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||||
|
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
|
||||||
|
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
mentionsAdapter.clearRecentHashtags();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||||
|
showAlertDialog(builder);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1506,9 +1538,15 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
chatActivityEnterView.setLayoutParams(layoutParams3);
|
chatActivityEnterView.setLayoutParams(layoutParams3);
|
||||||
chatActivityEnterView.setDelegate(new ChatActivityEnterView.ChatActivityEnterViewDelegate() {
|
chatActivityEnterView.setDelegate(new ChatActivityEnterView.ChatActivityEnterViewDelegate() {
|
||||||
@Override
|
@Override
|
||||||
public void onMessageSend() {
|
public void onMessageSend(String message) {
|
||||||
moveScrollToLastMessage();
|
moveScrollToLastMessage();
|
||||||
showReplyForMessageObjectOrForward(false, null, null, true);
|
showReplyForMessageObjectOrForward(false, null, null, true);
|
||||||
|
if (mentionsAdapter != null) {
|
||||||
|
mentionsAdapter.addHashtagsFromMessage(message);
|
||||||
|
}
|
||||||
|
if (message != null) {
|
||||||
|
NotificationsController.getInstance().playOutChatSound();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1517,7 +1555,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
stickersAdapter.loadStikersForEmoji(text);
|
stickersAdapter.loadStikersForEmoji(text);
|
||||||
}
|
}
|
||||||
if (mentionsAdapter != null) {
|
if (mentionsAdapter != null) {
|
||||||
mentionsAdapter.searchUsername(text.toString(), chatActivityEnterView.getCursorPosition(), messages);
|
mentionsAdapter.searchUsernameOrHashtag(text.toString(), chatActivityEnterView.getCursorPosition(), messages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1867,8 +1905,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
pagedownButton.setOnClickListener(new View.OnClickListener() {
|
pagedownButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
if (returnToMessageId > 0) {
|
||||||
|
scrollToMessageId(returnToMessageId, 0, true);
|
||||||
|
} else {
|
||||||
scrollToLastMessage();
|
scrollToLastMessage();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (loading && messages.isEmpty()) {
|
if (loading && messages.isEmpty()) {
|
||||||
|
@ -2094,11 +2136,80 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
forward_end_reached = true;
|
forward_end_reached = true;
|
||||||
loading = true;
|
loading = true;
|
||||||
startLoadFromMessageId = 0;
|
startLoadFromMessageId = 0;
|
||||||
|
needSelectFromMessageId = false;
|
||||||
chatAdapter.notifyDataSetChanged();
|
chatAdapter.notifyDataSetChanged();
|
||||||
MessagesController.getInstance().loadMessages(dialog_id, 30, 0, true, 0, classGuid, 0, 0, 0, true);
|
MessagesController.getInstance().loadMessages(dialog_id, 30, 0, true, 0, classGuid, 0, 0, 0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void scrollToMessageId(int id, int fromMessageId, boolean select) {
|
||||||
|
returnToMessageId = fromMessageId;
|
||||||
|
needSelectFromMessageId = select;
|
||||||
|
|
||||||
|
MessageObject object = messagesDict.get(id);
|
||||||
|
boolean query = false;
|
||||||
|
if (object != null) {
|
||||||
|
int index = messages.indexOf(object);
|
||||||
|
if (index != -1) {
|
||||||
|
if (needSelectFromMessageId) {
|
||||||
|
highlightMessageId = id;
|
||||||
|
} else {
|
||||||
|
highlightMessageId = Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
final int yOffset = Math.max(0, (chatListView.getHeight() - object.getApproximateHeight()) / 2);
|
||||||
|
if (messages.get(messages.size() - 1) == object) {
|
||||||
|
chatListView.setSelectionFromTop(0, AndroidUtilities.dp(-11) + yOffset);
|
||||||
|
} else {
|
||||||
|
chatListView.setSelectionFromTop(messages.size() - messages.indexOf(object), AndroidUtilities.dp(-11) + yOffset);
|
||||||
|
}
|
||||||
|
updateVisibleRows();
|
||||||
|
showPagedownButton(true, true);
|
||||||
|
} else {
|
||||||
|
query = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
query = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (query) {
|
||||||
|
messagesDict.clear();
|
||||||
|
messagesByDays.clear();
|
||||||
|
messages.clear();
|
||||||
|
if (currentEncryptedChat == null) {
|
||||||
|
maxMessageId = Integer.MAX_VALUE;
|
||||||
|
minMessageId = Integer.MIN_VALUE;
|
||||||
|
} else {
|
||||||
|
maxMessageId = Integer.MIN_VALUE;
|
||||||
|
minMessageId = Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
maxDate = Integer.MIN_VALUE;
|
||||||
|
endReached = false;
|
||||||
|
loading = false;
|
||||||
|
cacheEndReaced = false;
|
||||||
|
firstLoading = true;
|
||||||
|
loadsCount = 0;
|
||||||
|
minDate = 0;
|
||||||
|
first = true;
|
||||||
|
unread_to_load = 0;
|
||||||
|
first_unread_id = 0;
|
||||||
|
last_message_id = 0;
|
||||||
|
first_message_id = 0;
|
||||||
|
forward_end_reached = true;
|
||||||
|
loadingForward = false;
|
||||||
|
unreadMessageObject = null;
|
||||||
|
scrollToMessage = null;
|
||||||
|
highlightMessageId = Integer.MAX_VALUE;
|
||||||
|
scrollToMessageMiddleScreen = false;
|
||||||
|
loading = true;
|
||||||
|
startLoadFromMessageId = id;
|
||||||
|
MessagesController.getInstance().loadMessages(dialog_id, AndroidUtilities.isTablet() ? 30 : 20, startLoadFromMessageId, true, 0, classGuid, 3, 0, 0, false);
|
||||||
|
chatAdapter.notifyDataSetChanged();
|
||||||
|
progressView.setVisibility(View.VISIBLE);
|
||||||
|
chatListView.setEmptyView(null);
|
||||||
|
emptyViewContainer.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void showPagedownButton(boolean show, boolean animated) {
|
private void showPagedownButton(boolean show, boolean animated) {
|
||||||
if (pagedownButton == null) {
|
if (pagedownButton == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -2114,6 +2225,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
returnToMessageId = 0;
|
||||||
if (pagedownButton.getVisibility() == View.VISIBLE) {
|
if (pagedownButton.getVisibility() == View.VISIBLE) {
|
||||||
if (animated) {
|
if (animated) {
|
||||||
ObjectAnimatorProxy.ofFloatProxy(pagedownButton, "alpha", 0.0f).setDuration(200).addListener(new AnimatorListenerAdapterProxy() {
|
ObjectAnimatorProxy.ofFloatProxy(pagedownButton, "alpha", 0.0f).setDuration(200).addListener(new AnimatorListenerAdapterProxy() {
|
||||||
|
@ -2829,7 +2941,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
scrollToMessageMiddleScreen = false;
|
scrollToMessageMiddleScreen = false;
|
||||||
newRowsCount++;
|
newRowsCount++;
|
||||||
} else if (load_type == 3 && obj.getId() == startLoadFromMessageId) {
|
} else if (load_type == 3 && obj.getId() == startLoadFromMessageId) {
|
||||||
|
if (needSelectFromMessageId) {
|
||||||
highlightMessageId = obj.getId();
|
highlightMessageId = obj.getId();
|
||||||
|
} else {
|
||||||
|
highlightMessageId = Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
scrollToMessage = obj;
|
scrollToMessage = obj;
|
||||||
if (isCache) {
|
if (isCache) {
|
||||||
startLoadFromMessageId = 0;
|
startLoadFromMessageId = 0;
|
||||||
|
@ -3560,7 +3676,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
paused = false;
|
paused = false;
|
||||||
if (readWhenResume && !messages.isEmpty()) {
|
if (readWhenResume && !messages.isEmpty()) {
|
||||||
for (MessageObject messageObject : messages) {
|
for (MessageObject messageObject : messages) {
|
||||||
if (!messageObject.isUnread() && !messageObject.isFromMe()) {
|
if (!messageObject.isUnread() && !messageObject.isOut()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!messageObject.isOut()) {
|
if (!messageObject.isOut()) {
|
||||||
|
@ -4449,63 +4565,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void didPressReplyMessage(ChatBaseCell cell, int id) {
|
public void didPressReplyMessage(ChatBaseCell cell, int id) {
|
||||||
MessageObject object = messagesDict.get(id);
|
scrollToMessageId(id, cell.getMessageObject().getId(), true);
|
||||||
boolean query = false;
|
|
||||||
if (object != null) {
|
|
||||||
int index = messages.indexOf(object);
|
|
||||||
if (index != -1) {
|
|
||||||
highlightMessageId = id;
|
|
||||||
final int yOffset = Math.max(0, (chatListView.getHeight() - object.getApproximateHeight()) / 2);
|
|
||||||
if (messages.get(messages.size() - 1) == object) {
|
|
||||||
chatListView.setSelectionFromTop(0, AndroidUtilities.dp(-11) + yOffset);
|
|
||||||
} else {
|
|
||||||
chatListView.setSelectionFromTop(messages.size() - messages.indexOf(object), AndroidUtilities.dp(-11) + yOffset);
|
|
||||||
}
|
|
||||||
updateVisibleRows();
|
|
||||||
showPagedownButton(true, true);
|
|
||||||
} else {
|
|
||||||
query = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
query = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (query) {
|
|
||||||
messagesDict.clear();
|
|
||||||
messagesByDays.clear();
|
|
||||||
messages.clear();
|
|
||||||
if (currentEncryptedChat == null) {
|
|
||||||
maxMessageId = Integer.MAX_VALUE;
|
|
||||||
minMessageId = Integer.MIN_VALUE;
|
|
||||||
} else {
|
|
||||||
maxMessageId = Integer.MIN_VALUE;
|
|
||||||
minMessageId = Integer.MAX_VALUE;
|
|
||||||
}
|
|
||||||
maxDate = Integer.MIN_VALUE;
|
|
||||||
endReached = false;
|
|
||||||
loading = false;
|
|
||||||
cacheEndReaced = false;
|
|
||||||
firstLoading = true;
|
|
||||||
loadsCount = 0;
|
|
||||||
minDate = 0;
|
|
||||||
first = true;
|
|
||||||
unread_to_load = 0;
|
|
||||||
first_unread_id = 0;
|
|
||||||
last_message_id = 0;
|
|
||||||
first_message_id = 0;
|
|
||||||
forward_end_reached = true;
|
|
||||||
loadingForward = false;
|
|
||||||
unreadMessageObject = null;
|
|
||||||
scrollToMessage = null;
|
|
||||||
highlightMessageId = Integer.MAX_VALUE;
|
|
||||||
scrollToMessageMiddleScreen = false;
|
|
||||||
loading = true;
|
|
||||||
startLoadFromMessageId = id;
|
|
||||||
MessagesController.getInstance().loadMessages(dialog_id, AndroidUtilities.isTablet() ? 30 : 20, startLoadFromMessageId, true, 0, classGuid, 3, 0, 0, false);
|
|
||||||
chatAdapter.notifyDataSetChanged();
|
|
||||||
progressView.setVisibility(View.VISIBLE);
|
|
||||||
chatListView.setEmptyView(null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (view instanceof ChatMediaCell) {
|
if (view instanceof ChatMediaCell) {
|
||||||
|
|
|
@ -21,7 +21,6 @@ import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.Surface;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
@ -60,7 +59,7 @@ import java.lang.reflect.Field;
|
||||||
public class ChatActivityEnterView extends FrameLayoutFixed implements NotificationCenter.NotificationCenterDelegate, SizeNotifierRelativeLayout.SizeNotifierRelativeLayoutDelegate {
|
public class ChatActivityEnterView extends FrameLayoutFixed implements NotificationCenter.NotificationCenterDelegate, SizeNotifierRelativeLayout.SizeNotifierRelativeLayoutDelegate {
|
||||||
|
|
||||||
public interface ChatActivityEnterViewDelegate {
|
public interface ChatActivityEnterViewDelegate {
|
||||||
void onMessageSend();
|
void onMessageSend(String message);
|
||||||
void needSendTyping();
|
void needSendTyping();
|
||||||
void onTextChanged(CharSequence text);
|
void onTextChanged(CharSequence text);
|
||||||
void onAttachButtonHidden();
|
void onAttachButtonHidden();
|
||||||
|
@ -68,7 +67,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
void onWindowSizeChanged(int size);
|
void onWindowSizeChanged(int size);
|
||||||
}
|
}
|
||||||
|
|
||||||
private EditText messsageEditText;
|
private EditText messageEditText;
|
||||||
private ImageView sendButton;
|
private ImageView sendButton;
|
||||||
private PopupWindow emojiPopup;
|
private PopupWindow emojiPopup;
|
||||||
private ImageView emojiButton;
|
private ImageView emojiButton;
|
||||||
|
@ -169,28 +168,28 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
messsageEditText = new EditText(context);
|
messageEditText = new EditText(context);
|
||||||
messsageEditText.setHint(LocaleController.getString("TypeMessage", R.string.TypeMessage));
|
messageEditText.setHint(LocaleController.getString("TypeMessage", R.string.TypeMessage));
|
||||||
messsageEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
|
messageEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
|
||||||
messsageEditText.setInputType(messsageEditText.getInputType() | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE);
|
messageEditText.setInputType(messageEditText.getInputType() | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE);
|
||||||
messsageEditText.setSingleLine(false);
|
messageEditText.setSingleLine(false);
|
||||||
messsageEditText.setMaxLines(4);
|
messageEditText.setMaxLines(4);
|
||||||
messsageEditText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
|
messageEditText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
|
||||||
messsageEditText.setGravity(Gravity.BOTTOM);
|
messageEditText.setGravity(Gravity.BOTTOM);
|
||||||
messsageEditText.setPadding(0, AndroidUtilities.dp(11), 0, AndroidUtilities.dp(12));
|
messageEditText.setPadding(0, AndroidUtilities.dp(11), 0, AndroidUtilities.dp(12));
|
||||||
messsageEditText.setBackgroundDrawable(null);
|
messageEditText.setBackgroundDrawable(null);
|
||||||
AndroidUtilities.clearCursorDrawable(messsageEditText);
|
AndroidUtilities.clearCursorDrawable(messageEditText);
|
||||||
messsageEditText.setTextColor(0xff000000);
|
messageEditText.setTextColor(0xff000000);
|
||||||
messsageEditText.setHintTextColor(0xffb2b2b2);
|
messageEditText.setHintTextColor(0xffb2b2b2);
|
||||||
frameLayout.addView(messsageEditText);
|
frameLayout.addView(messageEditText);
|
||||||
layoutParams1 = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
layoutParams1 = (FrameLayout.LayoutParams) messageEditText.getLayoutParams();
|
||||||
layoutParams1.width = FrameLayout.LayoutParams.MATCH_PARENT;
|
layoutParams1.width = FrameLayout.LayoutParams.MATCH_PARENT;
|
||||||
layoutParams1.height = FrameLayout.LayoutParams.WRAP_CONTENT;
|
layoutParams1.height = FrameLayout.LayoutParams.WRAP_CONTENT;
|
||||||
layoutParams1.gravity = Gravity.BOTTOM;
|
layoutParams1.gravity = Gravity.BOTTOM;
|
||||||
layoutParams1.leftMargin = AndroidUtilities.dp(52);
|
layoutParams1.leftMargin = AndroidUtilities.dp(52);
|
||||||
layoutParams1.rightMargin = AndroidUtilities.dp(isChat ? 50 : 2);
|
layoutParams1.rightMargin = AndroidUtilities.dp(isChat ? 50 : 2);
|
||||||
messsageEditText.setLayoutParams(layoutParams1);
|
messageEditText.setLayoutParams(layoutParams1);
|
||||||
messsageEditText.setOnKeyListener(new View.OnKeyListener() {
|
messageEditText.setOnKeyListener(new View.OnKeyListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onKey(View view, int i, KeyEvent keyEvent) {
|
public boolean onKey(View view, int i, KeyEvent keyEvent) {
|
||||||
if (i == 4 && !keyboardVisible && emojiPopup != null && emojiPopup.isShowing()) {
|
if (i == 4 && !keyboardVisible && emojiPopup != null && emojiPopup.isShowing()) {
|
||||||
|
@ -205,7 +204,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
messsageEditText.setOnClickListener(new View.OnClickListener() {
|
messageEditText.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (emojiPopup != null && emojiPopup.isShowing()) {
|
if (emojiPopup != null && emojiPopup.isShowing()) {
|
||||||
|
@ -213,7 +212,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
messsageEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
messageEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
|
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
|
||||||
if (i == EditorInfo.IME_ACTION_SEND) {
|
if (i == EditorInfo.IME_ACTION_SEND) {
|
||||||
|
@ -228,7 +227,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
messsageEditText.addTextChangedListener(new TextWatcher() {
|
messageEditText.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||||
|
|
||||||
|
@ -269,7 +268,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
int j = arrayOfImageSpan.length;
|
int j = arrayOfImageSpan.length;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (i >= j) {
|
if (i >= j) {
|
||||||
Emoji.replaceEmoji(editable, messsageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20));
|
Emoji.replaceEmoji(editable, messageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
editable.removeSpan(arrayOfImageSpan[i]);
|
editable.removeSpan(arrayOfImageSpan[i]);
|
||||||
|
@ -520,6 +519,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
if (allowShowTopView) {
|
if (allowShowTopView) {
|
||||||
topView.setVisibility(VISIBLE);
|
topView.setVisibility(VISIBLE);
|
||||||
if (animated) {
|
if (animated) {
|
||||||
|
if (keyboardVisible || emojiPopup != null && emojiPopup.isShowing()) {
|
||||||
AnimatorSetProxy animatorSetProxy = new AnimatorSetProxy();
|
AnimatorSetProxy animatorSetProxy = new AnimatorSetProxy();
|
||||||
animatorSetProxy.playTogether(
|
animatorSetProxy.playTogether(
|
||||||
ObjectAnimatorProxy.ofFloat(ChatActivityEnterView.this, "topViewAnimation", 0.0f, 1.0f)
|
ObjectAnimatorProxy.ofFloat(ChatActivityEnterView.this, "topViewAnimation", 0.0f, 1.0f)
|
||||||
|
@ -537,6 +537,14 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
});
|
});
|
||||||
animatorSetProxy.setDuration(200);
|
animatorSetProxy.setDuration(200);
|
||||||
animatorSetProxy.start();
|
animatorSetProxy.start();
|
||||||
|
} else {
|
||||||
|
LayoutParams layoutParams2 = (LayoutParams) textFieldContainer.getLayoutParams();
|
||||||
|
layoutParams2.topMargin = AndroidUtilities.dp(2) + topView.getLayoutParams().height;
|
||||||
|
textFieldContainer.setLayoutParams(layoutParams2);
|
||||||
|
if (!forceShowSendButton) {
|
||||||
|
openKeyboard();
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LayoutParams layoutParams2 = (LayoutParams) textFieldContainer.getLayoutParams();
|
LayoutParams layoutParams2 = (LayoutParams) textFieldContainer.getLayoutParams();
|
||||||
layoutParams2.topMargin = AndroidUtilities.dp(2) + topView.getLayoutParams().height;
|
layoutParams2.topMargin = AndroidUtilities.dp(2) + topView.getLayoutParams().height;
|
||||||
|
@ -659,15 +667,16 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (processSendingText(messsageEditText.getText().toString())) {
|
String message = messageEditText.getText().toString();
|
||||||
messsageEditText.setText("");
|
if (processSendingText(message)) {
|
||||||
|
messageEditText.setText("");
|
||||||
lastTypingTimeSend = 0;
|
lastTypingTimeSend = 0;
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
delegate.onMessageSend();
|
delegate.onMessageSend(message);
|
||||||
}
|
}
|
||||||
} else if (forceShowSendButton) {
|
} else if (forceShowSendButton) {
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
delegate.onMessageSend();
|
delegate.onMessageSend(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -700,7 +709,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkSendButton(final boolean animated) {
|
private void checkSendButton(final boolean animated) {
|
||||||
String message = getTrimmedString(messsageEditText.getText().toString());
|
String message = getTrimmedString(messageEditText.getText().toString());
|
||||||
if (message.length() > 0 || forceShowSendButton) {
|
if (message.length() > 0 || forceShowSendButton) {
|
||||||
if (audioSendButton.getVisibility() == View.VISIBLE) {
|
if (audioSendButton.getVisibility() == View.VISIBLE) {
|
||||||
if (animated) {
|
if (animated) {
|
||||||
|
@ -734,10 +743,10 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
});
|
});
|
||||||
runningAnimation2.start();
|
runningAnimation2.start();
|
||||||
|
|
||||||
if (messsageEditText != null) {
|
if (messageEditText != null) {
|
||||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messageEditText.getLayoutParams();
|
||||||
layoutParams.rightMargin = AndroidUtilities.dp(0);
|
layoutParams.rightMargin = AndroidUtilities.dp(0);
|
||||||
messsageEditText.setLayoutParams(layoutParams);
|
messageEditText.setLayoutParams(layoutParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate.onAttachButtonHidden();
|
delegate.onAttachButtonHidden();
|
||||||
|
@ -784,9 +793,9 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
attachButton.setVisibility(View.GONE);
|
attachButton.setVisibility(View.GONE);
|
||||||
attachButton.clearAnimation();
|
attachButton.clearAnimation();
|
||||||
delegate.onAttachButtonHidden();
|
delegate.onAttachButtonHidden();
|
||||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messageEditText.getLayoutParams();
|
||||||
layoutParams.rightMargin = AndroidUtilities.dp(0);
|
layoutParams.rightMargin = AndroidUtilities.dp(0);
|
||||||
messsageEditText.setLayoutParams(layoutParams);
|
messageEditText.setLayoutParams(layoutParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -815,10 +824,10 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
runningAnimation2.setDuration(100);
|
runningAnimation2.setDuration(100);
|
||||||
runningAnimation2.start();
|
runningAnimation2.start();
|
||||||
|
|
||||||
if (messsageEditText != null) {
|
if (messageEditText != null) {
|
||||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messageEditText.getLayoutParams();
|
||||||
layoutParams.rightMargin = AndroidUtilities.dp(50);
|
layoutParams.rightMargin = AndroidUtilities.dp(50);
|
||||||
messsageEditText.setLayoutParams(layoutParams);
|
messageEditText.setLayoutParams(layoutParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate.onAttachButtonShow();
|
delegate.onAttachButtonShow();
|
||||||
|
@ -864,9 +873,9 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
if (attachButton != null) {
|
if (attachButton != null) {
|
||||||
delegate.onAttachButtonShow();
|
delegate.onAttachButtonShow();
|
||||||
attachButton.setVisibility(View.VISIBLE);
|
attachButton.setVisibility(View.VISIBLE);
|
||||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messageEditText.getLayoutParams();
|
||||||
layoutParams.rightMargin = AndroidUtilities.dp(50);
|
layoutParams.rightMargin = AndroidUtilities.dp(50);
|
||||||
messsageEditText.setLayoutParams(layoutParams);
|
messageEditText.setLayoutParams(layoutParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -957,19 +966,19 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
emojiView = new EmojiView(parentActivity);
|
emojiView = new EmojiView(parentActivity);
|
||||||
emojiView.setListener(new EmojiView.Listener() {
|
emojiView.setListener(new EmojiView.Listener() {
|
||||||
public void onBackspace() {
|
public void onBackspace() {
|
||||||
messsageEditText.dispatchKeyEvent(new KeyEvent(0, 67));
|
messageEditText.dispatchKeyEvent(new KeyEvent(0, 67));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEmojiSelected(String symbol) {
|
public void onEmojiSelected(String symbol) {
|
||||||
int i = messsageEditText.getSelectionEnd();
|
int i = messageEditText.getSelectionEnd();
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
CharSequence localCharSequence = Emoji.replaceEmoji(symbol, messsageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20));
|
CharSequence localCharSequence = Emoji.replaceEmoji(symbol, messageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20));
|
||||||
messsageEditText.setText(messsageEditText.getText().insert(i, localCharSequence));
|
messageEditText.setText(messageEditText.getText().insert(i, localCharSequence));
|
||||||
int j = i + localCharSequence.length();
|
int j = i + localCharSequence.length();
|
||||||
messsageEditText.setSelection(j, j);
|
messageEditText.setSelection(j, j);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
|
@ -992,19 +1001,19 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int currentHeight;
|
int currentHeight;
|
||||||
WindowManager wm = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE);
|
|
||||||
int rotation = wm.getDefaultDisplay().getRotation();
|
|
||||||
if (keyboardHeight <= 0) {
|
if (keyboardHeight <= 0) {
|
||||||
keyboardHeight = ApplicationLoader.applicationContext.getSharedPreferences("emoji", 0).getInt("kbd_height", AndroidUtilities.dp(200));
|
keyboardHeight = ApplicationLoader.applicationContext.getSharedPreferences("emoji", 0).getInt("kbd_height", AndroidUtilities.dp(200));
|
||||||
}
|
}
|
||||||
if (keyboardHeightLand <= 0) {
|
if (keyboardHeightLand <= 0) {
|
||||||
keyboardHeightLand = ApplicationLoader.applicationContext.getSharedPreferences("emoji", 0).getInt("kbd_height_land3", AndroidUtilities.dp(200));
|
keyboardHeightLand = ApplicationLoader.applicationContext.getSharedPreferences("emoji", 0).getInt("kbd_height_land3", AndroidUtilities.dp(200));
|
||||||
}
|
}
|
||||||
if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) {
|
if (AndroidUtilities.displaySize.x > AndroidUtilities.displaySize.y) {
|
||||||
currentHeight = keyboardHeightLand;
|
currentHeight = keyboardHeightLand;
|
||||||
} else {
|
} else {
|
||||||
currentHeight = keyboardHeight;
|
currentHeight = keyboardHeight;
|
||||||
}
|
}
|
||||||
|
FileLog.e("tmessages", "show emoji with height = " + currentHeight);
|
||||||
emojiPopup.setHeight(View.MeasureSpec.makeMeasureSpec(currentHeight, View.MeasureSpec.EXACTLY));
|
emojiPopup.setHeight(View.MeasureSpec.makeMeasureSpec(currentHeight, View.MeasureSpec.EXACTLY));
|
||||||
if (sizeNotifierRelativeLayout != null) {
|
if (sizeNotifierRelativeLayout != null) {
|
||||||
emojiPopup.setWidth(View.MeasureSpec.makeMeasureSpec(AndroidUtilities.displaySize.x, View.MeasureSpec.EXACTLY));
|
emojiPopup.setWidth(View.MeasureSpec.makeMeasureSpec(AndroidUtilities.displaySize.x, View.MeasureSpec.EXACTLY));
|
||||||
|
@ -1041,7 +1050,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
try {
|
try {
|
||||||
emojiPopup.showAsDropDown(this, 0, -currentHeight - getHeight());
|
emojiPopup.showAsDropDown(this, 0, -currentHeight - getHeight());
|
||||||
emojiPopup.update(this, 0, -currentHeight - getHeight(), -1, -1);
|
emojiPopup.update(this, 0, -currentHeight - getHeight(), -1, -1);
|
||||||
AndroidUtilities.hideKeyboard(messsageEditText);
|
AndroidUtilities.hideKeyboard(messageEditText);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
return;
|
return;
|
||||||
|
@ -1080,7 +1089,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openKeyboard() {
|
public void openKeyboard() {
|
||||||
AndroidUtilities.showKeyboard(messsageEditText);
|
AndroidUtilities.showKeyboard(messageEditText);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDelegate(ChatActivityEnterViewDelegate delegate) {
|
public void setDelegate(ChatActivityEnterViewDelegate delegate) {
|
||||||
|
@ -1088,48 +1097,48 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFieldText(String text) {
|
public void setFieldText(String text) {
|
||||||
if (messsageEditText == null) {
|
if (messageEditText == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ignoreTextChange = true;
|
ignoreTextChange = true;
|
||||||
messsageEditText.setText(text);
|
messageEditText.setText(text);
|
||||||
messsageEditText.setSelection(messsageEditText.getText().length());
|
messageEditText.setSelection(messageEditText.getText().length());
|
||||||
ignoreTextChange = false;
|
ignoreTextChange = false;
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
delegate.onTextChanged(messsageEditText.getText());
|
delegate.onTextChanged(messageEditText.getText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCursorPosition() {
|
public int getCursorPosition() {
|
||||||
if (messsageEditText == null) {
|
if (messageEditText == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return messsageEditText.getSelectionStart();
|
return messageEditText.getSelectionStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void replaceWithText(int start, int len, String text) {
|
public void replaceWithText(int start, int len, String text) {
|
||||||
try {
|
try {
|
||||||
StringBuilder builder = new StringBuilder(messsageEditText.getText());
|
StringBuilder builder = new StringBuilder(messageEditText.getText());
|
||||||
builder.replace(start, start + len, text);
|
builder.replace(start, start + len, text);
|
||||||
messsageEditText.setText(builder);
|
messageEditText.setText(builder);
|
||||||
messsageEditText.setSelection(messsageEditText.length());
|
messageEditText.setSelection(start + text.length());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFieldFocused(boolean focus) {
|
public void setFieldFocused(boolean focus) {
|
||||||
if (messsageEditText == null) {
|
if (messageEditText == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (focus) {
|
if (focus) {
|
||||||
if (!messsageEditText.isFocused()) {
|
if (!messageEditText.isFocused()) {
|
||||||
messsageEditText.postDelayed(new Runnable() {
|
messageEditText.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (messsageEditText != null) {
|
if (messageEditText != null) {
|
||||||
try {
|
try {
|
||||||
messsageEditText.requestFocus();
|
messageEditText.requestFocus();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
|
@ -1138,19 +1147,19 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}, 600);
|
}, 600);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (messsageEditText.isFocused() && !keyboardVisible) {
|
if (messageEditText.isFocused() && !keyboardVisible) {
|
||||||
messsageEditText.clearFocus();
|
messageEditText.clearFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasText() {
|
public boolean hasText() {
|
||||||
return messsageEditText != null && messsageEditText.length() > 0;
|
return messageEditText != null && messageEditText.length() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFieldText() {
|
public String getFieldText() {
|
||||||
if (messsageEditText != null && messsageEditText.length() > 0) {
|
if (messageEditText != null && messageEditText.length() > 0) {
|
||||||
return messsageEditText.getText().toString();
|
return messageEditText.getText().toString();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1176,15 +1185,9 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSizeChanged(int height) {
|
public void onSizeChanged(int height, boolean isWidthGreater) {
|
||||||
WindowManager wm = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE);
|
|
||||||
if (wm == null || wm.getDefaultDisplay() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int rotation = wm.getDefaultDisplay().getRotation();
|
|
||||||
|
|
||||||
if (height > AndroidUtilities.dp(50) && keyboardVisible) {
|
if (height > AndroidUtilities.dp(50) && keyboardVisible) {
|
||||||
if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) {
|
if (isWidthGreater) {
|
||||||
keyboardHeightLand = height;
|
keyboardHeightLand = height;
|
||||||
ApplicationLoader.applicationContext.getSharedPreferences("emoji", 0).edit().putInt("kbd_height_land3", keyboardHeightLand).commit();
|
ApplicationLoader.applicationContext.getSharedPreferences("emoji", 0).edit().putInt("kbd_height_land3", keyboardHeightLand).commit();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1195,12 +1198,13 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
|
|
||||||
if (emojiPopup != null && emojiPopup.isShowing()) {
|
if (emojiPopup != null && emojiPopup.isShowing()) {
|
||||||
int newHeight = 0;
|
int newHeight = 0;
|
||||||
if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) {
|
if (isWidthGreater) {
|
||||||
newHeight = keyboardHeightLand;
|
newHeight = keyboardHeightLand;
|
||||||
} else {
|
} else {
|
||||||
newHeight = keyboardHeight;
|
newHeight = keyboardHeight;
|
||||||
}
|
}
|
||||||
final WindowManager.LayoutParams layoutParams = (WindowManager.LayoutParams) emojiPopup.getContentView().getLayoutParams();
|
final WindowManager.LayoutParams layoutParams = (WindowManager.LayoutParams) emojiPopup.getContentView().getLayoutParams();
|
||||||
|
FileLog.e("tmessages", "update emoji height to = " + newHeight);
|
||||||
if (layoutParams.width != AndroidUtilities.displaySize.x || layoutParams.height != newHeight) {
|
if (layoutParams.width != AndroidUtilities.displaySize.x || layoutParams.height != newHeight) {
|
||||||
/*if (Build.VERSION.SDK_INT >= 21) {
|
/*if (Build.VERSION.SDK_INT >= 21) {
|
||||||
if (!keyboardVisible) {
|
if (!keyboardVisible) {
|
||||||
|
@ -1211,18 +1215,16 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}*/
|
}*/
|
||||||
layoutParams.width = AndroidUtilities.displaySize.x;
|
layoutParams.width = AndroidUtilities.displaySize.x;
|
||||||
layoutParams.height = newHeight;
|
layoutParams.height = newHeight;
|
||||||
|
WindowManager wm = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE);
|
||||||
|
if (wm != null) {
|
||||||
wm.updateViewLayout(emojiPopup.getContentView(), layoutParams);
|
wm.updateViewLayout(emojiPopup.getContentView(), layoutParams);
|
||||||
if (!keyboardVisible) {
|
if (!keyboardVisible) {
|
||||||
sizeNotifierRelativeLayout.post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (sizeNotifierRelativeLayout != null) {
|
if (sizeNotifierRelativeLayout != null) {
|
||||||
sizeNotifierRelativeLayout.setPadding(0, 0, 0, layoutParams.height);
|
sizeNotifierRelativeLayout.setPadding(0, 0, 0, layoutParams.height);
|
||||||
sizeNotifierRelativeLayout.requestLayout();
|
sizeNotifierRelativeLayout.requestLayout();
|
||||||
onWindowSizeChanged(sizeNotifierRelativeLayout.getHeight() - sizeNotifierRelativeLayout.getPaddingBottom());
|
onWindowSizeChanged(sizeNotifierRelativeLayout.getHeight() - sizeNotifierRelativeLayout.getPaddingBottom());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1252,8 +1254,8 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (id == NotificationCenter.closeChats) {
|
} else if (id == NotificationCenter.closeChats) {
|
||||||
if (messsageEditText != null && messsageEditText.isFocused()) {
|
if (messageEditText != null && messageEditText.isFocused()) {
|
||||||
AndroidUtilities.hideKeyboard(messsageEditText);
|
AndroidUtilities.hideKeyboard(messageEditText);
|
||||||
}
|
}
|
||||||
} else if (id == NotificationCenter.recordStartError || id == NotificationCenter.recordStopped) {
|
} else if (id == NotificationCenter.recordStartError || id == NotificationCenter.recordStopped) {
|
||||||
if (recordingAudio) {
|
if (recordingAudio) {
|
||||||
|
@ -1267,7 +1269,7 @@ public class ChatActivityEnterView extends FrameLayoutFixed implements Notificat
|
||||||
}
|
}
|
||||||
} else if (id == NotificationCenter.audioDidSent) {
|
} else if (id == NotificationCenter.audioDidSent) {
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
delegate.onMessageSend();
|
delegate.onMessageSend(null);
|
||||||
}
|
}
|
||||||
} else if (id == NotificationCenter.hideEmojiKeyboard) {
|
} else if (id == NotificationCenter.hideEmojiKeyboard) {
|
||||||
hideEmojiPopup();
|
hideEmojiPopup();
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class SizeNotifierRelativeLayout extends RelativeLayout {
|
||||||
private SizeNotifierRelativeLayoutDelegate delegate;
|
private SizeNotifierRelativeLayoutDelegate delegate;
|
||||||
|
|
||||||
public interface SizeNotifierRelativeLayoutDelegate {
|
public interface SizeNotifierRelativeLayoutDelegate {
|
||||||
void onSizeChanged(int keyboardHeight);
|
void onSizeChanged(int keyboardHeight, boolean isWidthGreater);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SizeNotifierRelativeLayout(Context context) {
|
public SizeNotifierRelativeLayout(Context context) {
|
||||||
|
@ -66,21 +66,24 @@ public class SizeNotifierRelativeLayout extends RelativeLayout {
|
||||||
@SuppressLint("DrawAllocation")
|
@SuppressLint("DrawAllocation")
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
if (changed && delegate != null) {
|
super.onLayout(changed, l, t, r, b);
|
||||||
|
|
||||||
|
if (delegate != null) {
|
||||||
View rootView = this.getRootView();
|
View rootView = this.getRootView();
|
||||||
int usableViewHeight = rootView.getHeight() - AndroidUtilities.statusBarHeight - AndroidUtilities.getViewInset(rootView);
|
int usableViewHeight = rootView.getHeight() - AndroidUtilities.statusBarHeight - AndroidUtilities.getViewInset(rootView);
|
||||||
this.getWindowVisibleDisplayFrame(rect);
|
this.getWindowVisibleDisplayFrame(rect);
|
||||||
keyboardHeight = usableViewHeight - (rect.bottom - rect.top);
|
keyboardHeight = usableViewHeight - (rect.bottom - rect.top);
|
||||||
|
final boolean isWidthGreater = AndroidUtilities.displaySize.x > AndroidUtilities.displaySize.y;
|
||||||
|
FileLog.e("tmessages", "isWidthGreater = " + isWidthGreater + " height = " + keyboardHeight);
|
||||||
post(new Runnable() {
|
post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
delegate.onSizeChanged(keyboardHeight);
|
delegate.onSizeChanged(keyboardHeight, isWidthGreater);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
super.onLayout(changed, l, t, r, b);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -42,7 +42,7 @@ import org.telegram.android.NotificationCenter;
|
||||||
import org.telegram.messenger.R;
|
import org.telegram.messenger.R;
|
||||||
import org.telegram.ui.Adapters.BaseSectionsAdapter;
|
import org.telegram.ui.Adapters.BaseSectionsAdapter;
|
||||||
import org.telegram.ui.Adapters.ContactsAdapter;
|
import org.telegram.ui.Adapters.ContactsAdapter;
|
||||||
import org.telegram.ui.Adapters.ContactsSearchAdapter;
|
import org.telegram.ui.Adapters.SearchAdapter;
|
||||||
import org.telegram.ui.Cells.UserCell;
|
import org.telegram.ui.Cells.UserCell;
|
||||||
import org.telegram.ui.ActionBar.ActionBar;
|
import org.telegram.ui.ActionBar.ActionBar;
|
||||||
import org.telegram.ui.ActionBar.ActionBarMenu;
|
import org.telegram.ui.ActionBar.ActionBarMenu;
|
||||||
|
@ -58,7 +58,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
|
||||||
private BaseSectionsAdapter listViewAdapter;
|
private BaseSectionsAdapter listViewAdapter;
|
||||||
private TextView emptyTextView;
|
private TextView emptyTextView;
|
||||||
private LetterSectionsListView listView;
|
private LetterSectionsListView listView;
|
||||||
private ContactsSearchAdapter searchListViewAdapter;
|
private SearchAdapter searchListViewAdapter;
|
||||||
|
|
||||||
private boolean searchWas;
|
private boolean searchWas;
|
||||||
private boolean searching;
|
private boolean searching;
|
||||||
|
@ -195,7 +195,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
|
||||||
});
|
});
|
||||||
item.getSearchField().setHint(LocaleController.getString("Search", R.string.Search));
|
item.getSearchField().setHint(LocaleController.getString("Search", R.string.Search));
|
||||||
|
|
||||||
searchListViewAdapter = new ContactsSearchAdapter(getParentActivity(), ignoreUsers, allowUsernameSearch);
|
searchListViewAdapter = new SearchAdapter(getParentActivity(), ignoreUsers, allowUsernameSearch);
|
||||||
listViewAdapter = new ContactsAdapter(getParentActivity(), onlyUsers, needPhonebook, ignoreUsers);
|
listViewAdapter = new ContactsAdapter(getParentActivity(), onlyUsers, needPhonebook, ignoreUsers);
|
||||||
|
|
||||||
fragmentView = new FrameLayout(getParentActivity());
|
fragmentView = new FrameLayout(getParentActivity());
|
||||||
|
|
|
@ -49,7 +49,7 @@ import org.telegram.android.MessagesController;
|
||||||
import org.telegram.android.NotificationCenter;
|
import org.telegram.android.NotificationCenter;
|
||||||
import org.telegram.messenger.R;
|
import org.telegram.messenger.R;
|
||||||
import org.telegram.ui.Adapters.ContactsAdapter;
|
import org.telegram.ui.Adapters.ContactsAdapter;
|
||||||
import org.telegram.ui.Adapters.ContactsSearchAdapter;
|
import org.telegram.ui.Adapters.SearchAdapter;
|
||||||
import org.telegram.ui.ActionBar.ActionBar;
|
import org.telegram.ui.ActionBar.ActionBar;
|
||||||
import org.telegram.ui.ActionBar.ActionBarMenu;
|
import org.telegram.ui.ActionBar.ActionBarMenu;
|
||||||
import org.telegram.ui.ActionBar.BaseFragment;
|
import org.telegram.ui.ActionBar.BaseFragment;
|
||||||
|
@ -94,7 +94,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
|
||||||
private TextView emptyTextView;
|
private TextView emptyTextView;
|
||||||
private EditText userSelectEditText;
|
private EditText userSelectEditText;
|
||||||
private LetterSectionsListView listView;
|
private LetterSectionsListView listView;
|
||||||
private ContactsSearchAdapter searchListViewAdapter;
|
private SearchAdapter searchListViewAdapter;
|
||||||
|
|
||||||
private GroupCreateActivityDelegate delegate;
|
private GroupCreateActivityDelegate delegate;
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
|
||||||
ActionBarMenu menu = actionBar.createMenu();
|
ActionBarMenu menu = actionBar.createMenu();
|
||||||
menu.addItemWithWidth(done_button, R.drawable.ic_done, AndroidUtilities.dp(56));
|
menu.addItemWithWidth(done_button, R.drawable.ic_done, AndroidUtilities.dp(56));
|
||||||
|
|
||||||
searchListViewAdapter = new ContactsSearchAdapter(getParentActivity(), null, false);
|
searchListViewAdapter = new SearchAdapter(getParentActivity(), null, false);
|
||||||
searchListViewAdapter.setCheckedMap(selectedContacts);
|
searchListViewAdapter.setCheckedMap(selectedContacts);
|
||||||
searchListViewAdapter.setUseUserCell(true);
|
searchListViewAdapter.setUseUserCell(true);
|
||||||
listViewAdapter = new ContactsAdapter(getParentActivity(), true, false, null);
|
listViewAdapter = new ContactsAdapter(getParentActivity(), true, false, null);
|
||||||
|
|
|
@ -236,7 +236,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||||
layersActionBarLayout.setBackgroundResource(R.drawable.boxshadow);
|
layersActionBarLayout.setBackgroundResource(R.drawable.boxshadow);
|
||||||
launchLayout.addView(layersActionBarLayout);
|
launchLayout.addView(layersActionBarLayout);
|
||||||
relativeLayoutParams = (RelativeLayout.LayoutParams)layersActionBarLayout.getLayoutParams();
|
relativeLayoutParams = (RelativeLayout.LayoutParams)layersActionBarLayout.getLayoutParams();
|
||||||
relativeLayoutParams.width = AndroidUtilities.dp(498);
|
relativeLayoutParams.width = AndroidUtilities.dp(530);
|
||||||
relativeLayoutParams.height = AndroidUtilities.dp(528);
|
relativeLayoutParams.height = AndroidUtilities.dp(528);
|
||||||
layersActionBarLayout.setLayoutParams(relativeLayoutParams);
|
layersActionBarLayout.setLayoutParams(relativeLayoutParams);
|
||||||
layersActionBarLayout.init(layerFragmentsStack);
|
layersActionBarLayout.init(layerFragmentsStack);
|
||||||
|
@ -843,17 +843,21 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||||
PhotoViewer.getInstance().closePhoto(false, true);
|
PhotoViewer.getInstance().closePhoto(false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drawerLayoutContainer.setAllowOpenDrawer(false, false);
|
||||||
if (AndroidUtilities.isTablet()) {
|
if (AndroidUtilities.isTablet()) {
|
||||||
actionBarLayout.showLastFragment();
|
actionBarLayout.showLastFragment();
|
||||||
rightActionBarLayout.showLastFragment();
|
rightActionBarLayout.showLastFragment();
|
||||||
|
} else {
|
||||||
|
drawerLayoutContainer.setAllowOpenDrawer(true, false);
|
||||||
}
|
}
|
||||||
drawerLayoutContainer.setAllowOpenDrawer(false, false);
|
|
||||||
} else if (open_settings != 0) {
|
} else if (open_settings != 0) {
|
||||||
actionBarLayout.presentFragment(new SettingsActivity(), false, true, true);
|
actionBarLayout.presentFragment(new SettingsActivity(), false, true, true);
|
||||||
drawerLayoutContainer.setAllowOpenDrawer(false, false);
|
|
||||||
if (AndroidUtilities.isTablet()) {
|
if (AndroidUtilities.isTablet()) {
|
||||||
actionBarLayout.showLastFragment();
|
actionBarLayout.showLastFragment();
|
||||||
rightActionBarLayout.showLastFragment();
|
rightActionBarLayout.showLastFragment();
|
||||||
|
drawerLayoutContainer.setAllowOpenDrawer(false, false);
|
||||||
|
} else {
|
||||||
|
drawerLayoutContainer.setAllowOpenDrawer(true, false);
|
||||||
}
|
}
|
||||||
pushOpened = true;
|
pushOpened = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -817,6 +817,12 @@ public class LoginActivity extends BaseFragment {
|
||||||
|
|
||||||
final Bundle params = new Bundle();
|
final Bundle params = new Bundle();
|
||||||
params.putString("phone", "+" + codeField.getText() + phoneField.getText());
|
params.putString("phone", "+" + codeField.getText() + phoneField.getText());
|
||||||
|
try {
|
||||||
|
params.putString("ephone", "+" + PhoneFormat.stripExceptNumbers(codeField.getText().toString()) + " " + PhoneFormat.stripExceptNumbers(phoneField.getText().toString()));
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
params.putString("ephone", "+" + phone);
|
||||||
|
}
|
||||||
params.putString("phoneFormated", phone);
|
params.putString("phoneFormated", phone);
|
||||||
nextPressed = true;
|
nextPressed = true;
|
||||||
needShowProgress();
|
needShowProgress();
|
||||||
|
@ -897,6 +903,7 @@ public class LoginActivity extends BaseFragment {
|
||||||
|
|
||||||
private String phoneHash;
|
private String phoneHash;
|
||||||
private String requestPhone;
|
private String requestPhone;
|
||||||
|
private String emailPhone;
|
||||||
private EditText codeField;
|
private EditText codeField;
|
||||||
private TextView confirmTextView;
|
private TextView confirmTextView;
|
||||||
private TextView timeText;
|
private TextView timeText;
|
||||||
|
@ -1004,8 +1011,8 @@ public class LoginActivity extends BaseFragment {
|
||||||
|
|
||||||
Intent mailer = new Intent(Intent.ACTION_SEND);
|
Intent mailer = new Intent(Intent.ACTION_SEND);
|
||||||
mailer.setType("message/rfc822");
|
mailer.setType("message/rfc822");
|
||||||
mailer.putExtra(Intent.EXTRA_EMAIL, new String[]{"sms@telegram.org"});
|
mailer.putExtra(Intent.EXTRA_EMAIL, new String[]{"sms@stel.com"});
|
||||||
mailer.putExtra(Intent.EXTRA_SUBJECT, "Android registration/login issue " + version + " " + requestPhone);
|
mailer.putExtra(Intent.EXTRA_SUBJECT, "Android registration/login issue " + version + " " + emailPhone);
|
||||||
mailer.putExtra(Intent.EXTRA_TEXT, "Phone: " + requestPhone + "\nApp version: " + version + "\nOS version: SDK " + Build.VERSION.SDK_INT + "\nDevice Name: " + Build.MANUFACTURER + Build.MODEL + "\nLocale: " + Locale.getDefault() + "\nError: " + lastError);
|
mailer.putExtra(Intent.EXTRA_TEXT, "Phone: " + requestPhone + "\nApp version: " + version + "\nOS version: SDK " + Build.VERSION.SDK_INT + "\nDevice Name: " + Build.MANUFACTURER + Build.MODEL + "\nLocale: " + Locale.getDefault() + "\nError: " + lastError);
|
||||||
getContext().startActivity(Intent.createChooser(mailer, "Send email..."));
|
getContext().startActivity(Intent.createChooser(mailer, "Send email..."));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -1063,6 +1070,7 @@ public class LoginActivity extends BaseFragment {
|
||||||
currentParams = params;
|
currentParams = params;
|
||||||
waitingForSms = true;
|
waitingForSms = true;
|
||||||
String phone = params.getString("phone");
|
String phone = params.getString("phone");
|
||||||
|
emailPhone = params.getString("ephone");
|
||||||
requestPhone = params.getString("phoneFormated");
|
requestPhone = params.getString("phoneFormated");
|
||||||
phoneHash = params.getString("phoneHash");
|
phoneHash = params.getString("phoneHash");
|
||||||
time = params.getInt("calltime");
|
time = params.getInt("calltime");
|
||||||
|
|
|
@ -382,7 +382,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
|
||||||
}
|
}
|
||||||
long dialog_id = 0;
|
long dialog_id = 0;
|
||||||
int message_id = 0;
|
int message_id = 0;
|
||||||
BaseFragmentAdapter adapter = (BaseFragmentAdapter)messagesListView.getAdapter();
|
BaseFragmentAdapter adapter = (BaseFragmentAdapter) messagesListView.getAdapter();
|
||||||
if (adapter == dialogsAdapter) {
|
if (adapter == dialogsAdapter) {
|
||||||
TLRPC.TL_dialog dialog = dialogsAdapter.getItem(i);
|
TLRPC.TL_dialog dialog = dialogsAdapter.getItem(i);
|
||||||
if (dialog == null) {
|
if (dialog == null) {
|
||||||
|
@ -411,6 +411,9 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
|
||||||
MessageObject messageObject = (MessageObject)obj;
|
MessageObject messageObject = (MessageObject)obj;
|
||||||
dialog_id = messageObject.getDialogId();
|
dialog_id = messageObject.getDialogId();
|
||||||
message_id = messageObject.getId();
|
message_id = messageObject.getId();
|
||||||
|
dialogsSearchAdapter.addHashtagsFromMessage(dialogsSearchAdapter.getLastSearchString());
|
||||||
|
} else if (obj instanceof String) {
|
||||||
|
actionBar.openSearchField((String) obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,6 +470,26 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
|
public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
if (onlySelect || searching && searchWas || getParentActivity() == null) {
|
if (onlySelect || searching && searchWas || getParentActivity() == null) {
|
||||||
|
if (searchWas && searching) {
|
||||||
|
BaseFragmentAdapter adapter = (BaseFragmentAdapter) messagesListView.getAdapter();
|
||||||
|
if (adapter == dialogsSearchAdapter) {
|
||||||
|
Object item = adapter.getItem(i);
|
||||||
|
if (item instanceof String) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||||
|
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||||
|
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
|
||||||
|
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
dialogsSearchAdapter.clearRecentHashtags();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||||
|
showAlertDialog(builder);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TLRPC.TL_dialog dialog;
|
TLRPC.TL_dialog dialog;
|
||||||
|
|
|
@ -77,6 +77,7 @@ public class NotificationsSettingsActivity extends BaseFragment implements Notif
|
||||||
private int inappSoundRow;
|
private int inappSoundRow;
|
||||||
private int inappVibrateRow;
|
private int inappVibrateRow;
|
||||||
private int inappPreviewRow;
|
private int inappPreviewRow;
|
||||||
|
private int inchatSoundRow;
|
||||||
private int inappPriorityRow;
|
private int inappPriorityRow;
|
||||||
private int eventsSectionRow2;
|
private int eventsSectionRow2;
|
||||||
private int eventsSectionRow;
|
private int eventsSectionRow;
|
||||||
|
@ -125,6 +126,7 @@ public class NotificationsSettingsActivity extends BaseFragment implements Notif
|
||||||
inappSoundRow = rowCount++;
|
inappSoundRow = rowCount++;
|
||||||
inappVibrateRow = rowCount++;
|
inappVibrateRow = rowCount++;
|
||||||
inappPreviewRow = rowCount++;
|
inappPreviewRow = rowCount++;
|
||||||
|
inchatSoundRow = rowCount++;
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
inappPriorityRow = rowCount++;
|
inappPriorityRow = rowCount++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -295,6 +297,13 @@ public class NotificationsSettingsActivity extends BaseFragment implements Notif
|
||||||
enabled = preferences.getBoolean("EnableInAppPreview", true);
|
enabled = preferences.getBoolean("EnableInAppPreview", true);
|
||||||
editor.putBoolean("EnableInAppPreview", !enabled);
|
editor.putBoolean("EnableInAppPreview", !enabled);
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
} else if (i == inchatSoundRow) {
|
||||||
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
enabled = preferences.getBoolean("EnableInChatSound", true);
|
||||||
|
editor.putBoolean("EnableInChatSound", !enabled);
|
||||||
|
editor.commit();
|
||||||
|
NotificationsController.getInstance().setInChatSoundEnabled(!enabled);
|
||||||
} else if (i == inappPriorityRow) {
|
} else if (i == inappPriorityRow) {
|
||||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
@ -696,6 +705,8 @@ public class NotificationsSettingsActivity extends BaseFragment implements Notif
|
||||||
checkCell.setTextAndCheck(LocaleController.getString("NotificationsService", R.string.NotificationsService), preferences.getBoolean("pushService", true), false);
|
checkCell.setTextAndCheck(LocaleController.getString("NotificationsService", R.string.NotificationsService), preferences.getBoolean("pushService", true), false);
|
||||||
} else if (i == badgeNumberRow) {
|
} else if (i == badgeNumberRow) {
|
||||||
checkCell.setTextAndCheck(LocaleController.getString("BadgeNumber", R.string.BadgeNumber), preferences.getBoolean("badgeNumber", true), true);
|
checkCell.setTextAndCheck(LocaleController.getString("BadgeNumber", R.string.BadgeNumber), preferences.getBoolean("badgeNumber", true), true);
|
||||||
|
} else if (i == inchatSoundRow) {
|
||||||
|
checkCell.setTextAndCheck(LocaleController.getString("InChatSound", R.string.InChatSound), preferences.getBoolean("EnableInChatSound", true), true);
|
||||||
}
|
}
|
||||||
} else if (type == 2) {
|
} else if (type == 2) {
|
||||||
if (view == null) {
|
if (view == null) {
|
||||||
|
@ -814,7 +825,8 @@ public class NotificationsSettingsActivity extends BaseFragment implements Notif
|
||||||
} else if (i == messageAlertRow || i == messagePreviewRow || i == groupAlertRow ||
|
} else if (i == messageAlertRow || i == messagePreviewRow || i == groupAlertRow ||
|
||||||
i == groupPreviewRow || i == inappSoundRow || i == inappVibrateRow ||
|
i == groupPreviewRow || i == inappSoundRow || i == inappVibrateRow ||
|
||||||
i == inappPreviewRow || i == contactJoinedRow || i == pebbleAlertRow ||
|
i == inappPreviewRow || i == contactJoinedRow || i == pebbleAlertRow ||
|
||||||
i == notificationsServiceRow || i == badgeNumberRow || i == inappPriorityRow) {
|
i == notificationsServiceRow || i == badgeNumberRow || i == inappPriorityRow ||
|
||||||
|
i == inchatSoundRow) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (i == messageLedRow || i == groupLedRow) {
|
} else if (i == messageLedRow || i == groupLedRow) {
|
||||||
return 3;
|
return 3;
|
||||||
|
|
|
@ -357,7 +357,7 @@ public class PhotoAlbumPickerActivity extends BaseFragment implements Notificati
|
||||||
WindowManager manager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE);
|
WindowManager manager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE);
|
||||||
int rotation = manager.getDefaultDisplay().getRotation();
|
int rotation = manager.getDefaultDisplay().getRotation();
|
||||||
columnsCount = 2;
|
columnsCount = 2;
|
||||||
if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) {
|
if (!AndroidUtilities.isTablet() && (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90)) {
|
||||||
columnsCount = 4;
|
columnsCount = 4;
|
||||||
}
|
}
|
||||||
listAdapter.notifyDataSetChanged();
|
listAdapter.notifyDataSetChanged();
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
package org.telegram.ui;
|
package org.telegram.ui;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
@ -282,6 +284,33 @@ public class PhotoPickerActivity extends BaseFragment implements NotificationCen
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (selectedAlbum == null) {
|
||||||
|
listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
if (searchResult.isEmpty() && lastSearchString == null) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||||
|
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||||
|
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
|
||||||
|
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
recentImages.clear();
|
||||||
|
if (listAdapter != null) {
|
||||||
|
listAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
MessagesStorage.getInstance().clearWebRecent(type);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||||
|
showAlertDialog(builder);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
emptyView = new TextView(getParentActivity());
|
emptyView = new TextView(getParentActivity());
|
||||||
emptyView.setTextColor(0xff808080);
|
emptyView.setTextColor(0xff808080);
|
||||||
emptyView.setTextSize(20);
|
emptyView.setTextSize(20);
|
||||||
|
|
|
@ -518,7 +518,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
||||||
imagesArrLocationsSizes.clear();
|
imagesArrLocationsSizes.clear();
|
||||||
avatarsArr.clear();
|
avatarsArr.clear();
|
||||||
for (TLRPC.Photo photo : photos) {
|
for (TLRPC.Photo photo : photos) {
|
||||||
if (photo instanceof TLRPC.TL_photoEmpty || photo.sizes == null) {
|
if (photo == null || photo instanceof TLRPC.TL_photoEmpty || photo.sizes == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
TLRPC.PhotoSize sizeFull = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 640);
|
TLRPC.PhotoSize sizeFull = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 640);
|
||||||
|
|
|
@ -194,7 +194,7 @@ public class PopupNotificationActivity extends Activity implements NotificationC
|
||||||
chatActivityEnterView.setLayoutParams(layoutParams3);
|
chatActivityEnterView.setLayoutParams(layoutParams3);
|
||||||
chatActivityEnterView.setDelegate(new ChatActivityEnterView.ChatActivityEnterViewDelegate() {
|
chatActivityEnterView.setDelegate(new ChatActivityEnterView.ChatActivityEnterViewDelegate() {
|
||||||
@Override
|
@Override
|
||||||
public void onMessageSend() {
|
public void onMessageSend(String message) {
|
||||||
if (currentMessageObject == null) {
|
if (currentMessageObject == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -718,9 +718,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
int avatarY = AndroidUtilities.dp(22) - (int)((AndroidUtilities.dp(22) - (AndroidUtilities.getCurrentActionBarHeight() - AndroidUtilities.dp(42)) / 2) * (1.0f - diff));
|
int avatarY = AndroidUtilities.dp(22) - (int)((AndroidUtilities.dp(22) - (AndroidUtilities.getCurrentActionBarHeight() - AndroidUtilities.dp(42)) / 2) * (1.0f - diff));
|
||||||
int nameX = 97 + (int)(21 * diffm);
|
int nameX = 97 + (int)(21 * diffm);
|
||||||
int nameEndX = 16 + (int)(32 * diffm);
|
int nameEndX = 16 + (int)(32 * diffm);
|
||||||
float nameFontSize = 20 - 2 * diffm;
|
|
||||||
int nameY = avatarY + AndroidUtilities.dp(29 - 10 * diffm);
|
int nameY = avatarY + AndroidUtilities.dp(29 - 10 * diffm);
|
||||||
int statusY = avatarY + AndroidUtilities.dp(8 - 7 * diffm);
|
int statusY = avatarY + AndroidUtilities.dp(8 - 7 * diffm);
|
||||||
|
float scale = 1.0f - 0.12f * diffm;
|
||||||
|
|
||||||
if (writeButton != null) {
|
if (writeButton != null) {
|
||||||
layoutParams = (FrameLayout.LayoutParams) writeButton.getLayoutParams();
|
layoutParams = (FrameLayout.LayoutParams) writeButton.getLayoutParams();
|
||||||
|
@ -742,7 +742,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
layoutParams.bottomMargin = avatarY;
|
layoutParams.bottomMargin = avatarY;
|
||||||
avatarImage.setLayoutParams(layoutParams);
|
avatarImage.setLayoutParams(layoutParams);
|
||||||
|
|
||||||
nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, nameFontSize);
|
ViewProxy.setPivotX(nameTextView, 0);
|
||||||
|
ViewProxy.setPivotY(nameTextView, 0);
|
||||||
|
ViewProxy.setScaleX(nameTextView, scale);
|
||||||
|
ViewProxy.setScaleY(nameTextView, scale);
|
||||||
layoutParams = (FrameLayout.LayoutParams) nameTextView.getLayoutParams();
|
layoutParams = (FrameLayout.LayoutParams) nameTextView.getLayoutParams();
|
||||||
layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? nameEndX : nameX);
|
layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? nameEndX : nameX);
|
||||||
layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? nameX : nameEndX);
|
layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? nameX : nameEndX);
|
||||||
|
|
|
@ -914,9 +914,9 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
|
||||||
int avatarY = AndroidUtilities.dp(22) - (int)((AndroidUtilities.dp(22) - (AndroidUtilities.getCurrentActionBarHeight() - AndroidUtilities.dp(42)) / 2) * (1.0f - diff));
|
int avatarY = AndroidUtilities.dp(22) - (int)((AndroidUtilities.dp(22) - (AndroidUtilities.getCurrentActionBarHeight() - AndroidUtilities.dp(42)) / 2) * (1.0f - diff));
|
||||||
int nameX = 97 + (int)(21 * diffm);
|
int nameX = 97 + (int)(21 * diffm);
|
||||||
int nameEndX = 16 + (int)(32 * diffm);
|
int nameEndX = 16 + (int)(32 * diffm);
|
||||||
float nameFontSize = 20 - 2 * diffm;
|
int nameY = avatarY + AndroidUtilities.dp(29 - 13 * diffm);
|
||||||
int nameY = avatarY + AndroidUtilities.dp(29 - 10 * diffm);
|
|
||||||
int statusY = avatarY + AndroidUtilities.dp(8 - 7 * diffm);
|
int statusY = avatarY + AndroidUtilities.dp(8 - 7 * diffm);
|
||||||
|
float scale = 1.0f - 0.12f * diffm;
|
||||||
|
|
||||||
layoutParams = (FrameLayout.LayoutParams) writeButton.getLayoutParams();
|
layoutParams = (FrameLayout.LayoutParams) writeButton.getLayoutParams();
|
||||||
layoutParams.topMargin = (actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0) + AndroidUtilities.getCurrentActionBarHeight() + actionBar.getExtraHeight() - AndroidUtilities.dp(29.5f);
|
layoutParams.topMargin = (actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0) + AndroidUtilities.getCurrentActionBarHeight() + actionBar.getExtraHeight() - AndroidUtilities.dp(29.5f);
|
||||||
|
@ -936,7 +936,10 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
|
||||||
layoutParams.bottomMargin = avatarY;
|
layoutParams.bottomMargin = avatarY;
|
||||||
avatarImage.setLayoutParams(layoutParams);
|
avatarImage.setLayoutParams(layoutParams);
|
||||||
|
|
||||||
nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, nameFontSize);
|
ViewProxy.setPivotX(nameTextView, 0);
|
||||||
|
ViewProxy.setPivotY(nameTextView, 0);
|
||||||
|
ViewProxy.setScaleX(nameTextView, scale);
|
||||||
|
ViewProxy.setScaleY(nameTextView, scale);
|
||||||
layoutParams = (FrameLayout.LayoutParams) nameTextView.getLayoutParams();
|
layoutParams = (FrameLayout.LayoutParams) nameTextView.getLayoutParams();
|
||||||
layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? nameEndX : nameX);
|
layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? nameEndX : nameX);
|
||||||
layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? nameX : nameEndX);
|
layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? nameX : nameEndX);
|
||||||
|
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 4.7 KiB |
BIN
TMessagesProj/src/main/res/raw/sound_out.wav
Normal file
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">إزالة كتم الصوت</string>
|
<string name="UnmuteNotifications">إزالة كتم الصوت</string>
|
||||||
<string name="WillUnmuteIn">خلال %1$s</string>
|
<string name="WillUnmuteIn">خلال %1$s</string>
|
||||||
<string name="MuteDisable">تعطيل</string>
|
<string name="MuteDisable">تعطيل</string>
|
||||||
|
<string name="Hashtags">الأوسمة</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">رسالة جماعية جديدة</string>
|
<string name="NewBroadcastList">رسالة جماعية جديدة</string>
|
||||||
<string name="EnterListName">أدخل اسم القائمة</string>
|
<string name="EnterListName">أدخل اسم القائمة</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">تعطيل</string>
|
<string name="VibrationDisabled">تعطيل</string>
|
||||||
<string name="LedDisabled">تعطيل</string>
|
<string name="LedDisabled">تعطيل</string>
|
||||||
<string name="RepeatDisabled">إيقاف</string>
|
<string name="RepeatDisabled">إيقاف</string>
|
||||||
|
<string name="InChatSound">الأصوات داخل المحادثات</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">رمز المرور</string>
|
<string name="Passcode">رمز المرور</string>
|
||||||
<string name="ChangePasscode">غيًر رمز المرور</string>
|
<string name="ChangePasscode">غيًر رمز المرور</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">هل أنت متأكد من رغبتك في حذف هذه الصورة؟</string>
|
<string name="AreYouSureDeletePhoto">هل أنت متأكد من رغبتك في حذف هذه الصورة؟</string>
|
||||||
<string name="AreYouSureDeleteVideo">هل أنت متأكد من رغبتك في حذف هذا المقطع المرئي؟</string>
|
<string name="AreYouSureDeleteVideo">هل أنت متأكد من رغبتك في حذف هذا المقطع المرئي؟</string>
|
||||||
<string name="DiscardChanges">تجاهل التغييرات؟</string>
|
<string name="DiscardChanges">تجاهل التغييرات؟</string>
|
||||||
|
<string name="ClearSearch">هل ترغب في مسح سجل البحث؟</string>
|
||||||
|
<string name="ClearButton">مسح</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">اسم العائلة غير صحيح</string>
|
<string name="InvalidLastName">اسم العائلة غير صحيح</string>
|
||||||
<string name="Loading">جاري التحميل ...</string>
|
<string name="Loading">جاري التحميل ...</string>
|
||||||
<string name="NoPlayerInstalled">ليس لديك أي مشغل مقاطع مرئية، يرجى تنزيل أية مشغل</string>
|
<string name="NoPlayerInstalled">ليس لديك أي مشغل مقاطع مرئية، يرجى تنزيل أية مشغل</string>
|
||||||
<string name="NoMailInstalled">يرجى إرسال رسالة بواسطة البريد الإلكتروني إلى sms@telegram.org لتخبرنا عن مشكلتك.</string>
|
<string name="NoMailInstalled">يرجى إرسال رسالة بواسطة البريد الإلكتروني إلى sms@stel.com لتخبرنا عن مشكلتك.</string>
|
||||||
<string name="NoHandleAppInstalled">لا يوجد لديك تطبيق يمكنه فتح \'%1$s\'، يرجى تنزيل تطبيق مناسب للإستمرار</string>
|
<string name="NoHandleAppInstalled">لا يوجد لديك تطبيق يمكنه فتح \'%1$s\'، يرجى تنزيل تطبيق مناسب للإستمرار</string>
|
||||||
<string name="InviteUser">هذا المستخدم ليس لديه تيليجرام بعد ، هل ترغب في دعوته الآن؟</string>
|
<string name="InviteUser">هذا المستخدم ليس لديه تيليجرام بعد ، هل ترغب في دعوته الآن؟</string>
|
||||||
<string name="AreYouSure">هل أنت متأكد؟</string>
|
<string name="AreYouSure">هل أنت متأكد؟</string>
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">Stumm aus</string>
|
<string name="UnmuteNotifications">Stumm aus</string>
|
||||||
<string name="WillUnmuteIn">In %1$s</string>
|
<string name="WillUnmuteIn">In %1$s</string>
|
||||||
<string name="MuteDisable">Stumm aus</string>
|
<string name="MuteDisable">Stumm aus</string>
|
||||||
|
<string name="Hashtags">HASHTAGS</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">Neue Broadcast Liste</string>
|
<string name="NewBroadcastList">Neue Broadcast Liste</string>
|
||||||
<string name="EnterListName">Listenname</string>
|
<string name="EnterListName">Listenname</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">Deaktiviert</string>
|
<string name="VibrationDisabled">Deaktiviert</string>
|
||||||
<string name="LedDisabled">Deaktiviert</string>
|
<string name="LedDisabled">Deaktiviert</string>
|
||||||
<string name="RepeatDisabled">Aus</string>
|
<string name="RepeatDisabled">Aus</string>
|
||||||
|
<string name="InChatSound">In-Chat Töne</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">Pincode</string>
|
<string name="Passcode">Pincode</string>
|
||||||
<string name="ChangePasscode">Pincode ändern</string>
|
<string name="ChangePasscode">Pincode ändern</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">Möchtest du wirklich dieses Bild löschen?</string>
|
<string name="AreYouSureDeletePhoto">Möchtest du wirklich dieses Bild löschen?</string>
|
||||||
<string name="AreYouSureDeleteVideo">Möchtest du wirklich dieses Video löschen?</string>
|
<string name="AreYouSureDeleteVideo">Möchtest du wirklich dieses Video löschen?</string>
|
||||||
<string name="DiscardChanges">Änderungen verwerfen?</string>
|
<string name="DiscardChanges">Änderungen verwerfen?</string>
|
||||||
|
<string name="ClearSearch">Suchverlauf löschen?</string>
|
||||||
|
<string name="ClearButton">Löschen</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">Ungültiger Nachname</string>
|
<string name="InvalidLastName">Ungültiger Nachname</string>
|
||||||
<string name="Loading">Lädt…</string>
|
<string name="Loading">Lädt…</string>
|
||||||
<string name="NoPlayerInstalled">Du hast keinen Videoplayer. Bitte installiere einen um fortzufahren.</string>
|
<string name="NoPlayerInstalled">Du hast keinen Videoplayer. Bitte installiere einen um fortzufahren.</string>
|
||||||
<string name="NoMailInstalled">Bitte sende uns eine Email an sms@telegram.org mit einer Beschreibung des Problems.</string>
|
<string name="NoMailInstalled">Bitte sende eine Email an sms@stel.com mit einer Beschreibung des Problems.</string>
|
||||||
<string name="NoHandleAppInstalled">Du hast keine Applikationen, die den Dateityp \'%1$s\' öffnen könnten. Bitte installiere eine entsprechende Anwendung um fortzufahren.</string>
|
<string name="NoHandleAppInstalled">Du hast keine Applikationen, die den Dateityp \'%1$s\' öffnen könnten. Bitte installiere eine entsprechende Anwendung um fortzufahren.</string>
|
||||||
<string name="InviteUser">Dieser Benutzer hat noch kein Telegram. Möchtest du ihn einladen?</string>
|
<string name="InviteUser">Dieser Benutzer hat noch kein Telegram. Möchtest du ihn einladen?</string>
|
||||||
<string name="AreYouSure">Bist du sicher?</string>
|
<string name="AreYouSure">Bist du sicher?</string>
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">No silenciar</string>
|
<string name="UnmuteNotifications">No silenciar</string>
|
||||||
<string name="WillUnmuteIn">En %1$s</string>
|
<string name="WillUnmuteIn">En %1$s</string>
|
||||||
<string name="MuteDisable">Desactivar</string>
|
<string name="MuteDisable">Desactivar</string>
|
||||||
|
<string name="Hashtags">HASHTAGS</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">Nueva difusión</string>
|
<string name="NewBroadcastList">Nueva difusión</string>
|
||||||
<string name="EnterListName">Nombre de la lista</string>
|
<string name="EnterListName">Nombre de la lista</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">Desactivadas</string>
|
<string name="VibrationDisabled">Desactivadas</string>
|
||||||
<string name="LedDisabled">Desactivado</string>
|
<string name="LedDisabled">Desactivado</string>
|
||||||
<string name="RepeatDisabled">Apagado</string>
|
<string name="RepeatDisabled">Apagado</string>
|
||||||
|
<string name="InChatSound">Sonidos en el chat</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">Código de acceso</string>
|
<string name="Passcode">Código de acceso</string>
|
||||||
<string name="ChangePasscode">Cambiar código de acceso</string>
|
<string name="ChangePasscode">Cambiar código de acceso</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">¿Quieres eliminar esta foto?</string>
|
<string name="AreYouSureDeletePhoto">¿Quieres eliminar esta foto?</string>
|
||||||
<string name="AreYouSureDeleteVideo">¿Quieres eliminar este vídeo?</string>
|
<string name="AreYouSureDeleteVideo">¿Quieres eliminar este vídeo?</string>
|
||||||
<string name="DiscardChanges">¿Descartar cambios?</string>
|
<string name="DiscardChanges">¿Descartar cambios?</string>
|
||||||
|
<string name="ClearSearch">¿Quieres borrar el historial de búsqueda?</string>
|
||||||
|
<string name="ClearButton">Borrar</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">Apellidos inválidos</string>
|
<string name="InvalidLastName">Apellidos inválidos</string>
|
||||||
<string name="Loading">Cargando...</string>
|
<string name="Loading">Cargando...</string>
|
||||||
<string name="NoPlayerInstalled">No tienes reproductor de vídeo. Por favor, instala uno para continuar.</string>
|
<string name="NoPlayerInstalled">No tienes reproductor de vídeo. Por favor, instala uno para continuar.</string>
|
||||||
<string name="NoMailInstalled">Por favor, envíanos un correo electrónico a sms@telegram.org y cuéntanos tu problema.</string>
|
<string name="NoMailInstalled">Por favor, envía un correo electrónico a sms@stel.com y cuéntanos tu problema.</string>
|
||||||
<string name="NoHandleAppInstalled">No tienes aplicaciones que puedan manejar el tipo de archivo \'%1$s\'. Por favor, instala una para continuar.</string>
|
<string name="NoHandleAppInstalled">No tienes aplicaciones que puedan manejar el tipo de archivo \'%1$s\'. Por favor, instala una para continuar.</string>
|
||||||
<string name="InviteUser">Este usuario no tiene Telegram aún. ¿Enviarle una invitación?</string>
|
<string name="InviteUser">Este usuario no tiene Telegram aún. ¿Enviarle una invitación?</string>
|
||||||
<string name="AreYouSure">¿Quieres hacerlo?</string>
|
<string name="AreYouSure">¿Quieres hacerlo?</string>
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">Suona</string>
|
<string name="UnmuteNotifications">Suona</string>
|
||||||
<string name="WillUnmuteIn">Tra %1$s</string>
|
<string name="WillUnmuteIn">Tra %1$s</string>
|
||||||
<string name="MuteDisable">Disabilita</string>
|
<string name="MuteDisable">Disabilita</string>
|
||||||
|
<string name="Hashtags">HASHTAG</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">Nuova lista broadcast</string>
|
<string name="NewBroadcastList">Nuova lista broadcast</string>
|
||||||
<string name="EnterListName">Immetti il nome della lista</string>
|
<string name="EnterListName">Immetti il nome della lista</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">Disabilitata</string>
|
<string name="VibrationDisabled">Disabilitata</string>
|
||||||
<string name="LedDisabled">Disabilitato</string>
|
<string name="LedDisabled">Disabilitato</string>
|
||||||
<string name="RepeatDisabled">No</string>
|
<string name="RepeatDisabled">No</string>
|
||||||
|
<string name="InChatSound">Suoni in-chat</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">Codice</string>
|
<string name="Passcode">Codice</string>
|
||||||
<string name="ChangePasscode">Cambia codice</string>
|
<string name="ChangePasscode">Cambia codice</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">Sei sicuro di voler eliminare questa foto?</string>
|
<string name="AreYouSureDeletePhoto">Sei sicuro di voler eliminare questa foto?</string>
|
||||||
<string name="AreYouSureDeleteVideo">Sei sicuro di voler eliminare questo video?</string>
|
<string name="AreYouSureDeleteVideo">Sei sicuro di voler eliminare questo video?</string>
|
||||||
<string name="DiscardChanges">Annullare le modifiche?</string>
|
<string name="DiscardChanges">Annullare le modifiche?</string>
|
||||||
|
<string name="ClearSearch">Cancellare la cronologia di ricerca?</string>
|
||||||
|
<string name="ClearButton">Pulisci</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">Cognome non valido</string>
|
<string name="InvalidLastName">Cognome non valido</string>
|
||||||
<string name="Loading">Caricamento…</string>
|
<string name="Loading">Caricamento…</string>
|
||||||
<string name="NoPlayerInstalled">Non hai un lettore video, per favore installane uno per continuare</string>
|
<string name="NoPlayerInstalled">Non hai un lettore video, per favore installane uno per continuare</string>
|
||||||
<string name="NoMailInstalled">Invia un’email a sms@telegram.org spiegandoci il problema.</string>
|
<string name="NoMailInstalled">Invia un’email a sms@stel.com spiegandoci il problema.</string>
|
||||||
<string name="NoHandleAppInstalled">Non hai nessuna applicazione che può gestire il tipo di file \'%1$s\': installane una per proseguire</string>
|
<string name="NoHandleAppInstalled">Non hai nessuna applicazione che può gestire il tipo di file \'%1$s\': installane una per proseguire</string>
|
||||||
<string name="InviteUser">Questo utente non ha ancora Telegram, vuoi invitarlo?</string>
|
<string name="InviteUser">Questo utente non ha ancora Telegram, vuoi invitarlo?</string>
|
||||||
<string name="AreYouSure">Sei sicuro?</string>
|
<string name="AreYouSure">Sei sicuro?</string>
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">음소거 해제</string>
|
<string name="UnmuteNotifications">음소거 해제</string>
|
||||||
<string name="WillUnmuteIn">%1$s 후</string>
|
<string name="WillUnmuteIn">%1$s 후</string>
|
||||||
<string name="MuteDisable">비활성화</string>
|
<string name="MuteDisable">비활성화</string>
|
||||||
|
<string name="Hashtags">해시태그</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">새 단체 메시지 리스트</string>
|
<string name="NewBroadcastList">새 단체 메시지 리스트</string>
|
||||||
<string name="EnterListName">리스트 이름을 입력하세요</string>
|
<string name="EnterListName">리스트 이름을 입력하세요</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">비활성화됨</string>
|
<string name="VibrationDisabled">비활성화됨</string>
|
||||||
<string name="LedDisabled">비활성화됨</string>
|
<string name="LedDisabled">비활성화됨</string>
|
||||||
<string name="RepeatDisabled">끔</string>
|
<string name="RepeatDisabled">끔</string>
|
||||||
|
<string name="InChatSound">채팅중 소리 설정</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">잠금번호</string>
|
<string name="Passcode">잠금번호</string>
|
||||||
<string name="ChangePasscode">잠금번호 변경</string>
|
<string name="ChangePasscode">잠금번호 변경</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">이 사진을 삭제하시겠습니까?</string>
|
<string name="AreYouSureDeletePhoto">이 사진을 삭제하시겠습니까?</string>
|
||||||
<string name="AreYouSureDeleteVideo">이 동영상을 삭제하시겠습니까?</string>
|
<string name="AreYouSureDeleteVideo">이 동영상을 삭제하시겠습니까?</string>
|
||||||
<string name="DiscardChanges">변경을 취소하시겠습니까?</string>
|
<string name="DiscardChanges">변경을 취소하시겠습니까?</string>
|
||||||
|
<string name="ClearSearch">검색기록을 지우시겠습니까?</string>
|
||||||
|
<string name="ClearButton">지우기</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">올바른 성을 입력해 주세요</string>
|
<string name="InvalidLastName">올바른 성을 입력해 주세요</string>
|
||||||
<string name="Loading">불러오는 중...</string>
|
<string name="Loading">불러오는 중...</string>
|
||||||
<string name="NoPlayerInstalled">동영상 재생 앱이 없습니다. 계속하려면 앱을 설치해 주세요.</string>
|
<string name="NoPlayerInstalled">동영상 재생 앱이 없습니다. 계속하려면 앱을 설치해 주세요.</string>
|
||||||
<string name="NoMailInstalled">sms@telegram.org 이메일 주소로 이 문제를 보내주세요.</string>
|
<string name="NoMailInstalled">발생한 문제에 대하여 sms@stel.com 주소로 이메일을 보내주세요.</string>
|
||||||
<string name="NoHandleAppInstalled">\'%1$s\' 파일 형식을 처리할 앱이 없습니다. 계속하려면 앱을 설치해 주세요.</string>
|
<string name="NoHandleAppInstalled">\'%1$s\' 파일 형식을 처리할 앱이 없습니다. 계속하려면 앱을 설치해 주세요.</string>
|
||||||
<string name="InviteUser">친구가 아직 텔레그램을 사용하지 않네요. 초대해 보세요!</string>
|
<string name="InviteUser">친구가 아직 텔레그램을 사용하지 않네요. 초대해 보세요!</string>
|
||||||
<string name="AreYouSure">확실합니까?</string>
|
<string name="AreYouSure">확실합니까?</string>
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">Stil uitschakelen</string>
|
<string name="UnmuteNotifications">Stil uitschakelen</string>
|
||||||
<string name="WillUnmuteIn">Over %1$s</string>
|
<string name="WillUnmuteIn">Over %1$s</string>
|
||||||
<string name="MuteDisable">Uitschakelen</string>
|
<string name="MuteDisable">Uitschakelen</string>
|
||||||
|
<string name="Hashtags">HASHTAGS</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">Nieuwe verzendlijst</string>
|
<string name="NewBroadcastList">Nieuwe verzendlijst</string>
|
||||||
<string name="EnterListName">Naam van lijst</string>
|
<string name="EnterListName">Naam van lijst</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">Uitgeschakeld</string>
|
<string name="VibrationDisabled">Uitgeschakeld</string>
|
||||||
<string name="LedDisabled">Uitgeschakeld</string>
|
<string name="LedDisabled">Uitgeschakeld</string>
|
||||||
<string name="RepeatDisabled">Uit</string>
|
<string name="RepeatDisabled">Uit</string>
|
||||||
|
<string name="InChatSound">Chatgeluiden</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">Toegangscode</string>
|
<string name="Passcode">Toegangscode</string>
|
||||||
<string name="ChangePasscode">Toegangscode wijzigen</string>
|
<string name="ChangePasscode">Toegangscode wijzigen</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">Foto echt verwijderen?</string>
|
<string name="AreYouSureDeletePhoto">Foto echt verwijderen?</string>
|
||||||
<string name="AreYouSureDeleteVideo">Video echt verwijderen?</string>
|
<string name="AreYouSureDeleteVideo">Video echt verwijderen?</string>
|
||||||
<string name="DiscardChanges">Wijzigingen negeren?</string>
|
<string name="DiscardChanges">Wijzigingen negeren?</string>
|
||||||
|
<string name="ClearSearch">Zoekgeschiedenis wissen?</string>
|
||||||
|
<string name="ClearButton">Wissen</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">Ongeldige achternaam</string>
|
<string name="InvalidLastName">Ongeldige achternaam</string>
|
||||||
<string name="Loading">Bezig met laden</string>
|
<string name="Loading">Bezig met laden</string>
|
||||||
<string name="NoPlayerInstalled">Je hebt geen mediaspeler. Installeer een mediaspeler om door te gaan.</string>
|
<string name="NoPlayerInstalled">Je hebt geen mediaspeler. Installeer een mediaspeler om door te gaan.</string>
|
||||||
<string name="NoMailInstalled">Mail ons op sms@telegram.org en vertel ons over je probleem.</string>
|
<string name="NoMailInstalled">Mail ons op sms@stel.com en vertel ons over je probleem.</string>
|
||||||
<string name="NoHandleAppInstalled">Je hebt geen apps die bestandstype \'%1$s\' kunnen verwerken, gelieve een compatibele app te installeren</string>
|
<string name="NoHandleAppInstalled">Je hebt geen apps die bestandstype \'%1$s\' kunnen verwerken, gelieve een compatibele app te installeren</string>
|
||||||
<string name="InviteUser">Deze gebruiker heeft nog geen Telegram. Wil je een uitnodiging sturen?</string>
|
<string name="InviteUser">Deze gebruiker heeft nog geen Telegram. Wil je een uitnodiging sturen?</string>
|
||||||
<string name="AreYouSure">Weet je het zeker?</string>
|
<string name="AreYouSure">Weet je het zeker?</string>
|
||||||
|
@ -616,54 +620,54 @@
|
||||||
<string name="Users_many">%1$d gebruikers</string>
|
<string name="Users_many">%1$d gebruikers</string>
|
||||||
<string name="Users_other">%1$d gebruikers</string>
|
<string name="Users_other">%1$d gebruikers</string>
|
||||||
<!--forwarded messages-->
|
<!--forwarded messages-->
|
||||||
<string name="ForwardedMessage_zero">+%1$d berichten</string>
|
<string name="ForwardedMessage_zero">Bijlage: %1$d berichten</string>
|
||||||
<string name="ForwardedMessage_one">+1 bericht</string>
|
<string name="ForwardedMessage_one">Bijlage: 1 bericht</string>
|
||||||
<string name="ForwardedMessage_two">+%1$d berichten</string>
|
<string name="ForwardedMessage_two">Bijlage: %1$d berichten</string>
|
||||||
<string name="ForwardedMessage_few">+%1$d berichten</string>
|
<string name="ForwardedMessage_few">Bijlage: %1$d berichten</string>
|
||||||
<string name="ForwardedMessage_many">+%1$d berichten</string>
|
<string name="ForwardedMessage_many">Bijlage: %1$d berichten</string>
|
||||||
<string name="ForwardedMessage_other">+%1$d berichten</string>
|
<string name="ForwardedMessage_other">Bijlage: %1$d berichten</string>
|
||||||
<string name="ForwardedFile_zero">+%1$d bestanden</string>
|
<string name="ForwardedFile_zero">Bijlage: %1$d bestanden</string>
|
||||||
<string name="ForwardedFile_one">+1 bestand</string>
|
<string name="ForwardedFile_one">Bijlage: 1 bestand</string>
|
||||||
<string name="ForwardedFile_two">+%1$d bestanden</string>
|
<string name="ForwardedFile_two">Bijlage: %1$d bestanden</string>
|
||||||
<string name="ForwardedFile_few">+%1$d bestanden</string>
|
<string name="ForwardedFile_few">Bijlage: %1$d bestanden</string>
|
||||||
<string name="ForwardedFile_many">+%1$d bestanden</string>
|
<string name="ForwardedFile_many">Bijlage: %1$d bestanden</string>
|
||||||
<string name="ForwardedFile_other">+%1$d bestanden</string>
|
<string name="ForwardedFile_other">Bijlage: %1$d bestanden</string>
|
||||||
<string name="ForwardedPhoto_zero">+%1$d foto\'s</string>
|
<string name="ForwardedPhoto_zero">Bijlage: %1$d foto\'s</string>
|
||||||
<string name="ForwardedPhoto_one">+1 foto</string>
|
<string name="ForwardedPhoto_one">Bijlage: 1 foto</string>
|
||||||
<string name="ForwardedPhoto_two">+%1$d foto\'s</string>
|
<string name="ForwardedPhoto_two">Bijlage: %1$d foto\'s</string>
|
||||||
<string name="ForwardedPhoto_few">+%1$d foto\'s</string>
|
<string name="ForwardedPhoto_few">Bijlage: %1$d foto\'s</string>
|
||||||
<string name="ForwardedPhoto_many">+%1$d foto\'s</string>
|
<string name="ForwardedPhoto_many">Bijlage: %1$d foto\'s</string>
|
||||||
<string name="ForwardedPhoto_other">+%1$d foto\'s</string>
|
<string name="ForwardedPhoto_other">Bijlage: %1$d foto\'s</string>
|
||||||
<string name="ForwardedVideo_zero">+%1$d foto\'s</string>
|
<string name="ForwardedVideo_zero">Bijlage: %1$d foto\'s</string>
|
||||||
<string name="ForwardedVideo_one">+1 video</string>
|
<string name="ForwardedVideo_one">Bijlage: 1 video</string>
|
||||||
<string name="ForwardedVideo_two">+%1$d video\'s</string>
|
<string name="ForwardedVideo_two">Bijlage: %1$d video\'s</string>
|
||||||
<string name="ForwardedVideo_few">+%1$d video\'s</string>
|
<string name="ForwardedVideo_few">Bijlage: %1$d video\'s</string>
|
||||||
<string name="ForwardedVideo_many">+%1$d video\'s</string>
|
<string name="ForwardedVideo_many">Bijlage: %1$d video\'s</string>
|
||||||
<string name="ForwardedVideo_other">+%1$d video\'s</string>
|
<string name="ForwardedVideo_other">Bijlage: %1$d video\'s</string>
|
||||||
<string name="ForwardedAudio_zero">+%1$d geluidsbestanden</string>
|
<string name="ForwardedAudio_zero">Bijlage: %1$d geluidsbestanden</string>
|
||||||
<string name="ForwardedAudio_one">+1 geluidsbestand</string>
|
<string name="ForwardedAudio_one">Bijlage: 1 geluidsbestand</string>
|
||||||
<string name="ForwardedAudio_two">+%1$d geluidsbestanden</string>
|
<string name="ForwardedAudio_two">Bijlage: %1$d geluidsbestanden</string>
|
||||||
<string name="ForwardedAudio_few">+%1$d geluidsbestanden</string>
|
<string name="ForwardedAudio_few">Bijlage: %1$d geluidsbestanden</string>
|
||||||
<string name="ForwardedAudio_many">+%1$d geluidsbestanden</string>
|
<string name="ForwardedAudio_many">Bijlage: %1$d geluidsbestanden</string>
|
||||||
<string name="ForwardedAudio_other">+%1$d geluidsbestanden</string>
|
<string name="ForwardedAudio_other">Bijlage: %1$d geluidsbestanden</string>
|
||||||
<string name="ForwardedLocation_zero">+%1$d locaties</string>
|
<string name="ForwardedLocation_zero">Bijlage: %1$d locaties</string>
|
||||||
<string name="ForwardedLocation_one">+1 locatie</string>
|
<string name="ForwardedLocation_one">Bijlage: 1 locatie</string>
|
||||||
<string name="ForwardedLocation_two">+%1$d locaties</string>
|
<string name="ForwardedLocation_two">Bijlage: %1$d locaties</string>
|
||||||
<string name="ForwardedLocation_few">+%1$d locaties</string>
|
<string name="ForwardedLocation_few">Bijlage: %1$d locaties</string>
|
||||||
<string name="ForwardedLocation_many">+%1$d locaties</string>
|
<string name="ForwardedLocation_many">Bijlage: %1$d locaties</string>
|
||||||
<string name="ForwardedLocation_other">+%1$d locaties</string>
|
<string name="ForwardedLocation_other">Bijlage: %1$d locaties</string>
|
||||||
<string name="ForwardedContact_zero">+%1$d contacten</string>
|
<string name="ForwardedContact_zero">Bijlage: %1$d contacten</string>
|
||||||
<string name="ForwardedContact_one">+1 contact</string>
|
<string name="ForwardedContact_one">Bijlage: 1 contact</string>
|
||||||
<string name="ForwardedContact_two">+%1$d contacten</string>
|
<string name="ForwardedContact_two">Bijlage: %1$d contacten</string>
|
||||||
<string name="ForwardedContact_few">+%1$d contacten</string>
|
<string name="ForwardedContact_few">Bijlage: %1$d contacten</string>
|
||||||
<string name="ForwardedContact_many">+%1$d contacten</string>
|
<string name="ForwardedContact_many">Bijlage: %1$d contacten</string>
|
||||||
<string name="ForwardedContact_other">+%1$d contacten</string>
|
<string name="ForwardedContact_other">Bijlage: %1$d contacten</string>
|
||||||
<string name="ForwardedSticker_zero">+%1$d stickers</string>
|
<string name="ForwardedSticker_zero">Bijlage: %1$d stickers</string>
|
||||||
<string name="ForwardedSticker_one">+1 sticker</string>
|
<string name="ForwardedSticker_one">Bijlage: 1 sticker</string>
|
||||||
<string name="ForwardedSticker_two">+%1$d stickers</string>
|
<string name="ForwardedSticker_two">Bijlage: %1$d stickers</string>
|
||||||
<string name="ForwardedSticker_few">+%1$d stickers</string>
|
<string name="ForwardedSticker_few">Bijlage: %1$d stickers</string>
|
||||||
<string name="ForwardedSticker_many">+%1$d stickers</string>
|
<string name="ForwardedSticker_many">Bijlage: %1$d stickers</string>
|
||||||
<string name="ForwardedSticker_other">+%1$d stickers</string>
|
<string name="ForwardedSticker_other">Bijlage: %1$d stickers</string>
|
||||||
<string name="AndOther_zero">en %1$d anderen</string>
|
<string name="AndOther_zero">en %1$d anderen</string>
|
||||||
<string name="AndOther_one">en %1$d andere</string>
|
<string name="AndOther_one">en %1$d andere</string>
|
||||||
<string name="AndOther_two">en %1$d anderen</string>
|
<string name="AndOther_two">en %1$d anderen</string>
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">Restaurar Som</string>
|
<string name="UnmuteNotifications">Restaurar Som</string>
|
||||||
<string name="WillUnmuteIn">Em %1$s</string>
|
<string name="WillUnmuteIn">Em %1$s</string>
|
||||||
<string name="MuteDisable">Desativado</string>
|
<string name="MuteDisable">Desativado</string>
|
||||||
|
<string name="Hashtags">HASHTAGS</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">Nova Lista de Transmissão</string>
|
<string name="NewBroadcastList">Nova Lista de Transmissão</string>
|
||||||
<string name="EnterListName">Digite o nome da lista</string>
|
<string name="EnterListName">Digite o nome da lista</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">Desativar</string>
|
<string name="VibrationDisabled">Desativar</string>
|
||||||
<string name="LedDisabled">Desativado</string>
|
<string name="LedDisabled">Desativado</string>
|
||||||
<string name="RepeatDisabled">Desativado</string>
|
<string name="RepeatDisabled">Desativado</string>
|
||||||
|
<string name="InChatSound">Sons no Chat</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">Senha</string>
|
<string name="Passcode">Senha</string>
|
||||||
<string name="ChangePasscode">Alterar Senha</string>
|
<string name="ChangePasscode">Alterar Senha</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">Você tem certeza que deseja apagar esta foto?</string>
|
<string name="AreYouSureDeletePhoto">Você tem certeza que deseja apagar esta foto?</string>
|
||||||
<string name="AreYouSureDeleteVideo">Você tem certeza que deseja apagar este vídeo?</string>
|
<string name="AreYouSureDeleteVideo">Você tem certeza que deseja apagar este vídeo?</string>
|
||||||
<string name="DiscardChanges">Descartar mudanças?</string>
|
<string name="DiscardChanges">Descartar mudanças?</string>
|
||||||
|
<string name="ClearSearch">Limpar histórico de busca?</string>
|
||||||
|
<string name="ClearButton">Limpar</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">Sobrenome inválido</string>
|
<string name="InvalidLastName">Sobrenome inválido</string>
|
||||||
<string name="Loading">Carregando...</string>
|
<string name="Loading">Carregando...</string>
|
||||||
<string name="NoPlayerInstalled">Você não possui um reprodutor de vídeo, instale um para continuar</string>
|
<string name="NoPlayerInstalled">Você não possui um reprodutor de vídeo, instale um para continuar</string>
|
||||||
<string name="NoMailInstalled">Por favor, envie um email para sms@telegram.org e conte-nos sobre seu problema.</string>
|
<string name="NoMailInstalled">Por favor, envie um email para sms@stel.com e conte-nos sobre seu problema.</string>
|
||||||
<string name="NoHandleAppInstalled">Você não possui um aplicativo que suporte o tipo de arquivo \'%1$s\', por favor instale um para continuar</string>
|
<string name="NoHandleAppInstalled">Você não possui um aplicativo que suporte o tipo de arquivo \'%1$s\', por favor instale um para continuar</string>
|
||||||
<string name="InviteUser">Este usuário ainda não possui Telegram, deseja enviar um convite?</string>
|
<string name="InviteUser">Este usuário ainda não possui Telegram, deseja enviar um convite?</string>
|
||||||
<string name="AreYouSure">Você tem certeza?</string>
|
<string name="AreYouSure">Você tem certeza?</string>
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">Restaurar Som</string>
|
<string name="UnmuteNotifications">Restaurar Som</string>
|
||||||
<string name="WillUnmuteIn">Em %1$s</string>
|
<string name="WillUnmuteIn">Em %1$s</string>
|
||||||
<string name="MuteDisable">Desativado</string>
|
<string name="MuteDisable">Desativado</string>
|
||||||
|
<string name="Hashtags">HASHTAGS</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">Nova Lista de Transmissão</string>
|
<string name="NewBroadcastList">Nova Lista de Transmissão</string>
|
||||||
<string name="EnterListName">Digite o nome da lista</string>
|
<string name="EnterListName">Digite o nome da lista</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">Desativar</string>
|
<string name="VibrationDisabled">Desativar</string>
|
||||||
<string name="LedDisabled">Desativado</string>
|
<string name="LedDisabled">Desativado</string>
|
||||||
<string name="RepeatDisabled">Desativado</string>
|
<string name="RepeatDisabled">Desativado</string>
|
||||||
|
<string name="InChatSound">Sons no Chat</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">Senha</string>
|
<string name="Passcode">Senha</string>
|
||||||
<string name="ChangePasscode">Alterar Senha</string>
|
<string name="ChangePasscode">Alterar Senha</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">Você tem certeza que deseja apagar esta foto?</string>
|
<string name="AreYouSureDeletePhoto">Você tem certeza que deseja apagar esta foto?</string>
|
||||||
<string name="AreYouSureDeleteVideo">Você tem certeza que deseja apagar este vídeo?</string>
|
<string name="AreYouSureDeleteVideo">Você tem certeza que deseja apagar este vídeo?</string>
|
||||||
<string name="DiscardChanges">Descartar mudanças?</string>
|
<string name="DiscardChanges">Descartar mudanças?</string>
|
||||||
|
<string name="ClearSearch">Limpar histórico de busca?</string>
|
||||||
|
<string name="ClearButton">Limpar</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">Sobrenome inválido</string>
|
<string name="InvalidLastName">Sobrenome inválido</string>
|
||||||
<string name="Loading">Carregando...</string>
|
<string name="Loading">Carregando...</string>
|
||||||
<string name="NoPlayerInstalled">Você não possui um reprodutor de vídeo, instale um para continuar</string>
|
<string name="NoPlayerInstalled">Você não possui um reprodutor de vídeo, instale um para continuar</string>
|
||||||
<string name="NoMailInstalled">Por favor, envie um email para sms@telegram.org e conte-nos sobre seu problema.</string>
|
<string name="NoMailInstalled">Por favor, envie um email para sms@stel.com e conte-nos sobre seu problema.</string>
|
||||||
<string name="NoHandleAppInstalled">Você não possui um aplicativo que suporte o tipo de arquivo \'%1$s\', por favor instale um para continuar</string>
|
<string name="NoHandleAppInstalled">Você não possui um aplicativo que suporte o tipo de arquivo \'%1$s\', por favor instale um para continuar</string>
|
||||||
<string name="InviteUser">Este usuário ainda não possui Telegram, deseja enviar um convite?</string>
|
<string name="InviteUser">Este usuário ainda não possui Telegram, deseja enviar um convite?</string>
|
||||||
<string name="AreYouSure">Você tem certeza?</string>
|
<string name="AreYouSure">Você tem certeza?</string>
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<string name="UnmuteNotifications">Unmute</string>
|
<string name="UnmuteNotifications">Unmute</string>
|
||||||
<string name="WillUnmuteIn">In %1$s</string>
|
<string name="WillUnmuteIn">In %1$s</string>
|
||||||
<string name="MuteDisable">Disable</string>
|
<string name="MuteDisable">Disable</string>
|
||||||
|
<string name="Hashtags">HASHTAGS</string>
|
||||||
<!--broadcasts-->
|
<!--broadcasts-->
|
||||||
<string name="NewBroadcastList">New Broadcast List</string>
|
<string name="NewBroadcastList">New Broadcast List</string>
|
||||||
<string name="EnterListName">Enter list name</string>
|
<string name="EnterListName">Enter list name</string>
|
||||||
|
@ -302,6 +303,7 @@
|
||||||
<string name="VibrationDisabled">Disabled</string>
|
<string name="VibrationDisabled">Disabled</string>
|
||||||
<string name="LedDisabled">Disabled</string>
|
<string name="LedDisabled">Disabled</string>
|
||||||
<string name="RepeatDisabled">Off</string>
|
<string name="RepeatDisabled">Off</string>
|
||||||
|
<string name="InChatSound">In-Chat Sounds</string>
|
||||||
<!--passcode view-->
|
<!--passcode view-->
|
||||||
<string name="Passcode">Passcode</string>
|
<string name="Passcode">Passcode</string>
|
||||||
<string name="ChangePasscode">Change Passcode</string>
|
<string name="ChangePasscode">Change Passcode</string>
|
||||||
|
@ -366,6 +368,8 @@
|
||||||
<string name="AreYouSureDeletePhoto">Are you sure you want to delete this photo?</string>
|
<string name="AreYouSureDeletePhoto">Are you sure you want to delete this photo?</string>
|
||||||
<string name="AreYouSureDeleteVideo">Are you sure you want to delete this video?</string>
|
<string name="AreYouSureDeleteVideo">Are you sure you want to delete this video?</string>
|
||||||
<string name="DiscardChanges">Discard changes?</string>
|
<string name="DiscardChanges">Discard changes?</string>
|
||||||
|
<string name="ClearSearch">Clear search history?</string>
|
||||||
|
<string name="ClearButton">Clear</string>
|
||||||
<!--password view-->
|
<!--password view-->
|
||||||
<string name="Password">Password</string>
|
<string name="Password">Password</string>
|
||||||
<string name="ChangePassword">Change password</string>
|
<string name="ChangePassword">Change password</string>
|
||||||
|
@ -486,7 +490,7 @@
|
||||||
<string name="InvalidLastName">Invalid last name</string>
|
<string name="InvalidLastName">Invalid last name</string>
|
||||||
<string name="Loading">Loading...</string>
|
<string name="Loading">Loading...</string>
|
||||||
<string name="NoPlayerInstalled">You don\'t have a video player, please install one to continue</string>
|
<string name="NoPlayerInstalled">You don\'t have a video player, please install one to continue</string>
|
||||||
<string name="NoMailInstalled">Please send an email to sms@telegram.org and tell us about your problem.</string>
|
<string name="NoMailInstalled">Please send an email to sms@stel.com and tell us about your problem.</string>
|
||||||
<string name="NoHandleAppInstalled">You don\'t have applications that can handle the file type \'%1$s\', please install one to continue</string>
|
<string name="NoHandleAppInstalled">You don\'t have applications that can handle the file type \'%1$s\', please install one to continue</string>
|
||||||
<string name="InviteUser">This user does not have Telegram yet, send an invitation?</string>
|
<string name="InviteUser">This user does not have Telegram yet, send an invitation?</string>
|
||||||
<string name="AreYouSure">Are you sure?</string>
|
<string name="AreYouSure">Are you sure?</string>
|
||||||
|
|