Skip to content

Commit

Permalink
Merge branch 'master' into support
Browse files Browse the repository at this point in the history
# Conflicts:
#	anylayer/src/main/java/per/goweii/anylayer/DragCompat.java
#	anylayer/src/main/java/per/goweii/anylayer/ScrollCompat.java
#	anylayer/src/main/java/per/goweii/anylayer/ViewDragHelper.java
  • Loading branch information
goweii committed Dec 1, 2019
2 parents 40fa3b8 + 85c8588 commit d48754a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ Android稳定高效的浮层创建管理框架。
- 链式调用
- 支持自由扩展
- 实现几种常用效果
- Dialog效果
- Dialog/BottomSheet效果
- 占用区域不会超过当前Activity避免导航栏遮挡
- 支持自定义大小和显示位置
- 支持自定义数据绑定
- 支持自定义进出场动画
- 支持自定义背景颜色/图片/高斯模糊
- 支持在Activity的onCreate生命周期弹出
- 支持从ApplicationContext中弹出
- 支持拖拽关闭
- 支持不拦截外部事件
- Popup效果
- 拥有Dialog效果特性
- 支持跟随目标View移动
Expand Down Expand Up @@ -116,11 +118,14 @@ allprojects {
> 从3.0.0版本开始,框架重构,删除通用库。因重构代码变化较大,不建议使用较多的老项目升级,保持2.5.0版即可,在实现Dialog/Popup等效果上无本质差别。
>
> 从3.1.0版本开始移除对support-v7的依赖,可同时兼容support和androidx
>
> 从3.3.0版本开始分为support和androidx两个分支,主要是适配滚动控件的拖拽关闭
```groovy
// build.gradle(Module:)
dependencies {
// 完整引入
implementation 'com.github.goweii:AnyLayer:3.2.0'
// 完整引入,二选一
implementation 'com.github.goweii:AnyLayer:3.3.0-androidx'
implementation 'com.github.goweii:AnyLayer:3.3.0-support'
// 基础库
// implementation 'com.github.goweii.AnyLayer:anylayer:2.5.0'
Expand Down
7 changes: 5 additions & 2 deletions anylayer/src/main/java/per/goweii/anylayer/DecorLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ protected ViewGroup onGetParent() {
parent.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
group.addView(parent, lastIndex + 1);
}
parent.setVisibility(View.VISIBLE);
getViewHolder().setParent(parent);
return parent;
}
Expand Down Expand Up @@ -146,7 +147,9 @@ public void onDetach() {
return;
}
if (parent.getChildCount() == 0) {
group.removeView(parent);
parent.setVisibility(View.GONE);
// group.removeView(parent);
// 存在toastLayer时,滑动关闭会崩溃
}
if (group.getChildCount() == 0) {
removeLayerLayoutFromDecor(group);
Expand Down Expand Up @@ -186,7 +189,7 @@ private LayerLayout findLayerLayoutFromDecor() {
final ViewGroup decor = getViewHolder().getDecor();
LayerLayout layerLayout = null;
final int count = decor.getChildCount();
for (int i = 0; i < count; i++) {
for (int i = count; i >= 0; i--) {
View child = decor.getChildAt(i);
if (child instanceof LayerLayout) {
layerLayout = (LayerLayout) child;
Expand Down

0 comments on commit d48754a

Please sign in to comment.