1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-11-22 11:55:31 +01:00

fix: crash in Comments and CheckBox

This commit is contained in:
luvletter2333 2023-04-04 11:50:58 -04:00
parent 1ab27f6b27
commit d845030973
No known key found for this signature in database
GPG Key ID: 9EB7723F3A0ACF92
2 changed files with 5 additions and 14 deletions

View File

@ -119,21 +119,11 @@ public class TextCheckCell extends FrameLayout {
valueTextView.setEllipsize(TextUtils.TruncateAt.END);
addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 64 : padding, 36, LocaleController.isRTL ? padding : 64, 0));
if (!dialog) {
checkBox = new Switch(context, resourcesProvider);
checkBox.setColors(Theme.key_switchTrack, Theme.key_switchTrackChecked, Theme.key_windowBackgroundWhite, Theme.key_windowBackgroundWhite);
addView(checkBox, LayoutHelper.createFrame(37, 20, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL, 22, 0, 22, 0));
} else {
checkBoxSquare = new CheckBoxSquare(context,true);
addView(checkBoxSquare, LayoutHelper.createFrame(18, 18, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL, 22, 0, 22, 0));
}
checkBox = new Switch(context, resourcesProvider);
checkBox.setColors(Theme.key_switchTrack, Theme.key_switchTrackChecked, Theme.key_windowBackgroundWhite, Theme.key_windowBackgroundWhite);
addView(checkBox, LayoutHelper.createFrame(37, 20, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL, 22, 0, 22, 0));
setClipChildren(false);
isRTL = LocaleController.isRTL;
}

View File

@ -14921,7 +14921,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
}
translateItem.setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() > 0);
if (translateItem != null)
translateItem.setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() > 0);
actionModeOtherItem.setSubItemVisibility(nkbtn_sharemessage, selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() > 0);
boolean allowPin = false;