Commit e27094b9 authored by DrKLO's avatar DrKLO

Bug fixes

parent 755446e9
...@@ -83,7 +83,7 @@ android { ...@@ -83,7 +83,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 19 targetSdkVersion 19
versionCode 293 versionCode 296
versionName "1.7.0" versionName "1.7.0"
} }
} }
...@@ -183,6 +183,8 @@ public class NotificationsController { ...@@ -183,6 +183,8 @@ public class NotificationsController {
} }
msg = LocaleController.formatString("NotificationGroupKickMember", R.string.NotificationGroupKickMember, Utilities.formatName(user.first_name, user.last_name), chat.title, Utilities.formatName(u2.first_name, u2.last_name)); msg = LocaleController.formatString("NotificationGroupKickMember", R.string.NotificationGroupKickMember, Utilities.formatName(user.first_name, user.last_name), chat.title, Utilities.formatName(u2.first_name, u2.last_name));
} }
} else if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatCreate) {
msg = messageObject.messageText.toString();
} }
} else { } else {
if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty) { if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty) {
...@@ -508,9 +510,6 @@ public class NotificationsController { ...@@ -508,9 +510,6 @@ public class NotificationsController {
if (oldCount != popupMessages.size()) { if (oldCount != popupMessages.size()) {
NotificationCenter.getInstance().postNotificationName(pushMessagesUpdated); NotificationCenter.getInstance().postNotificationName(pushMessagesUpdated);
} }
// if (readMessages != null || oldCount2 != pushMessages.size() || readMessages == null && dialog_id == 0) {
// showOrUpdateNotification(notifyCheck);
// }
} }
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) { public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) {
...@@ -585,6 +584,15 @@ public class NotificationsController { ...@@ -585,6 +584,15 @@ public class NotificationsController {
} }
if (newCount == 0) { if (newCount == 0) {
pushDialogs.remove(dialog_id); pushDialogs.remove(dialog_id);
for (int a = 0; a < pushMessages.size(); a++) {
MessageObject messageObject = pushMessages.get(a);
if (messageObject.getDialogId() == dialog_id) {
pushMessages.remove(a);
a--;
pushMessagesDict.remove(messageObject.messageOwner.id);
popupMessages.remove(messageObject);
}
}
} else if (canAddValue) { } else if (canAddValue) {
total_unread_count += newCount; total_unread_count += newCount;
pushDialogs.put(dialog_id, newCount); pushDialogs.put(dialog_id, newCount);
...@@ -611,7 +619,6 @@ public class NotificationsController { ...@@ -611,7 +619,6 @@ public class NotificationsController {
pushDialogs.clear(); pushDialogs.clear();
total_unread_count = 0; total_unread_count = 0;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE);
String dialogsToLoad = "";
for (HashMap.Entry<Long, Integer> entry : dialogs.entrySet()) { for (HashMap.Entry<Long, Integer> entry : dialogs.entrySet()) {
long dialog_id = entry.getKey(); long dialog_id = entry.getKey();
int notify_override = preferences.getInt("notify2_" + dialog_id, 0); int notify_override = preferences.getInt("notify2_" + dialog_id, 0);
...@@ -619,10 +626,6 @@ public class NotificationsController { ...@@ -619,10 +626,6 @@ public class NotificationsController {
if (!(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0)) { if (!(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0)) {
pushDialogs.put(dialog_id, entry.getValue()); pushDialogs.put(dialog_id, entry.getValue());
total_unread_count += entry.getValue(); total_unread_count += entry.getValue();
if (dialogsToLoad.length() != 0) {
dialogsToLoad += ",";
}
dialogsToLoad += "" + dialog_id;
} }
} }
if (total_unread_count == 0) { if (total_unread_count == 0) {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
package org.telegram.ui; package org.telegram.ui;
import android.animation.Animator;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
...@@ -149,7 +150,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -149,7 +150,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private int unread_to_load = 0; private int unread_to_load = 0;
private int first_unread_id = 0; private int first_unread_id = 0;
private int last_unread_id = 0; private int last_unread_id = 0;
private boolean unread_end_reached = true; private boolean unread_end_reached = false;
private boolean loadingForward = false; private boolean loadingForward = false;
private MessageObject unreadMessageObject = null; private MessageObject unreadMessageObject = null;
...@@ -617,6 +618,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -617,6 +618,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
View bottomOverlayChat = fragmentView.findViewById(R.id.bottom_overlay_chat); View bottomOverlayChat = fragmentView.findViewById(R.id.bottom_overlay_chat);
progressView = fragmentView.findViewById(R.id.progressLayout); progressView = fragmentView.findViewById(R.id.progressLayout);
pagedownButton = fragmentView.findViewById(R.id.pagedown_button); pagedownButton = fragmentView.findViewById(R.id.pagedown_button);
pagedownButton.setVisibility(View.GONE);
View progressViewInner = progressView.findViewById(R.id.progressLayoutInner); View progressViewInner = progressView.findViewById(R.id.progressLayoutInner);
...@@ -743,8 +745,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -743,8 +745,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (firstVisibleItem + visibleItemCount == totalItemCount && unread_end_reached) { if (firstVisibleItem + visibleItemCount == totalItemCount && unread_end_reached) {
showPagedownButton(false, true); showPagedownButton(false, true);
} }
} else {
showPagedownButton(false, false);
} }
for (int a = 0; a < visibleItemCount; a++) { for (int a = 0; a < visibleItemCount; a++) {
View view = absListView.getChildAt(a); View view = absListView.getChildAt(a);
...@@ -873,7 +873,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -873,7 +873,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
if (show) { if (show) {
if (pagedownButton.getVisibility() == View.GONE) { if (pagedownButton.getVisibility() == View.GONE) {
if (android.os.Build.VERSION.SDK_INT >= 16 && animated) { if (android.os.Build.VERSION.SDK_INT >= 12 && animated) {
pagedownButton.setVisibility(View.VISIBLE); pagedownButton.setVisibility(View.VISIBLE);
pagedownButton.setAlpha(0); pagedownButton.setAlpha(0);
pagedownButton.animate().alpha(1).setDuration(200).start(); pagedownButton.animate().alpha(1).setDuration(200).start();
...@@ -883,13 +883,28 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -883,13 +883,28 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
} else { } else {
if (pagedownButton.getVisibility() == View.VISIBLE) { if (pagedownButton.getVisibility() == View.VISIBLE) {
if (android.os.Build.VERSION.SDK_INT >= 16 && animated) { if (android.os.Build.VERSION.SDK_INT >= 12 && animated) {
pagedownButton.animate().alpha(0).withEndAction(new Runnable() { pagedownButton.animate().alpha(0).setDuration(200).setListener(new Animator.AnimatorListener() {
@Override @Override
public void run() { public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
pagedownButton.setVisibility(View.GONE); pagedownButton.setVisibility(View.GONE);
} }
}).setDuration(200).start();
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
}).start();
} else { } else {
pagedownButton.setVisibility(View.GONE); pagedownButton.setVisibility(View.GONE);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment