Skip to content

Commit

Permalink
优化createdResult回调
Browse files Browse the repository at this point in the history
  • Loading branch information
princekin-f committed Apr 8, 2020
1 parent c2c5857 commit 03e3ee9
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ allprojects {
- **在应用模块的`build.gradle`添加:**
```
dependencies {
implementation 'com.github.princekin-f:EasyFloat:1.3.0'
implementation 'com.github.princekin-f:EasyFloat:1.3.1'
}
```

Expand Down
3 changes: 3 additions & 0 deletions UpdateDoc.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## 版本更新日志
#### v 1.3.1:
- 优化`createdResult`回调。

#### v 1.3.0:
- 可动态适配虚拟导航栏:`setDisplayHeight(displayHeight: OnDisplayHeight)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ internal class AppFloatManager(val context: Context, var config: FloatConfig) {
// 如果设置了过滤当前页,或者设置仅后台显示,隐藏浮窗,否则执行入场动画
if (config.filterSelf || config.showPattern == ShowPattern.BACKGROUND)
setVisible(View.GONE) else enterAnim(floatingView)

// 设置callbacks
config.layoutView = floatingView
config.invokeView?.invoke(floatingView)
config.callbacks?.createdResult(true, null, floatingView)
config.floatCallbacks?.builder?.createdResult?.invoke(true, null, floatingView)
}
}

// 设置callbacks
config.layoutView = floatingView
config.invokeView?.invoke(floatingView)
config.callbacks?.createdResult(true, null, floatingView)
config.floatCallbacks?.builder?.createdResult?.invoke(true, null, floatingView)
}

/**
Expand Down
Binary file modified example/release/EasyFloat.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,21 @@ class MainActivity : AppCompatActivity(), View.OnClickListener {

override fun onStopTrackingTouch(seekBar: SeekBar?) {}
})

// // 解决 ListView 拖拽滑动冲突
// it.findViewById<ListView>(R.id.lv_test).apply {
// adapter = ArrayAdapter(
// this@MainActivity, R.layout.item_simple_list,
// arrayOf("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "...")
// )
//
// // 监听 ListView 的触摸事件,手指触摸时关闭拖拽,手指离开重新开启拖拽
// setOnTouchListener { _, event ->
// logger.e(event.action)
// EasyFloat.appFloatDragEnable(event?.action == MotionEvent.ACTION_UP)
// false
// }
// }
})
.show()
}
Expand Down
6 changes: 6 additions & 0 deletions example/src/main/res/layout/float_app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,10 @@
android:max="100"
android:progress="66" />

<!-- <ListView-->
<!-- android:id="@+id/lv_test"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="120dp"-->
<!-- android:layout_below="@id/seekBar" />-->

</RelativeLayout>
12 changes: 12 additions & 0 deletions example/src/main/res/layout/item_simple_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tv_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/green"
android:gravity="center"
android:padding="10dp"
android:text="哈哈"
android:textColor="@color/white">

</TextView>

0 comments on commit 03e3ee9

Please sign in to comment.