File tree Expand file tree Collapse file tree 1 file changed +58
-1
lines changed
Expand file tree Collapse file tree 1 file changed +58
-1
lines changed Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments