{"id":19462778,"url":"https://github.com/mvojtkovszky/singleactivitynavigation","last_synced_at":"2026-02-28T04:02:54.812Z","repository":{"id":144214314,"uuid":"306000865","full_name":"mvojtkovszky/SingleActivityNavigation","owner":"mvojtkovszky","description":"A single activity application framework with straightforward navigation controls, allowing seamless movement between fragments through different containers using a single line of code.","archived":false,"fork":false,"pushed_at":"2024-11-05T10:41:07.000Z","size":7498,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-10-29T09:30:55.217Z","etag":null,"topics":["android","android-library","android-navigation","kotlin","kotlin-android","single-activity","single-activity-pattern"],"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/mvojtkovszky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-21T11:23:58.000Z","updated_at":"2024-11-05T10:41:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"5393244d-adc4-4316-bce3-8df6d51f4869","html_url":"https://github.com/mvojtkovszky/SingleActivityNavigation","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/mvojtkovszky/SingleActivityNavigation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvojtkovszky%2FSingleActivityNavigation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvojtkovszky%2FSingleActivityNavigation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvojtkovszky%2FSingleActivityNavigation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvojtkovszky%2FSingleActivityNavigation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvojtkovszky","download_url":"https://codeload.github.com/mvojtkovszky/SingleActivityNavigation/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvojtkovszky%2FSingleActivityNavigation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29924719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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","kotlin","kotlin-android","single-activity","single-activity-pattern"],"created_at":"2024-11-10T18:05:35.439Z","updated_at":"2026-02-28T04:02:54.780Z","avatar_url":"https://github.com/mvojtkovszky.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SingleActivityNavigation\nA single activity application framework with straightforward navigation controls, allowing seamless\nmovement between fragments through different containers using a single line of code.\n\u003cbr/\u003e\u003cbr/\u003e\n\u003cimg src=\"example.gif\" alt=\"Example Flow\" width=\"320\"/\u003e\n\n## How does it work?\nYour (single) activity must extend from BaseSingleActivity and all your fragments extend from BaseSingleFragment.\nThen you can simply move between fragments from either activity or fragment.\n\n``` kotlin\n// take any fragment(s) of your choosing\nval myFragment = MyFragment()\n\n// multiple ways to navigate through back stack\n// notice how we can use same fragment and seamlessly put it into any container\nnavigateBack()\nnavigateBackTo(\"fragment name\")\nnavigateBackToRoot()\nnavigateTo(myFragment)\nnavigateToRoot(myFragment)\nnavigateToBottomSheed(myFragment)\nnavigateToDialog(myFragment)\ndismissOpenBottomSheet()\ndismissOpenDialog()\n```\n\n\u003cbr/\u003eMake use of many convenience methods to help you control the state of your app\n``` kotlin\ngetCurrentFragment()?.let {\n    when (it.fragmentType) {\n        // this fragment is root, came into existence with navigateToRoot() call\n        FragmentType.ROOT -\u003e TODO()\n        // this fragment is default, came into existence with navigateTo() call, no special flags\n        FragmentType.DEFAULT -\u003e TODO()\n        // this fragment is also default, but was flagged as modal during navigateTo() call\n        FragmentType.MODAL -\u003e TODO()\n        // this fragment is a dialog, came into existence with navigateToDialog() call\n        FragmentType.DIALOG -\u003e TODO()\n        // this fragment is a dialog, came into existence with navigateToBottomSheet() call\n        FragmentType.BOTTOM_SHEET -\u003e TODO()\n    }\n}\n```\n\n\u003cbr/\u003eLet the fragment define behavioural patterns of it's own by overriding open properties:\n``` kotlin\nopen val isModal: Boolean\nopen val mustBeValidToInvokeNavigation: Boolean\nopen val overridesBackPress: Boolean\nopen val animationEnter: Int\nopen val animationExit: Int\nopen val animationPopEnter: Int\nopen val animationPopExit: Int\n```\n\n\u003cbr/\u003eAnd much more:\n* Master/detail implementation support.\n* Safe instance state recreation.\n* Custom transition animations based on fragment type.\n* Make sure to check out example app to help you get started.\n\u003cbr/\u003e\n\n## Nice! How do I get started?\nMake sure root build.gradle repositories include JitPack\n``` gradle\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\nAnd SingleActivityNavigation dependency is added to app build.gradle\n``` gradle\ndependencies {\n    implementation 'com.github.mvojtkovszky:SingleActivityNavigation:$latest_version'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvojtkovszky%2Fsingleactivitynavigation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvojtkovszky%2Fsingleactivitynavigation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvojtkovszky%2Fsingleactivitynavigation/lists"}