mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +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 {
|
||||
minSdkVersion 8
|
||||
targetSdkVersion 21
|
||||
versionCode 453
|
||||
versionName "2.5.0"
|
||||
versionCode 454
|
||||
versionName "2.5.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1777,6 +1777,10 @@ public class SecretChatHelper {
|
|||
}
|
||||
}
|
||||
});
|
||||
try {
|
||||
progressDialog.show();
|
||||
} catch (Exception e) {
|
||||
//don't promt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,7 +200,11 @@ public class ActionBarPopupWindow extends PopupWindow {
|
|||
@Override
|
||||
public void dismiss() {
|
||||
setFocusable(false);
|
||||
try {
|
||||
super.dismiss();
|
||||
} catch (Exception e) {
|
||||
//don't promt
|
||||
}
|
||||
unregisterListener();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -603,16 +603,21 @@ public class DialogCell extends BaseCell {
|
|||
public void checkCurrentDialogIndex() {
|
||||
TLRPC.TL_dialog dialog = null;
|
||||
if (isServerOnly) {
|
||||
if (index < MessagesController.getInstance().dialogsServerOnly.size()) {
|
||||
dialog = MessagesController.getInstance().dialogsServerOnly.get(index);
|
||||
}
|
||||
} else {
|
||||
if (index < MessagesController.getInstance().dialogs.size()) {
|
||||
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) {
|
||||
currentDialogId = dialog.id;
|
||||
update(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void update(int mask) {
|
||||
if (isDialogCell) {
|
||||
|
|
|
@ -1307,7 +1307,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
progressView.setLayoutParams(layoutParams3);
|
||||
|
||||
ProgressBar progressBar = new ProgressBar(getParentActivity());
|
||||
try {
|
||||
progressBar.setIndeterminateDrawable(getParentActivity().getResources().getDrawable(R.drawable.loading_animation));
|
||||
} catch (Exception e) {
|
||||
//don't promt
|
||||
}
|
||||
progressBar.setIndeterminate(true);
|
||||
AndroidUtilities.setProgressBarAnimationDuration(progressBar, 1500);
|
||||
progressView.addView(progressBar);
|
||||
|
|
|
@ -854,7 +854,11 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC
|
|||
emojiButton.setImageResource(R.drawable.ic_msg_panel_smiles);
|
||||
}
|
||||
if (emojiPopup != null) {
|
||||
try {
|
||||
emojiPopup.dismiss();
|
||||
} catch (Exception e) {
|
||||
//don't promt
|
||||
}
|
||||
}
|
||||
if (sizeNotifierRelativeLayout != null) {
|
||||
sizeNotifierRelativeLayout.post(new Runnable() {
|
||||
|
|
|
@ -1446,7 +1446,7 @@ public class PhotoFilterView extends FrameLayout {
|
|||
}
|
||||
|
||||
public Bitmap getBitmap() {
|
||||
return eglThread.getTexture();
|
||||
return eglThread != null ? eglThread.getTexture() : null;
|
||||
}
|
||||
|
||||
private void fixLayout(int viewWidth, int viewHeight) {
|
||||
|
|
|
@ -488,7 +488,7 @@ public class PasscodeActivity extends BaseFragment implements NotificationCenter
|
|||
filterArray[0] = new InputFilter.LengthFilter(4);
|
||||
passwordEditText.setFilters(filterArray);
|
||||
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) {
|
||||
passwordEditText.setFilters(new InputFilter[0]);
|
||||
passwordEditText.setKeyListener(null);
|
||||
|
|
|
@ -972,6 +972,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
|
|||
}
|
||||
AvatarDrawable avatarDrawable = new AvatarDrawable(user, true);
|
||||
avatarDrawable.setColor(0xff5c98cd);
|
||||
if (avatarImage != null) {
|
||||
avatarImage.setImage(photo, "50_50", avatarDrawable);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private void sendLogs() {
|
||||
try {
|
||||
|
|
|
@ -419,7 +419,9 @@ public class WallpapersActivity extends BaseFragment implements NotificationCent
|
|||
wallPapers.add((TLRPC.WallPaper)obj);
|
||||
wallpappersByIds.put(((TLRPC.WallPaper)obj).id, (TLRPC.WallPaper)obj);
|
||||
}
|
||||
if (listAdapter != null) {
|
||||
listAdapter.notifyDataSetChanged();
|
||||
}
|
||||
if (backgroundImage != null) {
|
||||
processSelectedBackground();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue