{"id":13989449,"url":"https://github.com/k0shk0sh/PermissionHelper","last_synced_at":"2025-07-22T10:32:35.932Z","repository":{"id":57728871,"uuid":"46166191","full_name":"k0shk0sh/PermissionHelper","owner":"k0shk0sh","description":"Android Library to help you with your runtime Permissions.","archived":false,"fork":false,"pushed_at":"2018-10-01T11:54:22.000Z","size":1864,"stargazers_count":1227,"open_issues_count":0,"forks_count":228,"subscribers_count":45,"default_branch":"master","last_synced_at":"2024-08-09T13:15:56.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":" http://k0shk0sh.github.io/PermissionHelper/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k0shk0sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-14T07:42:16.000Z","updated_at":"2024-07-21T06:34:16.000Z","dependencies_parsed_at":"2022-09-09T10:00:28.616Z","dependency_job_id":null,"html_url":"https://github.com/k0shk0sh/PermissionHelper","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0shk0sh%2FPermissionHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0shk0sh%2FPermissionHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0shk0sh%2FPermissionHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0shk0sh%2FPermissionHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k0shk0sh","download_url":"https://codeload.github.com/k0shk0sh/PermissionHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227079405,"owners_count":17728002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-09T13:01:39.660Z","updated_at":"2024-11-29T08:31:27.328Z","avatar_url":"https://github.com/k0shk0sh.png","language":"Java","funding_links":[],"categories":["Java","Libs","Permission"],"sub_categories":["\u003cA NAME=\"Other1\"\u003e\u003c/A\u003eOther"],"readme":"# PermissionHelper\nAndroid Library to help you with your runtime Permissions.\n\nDemo \n======\n\n**Android M** \u003ca href=\"https://youtu.be/ypFH4yxjppQ\"\u003eWatch it in action.\u003c/a\u003e\n\u003cbr/\u003e\n**Pre M** \u003ca href=\"https://www.youtube.com/watch?v=n2dKAu5fR6M\"\u003eWatch it in action.\u003c/a\u003e\nNexus 6 (M)\n=======\n![Nexus 6](https://raw.github.com/k0shk0sh/PermissionHelper/master/art/nexus6.jpg)\n\nNexus 7 (L)\n=======\n![ScreenShot](https://raw.github.com/k0shk0sh/PermissionHelper/master/art/nexus7.jpg)\n\nNexus 10 (L)\n=======\n![ScreenShot](https://raw.github.com/k0shk0sh/PermissionHelper/master/art/nexus10.jpg)\n\n\n\n# Installation\n\n#### Gradle\n```groovy\n    compile 'com.github.k0shk0sh:PermissionHelper:1.1.0'\n```\n\n#### Maven\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.k0shk0sh\u003c/groupId\u003e\n  \u003cartifactId\u003ePermissionHelper\u003c/artifactId\u003e\n  \u003cversion\u003e1.1.0\u003c/version\u003e\n  \u003ctype\u003eaar\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nUsage\n=====\n\n# Ask Permissions in Style\n\n_Have you wondered what will give you a higher chance of letting the user accepts your permission?_\n\n\u003eThe answer is simple: **(Educating UI)** that explains why you need to use that particular `permission`. \n\n* All you need to do is extending \u003ca href=\"https://github\n.com/k0shk0sh/PermissionHelper/blob/master/permission/src/main/java/com/fastaccess/permission/base/activity/BasePermissionActivity\n.java\"\u003eBasePermissionActivity\u003c/a\u003e. \n\n  * By extending `BasePermissionActivity` you'll have control over (**Features**): \n    * Permissions that being asked and their Explanation if its needed.\n    * Each `Screen` Background color (`DarkPrimaryColor` of that background will be generated automatically).\n    * Each `Screen` Image Resource. \n    * Each `Screen` Title \u0026 Message.\n    * Each `Screen` Title \u0026 Message Text Color.\n    * Each `Screen` Title \u0026 Message Text Size.\n    * Each `Screen` Text \u0026 Message `FontType`, yes you heard me right, each `Screen` can have their own `FontType`.\n    * Each `Screen` Next, Previous \u0026 Request Buttons Icon Resources. \n    * Your Own `Theme`.\n    * Your Own Implementation of `ViewPager.PageTransformer` or use the default one. \n    * You can defined for instance that a particular permission can't be skipped until the Explanation `Dialog` is showed.(follow example code below\n     to know \n    how).\n    * `BasePermissionActivity` support Portrait \u0026 Landscape modes for both Mobile Phones \u0026 Tablets _(as showing in above images)_.\n    * `SYSTEM_ALERT_WINDOW Permission`  is being automatically handled if you ever pass it along other permissions ;) . \n* And Finally **Let The Library Do The Job For You. in Style.**\n\n**Notice** \n\u003e You still can use the library to explain why you used the permission in your app, the library will never try ask the permission if \nAndroid is smaller than **M**, it will just do like any Intro library does. as you can see in **Nexus 7 \u0026 Nexus 10** screens running Android **L**, \nrequest button is hidden ;). \n\n\u003e For Better Understanding, please have a look at the example code at \u003ca href=\"https://github.com/k0shk0sh/PermissionHelper/blob/master/app/src/main/java/com/fastaccess/permission/sample/SamplePagerActivity.java\"\u003eSamplePagerActivity\u003c/a\u003e\n\n# Take Control.\n\nYour ```Activity/Fragment/Presenter```  should implement ```OnPermissionCallback``` which in return will give you access to\n\n```java\n    void onPermissionGranted(String[] permissionName);\n\n    void onPermissionDeclined(String[] permissionName);\n\n    void onPermissionPreGranted(String permissionsName);\n\n    void onPermissionNeedExplanation(String permissionName);  \n    \n    void onPermissionReallyDeclined(String permissionName);//user has ticked don't show again and deny the permission\n\n    void onNoPermissionNeeded(); // fallback to api \u003c M\n```\n\nto request a permission all you have to do is:\n\n- Activity\n\n```java\npermissionHelper\n     .setForceAccepting(false)// true if you had like force reshowing the permission dialog on Deny (not recommended)\n     .request(isSingle ? SINGLE_PERMISSION : MULTIPLE_PERMISSIONS);\n```\n\n- Fragment \n\n```java\npermissionFragmentHelper\n     .setForceAccepting(false)// true if you had like force reshowing the permission dialog on Deny (not recommended)\n     .request(isSingle ? SINGLE_PERMISSION : MULTIPLE_PERMISSIONS);\n```\n\nTo request a permission without ask for explanation message even if the user press decline:\n```java\npermissionHelper\n     .setSkipExplanation(true)// true if you don't want to show expalanation message\n     .request(CAMERA_PERMISSION);\n\n\nand finally in your `Activity/Fragment`\n```java\nonRequestPermissionsResult(....)\n``` \ncall \n```java\npermissionHelper.onRequestPermissionsResult(....)\n```\n\n# Extra Activity/Fragment\n\n* Depends on whether you using `PermissionHelper` or `PermissionFragmentHelper` you can call these methods\n\n```java\npublic static String declinedPermission(@NonNull Context/Fragment context, @NonNull String[])\n```\n\n```java\npublic static String[] declinedPermissions(@NonNull Context/Fragment context, @NonNull String[] permissions)\n```\n\n```java\npublic static boolean isPermissionGranted(@NonNull Context/Fragment context, @NonNull String permission)\n```\n\n```java\npublic static boolean isPermissionDeclined(@NonNull Context/Fragment context, @NonNull String permission)\n```\n\n```java\npublic static boolean isExplanationNeeded(@NonNull Activity/Fragment context, @NonNull String permissionName)\n```\n\n\n```java\npublic static boolean permissionExists(@NonNull Context/Fragment context, @NonNull String permissionName)\n```\n\n```java\npublic static boolean isPermissionPermanentlyDenied(@NonNull Activity/Fragment context, @NonNull String permission)\n```\n\n```java\npublic static void openSettingsScreen(Context/Fragment context)//useful when we can't request for the permission due to user ticked don't show again.\n```\n\n```java\n@TargetApi(Build.VERSION_CODES.M)\npublic static boolean isSystemAlertGranted(@NonNull Context/Fragment context)// special case for SYSTEM_ALERT_WINDOW permission.\n```\n\n\n\u003e all of the above static methods you can still access them with PermissionHelper or PermissionFragmentHelper instance.\n\n\n\n* To understand more how taking control would look like please go through the \n    - `Activity` \u003ca href=\"https://github.com/k0shk0sh/PermissionHelper/tree/master/app/src/main/java/com/fastaccess/permission/sample/SampleActivity.java\"\u003e`SampleActivity`\u003c/a\u003e\n    - `Fragment` \u003ca href=\"https://github.com/k0shk0sh/PermissionHelper/tree/master/app/src/main/java/com/fastaccess/permission/sample/SampleFragment.java\"\u003e`SampleFragment`\u003c/a\u003e\n\n# Why this library?\n\n* Its simple to use.\n* Its Unique, Customizable \u0026 read back first point. \n* You have two choices, do it your way through `callbacks`, or let the `Library` do it for you with your look \u0026 Feel.\n* Minimum API is 14, but it'll probably work in API 11 and above, just make sure you test it out.  \n\n\u003e If you're using this library drop me an email at kosh20111@gmail.com to include in the list.\n\n# Dependency\n\nAndroid Support library ``v24.2.1``\n\nCirclePageIndicator by **JakeWharton** (integrated within the library).\n\n# Images\n\nImages used inside the demo are by \u003ca href=\"http://www.materialup.com/maxKeppeler\"\u003eMaximilian Keppeler\u003c/a\u003e\n\n# Copyright Notice\n\nCopyright (C) 2015 Kosh.\nLicensed under the [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0)\nlicense (see the LICENSE file).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0shk0sh%2FPermissionHelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk0shk0sh%2FPermissionHelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0shk0sh%2FPermissionHelper/lists"}