Skip to content

Commit

Permalink
0.0.49.beta11
Browse files Browse the repository at this point in the history
- 修复部分已知问题;

0.0.49.beta10
- 完善 OnBindView 内部逻辑,当dialog和view相同时不重复执行onBind事件;
- WaitDialog新增onShow(DialogXRunnable)和onDismiss(DialogXRunnable);
- 尝试修复可能存在的问题;

0.0.49.beta9
- 菜单布局结构优化;

0.0.49.beta8
- 对话框内的 dialogView 引用进行了处理,以及 PopTip 的 baseView,减少在低版本安卓系统上出现内存泄漏的可能性
- FullScreenDialog 新增了方法 hideActivityContentView(boolean) 用于设置是否在显示 FullScreenDialog 时不对 activity 的界面内容进行渲染,这将提升一定的性能,此方法只可以在使用 build 方法构建且在执行show方法之前使用,但这将引发一些问题,例如输入法弹出时 FullScreenDialog 无法上浮等;
- 其他问题修复;

0.0.49.beta6
- 对 BottomMenu 的 setOkButton、setCancelButton、setOtherButton 提供了单独的 OnBottomMenuButtonClickListener 参数接口,可直接提供 BottomMenu 参数的 onClick 回调事件;
- BottomDialog/BottomMenu 新增 set/get OkTextInfo 和 OtherTextInfo 方法;
- 修复 DialogXBaseRelativeLayout 可能存在的嵌套循环调用 requestFocus() 方法的问题;
- 修复关于 WaitDialog 设置背景颜色不生效的问题;

0.0.49.beta5 ready
- ActivityScreenShotImageView 增加静态方法 useHardwareRenderingMode,开启可使用硬件加速渲染模式;
- 修复部分系统下 ActivityScreenShotImageView 在执行回收时触发的“Software rendering doesn't support hardware bitmaps.”异常;
- 其他问题修复;

0.0.49.beta4 ready
- 修复部分系统下 BlurRelativeLayout 或 BlurRelativeLayout 在执行回收时触发的“Calling RS with no Context active.”异常;
- ActivityScreenShotImageView 截图方案更新;

0.0.49.beta4 ready
- 修复在部分设备上由 DialogXBaseRelativeLayout 引发的 StackOverflowError,此问题猜测跟特定版本系统固件存在问题有关;

0.0.49.beta3
- 修复 ActivityScreenShotImageView 可能引发的“Software rendering doesn’t support hardware bitmaps” 异常;
- 修复 BottomDialog/FullScreenDialog 的滑动事件在内部存在 ScrollController 时,若触摸位置处于 ScrollController 布局外无法滑动对话框的问题;

0.0.49.beta2
- InputInfo新增方法:`getInputFilters()`、`setInputFilters(InputFilter[] inputFilters)`、`addInputFilter(InputFilter inputFilter)` 和 `removeInputFilter(InputFilter inputFilter)`(issues:332);
- 尝试性修复 DialogFragment 模式实现下的 WaitDialog 内存泄漏问题(issues:334);
- 修复关于DialogFragmentImpl引发的空指针问题此问题(issues:335);

0.0.49.beta1
- 修复 BlurRelativeLayout 和 BlurLinearLayout 在 iOS 主题下使用 DialogFragment 模式时存在的渲染宽度和高度 <=0 导致的异常(issues:324);
- 修复 IOS 主题下可能存在的 `RSInvalidStateException: Calling RS with no Context active` 异常问题(issues:327);
- 修复可能存在的高频启关对话框过程中,因UI未完成构建被关闭引发的空指针异常(issues:331);
  • Loading branch information
kongzue committed Aug 25, 2023
1 parent c732970 commit 44ef6c8
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
protected Drawable titleIcon;
protected DialogXAnimInterface<BottomDialog> dialogXAnimImpl;
protected BUTTON_SELECT_RESULT buttonSelectResult = BUTTON_SELECT_RESULT.NONE;
protected boolean onlyRestrictingSlideTouchEventsToScrollLayoutAreas = false;
protected boolean scrollableWhenContentLargeThanVisibleRange = true;

