{"id":18269746,"url":"https://github.com/skyfe79/fragmentnavigationcontroller","last_synced_at":"2025-04-04T23:31:28.354Z","repository":{"id":137746279,"uuid":"59622931","full_name":"skyfe79/FragmentNavigationController","owner":"skyfe79","description":"FragmentNavigationController is a convenient utility library to navigate fragments on Android.","archived":false,"fork":false,"pushed_at":"2016-06-29T11:19:31.000Z","size":1502,"stargazers_count":35,"open_issues_count":0,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-20T20:18:16.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/skyfe79.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,"governance":null}},"created_at":"2016-05-25T02:03:12.000Z","updated_at":"2021-03-17T18:23:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"73c43f45-22a8-4731-962f-9b764d0c0899","html_url":"https://github.com/skyfe79/FragmentNavigationController","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyfe79%2FFragmentNavigationController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyfe79%2FFragmentNavigationController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyfe79%2FFragmentNavigationController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyfe79%2FFragmentNavigationController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyfe79","download_url":"https://codeload.github.com/skyfe79/FragmentNavigationController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266476,"owners_count":20910831,"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-11-05T11:37:02.155Z","updated_at":"2025-04-04T23:31:26.591Z","avatar_url":"https://github.com/skyfe79.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FragmentNavigationController\n\n[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)\n[![API](https://img.shields.io/badge/API-13%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=13)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT)\n\n\n\nFragmentNavigationController is a convenient utility class for navigating fragments on Android. It is similar to iOS UINavigationController. FragmentNavigationController manages fragment stack for you. You just use presentFragment() and dismissFragment() method of it. FragmentNavigationController also provides many present styles(transition style) for transition between two fragments.\n\n| ![](art/FragmentNavigationController.gif)  | ![](art/tabbar.gif) |\n|:-:|:-:|\n| [Random transition showcase](https://github.com/skyfe79/FragmentNavigationController/tree/master/app/src/main/java/kr/pe/burt/android/lib/fragmentnavigationcontroller/app) | [Tabbar example](https://github.com/skyfe79/FragmentNavigationController/tree/master/examples/TabBarExample/app/src/main/java/kr/pe/burt/android/tabbarexample) |\n\n\n\n\n## Setup Gradle\n\n```groovy\ndependencies {\n    ...\n    compile 'kr.pe.burt.android.lib:fragmentnavigationcontroller:0.0.4'\n}\n```\n\n## How to use it?\n\nFirst of all, declare fragment container place in Activity's layout XML file.\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cLinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    tools:context=\"kr.pe.burt.android.androidanimations.MainActivity\"\u003e\n\n\n    \u003cFrameLayout\n        android:id=\"@+id/fragmentContainer\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0dp\"\n        android:layout_weight=\"1\"\u003e\n    \u003c/FrameLayout\u003e\n\n\n\u003c/LinearLayout\u003e\n```\n\nAnd then, install a FragmentNavigationController in your activity like below:\n\n```java\n\npublic class MainActivity extends AppCompatActivity {\n\t\n\t...\n\t\n\tFragmentNavigationController navigationController;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        navigationController = FragmentNavigationController.navigationController(getFragmentManager(), R.id.fragmentContainer);\n    }\n    \n    ...\n}\n```\n\nIt's all to use FragmentNavigationController.\n\n## Present and Dismiss Fragment\n\nFragmentNavigationController has cons. to use it. You must inherit your fragment from AndroidFragment which is in FragmentNavigationController package. This is for the beautiful transition effects and others. After inheriting from AndroidFragment, You must implement abstract method `onCreateContentView` where you provide fragment's layout view.\n\n```java\npublic class FragmentOne extends AndroidFragment {\n\n\t @Nullable\n    @Override\n    protected View onCreateContentView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n        return inflater.inflate(R.layout.fragment_one, container, false);\n    }\n    \n}\n```\n\n* Present Fragment\n\n```java\nnavigationController.presentFragment(new FragmentOne());\n```\n\n* dismiss Fragment\n\n```java\nnavigationController.dismissFragment()\n```\n\n## Set the present style, duration and interpolator.\n\nYou can set the present style, duration and interpolator whatever you want. \n\n### Present Style\n\nUsing setPresentStyle() method, you can set many present style for fragment transition. There are 40 preset present style for you. Also you can set your custom present style by using animator xml files.\n\n```java\nnavigationController.setPresentStyle(PresentStyle.ACCORDION_LEFT);\n```\n\n### Duration and Interpolator\n\nUsing setDuration() and setInterpolator() method, you can set the duration of present animation and the interpolator for the animation. \n\n```java\nnavigationController.setDuration(500);\nnavigationController.setInterpolator(new AccelerateDecelerateInterpolator());\n```\n\n### The list of present style\n\n* `NONE`\n* `ACCORDION_LEFT`\n* `ACCORDION_RIGHT`\n* `ACCORDION_UP`\n* `ACCORDION_DOWN`\n* `CARD_FLIP_LEFT`\n* `CARD_FLIP_RIGHT`\n* `CARD_FLIP_UP`\n* `CARD_FLIP_DOWN`\n* `CUBE_LEFT`\n* `CUBE_RIGHT`\n* `CUBE_UP`\n* `CUBE_DOWN`\n* `FADE`\n* `GLIDE`\n* `ROTATE_DOWN_LEFT`\n* `ROTATE_DOWN_RIGHT`\n* `ROTATE_UP_LEFT`\n* `ROTATE_UP_RIGHT`\n* `ROTATE_LEFT_UP`\n* `ROTATE_LEFT_DOWN`\n* `ROTATE_RIGHT_UP`\n* `ROTATE_RIGHT_DOWN`\n* `SCALEX`\n* `SCALEY`\n* `SCALEXY`\n* `SLIDE_LEFT`\n* `SLIDE_RIGHT`\n* `SLIDE_UP`\n* `SLIDE_DOWN`\n* `STACK_LEFT`\n* `STACK_RIGHT`\n* `TABLE_LEFT`\n* `TABLE_RIGHT`\n* `TABLE_UP`\n* `TABLE_DOWN`\n* `ZOOM_FROM_LEFT_TOP_CORNER`\n* `ZOOM_FROM_RIGHT_TOP_CORNER`\n* `ZOOM_FROM_LEFT_BOTTOM_CORNER`\n* `ZOOM_FROM_RIGHT_BOTTOM_CORNER`\n\n## Manage back button and fragment stack.\n\nYou should manage back button and fragment stack by manually like below:\n\n```java\n@Override\npublic void onBackPressed() {\n    if(navigationController.dismissFragment() == false) {\n        super.onBackPressed();\n    }\n}\n```\n\n## APIs\n\n### FragmentNavigationController\n\n* setPresentStyle(int style)\n* setPresentStyle(PresentStyle style)\n* setInterpolator(Interpolator interpolator)\n* setDuration(long presentDuration)\n* pushFragment(AndroidFragment fragment)\n* popFragment()\n* presentFragment(AndroidFragment fragment)\n* presentFragment(AndroidFragment fragment, boolean withAnimation)\n* dismissFragment()\n* dismissFragment(boolean withAnimation)\n* popToRootFragment()\n\n### AndroidFragment\n\n* onShowFragment()\n* onHideFragment()\n\n## Extreme special thanks\n\n* `FragmentTransactionExtended` by Antonio Corrales : [https://github.com/DesarrolloAntonio/FragmentTransactionExtended](https://github.com/DesarrolloAntonio/FragmentTransactionExtended)\n * FragmentNavigationController can be born because there is FragmentTransactionExtended project. FragmentNavigationController use animator xml files of FragmentTransactionExtended.\n\n## MIT License\n\nThe MIT License\n\nCopyright © 2015 Sungcheol Kim, http://github.com/skyfe79/FragmentNavigationController\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyfe79%2Ffragmentnavigationcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyfe79%2Ffragmentnavigationcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyfe79%2Ffragmentnavigationcontroller/lists"}