Bug fixes
This commit is contained in:
parent
baed4120bc
commit
d69b5b3b36
@ -80,7 +80,7 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
targetSdkVersion 21
|
targetSdkVersion 21
|
||||||
versionCode 393
|
versionCode 395
|
||||||
versionName "2.0.3"
|
versionName "2.0.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1542,13 +1542,17 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
|
|||||||
if (sourceFile.exists()) {
|
if (sourceFile.exists()) {
|
||||||
ProgressDialog progressDialog = null;
|
ProgressDialog progressDialog = null;
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
progressDialog = new ProgressDialog(context);
|
try {
|
||||||
progressDialog.setMessage(LocaleController.getString("Loading", R.string.Loading));
|
progressDialog = new ProgressDialog(context);
|
||||||
progressDialog.setCanceledOnTouchOutside(false);
|
progressDialog.setMessage(LocaleController.getString("Loading", R.string.Loading));
|
||||||
progressDialog.setCancelable(false);
|
progressDialog.setCanceledOnTouchOutside(false);
|
||||||
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
progressDialog.setCancelable(false);
|
||||||
progressDialog.setMax(100);
|
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||||
progressDialog.show();
|
progressDialog.setMax(100);
|
||||||
|
progressDialog.show();
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final ProgressDialog finalProgress = progressDialog;
|
final ProgressDialog finalProgress = progressDialog;
|
||||||
|
@ -238,7 +238,7 @@ public class NotificationsController {
|
|||||||
PendingIntent pintent = PendingIntent.getService(ApplicationLoader.applicationContext, 0, new Intent(ApplicationLoader.applicationContext, NotificationRepeat.class), 0);
|
PendingIntent pintent = PendingIntent.getService(ApplicationLoader.applicationContext, 0, new Intent(ApplicationLoader.applicationContext, NotificationRepeat.class), 0);
|
||||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
|
||||||
int minutes = preferences.getInt("repeat_messages", 60);
|
int minutes = preferences.getInt("repeat_messages", 60);
|
||||||
if (minutes > 0 || personal_count > 0) {
|
if (minutes > 0 && personal_count > 0) {
|
||||||
alarm.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + minutes * 60 * 1000, pintent);
|
alarm.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + minutes * 60 * 1000, pintent);
|
||||||
} else {
|
} else {
|
||||||
alarm.cancel(pintent);
|
alarm.cancel(pintent);
|
||||||
|
@ -16,6 +16,7 @@ import android.net.Uri;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.webkit.MimeTypeMap;
|
import android.webkit.MimeTypeMap;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.telegram.messenger.BuffersStorage;
|
import org.telegram.messenger.BuffersStorage;
|
||||||
import org.telegram.messenger.ByteBufferDesc;
|
import org.telegram.messenger.ByteBufferDesc;
|
||||||
@ -23,6 +24,7 @@ import org.telegram.messenger.ConnectionsManager;
|
|||||||
import org.telegram.messenger.FileLoader;
|
import org.telegram.messenger.FileLoader;
|
||||||
import org.telegram.messenger.FileLog;
|
import org.telegram.messenger.FileLog;
|
||||||
import org.telegram.messenger.MessageKeyData;
|
import org.telegram.messenger.MessageKeyData;
|
||||||
|
import org.telegram.messenger.R;
|
||||||
import org.telegram.messenger.RPCRequest;
|
import org.telegram.messenger.RPCRequest;
|
||||||
import org.telegram.messenger.TLObject;
|
import org.telegram.messenger.TLObject;
|
||||||
import org.telegram.messenger.TLRPC;
|
import org.telegram.messenger.TLRPC;
|
||||||
@ -1856,9 +1858,9 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void prepareSendingDocumentInternal(String path, String originalPath, Uri uri, String mime, final long dialog_id) {
|
private static boolean prepareSendingDocumentInternal(String path, String originalPath, Uri uri, String mime, final long dialog_id) {
|
||||||
if ((path == null || path.length() == 0) && uri == null) {
|
if ((path == null || path.length() == 0) && uri == null) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
MimeTypeMap myMime = MimeTypeMap.getSingleton();
|
MimeTypeMap myMime = MimeTypeMap.getSingleton();
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
@ -1870,10 +1872,13 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
|||||||
extension = "txt";
|
extension = "txt";
|
||||||
}
|
}
|
||||||
path = MediaController.copyDocumentToCache(uri, extension);
|
path = MediaController.copyDocumentToCache(uri, extension);
|
||||||
|
if (path == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final File f = new File(path);
|
final File f = new File(path);
|
||||||
if (!f.exists() || f.length() == 0) {
|
if (!f.exists() || f.length() == 0) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isEncrypted = (int)dialog_id == 0;
|
boolean isEncrypted = (int)dialog_id == 0;
|
||||||
@ -1938,6 +1943,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
|||||||
SendMessagesHelper.getInstance().sendMessage(documentFinal, originalPathFinal, pathFinal, dialog_id);
|
SendMessagesHelper.getInstance().sendMessage(documentFinal, originalPathFinal, pathFinal, dialog_id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void prepareSendingDocument(String path, String originalPath, Uri uri, String mine, long dialog_id) {
|
public static void prepareSendingDocument(String path, String originalPath, Uri uri, String mine, long dialog_id) {
|
||||||
@ -1962,16 +1968,34 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
boolean error = false;
|
||||||
if (paths != null) {
|
if (paths != null) {
|
||||||
for (int a = 0; a < paths.size(); a++) {
|
for (int a = 0; a < paths.size(); a++) {
|
||||||
prepareSendingDocumentInternal(paths.get(a), originalPaths.get(a), null, mime, dialog_id);
|
if (!prepareSendingDocumentInternal(paths.get(a), originalPaths.get(a), null, mime, dialog_id)) {
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (uris != null) {
|
if (uris != null) {
|
||||||
for (int a = 0; a < uris.size(); a++) {
|
for (int a = 0; a < uris.size(); a++) {
|
||||||
prepareSendingDocumentInternal(null, null, uris.get(a), mime, dialog_id);
|
if (!prepareSendingDocumentInternal(null, null, uris.get(a), mime, dialog_id)) {
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (error) {
|
||||||
|
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
Toast toast = Toast.makeText(ApplicationLoader.applicationContext, LocaleController.getString("UnsupportedAttachment", R.string.UnsupportedAttachment), Toast.LENGTH_SHORT);
|
||||||
|
toast.show();
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
@ -567,6 +567,7 @@ public class ActionBarLayout extends FrameLayout {
|
|||||||
containerViewBack.addView(fragment.actionBar);
|
containerViewBack.addView(fragment.actionBar);
|
||||||
fragment.actionBar.setTitleOverlayText(titleOverlayText);
|
fragment.actionBar.setTitleOverlayText(titleOverlayText);
|
||||||
}
|
}
|
||||||
|
|
||||||
containerViewBack.addView(fragmentView);
|
containerViewBack.addView(fragmentView);
|
||||||
ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams();
|
ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams();
|
||||||
layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT;
|
layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT;
|
||||||
@ -623,6 +624,7 @@ public class ActionBarLayout extends FrameLayout {
|
|||||||
public void run() {
|
public void run() {
|
||||||
presentFragmentInternalRemoveOld(removeLast, currentFragment);
|
presentFragmentInternalRemoveOld(removeLast, currentFragment);
|
||||||
fragment.onOpenAnimationEnd();
|
fragment.onOpenAnimationEnd();
|
||||||
|
ViewProxy.setTranslationX(containerView, 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
currentAnimation = new AnimatorSetProxy();
|
currentAnimation = new AnimatorSetProxy();
|
||||||
|
@ -18,6 +18,8 @@ import android.view.ViewTreeObserver;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.PopupWindow;
|
import android.widget.PopupWindow;
|
||||||
|
|
||||||
|
import org.telegram.messenger.FileLog;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
public class ActionBarPopupWindow extends PopupWindow {
|
public class ActionBarPopupWindow extends PopupWindow {
|
||||||
@ -157,8 +159,12 @@ public class ActionBarPopupWindow extends PopupWindow {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showAsDropDown(View anchor, int xoff, int yoff) {
|
public void showAsDropDown(View anchor, int xoff, int yoff) {
|
||||||
super.showAsDropDown(anchor, xoff, yoff);
|
try {
|
||||||
registerListener(anchor);
|
super.showAsDropDown(anchor, xoff, yoff);
|
||||||
|
registerListener(anchor);
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -290,7 +290,9 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe
|
|||||||
view = new UserCell(mContext, 1);
|
view = new UserCell(mContext, 1);
|
||||||
}
|
}
|
||||||
TLRPC.User user = MessagesController.getInstance().getUser(MessagesController.getInstance().blockedUsers.get(i));
|
TLRPC.User user = MessagesController.getInstance().getUser(MessagesController.getInstance().blockedUsers.get(i));
|
||||||
((UserCell)view).setData(user, null, user.phone != null && user.phone.length() != 0 ? PhoneFormat.getInstance().format("+" + user.phone) : LocaleController.getString("NumberUnknown", R.string.NumberUnknown), 0);
|
if (user != null) {
|
||||||
|
((UserCell) view).setData(user, null, user.phone != null && user.phone.length() != 0 ? PhoneFormat.getInstance().format("+" + user.phone) : LocaleController.getString("NumberUnknown", R.string.NumberUnknown), 0);
|
||||||
|
}
|
||||||
} else if (type == 1) {
|
} else if (type == 1) {
|
||||||
if (view == null) {
|
if (view == null) {
|
||||||
view = new TextInfoCell(mContext);
|
view = new TextInfoCell(mContext);
|
||||||
|
@ -458,6 +458,7 @@ public class DialogCell extends BaseCell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nameWidth = Math.max(AndroidUtilities.dp(12), nameWidth);
|
||||||
CharSequence nameStringFinal = TextUtils.ellipsize(nameString.replace("\n", " "), currentNamePaint, nameWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END);
|
CharSequence nameStringFinal = TextUtils.ellipsize(nameString.replace("\n", " "), currentNamePaint, nameWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END);
|
||||||
try {
|
try {
|
||||||
nameLayout = new StaticLayout(nameStringFinal, currentNamePaint, nameWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
nameLayout = new StaticLayout(nameStringFinal, currentNamePaint, nameWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||||
@ -510,9 +511,13 @@ public class DialogCell extends BaseCell {
|
|||||||
}
|
}
|
||||||
messageString = Emoji.replaceEmoji(mess, messagePaint.getFontMetricsInt(), AndroidUtilities.dp(17));
|
messageString = Emoji.replaceEmoji(mess, messagePaint.getFontMetricsInt(), AndroidUtilities.dp(17));
|
||||||
}
|
}
|
||||||
|
messageWidth = Math.max(AndroidUtilities.dp(12), messageWidth);
|
||||||
CharSequence messageStringFinal = TextUtils.ellipsize(messageString, currentMessagePaint, messageWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END);
|
CharSequence messageStringFinal = TextUtils.ellipsize(messageString, currentMessagePaint, messageWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END);
|
||||||
messageLayout = new StaticLayout(messageStringFinal, currentMessagePaint, messageWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
try {
|
||||||
|
messageLayout = new StaticLayout(messageStringFinal, currentMessagePaint, messageWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
|
||||||
double widthpx = 0;
|
double widthpx = 0;
|
||||||
float left = 0;
|
float left = 0;
|
||||||
@ -526,7 +531,7 @@ public class DialogCell extends BaseCell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (messageLayout.getLineCount() > 0) {
|
if (messageLayout != null && messageLayout.getLineCount() > 0) {
|
||||||
left = messageLayout.getLineLeft(0);
|
left = messageLayout.getLineLeft(0);
|
||||||
if (left == 0) {
|
if (left == 0) {
|
||||||
widthpx = Math.ceil(messageLayout.getLineWidth(0));
|
widthpx = Math.ceil(messageLayout.getLineWidth(0));
|
||||||
@ -545,7 +550,7 @@ public class DialogCell extends BaseCell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (messageLayout.getLineCount() > 0) {
|
if (messageLayout != null && messageLayout.getLineCount() > 0) {
|
||||||
left = messageLayout.getLineRight(0);
|
left = messageLayout.getLineRight(0);
|
||||||
if (left == messageWidth) {
|
if (left == messageWidth) {
|
||||||
widthpx = Math.ceil(messageLayout.getLineWidth(0));
|
widthpx = Math.ceil(messageLayout.getLineWidth(0));
|
||||||
@ -677,10 +682,12 @@ public class DialogCell extends BaseCell {
|
|||||||
timeLayout.draw(canvas);
|
timeLayout.draw(canvas);
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
|
|
||||||
canvas.save();
|
if (messageLayout != null) {
|
||||||
canvas.translate(messageLeft, messageTop);
|
canvas.save();
|
||||||
messageLayout.draw(canvas);
|
canvas.translate(messageLeft, messageTop);
|
||||||
canvas.restore();
|
messageLayout.draw(canvas);
|
||||||
|
canvas.restore();
|
||||||
|
}
|
||||||
|
|
||||||
if (drawClock) {
|
if (drawClock) {
|
||||||
setDrawableBounds(clockDrawable, checkDrawLeft, checkDrawTop);
|
setDrawableBounds(clockDrawable, checkDrawLeft, checkDrawTop);
|
||||||
|
@ -386,7 +386,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||||||
if (Intent.ACTION_SEND.equals(intent.getAction())) {
|
if (Intent.ACTION_SEND.equals(intent.getAction())) {
|
||||||
boolean error = false;
|
boolean error = false;
|
||||||
String type = intent.getType();
|
String type = intent.getType();
|
||||||
if (type != null && type.equals("text/plain")) {
|
if (type != null && type.equals("text/plain") && intent.getStringExtra(Intent.EXTRA_TEXT) != null) {
|
||||||
String text = intent.getStringExtra(Intent.EXTRA_TEXT);
|
String text = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||||
String subject = intent.getStringExtra(Intent.EXTRA_SUBJECT);
|
String subject = intent.getStringExtra(Intent.EXTRA_SUBJECT);
|
||||||
|
|
||||||
@ -950,6 +950,9 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void didReceivedNotification(int id, Object... args) {
|
public void didReceivedNotification(int id, Object... args) {
|
||||||
if (id == NotificationCenter.appDidLogout) {
|
if (id == NotificationCenter.appDidLogout) {
|
||||||
|
if (drawerLayoutAdapter != null) {
|
||||||
|
drawerLayoutAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
for (BaseFragment fragment : actionBarLayout.fragmentsStack) {
|
for (BaseFragment fragment : actionBarLayout.fragmentsStack) {
|
||||||
fragment.onFragmentDestroy();
|
fragment.onFragmentDestroy();
|
||||||
}
|
}
|
||||||
|
@ -778,23 +778,27 @@ public class LoginActivity extends BaseFragment {
|
|||||||
|
|
||||||
private void updatePhoneField() {
|
private void updatePhoneField() {
|
||||||
ignoreOnPhoneChange = true;
|
ignoreOnPhoneChange = true;
|
||||||
String codeText = codeField.getText().toString();
|
try {
|
||||||
String phone = PhoneFormat.getInstance().format("+" + codeText + phoneField.getText().toString());
|
String codeText = codeField.getText().toString();
|
||||||
int idx = phone.indexOf(" ");
|
String phone = PhoneFormat.getInstance().format("+" + codeText + phoneField.getText().toString());
|
||||||
if (idx != -1) {
|
int idx = phone.indexOf(" ");
|
||||||
String resultCode = PhoneFormat.stripExceptNumbers(phone.substring(0, idx));
|
if (idx != -1) {
|
||||||
if (!codeText.equals(resultCode)) {
|
String resultCode = PhoneFormat.stripExceptNumbers(phone.substring(0, idx));
|
||||||
phone = PhoneFormat.getInstance().format(phoneField.getText().toString()).trim();
|
if (!codeText.equals(resultCode)) {
|
||||||
phoneField.setText(phone);
|
phone = PhoneFormat.getInstance().format(phoneField.getText().toString()).trim();
|
||||||
int len = phoneField.length();
|
phoneField.setText(phone);
|
||||||
phoneField.setSelection(phoneField.length());
|
int len = phoneField.length();
|
||||||
|
phoneField.setSelection(phoneField.length());
|
||||||
|
} else {
|
||||||
|
phoneField.setText(phone.substring(idx).trim());
|
||||||
|
int len = phoneField.length();
|
||||||
|
phoneField.setSelection(phoneField.length());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
phoneField.setText(phone.substring(idx).trim());
|
|
||||||
int len = phoneField.length();
|
|
||||||
phoneField.setSelection(phoneField.length());
|
phoneField.setSelection(phoneField.length());
|
||||||
}
|
}
|
||||||
} else {
|
} catch (Exception e) {
|
||||||
phoneField.setSelection(phoneField.length());
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
ignoreOnPhoneChange = false;
|
ignoreOnPhoneChange = false;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import android.view.ViewTreeObserver;
|
|||||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||||
import android.widget.AbsListView;
|
import android.widget.AbsListView;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
@ -32,6 +33,7 @@ import android.widget.TextView;
|
|||||||
import org.telegram.android.AndroidUtilities;
|
import org.telegram.android.AndroidUtilities;
|
||||||
import org.telegram.android.LocaleController;
|
import org.telegram.android.LocaleController;
|
||||||
import org.telegram.android.MessageObject;
|
import org.telegram.android.MessageObject;
|
||||||
|
import org.telegram.messenger.FileLog;
|
||||||
import org.telegram.messenger.TLRPC;
|
import org.telegram.messenger.TLRPC;
|
||||||
import org.telegram.android.ContactsController;
|
import org.telegram.android.ContactsController;
|
||||||
import org.telegram.android.MessagesController;
|
import org.telegram.android.MessagesController;
|
||||||
@ -537,19 +539,26 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
|
|||||||
dialogsSearchAdapter.notifyDataSetChanged();
|
dialogsSearchAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
if (messagesListView != null) {
|
if (messagesListView != null) {
|
||||||
if (MessagesController.getInstance().loadingDialogs && MessagesController.getInstance().dialogs.isEmpty()) {
|
try {
|
||||||
searchEmptyView.setVisibility(View.GONE);
|
if (messagesListView.getAdapter() != null && messagesListView.getAdapter() instanceof BaseAdapter) {
|
||||||
emptyView.setVisibility(View.GONE);
|
((BaseAdapter) messagesListView.getAdapter()).notifyDataSetChanged();
|
||||||
messagesListView.setEmptyView(progressView);
|
|
||||||
} else {
|
|
||||||
if (searching && searchWas) {
|
|
||||||
messagesListView.setEmptyView(searchEmptyView);
|
|
||||||
emptyView.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
messagesListView.setEmptyView(emptyView);
|
|
||||||
searchEmptyView.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
progressView.setVisibility(View.GONE);
|
if (MessagesController.getInstance().loadingDialogs && MessagesController.getInstance().dialogs.isEmpty()) {
|
||||||
|
searchEmptyView.setVisibility(View.GONE);
|
||||||
|
emptyView.setVisibility(View.GONE);
|
||||||
|
messagesListView.setEmptyView(progressView);
|
||||||
|
} else {
|
||||||
|
if (searching && searchWas) {
|
||||||
|
messagesListView.setEmptyView(searchEmptyView);
|
||||||
|
emptyView.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
messagesListView.setEmptyView(emptyView);
|
||||||
|
searchEmptyView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
progressView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e); //TODO fix it in other way?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (id == NotificationCenter.emojiDidLoaded) {
|
} else if (id == NotificationCenter.emojiDidLoaded) {
|
||||||
|
@ -242,12 +242,12 @@ public class PhotoCropActivity extends BaseFragment {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return Bitmap.createBitmap(imageToCrop, x, y, size, size);
|
return Bitmap.createBitmap(imageToCrop, x, y, size, size);
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
FileLog.e("tmessags", e);
|
FileLog.e("tmessags", e);
|
||||||
System.gc();
|
System.gc();
|
||||||
try {
|
try {
|
||||||
return Bitmap.createBitmap(imageToCrop, x, y, size, size);
|
return Bitmap.createBitmap(imageToCrop, x, y, size, size);
|
||||||
} catch (Exception e2) {
|
} catch (Throwable e2) {
|
||||||
FileLog.e("tmessages", e2);
|
FileLog.e("tmessages", e2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1579,14 +1579,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
actionBar.setTitle(LocaleController.formatString("Of", R.string.Of, 1, 1));
|
|
||||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailedLoad);
|
|
||||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidLoaded);
|
|
||||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileLoadProgressChanged);
|
|
||||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.mediaCountDidLoaded);
|
|
||||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.mediaDidLoaded);
|
|
||||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.userPhotosLoaded);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (windowView.getParent() != null) {
|
if (windowView.getParent() != null) {
|
||||||
WindowManager wm = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE);
|
WindowManager wm = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE);
|
||||||
@ -1596,9 +1588,24 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
placeProvider = provider;
|
|
||||||
WindowManager wm = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE);
|
WindowManager wm = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE);
|
||||||
wm.addView(windowView, windowLayoutParams);
|
try {
|
||||||
|
wm.addView(windowView, windowLayoutParams);
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
actionBar.setTitle(LocaleController.formatString("Of", R.string.Of, 1, 1));
|
||||||
|
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailedLoad);
|
||||||
|
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidLoaded);
|
||||||
|
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileLoadProgressChanged);
|
||||||
|
NotificationCenter.getInstance().addObserver(this, NotificationCenter.mediaCountDidLoaded);
|
||||||
|
NotificationCenter.getInstance().addObserver(this, NotificationCenter.mediaDidLoaded);
|
||||||
|
NotificationCenter.getInstance().addObserver(this, NotificationCenter.userPhotosLoaded);
|
||||||
|
|
||||||
|
placeProvider = provider;
|
||||||
|
|
||||||
if (velocityTracker == null) {
|
if (velocityTracker == null) {
|
||||||
velocityTracker = VelocityTracker.obtain();
|
velocityTracker = VelocityTracker.obtain();
|
||||||
|
@ -287,10 +287,10 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
|
|||||||
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();
|
||||||
editor.clear().commit();
|
editor.clear().commit();
|
||||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.appDidLogout);
|
|
||||||
MessagesController.getInstance().unregistedPush();
|
MessagesController.getInstance().unregistedPush();
|
||||||
MessagesController.getInstance().logOut();
|
MessagesController.getInstance().logOut();
|
||||||
UserConfig.clearConfig();
|
UserConfig.clearConfig();
|
||||||
|
NotificationCenter.getInstance().postNotificationName(NotificationCenter.appDidLogout);
|
||||||
MessagesStorage.getInstance().cleanUp(false);
|
MessagesStorage.getInstance().cleanUp(false);
|
||||||
MessagesController.getInstance().cleanUp();
|
MessagesController.getInstance().cleanUp();
|
||||||
ContactsController.getInstance().deleteAllAppAccounts();
|
ContactsController.getInstance().deleteAllAppAccounts();
|
||||||
|
@ -631,7 +631,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
|
|||||||
emojiPopup.setWidth(View.MeasureSpec.makeMeasureSpec(AndroidUtilities.displaySize.x, View.MeasureSpec.EXACTLY));
|
emojiPopup.setWidth(View.MeasureSpec.makeMeasureSpec(AndroidUtilities.displaySize.x, View.MeasureSpec.EXACTLY));
|
||||||
}
|
}
|
||||||
|
|
||||||
emojiPopup.showAtLocation(parentActivity.getWindow().getDecorView(), Gravity.BOTTOM | Gravity.LEFT, 0, 0);
|
try {
|
||||||
|
emojiPopup.showAtLocation(parentActivity.getWindow().getDecorView(), Gravity.BOTTOM | Gravity.LEFT, 0, 0);
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
if (!keyboardVisible) {
|
if (!keyboardVisible) {
|
||||||
if (sizeNotifierRelativeLayout != null) {
|
if (sizeNotifierRelativeLayout != null) {
|
||||||
sizeNotifierRelativeLayout.setPadding(0, 0, 0, currentHeight);
|
sizeNotifierRelativeLayout.setPadding(0, 0, 0, currentHeight);
|
||||||
|
Loading…
Reference in New Issue
Block a user