Skip to content

Commit

Permalink
更新代码
Browse files Browse the repository at this point in the history
  • Loading branch information
brook committed May 7, 2019
1 parent 864949f commit e25360d
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 96 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.brook.app.android.permissionutil"
applicationId "com.brook.app.android.supportlibrary.permissionutil"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.brook.app.android.permissionutil.MainActivity">
<activity android:name="com.brook.app.android.supportlibrary.permissionutil.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.brook.app.android.permissionutil;
package com.brook.app.android.supportlibrary.permissionutil;

import android.Manifest;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.brook.app.android.supportlibrary.permissionutil.R;
import com.brook.app.android.permissionutil.PermissionUtil;

import java.util.List;

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context="com.brook.app.android.supportlibrary.permissionutil.MainActivity">

<Button
android:layout_width="wrap_content"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
/**
* @author Brook
* @time 2017年11月15日
* @hide
*/
public class PermissionActivity extends AppCompatActivity {
class PermissionActivity extends AppCompatActivity {

private static volatile WeakReference<PermissionUtil.PermissionCallback> sCallback;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.List;

/**
* @auther Brook
* @author Brook
* @time 2017年11月15日 9:37
*/
public class PermissionUtil {
Expand Down Expand Up @@ -77,10 +77,10 @@ public void request(PermissionCallback callback) {
List<String> requestPermission = new ArrayList<>();

if (permission != null) {
for (int i = 0; i < permission.length; i++) {
if (ContextCompat.checkSelfPermission(context, permission[i])
for (String s : permission) {
if (ContextCompat.checkSelfPermission(context, s)
!= PackageManager.PERMISSION_GRANTED) {
requestPermission.add(permission[i]);
requestPermission.add(s);
}
}
}
Expand Down

This file was deleted.

0 comments on commit e25360d

Please sign in to comment.