├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── card.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ └── shape_btn.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── values-zh │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── me │ │ │ └── weyye │ │ │ └── demo │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── me │ │ │ └── weyye │ │ │ └── demo │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── me │ │ └── weyye │ │ └── demo │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── library ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── permission_card1.png │ │ │ │ ├── permission_ic_sms.png │ │ │ │ ├── permission_ic_camera.png │ │ │ │ ├── permission_ic_phone.png │ │ │ │ ├── permission_ic_sensors.png │ │ │ │ ├── permission_ic_storage.png │ │ │ │ ├── permission_ic_calendar.png │ │ │ │ ├── permission_ic_contacts.png │ │ │ │ ├── permission_ic_location.png │ │ │ │ └── permission_ic_micro_phone.png │ │ │ ├── drawable │ │ │ │ ├── spacer_30.xml │ │ │ │ ├── shape_btn_next.xml │ │ │ │ ├── shape_btn_blue.xml │ │ │ │ ├── shape_btn_green_light.xml │ │ │ │ ├── shape_bg_white.xml │ │ │ │ └── shape_btn_border_white.xml │ │ │ ├── values │ │ │ │ ├── arrays.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── attrs.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── anim │ │ │ │ ├── fade_in.xml │ │ │ │ ├── fade_out.xml │ │ │ │ ├── scale_in.xml │ │ │ │ ├── scale_out.xml │ │ │ │ ├── modal_out.xml │ │ │ │ └── modal_in.xml │ │ │ ├── layout │ │ │ │ ├── permission_info_item.xml │ │ │ │ └── dialog_request_permission.xml │ │ │ └── values-zh │ │ │ │ └── strings.xml │ │ ├── java │ │ │ └── me │ │ │ │ └── weyye │ │ │ │ └── hipermission │ │ │ │ ├── PermissionCallback.java │ │ │ │ ├── ConstantValue.java │ │ │ │ ├── PermissionItem.java │ │ │ │ ├── WrapHeightGridView.java │ │ │ │ ├── PermissionAdapter.java │ │ │ │ ├── PermissionView.java │ │ │ │ ├── HiPermission.java │ │ │ │ └── PermissionActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── me │ │ │ └── weyye │ │ │ └── hipermission │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── me │ │ └── weyye │ │ └── hipermission │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── screenshot ├── app-debug.apk ├── 3ceb82af5f.gif ├── 45cd8b0505.gif ├── 6771a424d1.gif ├── screenshot1.gif ├── screenshot2.jpg └── 20170524135457.jpg ├── .idea ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml ├── modules.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew ├── README-CN.md └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':library' 2 | -------------------------------------------------------------------------------- /screenshot/app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/screenshot/app-debug.apk -------------------------------------------------------------------------------- /screenshot/3ceb82af5f.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/screenshot/3ceb82af5f.gif -------------------------------------------------------------------------------- /screenshot/45cd8b0505.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/screenshot/45cd8b0505.gif -------------------------------------------------------------------------------- /screenshot/6771a424d1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/screenshot/6771a424d1.gif -------------------------------------------------------------------------------- /screenshot/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/screenshot/screenshot1.gif -------------------------------------------------------------------------------- /screenshot/screenshot2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/screenshot/screenshot2.jpg -------------------------------------------------------------------------------- /screenshot/20170524135457.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/screenshot/20170524135457.jpg -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/app/src/main/res/drawable-hdpi/card.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_card1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_card1.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_sms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_sms.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_camera.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_phone.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_sensors.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_storage.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_calendar.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_contacts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_contacts.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_location.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/permission_ic_micro_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yewei02538/HiPermission/HEAD/library/src/main/res/drawable-xxhdpi/permission_ic_micro_phone.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/spacer_30.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_btn_next.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #fffffc 7 | 8 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_btn_blue.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /library/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @string/permission_storage 5 | @string/permission_location 6 | @string/permission_camera 7 | 8 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_btn_green_light.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /library/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /library/src/main/res/anim/fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /library/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #41c236 4 | #ffffff 5 | #44A49C 6 | #ee447AA4 7 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_bg_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_btn_border_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /library/src/main/java/me/weyye/hipermission/PermissionCallback.java: -------------------------------------------------------------------------------- 1 | package me.weyye.hipermission; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by Administrator on 2017/5/10 0010. 7 | */ 8 | 9 | public interface PermissionCallback extends Serializable { 10 | void onClose(); 11 | 12 | void onFinish(); 13 | 14 | void onDeny(String permission, int position); 15 | 16 | void onGuarantee(String permission, int position); 17 | } 18 | -------------------------------------------------------------------------------- /library/src/main/res/anim/scale_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 14 | -------------------------------------------------------------------------------- /app/src/test/java/me/weyye/demo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package me.weyye.demo; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /library/src/test/java/me/weyye/hipermission/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package me.weyye.hipermission; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /library/src/main/res/anim/scale_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 15 | -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /library/src/main/java/me/weyye/hipermission/ConstantValue.java: -------------------------------------------------------------------------------- 1 | package me.weyye.hipermission; 2 | 3 | /** 4 | * Created by Administrator on 2017/5/10 0010. 5 | */ 6 | 7 | public interface ConstantValue { 8 | String DATA_PERMISSION_TYPE = "data_permission_type"; 9 | String DATA_TITLE = "data_title"; 10 | String DATA_MSG = "data_msg"; 11 | String DATA_FILTER_COLOR = "data_color_filter"; 12 | String DATA_STYLE_ID = "data_style_id"; 13 | String DATA_ANIM_STYLE = "data_anim_style"; 14 | String DATA_PERMISSIONS = "data_permissions"; 15 | String DATA_CALLBACK = "data_callback"; 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /library/src/main/res/anim/modal_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 13 | 17 | -------------------------------------------------------------------------------- /library/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /library/src/main/java/me/weyye/hipermission/PermissionItem.java: -------------------------------------------------------------------------------- 1 | package me.weyye.hipermission; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by Administrator on 2017/5/10 0010. 7 | */ 8 | 9 | public class PermissionItem implements Serializable { 10 | public String PermissionName; 11 | public String Permission; 12 | public int PermissionIconRes; 13 | 14 | public PermissionItem(String permission, String permissionName, int permissionIconRes) { 15 | Permission = permission; 16 | PermissionName = permissionName; 17 | PermissionIconRes = permissionIconRes; 18 | } 19 | 20 | public PermissionItem(String permission) { 21 | Permission = permission; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /library/src/main/res/layout/permission_info_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/res/values-zh/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 申请多个权限(Default Style With Fade) 4 | 申请多个权限(Blue Style With Scale) 5 | 申请多个权限(Green Style With Modal) 6 | 申请单个权限 7 | 用户关闭权限申请 8 | 所有权限申请完成 9 | 照相机 10 | 拨打手机 11 | 亲爱的上帝 12 | 为了保护世界的和平,开启这些权限吧!\n你我一起拯救世界! 13 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /library/src/main/res/values-zh/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 存储空间 3 | 位置信息 4 | 拍照权限 5 | 开启%s 6 | 为了您能正常使用%s,需要以下权限 7 | 请允许获取%s 8 | 我们需要获取%1$s, 否则您将无法正常使用%2$s 9 | "由于%1$s无法获取%2$s, 不能正常运行, 请开启权限后再使用。\n\n设置路径: 应用管理->%3$s->权限" 10 | 取消 11 | 确定 12 | 拒绝 13 | 下一步 14 | 去设置 15 | 16 | -------------------------------------------------------------------------------- /app/src/androidTest/java/me/weyye/demo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package me.weyye.demo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("me.weyye.hipermission", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /library/src/androidTest/java/me/weyye/hipermission/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package me.weyye.hipermission; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("me.weyye.library.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | HiPermission 3 | Mutl Permission(Default Style With Fade) 4 | Mutl Permission(Blue Style With Scale) 5 | Mutl Permission(Green Style With Modal) 6 | Single Permission 7 | They cancelled our request 8 | All permissions requested completed 9 | Camera 10 | Call Phone 11 | Dear God 12 | To protect the peace of the world, open these permissions! You and I together save the world! 13 | 14 | -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Storage 3 | Location 4 | Camera 5 | Start %s 6 | For your normal use %s, you need the following permissions 7 | Please allow access to %s 8 | We need access to %1$s,otherwise, you will not be able to use %2$s 9 | "Because %1$s cannot use %2$s,Can not run normally,Please open permissions before using.\n\nSetup path: Apps->%3$s->Permissions" 10 | Cancel 11 | Enter 12 | Deny 13 | Next 14 | Go to Setting 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 19 | 20 | 23 | 24 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.compileVersion 5 | buildToolsVersion rootProject.ext.buildToolsVersion 6 | defaultConfig { 7 | applicationId "me.weyye.demo" 8 | minSdkVersion rootProject.ext.minSdk 9 | targetSdkVersion rootProject.ext.targetSdk 10 | versionCode rootProject.ext.version_code 11 | versionName rootProject.ext.version_name 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile "com.android.support:appcompat-v7:${rootProject.ext.supportVersion}" 28 | testCompile 'junit:junit:4.12' 29 | compile project(':library') 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /library/src/main/res/anim/modal_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 10 | 18 | 19 | 28 | 29 | 38 | -------------------------------------------------------------------------------- /library/src/main/java/me/weyye/hipermission/WrapHeightGridView.java: -------------------------------------------------------------------------------- 1 | package me.weyye.hipermission; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.GridView; 6 | 7 | /** 8 | * 自适应高度的GridView 9 | */ 10 | public class WrapHeightGridView extends GridView { 11 | 12 | //防止计算多次导致界面显示错误 13 | public boolean isOnMeasure; 14 | 15 | public WrapHeightGridView(Context context) { 16 | super(context); 17 | } 18 | 19 | public WrapHeightGridView(Context context, AttributeSet attrs) { 20 | super(context, attrs); 21 | } 22 | 23 | public WrapHeightGridView(Context context, AttributeSet attrs, int defStyle) { 24 | super(context, attrs, defStyle); 25 | } 26 | 27 | @Override 28 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 29 | isOnMeasure = true; 30 | int heightSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, 31 | MeasureSpec.AT_MOST); 32 | super.onMeasure(widthMeasureSpec, heightSpec); 33 | } 34 | 35 | @Override 36 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 37 | isOnMeasure = false; 38 | super.onLayout(changed, l, t, r, b); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 |