protected TextInfo titleTextInfo;
protected TextInfo messageTextInfo;
Expand Down Expand Up @@ -284,6 +284,12 @@ public DialogImpl(View convertView) {
boxList = convertView.findViewById(R.id.box_list);
boxCustom = convertView.findViewById(R.id.box_custom);

if (!scrollableWhenContentLargeThanVisibleRange) {
ViewGroup bodyContent = (ViewGroup) txtDialogTitle.getParent();
((ViewGroup) boxContent.getParent()).removeView(boxContent);
bodyContent.addView(boxContent, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}

boxCancel = convertView.findViewWithTag("cancelBox");

boxButton = convertView.findViewById(R.id.box_button);
Expand Down Expand Up @@ -765,6 +771,10 @@ public long getEnterAnimationDuration() {
}
return enterAnimDurationTemp;
}

public BottomDialogTouchEventInterceptor getBottomDialogTouchEventInterceptor() {
return bottomDialogTouchEventInterceptor;
}
}

public void refreshUI() {
Expand Down Expand Up @@ -1322,12 +1332,12 @@ public BottomDialog setBottomNonSafetyAreaBySelf(boolean bottomNonSafetyAreaBySe
return this;
}

public boolean isOnlyRestrictingSlideTouchEventsToScrollLayoutAreas() {
return onlyRestrictingSlideTouchEventsToScrollLayoutAreas;
public boolean isScrollableWhenContentLargeThanVisibleRange() {
return scrollableWhenContentLargeThanVisibleRange;
}

public BottomDialog setOnlyRestrictingSlideTouchEventsToScrollLayoutAreas(boolean onlyRestrictingSlideTouchEventsToScrollLayoutAreas) {
this.onlyRestrictingSlideTouchEventsToScrollLayoutAreas = onlyRestrictingSlideTouchEventsToScrollLayoutAreas;
public BottomDialog setScrollableWhenContentLargeThanVisibleRange(boolean scrollableWhenContentLargeThanVisibleRange) {
this.scrollableWhenContentLargeThanVisibleRange = scrollableWhenContentLargeThanVisibleRange;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1359,8 +1359,8 @@ public BottomMenu setOtherTextInfo(TextInfo otherTextInfo) {
return this;
}

public BottomMenu setOnlyRestrictingSlideTouchEventsToScrollLayoutAreas(boolean onlyRestrictingSlideTouchEventsToScrollLayoutAreas) {
this.onlyRestrictingSlideTouchEventsToScrollLayoutAreas = onlyRestrictingSlideTouchEventsToScrollLayoutAreas;
public BottomMenu setScrollableWhenContentLargeThanVisibleRange(boolean scrollableWhenContentLargeThanVisibleRange) {
this.scrollableWhenContentLargeThanVisibleRange = scrollableWhenContentLargeThanVisibleRange;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
protected DialogXAnimInterface<FullScreenDialog> dialogXAnimImpl;
protected boolean bottomNonSafetyAreaBySelf = false;
protected boolean hideActivityContentView;
protected boolean onlyRestrictingSlideTouchEventsToScrollLayoutAreas = false;

protected DialogLifecycleCallback<FullScreenDialog> dialogLifecycleCallback;
protected OnBackgroundMaskClickListener<FullScreenDialog> onBackgroundMaskClickListener;
Expand Down Expand Up @@ -785,13 +784,4 @@ public FullScreenDialog hideActivityContentView(boolean hideActivityContentView)
this.hideActivityContentView = hideActivityContentView;
return this;
}

public boolean isOnlyRestrictingSlideTouchEventsToScrollLayoutAreas() {
return onlyRestrictingSlideTouchEventsToScrollLayoutAreas;
}

public FullScreenDialog setOnlyRestrictingSlideTouchEventsToScrollLayoutAreas(boolean onlyRestrictingSlideTouchEventsToScrollLayoutAreas) {
this.onlyRestrictingSlideTouchEventsToScrollLayoutAreas = onlyRestrictingSlideTouchEventsToScrollLayoutAreas;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public OnBindView(android.app.Fragment supportFragment) {

public abstract void onBind(D dialog, View v);

public void setEvent(D dialog, View v){}

public void onFragmentBind(D dialog, View frameLayout, androidx.fragment.app.Fragment fragment, androidx.fragment.app.FragmentManager fragmentManager) {
}

Expand Down Expand Up @@ -175,7 +177,8 @@ public void bindParent(ViewGroup parentView, BaseDialog dialog) {
lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
parentView.addView(getCustomView(), lp);
callOnBind((D) dialog, parentView);
onBind((D) dialog, parentView);
callSetEvent((D) dialog, parentView);
if (fragment != null || supportFragment != null) {
if (dialog.getDialogImplMode() != DialogX.IMPL_MODE.VIEW) {
BaseDialog.error(dialog.dialogKey() + "非 VIEW 实现模式不支持 fragment 作为子布局显示。\n" +
Expand Down Expand Up @@ -206,11 +209,11 @@ public void run() {

private int dialogHash, parentViewHash;

private void callOnBind(D dialog, ViewGroup parentView) {
private void callSetEvent(D dialog, ViewGroup parentView) {
if (dialog.hashCode() != dialogHash || parentView.hashCode() != parentViewHash) {
dialogHash = dialog.hashCode();
parentViewHash = parentView.hashCode();
onBind(dialog, getCustomView());
setEvent(dialog, getCustomView());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class BottomDialogTouchEventInterceptor {
private float bkgTouchDownY;
private float scrolledY;
private float bkgOldY;
private boolean onlyRestrictingSlideTouchEventsToScrollLayoutAreas = false;
/**
* 0:bkg接收触控事件,-1:scrollView进行滚动
* 此标记的意义在于,当从 [scrollView滚动] 与 [bkg接收触控事件] 状态切换时,
Expand Down Expand Up @@ -60,10 +61,10 @@ public void refresh(final BottomDialog me, final BottomDialog.DialogImpl impl) {
* }
*/
View interceptTouchView = impl.bkg;
if (me.isOnlyRestrictingSlideTouchEventsToScrollLayoutAreas()){
interceptTouchView = (View) impl.scrollView;
}
if (me.isAllowInterceptTouch()) {
if (isOnlyRestrictingSlideTouchEventsToScrollLayoutAreas()){
interceptTouchView = (View) impl.scrollView;
}
View finalInterceptTouchView = interceptTouchView;
interceptTouchView.setOnTouchListener(new View.OnTouchListener() {
@Override
Expand Down Expand Up @@ -169,4 +170,13 @@ private int dip2px(float dpValue) {
final float scale = Resources.getSystem().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}

public boolean isOnlyRestrictingSlideTouchEventsToScrollLayoutAreas() {
return onlyRestrictingSlideTouchEventsToScrollLayoutAreas;
}

public BottomDialogTouchEventInterceptor setOnlyRestrictingSlideTouchEventsToScrollLayoutAreas(boolean onlyRestrictingSlideTouchEventsToScrollLayoutAreas) {
this.onlyRestrictingSlideTouchEventsToScrollLayoutAreas = onlyRestrictingSlideTouchEventsToScrollLayoutAreas;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public void refresh(final FullScreenDialog me, final FullScreenDialog.DialogImpl
View touchView = impl.boxCustom;
if (impl.scrollView != null) {
touchView = impl.bkg;
if (me.isOnlyRestrictingSlideTouchEventsToScrollLayoutAreas()){
touchView = (View) impl.scrollView;
}
}
touchView.setOnTouchListener(new View.OnTouchListener() {
@Override
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

BUILD_VERSION=0.0.49.beta10
BUILD_VERSION=0.0.49.beta11
BUILD_VERSION_INT=48
DIALOGX_STYLE_VERSION=5
android.nonTransitiveRClass=true

0 comments on commit 44ef6c8

Please sign in to comment.