Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

javaherisaber/FloatingOverlayView

Open more actions menu

Repository files navigation

FloatingOverlayView

Floating view with draw over other apps it uses system alert window with the permission android.permission.SYSTEM_ALERT_WINDOW under the hood

Download

Demo

Build

Step 1. Add the JitPack repository to your build file
allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}
Step 2. Add the dependency
dependencies {
    implementation 'com.github.javaherisaber:FloatingOverlayView:1.0.2'
}

Usage

Layout.xml

Step 1. Create layout and don't forget add id (root_container) like this
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/root_container"
        android:layout_width="250dp"
        android:layout_height="200dp">

        ....

    </FrameLayout>

</FrameLayout>

Kotlin/Java

Step 2. Create FloatingOverlayView
FloatingOverlayView(context, R.layout.view_overlay)
    .setXOffset(800) // move the banner to the right side
    .setOnCreateListener { layout: FloatingOverlayView, view: View ->
        // do something with `view`, maybe a close button
    }
    .setOnCloseListener {
        // do something after the banner is closed
    }
    .create()

About

Floating view to draw over other apps

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.