Skip to content

Commit

Permalink
更新使用说明书
Browse files Browse the repository at this point in the history
  • Loading branch information
xuexiangjys committed Sep 14, 2018
1 parent 5f55de9 commit 45d866e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,64 @@

![][download-img]

## 2、如何使用

目前支持主流开发工具AndroidStudio的使用,直接配置build.gradle,增加依赖即可.

### 2.1、Android Studio导入方法,添加Gradle依赖

1.先在项目根目录的 build.gradle 的 repositories 添加:

```
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```

2.然后在dependencies添加:

```
dependencies {
...
implementation 'com.github.xuexiangjys:XFloatView:1.0.0'
}
```

### 2.2、继承XFloatView,实现自定义窗体

主要需要实现如下抽象方法:

```
/**
* @return 获取根布局的ID
*/
protected abstract int getLayoutId();
/**
* @return 能否移动或者触摸响应
*/
protected abstract boolean canMoveOrTouch();
/**
* 初始化悬浮控件
*/
protected abstract void initFloatView();
/**
* 初始化监听
*/
protected abstract void initListener();
/**
* @return 设置悬浮框是否吸附在屏幕边缘
*/
protected abstract boolean isAdsorbView();
```

[点击查看示例代码](https://github.com/xuexiangjys/XFloatView/tree/master/app/src/main/java/com/xuexiang/xfloatviewdemo/widget)


## 联系方式
Expand Down
Binary file added img/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 45d866e

Please sign in to comment.