[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4106":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":20,"defaultBranch":21,"hasWiki":19,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":14,"lastSyncTime":29,"discoverSource":30},4106,"RxPermissions","tbruyelle\u002FRxPermissions","tbruyelle","Android runtime permissions powered by RxJava2","",null,"Java",10417,1374,2,91,0,44.41,"Apache License 2.0",true,false,"master",[23,24,25],"android","android-permissions","rxjava","2026-06-12 02:00:58","# RxPermissions\n\n[![](https:\u002F\u002Fjitpack.io\u002Fv\u002Ftbruyelle\u002FRxPermissions.svg)](https:\u002F\u002Fjitpack.io\u002F#tbruyelle\u002FRxPermissions) [![BuildVersion](https:\u002F\u002Fbuildstats.info\u002Fnuget\u002FRxPermissions)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FRxPermissions\u002F) [![Build Status](https:\u002F\u002Fapi.travis-ci.org\u002Ftbruyelle\u002FRxPermissions.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Ftbruyelle\u002FRxPermissions)\n\nThis library allows the usage of RxJava with the new Android M permission model.\n\n## Setup\n\nTo use this library your `minSdkVersion` must be >= 14.\n\n```gradle\nallprojects {\n    repositories {\n        ...\n        maven { url 'https:\u002F\u002Fjitpack.io' }\n    }\n}\n\ndependencies {\n    implementation 'com.github.tbruyelle:rxpermissions:0.12'\n}\n```\n\n## Usage\n\nCreate a `RxPermissions` instance :\n\n```java\nfinal RxPermissions rxPermissions = new RxPermissions(this); \u002F\u002F where this is an Activity or Fragment instance\n```\n\n**NOTE:** `new RxPermissions(this)` the `this` parameter can be a FragmentActivity or a Fragment. If you are using `RxPermissions` inside of a fragment you should pass the fragment instance(`new RxPermissions(this)`) as constructor parameter rather than `new RxPermissions(fragment.getActivity())` or you could face a `java.lang.IllegalStateException: FragmentManager is already executing transactions`.  \n\nExample : request the CAMERA permission (with Retrolambda for brevity, but not required)\n\n```java\n\u002F\u002F Must be done during an initialization phase like onCreate\nrxPermissions\n    .request(Manifest.permission.CAMERA)\n    .subscribe(granted -> {\n        if (granted) { \u002F\u002F Always true pre-M\n           \u002F\u002F I can control the camera now\n        } else {\n           \u002F\u002F Oups permission denied\n        }\n    });\n```\n\nIf you need to trigger the permission request from a specific event, you need to setup your event\nas an observable inside an initialization phase.\n\nYou can use [JakeWharton\u002FRxBinding](https:\u002F\u002Fgithub.com\u002FJakeWharton\u002FRxBinding) to turn your view to\nan observable (not included in the library).\n\nExample :\n\n```java\n\u002F\u002F Must be done during an initialization phase like onCreate\nRxView.clicks(findViewById(R.id.enableCamera))\n    .compose(rxPermissions.ensure(Manifest.permission.CAMERA))\n    .subscribe(granted -> {\n        \u002F\u002F R.id.enableCamera has been clicked\n    });\n```\n\nIf multiple permissions at the same time, the result is combined :\n\n```java\nrxPermissions\n    .request(Manifest.permission.CAMERA,\n             Manifest.permission.READ_PHONE_STATE)\n    .subscribe(granted -> {\n        if (granted) {\n           \u002F\u002F All requested permissions are granted\n        } else {\n           \u002F\u002F At least one permission is denied\n        }\n    });\n```\n\nYou can also observe a detailed result with `requestEach` or `ensureEach` :\n\n```java\nrxPermissions\n    .requestEach(Manifest.permission.CAMERA,\n             Manifest.permission.READ_PHONE_STATE)\n    .subscribe(permission -> { \u002F\u002F will emit 2 Permission objects\n        if (permission.granted) {\n           \u002F\u002F `permission.name` is granted !\n        } else if (permission.shouldShowRequestPermissionRationale) {\n           \u002F\u002F Denied permission without ask never again\n        } else {\n           \u002F\u002F Denied permission with ask never again\n           \u002F\u002F Need to go to the settings\n        }\n    });\n```\n\nYou can also get combined detailed result with `requestEachCombined` or `ensureEachCombined` :\n\n```java\nrxPermissions\n    .requestEachCombined(Manifest.permission.CAMERA,\n             Manifest.permission.READ_PHONE_STATE)\n    .subscribe(permission -> { \u002F\u002F will emit 1 Permission object\n        if (permission.granted) {\n           \u002F\u002F All permissions are granted !\n        } else if (permission.shouldShowRequestPermissionRationale)\n           \u002F\u002F At least one denied permission without ask never again\n        } else {\n           \u002F\u002F At least one denied permission with ask never again\n           \u002F\u002F Need to go to the settings\n        }\n    });\n```\n\nLook at the `sample` app for more.\n\n## Important read\n\n**As mentioned above, because your app may be restarted during the permission request, the request\nmust be done during an initialization phase**. This may be `Activity.onCreate`, or\n`View.onFinishInflate`, but not *pausing* methods like `onResume`, because you'll potentially create an infinite request loop, as your requesting activity is paused by the framework during the permission request.\n\nIf not, and if your app is restarted during the permission request (because of a configuration\nchange for instance), the user's answer will never be emitted to the subscriber.\n\nYou can find more details about that [here](https:\u002F\u002Fgithub.com\u002Ftbruyelle\u002FRxPermissions\u002Fissues\u002F69).\n\n## Status\n\nThis library is still beta, so contributions are welcome.\nI'm currently using it in production since months without issue.\n\n## Benefits\n\n- Avoid worrying about the framework version. If the sdk is pre-M, the observer will automatically\nreceive a granted result.\n\n- Prevents you to split your code between the permission request and the result handling.\nCurrently without this library you have to request the permission in one place and handle the result\nin `Activity.onRequestPermissionsResult()`.\n\n- All what RX provides about transformation, filter, chaining...\n\n# License\n\n```\nCopyright (C) 2015 Thomas Bruyelle\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","RxPermissions 是一个基于 RxJava2 的 Android 运行时权限管理库。它允许开发者以响应式编程的方式处理 Android M 及以上版本的权限请求，简化了权限请求逻辑，并提供了流畅的链式调用接口。该库支持单个或多个权限同时请求，并能够详细反馈每个权限的状态（如已授权、被拒绝等），非常适合需要在用户交互过程中动态请求权限的应用场景。此外，RxPermissions 与 RxBinding 等库结合使用时，可以更方便地将权限请求与 UI 事件绑定，提升开发效率和用户体验。","2026-06-11 02:58:28","top_language"]