{"id":20492523,"url":"https://github.com/redmadrobot/flipper","last_synced_at":"2025-07-21T23:32:09.998Z","repository":{"id":55634290,"uuid":"215536315","full_name":"RedMadRobot/flipper","owner":"RedMadRobot","description":"Flipper is a simple and useful tool to deal with feature toggles","archived":false,"fork":false,"pushed_at":"2021-04-27T08:50:31.000Z","size":332,"stargazers_count":71,"open_issues_count":3,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-20T17:06:25.536Z","etag":null,"topics":["android","android-library","feature-flags","feature-toggle","feature-toggles","kotlin","kotlin-android","kotlin-library"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedMadRobot.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":"2019-10-16T11:54:31.000Z","updated_at":"2024-07-09T18:16:16.000Z","dependencies_parsed_at":"2022-08-15T05:00:55.928Z","dependency_job_id":null,"html_url":"https://github.com/RedMadRobot/flipper","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/RedMadRobot/flipper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fflipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fflipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fflipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fflipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedMadRobot","download_url":"https://codeload.github.com/RedMadRobot/flipper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fflipper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266403045,"owners_count":23923403,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["android","android-library","feature-flags","feature-toggle","feature-toggles","kotlin","kotlin-android","kotlin-library"],"created_at":"2024-11-15T17:29:28.083Z","updated_at":"2025-07-21T23:32:09.969Z","avatar_url":"https://github.com/RedMadRobot.png","language":"Kotlin","readme":"\u003cimg src=\"images/logo.png\"/\u003e\n\n# Flipper\n[![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23384-green)](https://androidweekly.net/issues/issue-384)\n[![API](https://img.shields.io/badge/API-16%2B-red.svg?style=flat)](https://android-arsenal.com/api?level=16)\n[![Build Status](https://travis-ci.org/RedMadRobot/flipper.svg?branch=master)](https://travis-ci.org/RedMadRobot/flipper)\n![Maven Central](https://img.shields.io/maven-central/v/com.redmadrobot/flipper)\n\nFlipper is a simple and useful tool to deal with feature toggles. It's not some *secret weapon* but rather a set of best practices to work with flipping features in your application, which is shipped as a library.\n\n### Quick start\n\nAdd this library to your gradle config\n```groovy\nimplementation 'com.redmadrobot:flipper:1.0.6'\n```\n\nCreate a class with a description of features\n```kotlin\nobject Features {\n\n    object Feature1 : Feature() {\n        override val id = \"Feature1\"\n    }\n}\n``` \n\nCreate some simplest configuration describing which features are enabled and which features are disabled:\n```kotlin\nclass HardcodedConfig : FlipperConfig {\n    private val features = mapOf(\n        Features.Feature1.id to true\n    )\n\n    override fun featureIsEnabled(feature: Feature): Boolean {\n        return features[feature.id] ?: false\n    }\n}\n``` \n\u003e If you want to manage your features with Firebase, look at [this](https://github.com/RedMadRobot/flipper/blob/master/app/src/main/java/com/redmadrobot/sample/configs/RemoteConfig.kt) config example.   \n\nInit the library in your **Application** class\n```kotlin\nToggleRouter.init(HardcodedConfig())\n```\n\nChoose the necessary \"feature edge\" and place a toggle point (flipper point in this library terms).\n```kotlin\nval feature1Button = (Button) findViewById(R.id.feature1_button)\n\nfeature1Button.flipperPoint(Features.Feature1)\n\n...\n\nfeature1Button.setOnClickListener { openFeature1Screen() }\n```\n\nRun and enjoy!\n\n### Library components\n\n- [`Feature`](https://github.com/RedMadRobot/flipper/blob/master/flipper/src/main/kotlin/com/redmadrobot/flipper/Feature.kt): base class for all your feature objects. You have to provide a unique identifier for each such object.\n- [`ToggleRouter`](https://github.com/RedMadRobot/flipper/blob/master/flipper/src/main/kotlin/com/redmadrobot/flipper/ToggleRouter.kt): features orchestrator based on some variant of the configuration   \n- [`FlipperConfig`](https://github.com/RedMadRobot/flipper/blob/master/flipper/src/main/kotlin/com/redmadrobot/flipper/config/FlipperConfig.kt): base class for your variant of the feature toggle configuration\n- [`flipperPoint`](https://github.com/RedMadRobot/flipper/blob/master/flipper/src/main/kotlin/com/redmadrobot/flipper/FlipperExt.kt): Kotlin extension function which you should place at the edge of your feature\n\n### More information about the \"feature edges\"\nWhen it comes to Android application, you have only three ways of transition between features. \n- tap on the view (swipe like a special case)\n- tap on the menu item\n- an external event driven by business logic\n\nIn fact, all components that trigger transitions are the edges of the features. So, to prevent transition between features, we've got to disable the border component. You can do it using extension functions on View and MenuItem or a top-level function with flipping code blocks.\n\nSome examples\n```kotlin\nwith(feature4_button) {\n    setOnClickListener { findNavController().navigate(Feature1FragmentDirections.toFeature4()) }\n    flipperPoint(Features.Feature4)\n}\n```\n\n```kotlin\nwith(bottom_nav.menu) {\n    findItem(R.id.feature1).flipperPoint(Features.Feature1)\n    findItem(R.id.feature2).flipperPoint(Features.Feature2)\n    findItem(R.id.feature3).flipperPoint(Features.Feature3)\n}\n```\n\n```kotlin\nflipperPoint(Features.Feature1) {\n    Log.d(\"Flipper\", \"I'll appear only when feature1 is enabled.\")\n}\n```\n\n```kotlin\nif(flipperPointIsEnabled(Features.Feature1)) {\n    Log.d(\"Flipper\", \"Feature1 is enabled.\")\n} else {\n    Log.d(\"Flipper\", \"Feature1 is disabled.\")\n}\n```\n        \n### Further reading\nThere is an almost \"classic\" article about feature toggles [Feature Toggles (aka Feature Flags)](https://www.martinfowler.com/articles/feature-toggles.html). You can read it to know more about this library underline concepts.\n\n## Feedback\nIn case you have faced any bug or have a useful suggestion for improvement of this library, feel free to create an [issue](https://github.com/RedMadRobot/flipper/issues). \n\n## LICENSE\n\n\u003eTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredmadrobot%2Fflipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredmadrobot%2Fflipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredmadrobot%2Fflipper/lists"}