Skip to content

Commit

Permalink
update to v1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
yhaowa committed Dec 25, 2017
1 parent a9cda8a commit ddd05ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

```
dependencies {
compile 'com.github.yhaolpz:FloatWindow:1.0.6'
compile 'com.github.yhaolpz:FloatWindow:1.0.7'
}
```

Expand Down Expand Up @@ -85,7 +85,7 @@ setView 方法可设置 View 子类或 xml 布局。
.with(getApplicationContext())
.setView(view)
.setX(100) //100px
.setY(Screen.width,0.2f) //屏幕宽度的 20%
.setY(Screen.height,0.3f) //屏幕高度的 30%
.build();

```
Expand Down Expand Up @@ -152,7 +152,7 @@ MoveType.free : 不可拖动,但可改变位置

```

自定义贴边或回到原位置过程的动画效果,只在 MoveType.slide 或 MoveType.back 模式下设置此项才有意义。默认减速插值器,默认动画时长为 300ms。
自定义动画效果,只在 MoveType.slide 或 MoveType.back 模式下设置此项才有意义。默认减速插值器,默认动画时长为 300ms。


**7.后续操作**
Expand Down Expand Up @@ -227,6 +227,11 @@ MoveType.free : 不可拖动,但可改变位置
**更新日志**
--

**v1.0.7**

1.适配 Android 8.0


**v1.0.6**

1.支持悬浮窗拖动及相关动效
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.graphics.PixelFormat;
import android.os.Build;
import android.view.View;
import android.view.WindowManager;

Expand Down Expand Up @@ -35,7 +36,11 @@ public void setSize(int width, int height) {
public void setView(View view) {
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mLayoutParams.type = WindowManager.LayoutParams.TYPE_PHONE;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
}else{
mLayoutParams.type = WindowManager.LayoutParams.TYPE_PHONE;
}
mLayoutParams.windowAnimations = 0;
mView = view;
}
Expand Down

0 comments on commit ddd05ee

Please sign in to comment.