Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamed authored Jul 2, 2019
1 parent 7da2bc6 commit 2fed279
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
# floating-layout-android
[![](https://jitpack.io/v/HamedTaherpour/floating-layout-android.svg)](https://jitpack.io/#HamedTaherpour/floating-layout-android)

### Build
## Build
##### Step 1. Add the JitPack repository to your build file
```build
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
repositories {
maven { url "https://jitpack.io" }
}
}
```

##### Step 2. Add the dependency
```build
dependencies {
implementation 'com.github.HamedTaherpour:floating-layout-android:1.0.0'
implementation 'com.github.HamedTaherpour:floating-layout-android:1.0.0'
}
```

## Usage
#### Layout.xml

### Manifest
##### Step 1. Add permission and service to your manifest file
```xml
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

<application>
<service android:name=".FloatingLayoutService" />
</application>
```
### Layout.xml
##### Step 2. Create layout and dont forget add id (root_container) like this
```layout
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
Expand All @@ -38,10 +46,13 @@ dependencies {
</FrameLayout>
```
### Java
##### Step 3. Create FloatingLayout
```java
FloatingLayout floatingLayout = new FloatingLayout(this, R.layout.floating_layout, this);
if (!floatingLayout.isShow())
floatingLayout.create();
FloatingLayout floatingLayout = new FloatingLayout(this, R.layout.floating_layout, null);
```
##### Show FloatingLayout
```java
floatingLayout.create();
```


0 comments on commit 2fed279

Please sign in to comment.