1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-06-30 22:22:57 +00:00

Crash fixes

This commit is contained in:
DrKLO 2015-02-26 17:36:15 +03:00
parent f63c8b20bb
commit 85bc7046bb
10 changed files with 45 additions and 20 deletions

View File

@ -82,7 +82,7 @@ android {
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 453
versionName "2.5.0"
versionCode 454
versionName "2.5.1"
}
}

View File

@ -1777,6 +1777,10 @@ public class SecretChatHelper {
}
}
});
progressDialog.show();
try {
progressDialog.show();
} catch (Exception e) {
//don't promt
}
}
}

View File

@ -200,7 +200,11 @@ public class ActionBarPopupWindow extends PopupWindow {
@Override
public void dismiss() {
setFocusable(false);
super.dismiss();
try {
super.dismiss();
} catch (Exception e) {
//don't promt
}
unregisterListener();
}
}

View File

@ -603,14 +603,19 @@ public class DialogCell extends BaseCell {
public void checkCurrentDialogIndex() {
TLRPC.TL_dialog dialog = null;
if (isServerOnly) {
dialog = MessagesController.getInstance().dialogsServerOnly.get(index);
if (index < MessagesController.getInstance().dialogsServerOnly.size()) {
dialog = MessagesController.getInstance().dialogsServerOnly.get(index);
}
} else {
dialog = MessagesController.getInstance().dialogs.get(index);
if (index < MessagesController.getInstance().dialogs.size()) {
dialog = MessagesController.getInstance().dialogs.get(index);
}
}
boolean update = true;
if (currentDialogId != dialog.id || message != null && message.messageOwner.id != dialog.top_message || unreadCount != dialog.unread_count) {
currentDialogId = dialog.id;
update(0);
if (dialog != null) {
if (currentDialogId != dialog.id || message != null && message.messageOwner.id != dialog.top_message || unreadCount != dialog.unread_count) {
currentDialogId = dialog.id;
update(0);
}
}
}

View File

@ -1307,7 +1307,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
progressView.setLayoutParams(layoutParams3);
ProgressBar progressBar = new ProgressBar(getParentActivity());
progressBar.setIndeterminateDrawable(getParentActivity().getResources().getDrawable(R.drawable.loading_animation));
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);

View File

@ -854,7 +854,11 @@ public class ChatActivityEnterView extends LinearLayout implements NotificationC
emojiButton.setImageResource(R.drawable.ic_msg_panel_smiles);
}
if (emojiPopup != null) {
emojiPopup.dismiss();
try {
emojiPopup.dismiss();
} catch (Exception e) {
//don't promt
}
}
if (sizeNotifierRelativeLayout != null) {
sizeNotifierRelativeLayout.post(new Runnable() {

View File

@ -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) {

View File

@ -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);

View File

@ -972,13 +972,15 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
}
AvatarDrawable avatarDrawable = new AvatarDrawable(user, true);
avatarDrawable.setColor(0xff5c98cd);
avatarImage.setImage(photo, "50_50", avatarDrawable);
avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
if (avatarImage != null) {
avatarImage.setImage(photo, "50_50", avatarDrawable);
avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
onlineTextView.setText(LocaleController.getString("Online", R.string.Online));
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
onlineTextView.setText(LocaleController.getString("Online", R.string.Online));
avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
}
}
private void sendLogs() {

View File

@ -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);
}
listAdapter.notifyDataSetChanged();
if (listAdapter != null) {
listAdapter.notifyDataSetChanged();
}
if (backgroundImage != null) {
processSelectedBackground();
}