Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
leotyndale authored Jun 20, 2019
1 parent 2729401 commit af22ad6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;

1.在gralde的dependencies中加入
```java
compile 'com.imuxuan:floatingview:1.0'
compile 'com.imuxuan:floatingview:1.1'
```


Expand Down Expand Up @@ -89,6 +89,22 @@ layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
```java
FloatingView.get().remove();
```

5.添加点击事件

```java
FloatingView.get().listener(new MagnetViewListener() {
@Override
public void onRemove(FloatingMagnetView magnetView) {
Toast.makeText(TestActivity.this, "我没了", Toast.LENGTH_SHORT).show();
}

@Override
public void onClick(FloatingMagnetView magnetView) {
Toast.makeText(TestActivity.this, "点到我了", Toast.LENGTH_SHORT).show();
}
});
```

### 效果图
![预览图](https://github.com/leotyndale/EnFloatingView/blob/master/preview/2.gif)

0 comments on commit af22ad6

Please sign in to comment.