mirror of
https://github.com/DrKLO/Telegram.git
synced 2025-03-29 01:27:22 +01:00
Crash fixes
This commit is contained in:
parent
f63c8b20bb
commit
85bc7046bb
10 changed files with 45 additions and 20 deletions
|
@ -82,7 +82,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
targetSdkVersion 21
|
targetSdkVersion 21
|
||||||
versionCode 453
|
versionCode 454
|
||||||
versionName "2.5.0"
|
versionName "2.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1777,6 +1777,10 @@ public class SecretChatHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
try {
|
||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
|
} catch (Exception e) {
|
||||||
|
//don't promt
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,7 +200,11 @@ public class ActionBarPopupWindow extends PopupWindow {
|
||||||
@Override
|
@Override
|
||||||
public void dismiss() {
|
public void dismiss() {
|
||||||
setFocusable(false);
|
setFocusable(false);
|
||||||
|
try {
|
||||||
super.dismiss();
|
super.dismiss();
|
||||||
|
} catch (Exception e) {
|
||||||
|
//don't promt
|
||||||
|
}
|
||||||
unregisterListener();
|
unregisterListener();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -603,16 +603,21 @@ public class DialogCell extends BaseCell {
|
||||||
public void checkCurrentDialogIndex() {
|
public void checkCurrentDialogIndex() {
|
||||||
TLRPC.TL_dialog dialog = null;
|
TLRPC.TL_dialog dialog = null;
|
||||||
if (isServerOnly) {
|
if (isServerOnly) {
|
||||||
|
if (index < MessagesController.getInstance().dialogsServerOnly.size()) {
|
||||||
dialog = MessagesController.getInstance().dialogsServerOnly.get(index);
|
dialog = MessagesController.getInstance().dialogsServerOnly.get(index);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (index < MessagesController.getInstance().dialogs.size()) {
|
||||||
dialog = MessagesController.getInstance().dialogs.get(index);
|
dialog = MessagesController.getInstance().dialogs.get(index);
|
||||||
}
|
}
|
||||||
boolean update = true;
|
}
|
||||||
|
if (dialog != null) {
|
||||||
if (currentDialogId != dialog.id || message != null && message.messageOwner.id != dialog.top_message || unreadCount != dialog.unread_count) {
|
if (currentDialogId != dialog.id || message != null && message.messageOwner.id != dialog.top_message || unreadCount != dialog.unread_count) {
|
||||||
currentDialogId = dialog.id;
|
currentDialogId = dialog.id;
|
||||||
update(0);
|
update(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void update(int mask) {
|
public void update(int mask) {
|
||||||
if (isDialogCell) {
|
if (isDialogCell) {
|
||||||
|
|
|
@ -1307,7 +1307,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
progressView.setLayoutParams(layoutParams3);
|
progressView.setLayoutParams(layoutParams3);
|
||||||
|
|
||||||
ProgressBar progressBar = new ProgressBar(getParentActivity());
|
ProgressBar progressBar = new ProgressBar(getParentActivity());
|
||||||
|
try {
|
||||||
progressBar.setIndeterminateDrawable(getParentActivity().getResources().getDrawable(R.drawable.loading_animation));
|
progressBar.setIndeterminateDrawable(getParentActivity().getResources().getDrawable(R.drawable.loading_animation));
|
||||||
|
} catch (Exception e) {
|
||||||
|
//don't promt
|
||||||
|
}
|
||||||
progressBar.setIndeterminate(true);
|
progressBar.setIndeterminate(true);
|
||||||
AndroidUtilities.setProgressBarAnimationDuration(progressBar, 1500);
|
AndroidUtilities.setProgressBarAnimationDuration(progressBar, 1500);
|
||||||
progressView.addView(progressBar);
|
progressView.addView(progressBar);
|
||||||
|
|
|
@ -854,7 +854,11 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC
|
||||||
emojiButton.setImageResource(R.drawable.ic_msg_panel_smiles);
|
emojiButton.setImageResource(R.drawable.ic_msg_panel_smiles);
|
||||||
}
|
}
|
||||||
if (emojiPopup != null) {
|
if (emojiPopup != null) {
|
||||||
|
try {
|
||||||
emojiPopup.dismiss();
|
emojiPopup.dismiss();
|
||||||
|
} catch (Exception e) {
|
||||||
|
//don't promt
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (sizeNotifierRelativeLayout != null) {
|
if (sizeNotifierRelativeLayout != null) {
|
||||||
sizeNotifierRelativeLayout.post(new Runnable() {
|
sizeNotifierRelativeLayout.post(new Runnable() {
|
||||||
|
|
|
@ -1446,7 +1446,7 @@ public class PhotoFilterView extends FrameLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap getBitmap() {
|
public Bitmap getBitmap() {
|
||||||
return eglThread.getTexture();
|
return eglThread != null ? eglThread.getTexture() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fixLayout(int viewWidth, int viewHeight) {
|
private void fixLayout(int viewWidth, int viewHeight) {
|
||||||
|
|
|
@ -488,7 +488,7 @@ public class PasscodeActivity extends BaseFragment implements NotificationCenter
|
||||||
filterArray[0] = new InputFilter.LengthFilter(4);
|
filterArray[0] = new InputFilter.LengthFilter(4);
|
||||||
passwordEditText.setFilters(filterArray);
|
passwordEditText.setFilters(filterArray);
|
||||||
passwordEditText.setInputType(InputType.TYPE_CLASS_PHONE);
|
passwordEditText.setInputType(InputType.TYPE_CLASS_PHONE);
|
||||||
passwordEditText.setKeyListener(DigitsKeyListener.getInstance("123456789"));
|
passwordEditText.setKeyListener(DigitsKeyListener.getInstance("1234567890"));
|
||||||
} else if (type == 1 && currentPasswordType == 1 || type == 2 && UserConfig.passcodeType == 1) {
|
} else if (type == 1 && currentPasswordType == 1 || type == 2 && UserConfig.passcodeType == 1) {
|
||||||
passwordEditText.setFilters(new InputFilter[0]);
|
passwordEditText.setFilters(new InputFilter[0]);
|
||||||
passwordEditText.setKeyListener(null);
|
passwordEditText.setKeyListener(null);
|
||||||
|
|
|
@ -972,6 +972,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
|
||||||
}
|
}
|
||||||
AvatarDrawable avatarDrawable = new AvatarDrawable(user, true);
|
AvatarDrawable avatarDrawable = new AvatarDrawable(user, true);
|
||||||
avatarDrawable.setColor(0xff5c98cd);
|
avatarDrawable.setColor(0xff5c98cd);
|
||||||
|
if (avatarImage != null) {
|
||||||
avatarImage.setImage(photo, "50_50", avatarDrawable);
|
avatarImage.setImage(photo, "50_50", avatarDrawable);
|
||||||
avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
|
avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
|
||||||
|
|
||||||
|
@ -980,6 +981,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
|
||||||
|
|
||||||
avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
|
avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void sendLogs() {
|
private void sendLogs() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -419,7 +419,9 @@ public class WallpapersActivity extends BaseFragment implements NotificationCent
|
||||||
wallPapers.add((TLRPC.WallPaper)obj);
|
wallPapers.add((TLRPC.WallPaper)obj);
|
||||||
wallpappersByIds.put(((TLRPC.WallPaper)obj).id, (TLRPC.WallPaper)obj);
|
wallpappersByIds.put(((TLRPC.WallPaper)obj).id, (TLRPC.WallPaper)obj);
|
||||||
}
|
}
|
||||||
|
if (listAdapter != null) {
|
||||||
listAdapter.notifyDataSetChanged();
|
listAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
if (backgroundImage != null) {
|
if (backgroundImage != null) {
|
||||||
processSelectedBackground();
|
processSelectedBackground();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue