File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -5,29 +5,30 @@ Floating view with draw over other apps
55
66## Demo
77<div style =" dispaly :flex " >
8- <img src="/demo.gif" width="24 %">
8+ <img src="/demo.gif" width="30 %">
99</div >
1010
1111## Build
1212##### Step 1. Add the JitPack repository to your build file
13- ``` build
13+ ``` bat
1414allprojects {
1515 repositories {
1616 maven { url "https://jitpack.io" }
1717 }
1818}
1919```
20+
2021##### Step 2. Add the dependency
21- ``` build
22+ ``` bat
2223dependencies {
23- implementation 'com.buildtoapp.floatingoverlayview :FloatingOverlayView:1.0.0'
24+ implementation 'com.github.javaherisaber :FloatingOverlayView:1.0.0'
2425}
2526```
2627
2728## Usage
2829### Layout.xml
2930##### Step 1. Create layout and don't forget add id (root_container) like this
30- ``` layout
31+ ``` xml
3132<?xml version =" 1.0" encoding =" utf-8" ?>
3233<FrameLayout xmlns : android =" http://schemas.android.com/apk/res/android"
3334 android : layout_width =" match_parent"
@@ -44,16 +45,17 @@ dependencies {
4445
4546</FrameLayout >
4647```
48+
4749### Kotlin/Java
4850##### Step 2. Create FloatingOverlayView
4951``` kotlin
5052FloatingOverlayView (context, R .layout.view_overlay)
51- .setXOffset(800 )
53+ .setXOffset(800 ) // move the banner to the right side
5254 .setOnCreateListener { layout: FloatingOverlayView , view: View ->
53-
55+ // do something with `view`, maybe a close button
5456 }
5557 .setOnCloseListener {
56-
58+ // do something after the banner is closed
5759 }
5860 .create()
5961```
You can’t perform that action at this time.
0 commit comments