Bug fixes
This commit is contained in:
parent
dd61bbaa7a
commit
a38e46cd8b
@ -80,7 +80,7 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
targetSdkVersion 21
|
targetSdkVersion 21
|
||||||
versionCode 391
|
versionCode 392
|
||||||
versionName "2.0.2"
|
versionName "2.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1636,6 +1636,9 @@ public class ContactsController {
|
|||||||
TLRPC.User toDbUser = new TLRPC.User();
|
TLRPC.User toDbUser = new TLRPC.User();
|
||||||
TLRPC.TL_contactStatus status = (TLRPC.TL_contactStatus) object;
|
TLRPC.TL_contactStatus status = (TLRPC.TL_contactStatus) object;
|
||||||
|
|
||||||
|
if (status == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (status.status instanceof TLRPC.TL_userStatusRecently) {
|
if (status.status instanceof TLRPC.TL_userStatusRecently) {
|
||||||
status.status.expires = -100;
|
status.status.expires = -100;
|
||||||
} else if (status.status instanceof TLRPC.TL_userStatusLastWeek) {
|
} else if (status.status instanceof TLRPC.TL_userStatusLastWeek) {
|
||||||
|
@ -1062,77 +1062,76 @@ public class MessagesController implements NotificationCenter.NotificationCenter
|
|||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
MessagesStorage.getInstance().deleteDialog(did, onlyHistory);
|
MessagesStorage.getInstance().deleteDialog(did, onlyHistory);
|
||||||
}
|
}
|
||||||
TLRPC.TL_dialog dialog = dialogs_dict.get(did);
|
|
||||||
if (dialog != null) {
|
|
||||||
int lower_part = (int)did;
|
|
||||||
int high_id = (int)(did >> 32);
|
|
||||||
|
|
||||||
if (offset == 0) {
|
int lower_part = (int)did;
|
||||||
if (!onlyHistory) {
|
int high_id = (int)(did >> 32);
|
||||||
dialogs.remove(dialog);
|
|
||||||
dialogsServerOnly.remove(dialog);
|
|
||||||
dialogs_dict.remove(did);
|
|
||||||
totalDialogsCount--;
|
|
||||||
} else {
|
|
||||||
dialog.unread_count = 0;
|
|
||||||
}
|
|
||||||
dialogMessage.remove(dialog.top_message);
|
|
||||||
MessagesStorage.getInstance().getStorageQueue().postRunnable(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
NotificationsController.getInstance().processReadMessages(null, did, 0, Integer.MAX_VALUE, false);
|
|
||||||
HashMap<Long, Integer> dialogsToUpdate = new HashMap<Long, Integer>();
|
|
||||||
dialogsToUpdate.put(did, 0);
|
|
||||||
NotificationsController.getInstance().processDialogsUpdateRead(dialogsToUpdate);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.removeAllMessagesFromDialog, did);
|
|
||||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (high_id == 1) {
|
if (offset == 0) {
|
||||||
return;
|
TLRPC.TL_dialog dialog = dialogs_dict.get(did);
|
||||||
}
|
if (!onlyHistory) {
|
||||||
|
dialogs.remove(dialog);
|
||||||
if (lower_part != 0) {
|
dialogsServerOnly.remove(dialog);
|
||||||
TLRPC.TL_messages_deleteHistory req = new TLRPC.TL_messages_deleteHistory();
|
dialogs_dict.remove(did);
|
||||||
req.offset = offset;
|
totalDialogsCount--;
|
||||||
if (did < 0) {
|
|
||||||
req.peer = new TLRPC.TL_inputPeerChat();
|
|
||||||
req.peer.chat_id = -lower_part;
|
|
||||||
} else {
|
|
||||||
TLRPC.User user = getUser(lower_part);
|
|
||||||
if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) {
|
|
||||||
req.peer = new TLRPC.TL_inputPeerForeign();
|
|
||||||
req.peer.access_hash = user.access_hash;
|
|
||||||
} else {
|
|
||||||
req.peer = new TLRPC.TL_inputPeerContact();
|
|
||||||
}
|
|
||||||
req.peer.user_id = lower_part;
|
|
||||||
}
|
|
||||||
ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
|
|
||||||
@Override
|
|
||||||
public void run(TLObject response, TLRPC.TL_error error) {
|
|
||||||
if (error == null) {
|
|
||||||
TLRPC.TL_messages_affectedHistory res = (TLRPC.TL_messages_affectedHistory) response;
|
|
||||||
if (res.offset > 0) {
|
|
||||||
deleteDialog(did, res.offset, onlyHistory);
|
|
||||||
}
|
|
||||||
processNewDifferenceParams(res.seq, res.pts, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
if (onlyHistory) {
|
dialog.unread_count = 0;
|
||||||
SendMessagesHelper.getInstance().sendClearHistoryMessage(getEncryptedChat(high_id), null);
|
}
|
||||||
} else {
|
dialogMessage.remove(dialog.top_message);
|
||||||
declineSecretChat(high_id);
|
MessagesStorage.getInstance().getStorageQueue().postRunnable(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
NotificationsController.getInstance().processReadMessages(null, did, 0, Integer.MAX_VALUE, false);
|
||||||
|
HashMap<Long, Integer> dialogsToUpdate = new HashMap<Long, Integer>();
|
||||||
|
dialogsToUpdate.put(did, 0);
|
||||||
|
NotificationsController.getInstance().processDialogsUpdateRead(dialogsToUpdate);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
NotificationCenter.getInstance().postNotificationName(NotificationCenter.removeAllMessagesFromDialog, did);
|
||||||
|
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (high_id == 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lower_part != 0) {
|
||||||
|
TLRPC.TL_messages_deleteHistory req = new TLRPC.TL_messages_deleteHistory();
|
||||||
|
req.offset = offset;
|
||||||
|
if (did < 0) {
|
||||||
|
req.peer = new TLRPC.TL_inputPeerChat();
|
||||||
|
req.peer.chat_id = -lower_part;
|
||||||
|
} else {
|
||||||
|
TLRPC.User user = getUser(lower_part);
|
||||||
|
if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) {
|
||||||
|
req.peer = new TLRPC.TL_inputPeerForeign();
|
||||||
|
req.peer.access_hash = user.access_hash;
|
||||||
|
} else {
|
||||||
|
req.peer = new TLRPC.TL_inputPeerContact();
|
||||||
|
}
|
||||||
|
req.peer.user_id = lower_part;
|
||||||
|
}
|
||||||
|
ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
|
||||||
|
@Override
|
||||||
|
public void run(TLObject response, TLRPC.TL_error error) {
|
||||||
|
if (error == null) {
|
||||||
|
TLRPC.TL_messages_affectedHistory res = (TLRPC.TL_messages_affectedHistory) response;
|
||||||
|
if (res.offset > 0) {
|
||||||
|
deleteDialog(did, res.offset, onlyHistory);
|
||||||
|
}
|
||||||
|
processNewDifferenceParams(res.seq, res.pts, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (onlyHistory) {
|
||||||
|
SendMessagesHelper.getInstance().sendClearHistoryMessage(getEncryptedChat(high_id), null);
|
||||||
|
} else {
|
||||||
|
declineSecretChat(high_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1455,6 +1454,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loadingDialogs = true;
|
loadingDialogs = true;
|
||||||
|
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||||
|
|
||||||
if (fromCache) {
|
if (fromCache) {
|
||||||
MessagesStorage.getInstance().getDialogs(offset, serverOffset, count);
|
MessagesStorage.getInstance().getDialogs(offset, serverOffset, count);
|
||||||
|
@ -397,6 +397,10 @@ public class NotificationsController {
|
|||||||
.setGroup("messages")
|
.setGroup("messages")
|
||||||
.setGroupSummary(true);
|
.setGroupSummary(true);
|
||||||
|
|
||||||
|
//if (ApplicationLoader.mainInterfacePaused) {
|
||||||
|
// mBuilder.setPriority(NotificationCompat.PRIORITY_HIGH);
|
||||||
|
//}
|
||||||
|
|
||||||
String lastMessage = null;
|
String lastMessage = null;
|
||||||
String lastMessageFull = null;
|
String lastMessageFull = null;
|
||||||
if (pushMessages.size() == 1) {
|
if (pushMessages.size() == 1) {
|
||||||
|
@ -2236,6 +2236,17 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
|
|||||||
|
|
||||||
lastOutgoingMessageId = Math.max(messageId, lastOutgoingMessageId);
|
lastOutgoingMessageId = Math.max(messageId, lastOutgoingMessageId);
|
||||||
}
|
}
|
||||||
|
long resultMid = ((TLRPC.TL_bad_server_salt) message).bad_msg_id;
|
||||||
|
if (resultMid != 0) {
|
||||||
|
for (RPCRequest request : runningRequests) {
|
||||||
|
if ((request.flags & RPCRequest.RPCRequestClassDownloadMedia) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (request.respondsToMessageId(resultMid)) {
|
||||||
|
request.retryCount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
datacenter.clearServerSalts();
|
datacenter.clearServerSalts();
|
||||||
|
|
||||||
|
@ -628,8 +628,7 @@ public class ActionBarLayout extends FrameLayout {
|
|||||||
currentAnimation = new AnimatorSetProxy();
|
currentAnimation = new AnimatorSetProxy();
|
||||||
currentAnimation.playTogether(
|
currentAnimation.playTogether(
|
||||||
ObjectAnimatorProxy.ofFloat(containerView, "alpha", 0.0f, 1.0f),
|
ObjectAnimatorProxy.ofFloat(containerView, "alpha", 0.0f, 1.0f),
|
||||||
ObjectAnimatorProxy.ofFloat(containerView, "scaleX", 0.8f, 1.0f),
|
ObjectAnimatorProxy.ofFloat(containerView, "translationY", AndroidUtilities.dp(48), 0));
|
||||||
ObjectAnimatorProxy.ofFloat(containerView, "scaleY", 0.8f, 1.0f));
|
|
||||||
currentAnimation.setInterpolator(new DecelerateInterpolator(1.5f));
|
currentAnimation.setInterpolator(new DecelerateInterpolator(1.5f));
|
||||||
currentAnimation.setDuration(200);
|
currentAnimation.setDuration(200);
|
||||||
currentAnimation.addListener(new AnimatorListenerAdapterProxy() {
|
currentAnimation.addListener(new AnimatorListenerAdapterProxy() {
|
||||||
@ -731,14 +730,14 @@ public class ActionBarLayout extends FrameLayout {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
closeLastFragmentInternalRemoveOld(currentFragment);
|
closeLastFragmentInternalRemoveOld(currentFragment);
|
||||||
|
ViewProxy.setTranslationY(containerViewBack, 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
currentAnimation = new AnimatorSetProxy();
|
currentAnimation = new AnimatorSetProxy();
|
||||||
currentAnimation.playTogether(
|
currentAnimation.playTogether(
|
||||||
ObjectAnimatorProxy.ofFloat(containerViewBack, "alpha", 1.0f, 0.0f),
|
ObjectAnimatorProxy.ofFloat(containerViewBack, "alpha", 1.0f, 0.0f),
|
||||||
ObjectAnimatorProxy.ofFloat(containerViewBack, "scaleX", 1.0f, 0.8f),
|
ObjectAnimatorProxy.ofFloat(containerViewBack, "translationY", 0, AndroidUtilities.dp(48)));
|
||||||
ObjectAnimatorProxy.ofFloat(containerViewBack, "scaleY", 1.0f, 0.8f));
|
|
||||||
currentAnimation.setInterpolator(new DecelerateInterpolator(1.5f));
|
currentAnimation.setInterpolator(new DecelerateInterpolator(1.5f));
|
||||||
currentAnimation.setDuration(200);
|
currentAnimation.setDuration(200);
|
||||||
currentAnimation.addListener(new AnimatorListenerAdapterProxy() {
|
currentAnimation.addListener(new AnimatorListenerAdapterProxy() {
|
||||||
|
@ -134,8 +134,9 @@ public class ActionBarMenu extends LinearLayout {
|
|||||||
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.hasSubMenu()) {
|
if (item.hasSubMenu() && item.getVisibility() == VISIBLE) {
|
||||||
item.toggleSubMenu();
|
item.toggleSubMenu();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,15 +214,19 @@ public class BaseFragment {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
visibleDialog = builder.show();
|
try {
|
||||||
visibleDialog.setCanceledOnTouchOutside(true);
|
visibleDialog = builder.show();
|
||||||
visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
visibleDialog.setCanceledOnTouchOutside(true);
|
||||||
@Override
|
visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||||
public void onDismiss(DialogInterface dialog) {
|
@Override
|
||||||
visibleDialog = null;
|
public void onDismiss(DialogInterface dialog) {
|
||||||
onDialogDismiss();
|
visibleDialog = null;
|
||||||
}
|
onDialogDismiss();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onDialogDismiss() {
|
protected void onDialogDismiss() {
|
||||||
|
@ -52,7 +52,9 @@ public class ContactsAdapter extends BaseSectionsAdapter {
|
|||||||
if (onlyUsers) {
|
if (onlyUsers) {
|
||||||
if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) {
|
if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) {
|
||||||
ArrayList<TLRPC.TL_contact> arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section));
|
ArrayList<TLRPC.TL_contact> arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section));
|
||||||
return MessagesController.getInstance().getUser(arr.get(position).user_id);
|
if (position < arr.size()) {
|
||||||
|
return MessagesController.getInstance().getUser(arr.get(position).user_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
|
@ -236,6 +236,11 @@ public class ChangeUsernameActivity extends BaseFragment {
|
|||||||
}
|
}
|
||||||
lastNameAvailable = false;
|
lastNameAvailable = false;
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
|
if (name.startsWith("_") || name.endsWith("_")) {
|
||||||
|
checkTextView.setText(LocaleController.getString("UsernameInvalid", R.string.UsernameInvalid));
|
||||||
|
checkTextView.setTextColor(0xffcf3030);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
for (int a = 0; a < name.length(); a++) {
|
for (int a = 0; a < name.length(); a++) {
|
||||||
char ch = name.charAt(a);
|
char ch = name.charAt(a);
|
||||||
if (a == 0 && ch >= '0' && ch <= '9') {
|
if (a == 0 && ch >= '0' && ch <= '9') {
|
||||||
|
@ -473,7 +473,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
MessagesController.getInstance().cancelLoadFullUser(currentUser.id);
|
MessagesController.getInstance().cancelLoadFullUser(currentUser.id);
|
||||||
}
|
}
|
||||||
if (!AndroidUtilities.isTablet()) {
|
if (!AndroidUtilities.isTablet() && getParentActivity() != null) {
|
||||||
getParentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
getParentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
||||||
}
|
}
|
||||||
AndroidUtilities.unlockOrientation(getParentActivity());
|
AndroidUtilities.unlockOrientation(getParentActivity());
|
||||||
@ -1270,7 +1270,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void scrollToLastMessage() {
|
private void scrollToLastMessage() {
|
||||||
if ((forward_end_reached || first_unread_id == 0) && startLoadFromMessageId == 0) {
|
if (forward_end_reached && first_unread_id == 0 && startLoadFromMessageId == 0) {
|
||||||
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
||||||
} else {
|
} else {
|
||||||
messages.clear();
|
messages.clear();
|
||||||
@ -3087,7 +3087,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
presentFragment(chatActivity, true);
|
presentFragment(chatActivity, true);
|
||||||
if (!AndroidUtilities.isTablet()) {
|
if (!AndroidUtilities.isTablet()) {
|
||||||
removeSelfFromStack();
|
removeSelfFromStack();
|
||||||
chatActivity.getParentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
Activity parentActivity = getParentActivity();
|
||||||
|
if (parentActivity == null) {
|
||||||
|
parentActivity = chatActivity.getParentActivity();
|
||||||
|
}
|
||||||
|
if (parentActivity != null) {
|
||||||
|
parentActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
activity.finishFragment();
|
activity.finishFragment();
|
||||||
|
@ -1131,7 +1131,16 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fragment instanceof ChatActivity) {
|
if (fragment instanceof ChatActivity) {
|
||||||
if (!tabletFullSize && layout != rightActionBarLayout) {
|
if (!tabletFullSize && layout == rightActionBarLayout || tabletFullSize && layout == actionBarLayout) {
|
||||||
|
if (!layersActionBarLayout.fragmentsStack.isEmpty()) {
|
||||||
|
for (int a = 0; a < layersActionBarLayout.fragmentsStack.size() - 1; a++) {
|
||||||
|
layersActionBarLayout.removeFragmentFromStack(layersActionBarLayout.fragmentsStack.get(0));
|
||||||
|
a--;
|
||||||
|
}
|
||||||
|
layersActionBarLayout.closeLastFragment(!forceWithoutAnimation);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (!tabletFullSize && layout != rightActionBarLayout) {
|
||||||
rightActionBarLayout.setVisibility(View.VISIBLE);
|
rightActionBarLayout.setVisibility(View.VISIBLE);
|
||||||
backgroundTablet.setVisibility(View.GONE);
|
backgroundTablet.setVisibility(View.GONE);
|
||||||
rightActionBarLayout.removeAllFragments();
|
rightActionBarLayout.removeAllFragments();
|
||||||
|
@ -530,6 +530,12 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void didReceivedNotification(int id, Object... args) {
|
public void didReceivedNotification(int id, Object... args) {
|
||||||
if (id == NotificationCenter.dialogsNeedReload) {
|
if (id == NotificationCenter.dialogsNeedReload) {
|
||||||
|
if (dialogsAdapter != null) {
|
||||||
|
dialogsAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
if (dialogsSearchAdapter != null) {
|
||||||
|
dialogsSearchAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
if (messagesListView != null) {
|
if (messagesListView != null) {
|
||||||
if (MessagesController.getInstance().loadingDialogs && MessagesController.getInstance().dialogs.isEmpty()) {
|
if (MessagesController.getInstance().loadingDialogs && MessagesController.getInstance().dialogs.isEmpty()) {
|
||||||
searchEmptyView.setVisibility(View.GONE);
|
searchEmptyView.setVisibility(View.GONE);
|
||||||
@ -537,33 +543,14 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
|
|||||||
messagesListView.setEmptyView(progressView);
|
messagesListView.setEmptyView(progressView);
|
||||||
} else {
|
} else {
|
||||||
if (searching && searchWas) {
|
if (searching && searchWas) {
|
||||||
if (dialogsAdapter != null) {
|
|
||||||
dialogsAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
if (dialogsSearchAdapter != null) {
|
|
||||||
dialogsSearchAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
messagesListView.setEmptyView(searchEmptyView);
|
messagesListView.setEmptyView(searchEmptyView);
|
||||||
emptyView.setVisibility(View.GONE);
|
emptyView.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
if (dialogsAdapter != null) {
|
|
||||||
dialogsAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
if (dialogsSearchAdapter != null) {
|
|
||||||
dialogsSearchAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
messagesListView.setEmptyView(emptyView);
|
messagesListView.setEmptyView(emptyView);
|
||||||
searchEmptyView.setVisibility(View.GONE);
|
searchEmptyView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
progressView.setVisibility(View.GONE);
|
progressView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (dialogsAdapter != null) {
|
|
||||||
dialogsAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
if (dialogsSearchAdapter != null) {
|
|
||||||
dialogsSearchAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (id == NotificationCenter.emojiDidLoaded) {
|
} else if (id == NotificationCenter.emojiDidLoaded) {
|
||||||
if (messagesListView != null) {
|
if (messagesListView != null) {
|
||||||
|
@ -183,7 +183,7 @@ public class PrivacySettingsActivity extends BaseFragment implements Notificatio
|
|||||||
if (which == 0) {
|
if (which == 0) {
|
||||||
value = 30;
|
value = 30;
|
||||||
} else if (which == 1) {
|
} else if (which == 1) {
|
||||||
value = 60;
|
value = 90;
|
||||||
} else if (which == 2) {
|
} else if (which == 2) {
|
||||||
value = 182;
|
value = 182;
|
||||||
} else if (which == 3) {
|
} else if (which == 3) {
|
||||||
|
@ -937,8 +937,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
public int compare(Integer lhs, Integer rhs) {
|
public int compare(Integer lhs, Integer rhs) {
|
||||||
TLRPC.User user1 = MessagesController.getInstance().getUser(info.participants.get(rhs).user_id);
|
TLRPC.User user1 = MessagesController.getInstance().getUser(info.participants.get(rhs).user_id);
|
||||||
TLRPC.User user2 = MessagesController.getInstance().getUser(info.participants.get(lhs).user_id);
|
TLRPC.User user2 = MessagesController.getInstance().getUser(info.participants.get(lhs).user_id);
|
||||||
Integer status1 = 0;
|
int status1 = 0;
|
||||||
Integer status2 = 0;
|
int status2 = 0;
|
||||||
if (user1 != null && user1.status != null) {
|
if (user1 != null && user1.status != null) {
|
||||||
if (user1.id == UserConfig.getClientUserId()) {
|
if (user1.id == UserConfig.getClientUserId()) {
|
||||||
status1 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
|
status1 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
|
||||||
@ -953,7 +953,26 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
status2 = user2.status.expires;
|
status2 = user2.status.expires;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status1.compareTo(status2);
|
if (status1 > 0 && status2 > 0) {
|
||||||
|
if (status1 > status2) {
|
||||||
|
return 1;
|
||||||
|
} else if (status1 < status2) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
} else if (status1 < 0 && status2 < 0) {
|
||||||
|
if (status1 > status2) {
|
||||||
|
return 1;
|
||||||
|
} else if (status1 < status2) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
} else if (status1 < 0 && status2 > 0 || status1 == 0 && status2 != 0) {
|
||||||
|
return -1;
|
||||||
|
} else if (status2 < 0 && status1 > 0 || status2 == 0 && status1 != 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -184,7 +184,9 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
|
|||||||
@Override
|
@Override
|
||||||
public void onPrepared(MediaPlayer mp) {
|
public void onPrepared(MediaPlayer mp) {
|
||||||
playerPrepared = true;
|
playerPrepared = true;
|
||||||
videoPlayer.seekTo((int) (videoTimelineView.getLeftProgress() * videoDuration));
|
if (videoTimelineView != null && videoPlayer != null) {
|
||||||
|
videoPlayer.seekTo((int) (videoTimelineView.getLeftProgress() * videoDuration));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
|
@ -391,9 +391,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
|
|||||||
});
|
});
|
||||||
runningAnimation2.start();
|
runningAnimation2.start();
|
||||||
|
|
||||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
if (messsageEditText != null) {
|
||||||
layoutParams.rightMargin = AndroidUtilities.dp(0);
|
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
||||||
messsageEditText.setLayoutParams(layoutParams);
|
layoutParams.rightMargin = AndroidUtilities.dp(0);
|
||||||
|
messsageEditText.setLayoutParams(layoutParams);
|
||||||
|
}
|
||||||
|
|
||||||
delegate.onAttachButtonHidden();
|
delegate.onAttachButtonHidden();
|
||||||
}
|
}
|
||||||
@ -470,9 +472,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
|
|||||||
runningAnimation2.setDuration(100);
|
runningAnimation2.setDuration(100);
|
||||||
runningAnimation2.start();
|
runningAnimation2.start();
|
||||||
|
|
||||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
if (messsageEditText != null) {
|
||||||
layoutParams.rightMargin = AndroidUtilities.dp(50);
|
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) messsageEditText.getLayoutParams();
|
||||||
messsageEditText.setLayoutParams(layoutParams);
|
layoutParams.rightMargin = AndroidUtilities.dp(50);
|
||||||
|
messsageEditText.setLayoutParams(layoutParams);
|
||||||
|
}
|
||||||
|
|
||||||
delegate.onAttachButtonShow();
|
delegate.onAttachButtonShow();
|
||||||
}
|
}
|
||||||
|
@ -132,6 +132,8 @@ public class SectionsListView extends ListView implements AbsListView.OnScrollLi
|
|||||||
View child = getChildAt(itemNum - firstVisibleItem);
|
View child = getChildAt(itemNum - firstVisibleItem);
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
header.setTag(child.getTop());
|
header.setTag(child.getTop());
|
||||||
|
} else {
|
||||||
|
header.setTag(-AndroidUtilities.dp(100));
|
||||||
}
|
}
|
||||||
itemNum += count;
|
itemNum += count;
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,7 @@
|
|||||||
<string name="SaveToDownloads">Save to downloads</string>
|
<string name="SaveToDownloads">Save to downloads</string>
|
||||||
<string name="ApplyLocalizationFile">Apply localization file</string>
|
<string name="ApplyLocalizationFile">Apply localization file</string>
|
||||||
<string name="UnsupportedAttachment">Unsupported attachment</string>
|
<string name="UnsupportedAttachment">Unsupported attachment</string>
|
||||||
|
<string name="SetTimer">Set timer</string>
|
||||||
<!--notification-->
|
<!--notification-->
|
||||||
<string name="MessageLifetimeChanged">%1$s set the self-destruct timer to %2$s</string>
|
<string name="MessageLifetimeChanged">%1$s set the self-destruct timer to %2$s</string>
|
||||||
<string name="MessageLifetimeChangedOutgoing">You set the self-destruct timer to %1$s</string>
|
<string name="MessageLifetimeChangedOutgoing">You set the self-destruct timer to %1$s</string>
|
||||||
@ -146,7 +147,7 @@
|
|||||||
<string name="SelectContact">Select Contact</string>
|
<string name="SelectContact">Select Contact</string>
|
||||||
<string name="NoContacts">No contacts yet</string>
|
<string name="NoContacts">No contacts yet</string>
|
||||||
<string name="InviteText">Hey, let\'s switch to Telegram: http://telegram.org/dl2</string>
|
<string name="InviteText">Hey, let\'s switch to Telegram: http://telegram.org/dl2</string>
|
||||||
<string name="TodayAt">today at</string>
|
<string name="TodayAt">at</string>
|
||||||
<string name="YesterdayAt">yesterday at</string>
|
<string name="YesterdayAt">yesterday at</string>
|
||||||
<string name="Online">online</string>
|
<string name="Online">online</string>
|
||||||
<string name="LastSeen">last seen</string>
|
<string name="LastSeen">last seen</string>
|
||||||
@ -271,6 +272,11 @@
|
|||||||
<string name="NoMediaAutoDownload">No media</string>
|
<string name="NoMediaAutoDownload">No media</string>
|
||||||
<string name="SaveToGallerySettings">Save to gallery</string>
|
<string name="SaveToGallerySettings">Save to gallery</string>
|
||||||
<string name="EditName">Edit name</string>
|
<string name="EditName">Edit name</string>
|
||||||
|
<string name="NotificationsPriority">Priority</string>
|
||||||
|
<string name="NotificationsPriorityDefault">Default</string>
|
||||||
|
<string name="NotificationsPriorityLow">Low</string>
|
||||||
|
<string name="NotificationsPriorityHigh">High</string>
|
||||||
|
<string name="NotificationsPriorityMax">Max</string>
|
||||||
<!--media view-->
|
<!--media view-->
|
||||||
<string name="NoMedia">No shared media yet</string>
|
<string name="NoMedia">No shared media yet</string>
|
||||||
<!--map view-->
|
<!--map view-->
|
||||||
|
Loading…
Reference in New Issue
Block a user