{"id":13803520,"url":"https://github.com/f2prateek/rx-preferences","last_synced_at":"2025-05-15T07:03:52.021Z","repository":{"id":24661731,"uuid":"28071993","full_name":"f2prateek/rx-preferences","owner":"f2prateek","description":"Reactive SharedPreferences for Android","archived":false,"fork":false,"pushed_at":"2023-05-24T00:46:03.000Z","size":302,"stargazers_count":1532,"open_issues_count":19,"forks_count":132,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-15T07:03:48.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://f2prateek.com/2015/10/05/rx-preferences/","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/f2prateek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-12-16T05:28:28.000Z","updated_at":"2025-05-06T22:27:58.000Z","dependencies_parsed_at":"2024-01-03T01:29:35.368Z","dependency_job_id":"c700fedf-696b-4f27-94e1-080d3fcb64cd","html_url":"https://github.com/f2prateek/rx-preferences","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2prateek%2Frx-preferences","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2prateek%2Frx-preferences/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2prateek%2Frx-preferences/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2prateek%2Frx-preferences/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f2prateek","download_url":"https://codeload.github.com/f2prateek/rx-preferences/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254291974,"owners_count":22046425,"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-04T01:00:34.402Z","updated_at":"2025-05-15T07:03:51.989Z","avatar_url":"https://github.com/f2prateek.png","language":"Java","readme":"# DEPRECATED\n\nrx-preferences is deprecated. Please consider using a replacement, such as [this](https://github.com/pablobaxter/rx-preferences). Thank you for using the library!\n\nRx Preferences\n--------------\n\nReactive `SharedPreferences` for Android.\n\n\nUsage\n-----\n\nCreate an `RxSharedPreferences` instance which wraps a `SharedPreferences`:\n\n```java\nSharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\nRxSharedPreferences rxPreferences = RxSharedPreferences.create(preferences);\n```\n\n*Hint: Keep a strong reference on your `RxSharedPreferences` instance for as long as you want to observe them to prevent listeners from being GCed.*\n\nCreate individual `Preference` objects:\n\n```java\nPreference\u003cString\u003e username = rxPreferences.getString(\"username\");\nPreference\u003cBoolean\u003e showWhatsNew = rxPreferences.getBoolean(\"show-whats-new\", true);\n```\n\nObserve changes to individual preferences:\n\n```java\nusername.asObservable().subscribe(new Action1\u003cString\u003e() {\n  @Override public void call(String username) {\n    Log.d(TAG, \"Username: \" + username);\n  }\n}\n```\n\nSubscribe preferences to streams to store values:\n\n```java\nRxCompoundButton.checks(showWhatsNewView)\n    .subscribe(showWhatsNew.asConsumer());\n```\n*(Note: `RxCompoundButton` is from [RxBinding][1])*\n\n\nDownload\n--------\n\n```groovy\nimplementation 'com.f2prateek.rx.preferences2:rx-preferences:2.0.1'\n```\n\n\nLicense\n-------\n\n    Copyright 2014 Prateek Srivastava\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n\n [1]: https://github.com/JakeWharton/RxBinding\n [2]: http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy\u0026g=com.f2prateek.rx.preferences\u0026a=rx-preferences\u0026v=LATEST\n","funding_links":[],"categories":["Library","Index","Rx","Bindings"],"sub_categories":["一些原理分析的文章","RxJava"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff2prateek%2Frx-preferences","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff2prateek%2Frx-preferences","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff2prateek%2Frx-preferences/lists"}