Skip to content

Commit 7756e68

Browse files
committed
Make SYSTEM_ALERT_WINDOW permission optional
1 parent b6f1656 commit 7756e68

5 files changed

Lines changed: 24 additions & 14 deletions

File tree

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
Add it in your build.gradle at the end of repositories:
3131

32-
```
32+
```groovy
3333
allprojects {
3434
repositories {
3535
...
@@ -40,9 +40,9 @@ allprojects {
4040

4141
Add the dependency in the form:
4242

43-
```
43+
```groovy
4444
dependencies {
45-
compile 'com.github.hzw1199:FloatingView:1.6.0'
45+
compile 'com.github.hzw1199:FloatingView:1.7.0'
4646
}
4747
```
4848

@@ -52,6 +52,11 @@ Configure and display
5252

5353
* ```OverlaySystem``` mode
5454

55+
AndroidManifest.xml:
56+
```xml
57+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
58+
```
59+
5560
onCreate:
5661

5762
```java
@@ -68,7 +73,7 @@ floatingView.showOverlaySystem();
6873

6974
onDestroy:
7075

71-
```
76+
```java
7277
if (floatingView != null) {
7378
floatingView.hide();
7479
}
@@ -92,7 +97,7 @@ floatingView.showOverlayActivity();
9297

9398
onDetachedFromWindow:
9499

95-
```
100+
```java
96101
if (floatingView != null) {
97102
floatingView.hide();
98103
}
@@ -123,7 +128,7 @@ lyViewGroup.post(new Runnable() {
123128

124129
onDestroy:
125130

126-
```
131+
```java
127132
if (floatingView != null) {
128133
floatingView.hide();
129134
}

READMEcn.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
在project的build.gradle中加入以下语句:
2929

30-
```
30+
```groovy
3131
allprojects {
3232
repositories {
3333
...
@@ -38,9 +38,9 @@ allprojects {
3838

3939
在module的build.gradle中加入以下语句:
4040

41-
```
41+
```groovy
4242
dependencies {
43-
compile 'com.github.hzw1199:FloatingView:1.6.0'
43+
compile 'com.github.hzw1199:FloatingView:1.7.0'
4444
}
4545
```
4646

@@ -50,6 +50,11 @@ dependencies {
5050

5151
* ```OverlaySystem```模式
5252

53+
AndroidManifest.xml:
54+
```xml
55+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
56+
```
57+
5358
onCreate:
5459

5560
```java
@@ -66,7 +71,7 @@ floatingView.showOverlaySystem();
6671

6772
onDestroy:
6873

69-
```
74+
```java
7075
if (floatingView != null) {
7176
floatingView.hide();
7277
}
@@ -90,7 +95,7 @@ floatingView.showOverlayActivity();
9095

9196
onDetachedFromWindow:
9297

93-
```
98+
```java
9499
if (floatingView != null) {
95100
floatingView.hide();
96101
}
@@ -121,7 +126,7 @@ lyViewGroup.post(new Runnable() {
121126

122127
onDestroy:
123128

124-
```
129+
```java
125130
if (floatingView != null) {
126131
floatingView.hide();
127132
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
33

4+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
45
<application
56
android:allowBackup="true"
67
android:icon="@mipmap/ic_launcher"

floatingview/maven_publish.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ publishing {
66
release(MavenPublication) {
77
groupId = 'com.github.hzw1199'
88
artifactId = 'FloatingView'
9-
version = '1.6.0'
9+
version = '1.7.0'
1010

1111
afterEvaluate {
1212
from components.release
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22

3-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
43
</manifest>

0 commit comments

Comments
 (0)