Skip to content

Commit 48aed62

Browse files
committed
Update README.md
1 parent dbe9ed2 commit 48aed62

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
11
# FloatingOverlayView
2-
Floating view with draw over other apps
2+
Floating view with draw over other apps
3+
4+
[![](https://jitpack.io/v/javaherisaber/FloatingOverlayView.svg)](https://jitpack.io/#javaherisaber/FloatingOverlayView)
5+
6+
## Demo
7+
<div style="dispaly:flex">
8+
<img src="/demo.gif" width="24%">
9+
</div>
10+
11+
## Build
12+
##### Step 1. Add the JitPack repository to your build file
13+
```build
14+
allprojects {
15+
repositories {
16+
maven { url "https://jitpack.io" }
17+
}
18+
}
19+
```
20+
##### Step 2. Add the dependency
21+
```build
22+
dependencies {
23+
implementation 'com.buildtoapp.floatingoverlayview:FloatingOverlayView:1.0.0'
24+
}
25+
```
26+
27+
## Usage
28+
### Layout.xml
29+
##### Step 1. Create layout and don't forget add id (root_container) like this
30+
```layout
31+
<?xml version="1.0" encoding="utf-8"?>
32+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
33+
android:layout_width="match_parent"
34+
android:layout_height="match_parent">
35+
36+
<FrameLayout
37+
android:id="@+id/root_container"
38+
android:layout_width="250dp"
39+
android:layout_height="200dp">
40+
41+
....
42+
43+
</FrameLayout>
44+
45+
</FrameLayout>
46+
```
47+
### Kotlin/Java
48+
##### Step 2. Create FloatingOverlayView
49+
```kotlin
50+
FloatingOverlayView(context, R.layout.view_overlay)
51+
.setXOffset(800)
52+
.setOnCreateListener { layout: FloatingOverlayView, view: View ->
53+
54+
}
55+
.setOnCloseListener {
56+
57+
}
58+
.create()
59+
```

0 commit comments

Comments
 (0)