{"id":17966370,"url":"https://github.com/x1nto/taxi","last_synced_at":"2025-08-01T04:04:14.246Z","repository":{"id":37559319,"uuid":"503485538","full_name":"X1nto/Taxi","owner":"X1nto","description":"A simple Jetpack Compose navigator.","archived":false,"fork":false,"pushed_at":"2022-11-24T10:29:14.000Z","size":192,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-25T16:53:07.182Z","etag":null,"topics":["android","android-library","android-navigation","jetpack-compose","jetpack-compose-navigation","kotlin","kotlin-android","kotlin-library","navigation"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/X1nto.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":"2022-06-14T18:58:58.000Z","updated_at":"2024-08-30T20:24:48.000Z","dependencies_parsed_at":"2022-07-12T16:23:29.088Z","dependency_job_id":null,"html_url":"https://github.com/X1nto/Taxi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/X1nto/Taxi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X1nto%2FTaxi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X1nto%2FTaxi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X1nto%2FTaxi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X1nto%2FTaxi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/X1nto","download_url":"https://codeload.github.com/X1nto/Taxi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X1nto%2FTaxi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268166924,"owners_count":24206448,"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-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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","android-navigation","jetpack-compose","jetpack-compose-navigation","kotlin","kotlin-android","kotlin-library","navigation"],"created_at":"2024-10-29T13:10:21.013Z","updated_at":"2025-08-01T04:04:14.203Z","avatar_url":"https://github.com/X1nto.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Taxi\nA small navigation library for Jetpack Compose with state saving, backstack and animations support.\n\n# Quick Setup\n## Installation\nAdd JitPack repository to root build.gradle\n```kotlin\nallprojects {\n    repositories {\n        ...\n        maven(url = \"https://jitpack.io\")\n    }\n}\n```\nAdd Taxi dependency to app build.gradle\n```kotlin\ndependencies {\n    implementation(\"com.github.X1nto.taxi:taxi:1.3.0\")\n}\n```\n\n## Basic Usage\n```kotlin\nsealed interface AppDestination : Destination {\n    \n    @Parcelize\n    object Home : AppDestination\n    \n    @Parcelize\n    object Settings : AppDestination\n    \n}\n\n@Composable\nfun BackstackApp() {\n    val navigator = rememberBackstackNavigator\u003cAppDestination\u003e(initial = AppDestination.Home)\n    \n    BackHandler {\n        //Check if the navigator can pop\n        if (!navigator.pop()) {\n            finish() //Finish the activity if the backstack was empty\n        }\n    }\n    \n    Taxi(\n        modifier = Modifier.filLMaxSize(),\n        navigator = navigator,\n        transitionSpec = { fadeIn() with fadeOut() }\n    ) { destination -\u003e\n        when (destination) {\n            is AppDestination.Home -\u003e {\n                Home(onSettingsClick = {\n                    navigator.push(AppDestination.Settings)\n                })\n            }\n            is AppDestination.Settings -\u003e {\n                Settings(onBackClick = {\n                    navigator.pop()\n                })\n            }\n        }\n    }\n}\n\n@Composable\nfun NavbarApp() {\n    val navigator = rememberNavigator\u003cAppDestination\u003e(initial = AppDestination.Home)\n\n    Scaffold(\n        modifier = Modifier.fillMaxSize(),\n        bottomBar = {\n            NavigationBar(modifier = Modifier.fillMaxWidth()) {\n                NavigationBarItem(\n                    selected = navigator.currentDestination is AppDestination.Home,\n                    onClick = { \n                        navigator.replace(AppDestination.Home)\n                    },\n                    label = {\n                        Text(\"Home\")\n                    }\n                )\n                NavigationBarItem(\n                    selected = navigator.currentDestination is AppDestination.Settings,\n                    onClick = { \n                        navigator.replace(AppDestination.Settings)\n                    },\n                    label = {\n                        Text(\"Settings\")\n                    }\n                )\n            }\n        }\n    ) { paddingValues -\u003e\n        Taxi(\n            modifier = Modifier.fillMaxSize().padding(paddingValues),\n            navigator = navigator,\n            transitionSpec = { fadeIn() with fadeOut() }\n        ) { destination -\u003e\n            when (destination) {\n                is AppDestination.Home -\u003e {\n                    Home()\n                }\n                is AppDestination.Settings -\u003e {\n                    Settings()\n                }\n            }\n        }\n    }\n}\n```\n\n## Usage with Addresses\nTaxi addresses simplify your code by providing a neat DSL for registering new destinations.\n\nAdd the addresses dependency to app build.gradle\n```kt\ndependencies {\n    ...\n    implementation(\"com.github.X1nto.taxi:taxi-addresses:1.3.0\")\n}\n```\n\nNow use Taxi with a beautiful DSL:\n```kt\nAddressedTaxi(\n    modifier = Modifier.fillMaxSize().padding(paddingValues),\n    navigator = navigator,\n    transitionSpec = { fadeIn() with fadeOut() }\n) {\n    address\u003cAppDestination.Home\u003e {\n        Home()\n    }\n    address\u003cAppDestination.Counter\u003e {\n        Counter(it.count)\n    }\n}\n```\n\nCheck out the [sample app](/app) for better examples.\n\nLicense\n-------\n```\nCopyright (C) 2022 X1nto.\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://www.apache.org/licenses/LICENSE-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```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx1nto%2Ftaxi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx1nto%2Ftaxi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx1nto%2Ftaxi/lists"}