mirror of https://github.com/NekoX-Dev/NekoX.git
fix NPE about LinearLayout
This commit is contained in:
parent
f56b39d56d
commit
2984ee4ef3
|
@ -522,7 +522,7 @@ public class BottomSheet extends Dialog {
|
|||
continue;
|
||||
}
|
||||
if (!onCustomLayout(child, left, top, right, bottom - (drawNavigationBar ? getBottomInset() : 0))) {
|
||||
final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) child.getLayoutParams();
|
||||
final FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) child.getLayoutParams();
|
||||
|
||||
final int width = child.getMeasuredWidth();
|
||||
final int height = child.getMeasuredHeight();
|
||||
|
|
|
@ -290,7 +290,7 @@ public class AudioPlayerAlert extends BottomSheet implements NotificationCenter.
|
|||
layoutParams = (LayoutParams) actionBarShadow.getLayoutParams();
|
||||
layoutParams.topMargin = ActionBar.getCurrentActionBarHeight() + AndroidUtilities.statusBarHeight;
|
||||
|
||||
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) blurredView.getLayoutParams();
|
||||
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) blurredView.getLayoutParams();
|
||||
lp.topMargin = -getPaddingTop();
|
||||
|
||||
int contentSize = AndroidUtilities.dp(179);
|
||||
|
|
|
@ -2257,7 +2257,7 @@ public class ChatAttachAlertPhotoLayout extends ChatAttachAlert.AttachAlertLayou
|
|||
|
||||
|
||||
int cameraViewW, cameraViewH;
|
||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) cameraView.getLayoutParams();
|
||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) cameraView.getLayoutParams();
|
||||
|
||||
float textureStartHeight = cameraView.getTextureHeight(startWidth, startHeight);
|
||||
float textureEndHeight = cameraView.getTextureHeight(endWidth, endHeight);
|
||||
|
@ -2442,16 +2442,16 @@ public class ChatAttachAlertPhotoLayout extends ChatAttachAlert.AttachAlertLayou
|
|||
int finalWidth = itemSize;
|
||||
int finalHeight = itemSize;
|
||||
|
||||
LinearLayout.LayoutParams layoutParams;
|
||||
ViewGroup.LayoutParams layoutParams;
|
||||
if (!cameraOpened) {
|
||||
cameraView.setClipTop((int) cameraViewOffsetY);
|
||||
cameraView.setClipBottom((int) cameraViewOffsetBottomY);
|
||||
layoutParams = (LinearLayout.LayoutParams) cameraView.getLayoutParams();
|
||||
layoutParams = cameraView.getLayoutParams();
|
||||
if (layoutParams.height != finalHeight || layoutParams.width != finalWidth) {
|
||||
layoutParams.width = finalWidth;
|
||||
layoutParams.height = finalHeight;
|
||||
cameraView.setLayoutParams(layoutParams);
|
||||
final LinearLayout.LayoutParams layoutParamsFinal = layoutParams;
|
||||
final ViewGroup.LayoutParams layoutParamsFinal = layoutParams;
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
if (cameraView != null) {
|
||||
cameraView.setLayoutParams(layoutParamsFinal);
|
||||
|
@ -2463,12 +2463,12 @@ public class ChatAttachAlertPhotoLayout extends ChatAttachAlert.AttachAlertLayou
|
|||
finalWidth = (int) (itemSize - cameraViewOffsetX);
|
||||
finalHeight = (int) (itemSize - cameraViewOffsetY - cameraViewOffsetBottomY);
|
||||
|
||||
layoutParams = (LinearLayout.LayoutParams) cameraIcon.getLayoutParams();
|
||||
layoutParams = cameraIcon.getLayoutParams();
|
||||
if (layoutParams.height != finalHeight || layoutParams.width != finalWidth) {
|
||||
layoutParams.width = finalWidth;
|
||||
layoutParams.height = finalHeight;
|
||||
cameraIcon.setLayoutParams(layoutParams);
|
||||
final LinearLayout.LayoutParams layoutParamsFinal = layoutParams;
|
||||
final ViewGroup.LayoutParams layoutParamsFinal = layoutParams;
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
if (cameraIcon != null) {
|
||||
cameraIcon.setLayoutParams(layoutParamsFinal);
|
||||
|
|
Loading…
Reference in New Issue