{"id":21942038,"url":"https://github.com/malekkamel/navigator","last_synced_at":"2025-04-22T18:10:51.355Z","repository":{"id":90820902,"uuid":"110376843","full_name":"MalekKamel/Navigator","owner":"MalekKamel","description":null,"archived":false,"fork":false,"pushed_at":"2019-12-16T11:57:20.000Z","size":2769,"stargazers_count":27,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T21:40:31.090Z","etag":null,"topics":["activity","android","fragment","intents","navigation","navigator","navigatorcontroller","parcelable"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MalekKamel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-11-11T20:15:56.000Z","updated_at":"2023-09-08T17:32:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"72a225b1-37e4-4619-aa11-f1e19ce63915","html_url":"https://github.com/MalekKamel/Navigator","commit_stats":null,"previous_names":["malekkamel/navigator","shabankamell/navigator"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FNavigator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FNavigator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FNavigator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FNavigator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MalekKamel","download_url":"https://codeload.github.com/MalekKamel/Navigator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250296175,"owners_count":21407037,"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":["activity","android","fragment","intents","navigation","navigator","navigatorcontroller","parcelable"],"created_at":"2024-11-29T03:16:16.490Z","updated_at":"2025-04-22T18:10:51.333Z","avatar_url":"https://github.com/MalekKamel.png","language":"Kotlin","readme":"\n\n# Android Navigator\n\n[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Navigator-green.svg?style=flat )]( https://android-arsenal.com/details/1/6514 ) [![](https://jitpack.io/v/ShabanKamell/Navigator.svg)](https://jitpack.io/#ShabanKamell/Navigator)\n\nA simple wrapper for Android navigation that helps you get rid of a lot of boilerplate code.\n\n\u003cimg src=\"https://github.com/ShabanKamell/Navigator/blob/master/blob/raw/logo.png\" height=\"250\"\u003e\n\n## Install\n\n#### Gradle:\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url \"https://jitpack.io\" }\n    }\n}\n\ndependencies {\n       implementation 'com.github.ShabanKamell:Navigator:x.y.z'\n}\n\n```\n(Please replace x, y and z with the latest version numbers:  [![](https://jitpack.io/v/ShabanKamell/Navigator.svg)](https://jitpack.io/#ShabanKamell/Navigator))\n\n\n# Usage\n\n## Modular Navigation\n\nNavigator supports Fragment/Activity navigation\n\n#### Activity\n```kotlin\n// Declare Addresable Activity\nobject Profile: AddressableActivity {\n     override val className: String = \"com.sha.navigator.profile.ProfileActivity\"\n}\n// start Activity\nActivityModuleNavigator(this, packageName).navigate(Profile)\n```\n\n#### Fragment\n\n```kotlin\n// Declare Addresable Fragment\nobject Profile: AddressableFragment {\n     override val className: String = \"com.sha.navigator.profile.ProfileFragment\"\n}\n// Add Fragment\nFragmentModuleNavigator(this).add(Profile)\n// OR Replace Fragment\nFragmentModuleNavigator(this).replace(Profile)\n```\n\n## Fragment Navigation\n\n#### Replace Fragment\n``` java\n FragmentNavigator(this).replace(ExampleFragment.newInstance()\n```\n\n#### Add Fragment\n``` java\n FragmentNavigator(this).add(ExampleFragment.newInstance())\n```\n\n#### Show DialogFragment\n``` java\n FragmentNavigator(this).showDialogFragment(CustomerDialogFragment.newInstance())\n```\n\n### Where's FrameLayout's ID?\nFrameLayout's ID can be Provided with 2 ways:\n#### 1- Pass in FragmentNavigator Contstructor\n\n```java\n   FragmentNavigator(this, R.id.mainFrame)\n```\n\n#### 2- Provide only once  in Application class or anywhere\nIn this case, you don't have to pass the ID in the constructor in every call.\n```java\nclass SampleApp : Application() {\n    override fun onCreate() {\n        super.onCreate()\n        NavigatorOptions.frameLayoutId = R.id.mainFrame\n    }\n}\n```\nNote: Passing the ID in the constructor will override the ID of `NavigatorOptions` only this call and won't change `NavigatorOptions`'s ID.\n\n## Activity Navigation\n#### Navigate to Activity\n``` java\n new ActivityNavigator(this).navigate(ExampleActivity.class);\n```\n\n#### Start Activity For Result\n``` java\n ActivityNavigator(this).navigate(ExampleActivity::class.java)\n```\n\n#### With Parcelable\n``` java\nActivityNavigator(this)\n                    .withParcelable(Parcels.wrap(Message()), \"message\")\n                    .navigate(ExampleActivity::class.java)\n```\n\n#### With Flags\n``` java\n  ActivityNavigator(this)  \n        .withFlags(new Flags().newTask().singleTop())\n        .navigate(ExampleActivity.class)\n        \n        // OR\n        \n  ActivityNavigator(this)  \n        .withFlags(Intent.FLAG_ACTIVITY_NEW_TASK, Intent.FLAG_ACTIVITY_SINGLE_TOP)\n        .navigate(ExampleActivity.class)\n```\n\n#### Open App In Google Play\n``` java\n  ActivityNavigator(this).openInGooglePlay()\n```\n\n#### Open Camera\n``` java\n  ActivityNavigator(this).openCamera(2)\n```\n\n#### Open Settings\n``` java\n  ActivityNavigator(this).navigateToSettings()\n```\n\n#### Show Route In Google Map\n``` java\n new ActivityNavigator(this).showRouteInGoogleMap(  \n        25.095549,  // from lat\n        29.644703,  // from lng\n        24.457151,  // to lat\n        27.184841   // to lng\n  );\n```\n\n### See 'sample' module for the full code.\n\n## Credit\n[Plaid](https://github.com/android/plaid) Modular Navigation\n\n## License\n\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```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalekkamel%2Fnavigator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalekkamel%2Fnavigator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalekkamel%2Fnavigator/lists"}