{"id":15027393,"url":"https://github.com/armcha/space-navigation-view","last_synced_at":"2025-05-15T16:05:43.858Z","repository":{"id":49398167,"uuid":"65409253","full_name":"armcha/Space-Navigation-View","owner":"armcha","description":"Space Navigation is a library allowing easily integrate fully customizable Google Spaces like navigation to your app.","archived":false,"fork":false,"pushed_at":"2021-04-29T10:21:15.000Z","size":8680,"stargazers_count":1989,"open_issues_count":66,"forks_count":378,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-05-10T06:43:40.096Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armcha.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}},"created_at":"2016-08-10T19:07:41.000Z","updated_at":"2025-03-07T05:30:32.000Z","dependencies_parsed_at":"2022-07-26T14:30:05.748Z","dependency_job_id":null,"html_url":"https://github.com/armcha/Space-Navigation-View","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armcha%2FSpace-Navigation-View","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armcha%2FSpace-Navigation-View/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armcha%2FSpace-Navigation-View/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armcha%2FSpace-Navigation-View/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armcha","download_url":"https://codeload.github.com/armcha/Space-Navigation-View/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374427,"owners_count":22060611,"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-09-24T20:06:21.282Z","updated_at":"2025-05-15T16:05:43.812Z","avatar_url":"https://github.com/armcha.png","language":"Java","funding_links":["https://ko-fi.com/A654L70'"],"categories":[],"sub_categories":[],"readme":"# Space-Navigation-View\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Space--Navigation--View-green.svg?style=true)](https://android-arsenal.com/details/1/4180)\n\u003ca href='https://ko-fi.com/A654L70' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=f' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e \n\n## Introduction\n------------\nSpace Navigation is a library allowing easily integrate fully customizable Google [Spaces][1] like navigation to your app.\n[1]: https://play.google.com/store/apps/details?id=com.google.android.apps.social.spaces\n\n![](screens/mainGif.gif)\n![](screens/screen4.png)\n\n\nThe current minSDK version is API level 14 Android 4.0 (ICE CREAM SANDWICH).\n\nDownload sample [apk][7]\n[7]: https://github.com/armcha/Space-Navigation-View/raw/master/SpaceNavigationView.apk\n\n# YouTube demos \n\n## Demo 1    \n[![Demo 1](https://img.youtube.com/vi/LY-7abfJV2o/2.jpg)](https://www.youtube.com/watch?v=LY-7abfJV2o)    \n## Demo 2     \n[![Demo 2](https://img.youtube.com/vi/rA1NMMLJ4TE/2.jpg)](https://www.youtube.com/watch?v=rA1NMMLJ4TE)      \n\n# Download magic\n-----------------------\n\n\nGradle:\n```groovy\ncompile 'com.github.armcha:SpaceNavigationView:1.6.0'\n```\nMaven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.armcha\u003c/groupId\u003e\n  \u003cartifactId\u003eSpaceNavigationView\u003c/artifactId\u003e\n  \u003cversion\u003e1.6.0\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n## Setup and usage\n------------------\n\nAdd the Space Navigation view to your layout\n\n```xml\n \u003cFrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     xmlns:tools=\"http://schemas.android.com/tools\"\n     xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n     android:layout_width=\"match_parent\"\n     android:layout_height=\"match_parent\"\u003e\n     \n      \u003c...View\n             ....\n             android:layout_marginBottom=\"@dimen/view_bottom_margin\" /\u003e\n             \n      \u003ccom.luseen.spacenavigation.SpaceNavigationView\n             android:id=\"@+id/space\"\n             android:layout_width=\"match_parent\"\n             android:layout_height=\"match_parent\"\n             android:layout_gravity=\"bottom\"/\u003e\n             \n \u003c/FrameLayout\u003e\n```\n\nAdd Space Navigation items.\n\n```java\n   SpaceNavigationView spaceNavigationView = (SpaceNavigationView) findViewById(R.id.space);\n   spaceNavigationView.initWithSaveInstanceState(savedInstanceState);\n   spaceNavigationView.addSpaceItem(new SpaceItem(\"HOME\", R.drawable.yourDrawable));\n   spaceNavigationView.addSpaceItem(new SpaceItem(\"SEARCH\", R.drawable.yourDrawable));\n```\n\nUse ```initWithSaveInstanceState(savedInstanceState)``` and override ```onSaveInstanceState``` \nif you want to keep selected item position and badge on device rotation\n```java\n       @Override\n       protected void onSaveInstanceState(Bundle outState) {\n           super.onSaveInstanceState(outState);\n           spaceNavigationView.onSaveInstanceState(outState);\n       }\n```\n\nSet onClick listener\n```java\n   spaceNavigationView.setSpaceOnClickListener(new SpaceOnClickListener() {\n            @Override\n            public void onCentreButtonClick() {\n               Toast.makeText(MainActivity.this,\"onCentreButtonClick\", Toast.LENGTH_SHORT).show();\n            }\n\n            @Override\n            public void onItemClick(int itemIndex, String itemName) {\n               Toast.makeText(MainActivity.this, itemIndex + \" \" + itemName, Toast.LENGTH_SHORT).show();\n            }\n            \n             @Override\n             public void onItemReselected(int itemIndex, String itemName) {\n               Toast.makeText(MainActivity.this, itemIndex + \" \" + itemName, Toast.LENGTH_SHORT).show();           \n            }\n        });\n```\n\nSet onLongClick listener\n```java\n    spaceNavigationView.setSpaceOnLongClickListener(new SpaceOnLongClickListener() {\n            @Override\n            public void onCentreButtonLongClick() {\n                Toast.makeText(MainActivity.this,\"onCentreButtonLongClick\", Toast.LENGTH_SHORT).show();\n            }\n\n            @Override\n            public void onItemLongClick(int itemIndex, String itemName) {\n                Toast.makeText(MainActivity.this, itemIndex + \" \" + itemName, Toast.LENGTH_SHORT).show();\n            }\n        });\n```\n\nCustomize\n---------\n\nCustomize with xml\n\n```xml\n \u003ccom.luseen.spacenavigation.SpaceNavigationView\n        android:id=\"@+id/space\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"bottom\"\n        app:active_item_color=\"@color/colorAccent\"\n        app:centre_button_color=\"@color/centre_button_color\"\n        app:inactive_item_color=\"@color/white\"\n        app:space_background_color=\"@color/colorPrimary\"\n        app:centre_button_icon=\"@drawable/my_drawable\"\n        app:space_item_icon_size=\"@dimen/space_item_icon_default_size\"\n        app:space_item_icon_only_size=\"@dimen/space_item_icon_only_size\"\n        app:space_item_text_size=\"@dimen/space_item_text_default_size\" /\u003e\n```\n\n|  Attribute | Description |\n|---|---|\n| active_item_color  | item color when selected |\n| inactive_item_color |  item color when unselected |\n| centre_button_color | centre circle button color |\n| space_background_color | space view background color |\n| space_item_icon_size | item icon size |\n| space_item_icon_only_size | item icon size on ```showIconOnly()``` mode |\n| space_item_text_size | item text size |\n| centre_button_icon | allow changing center icon from layout |\n\nChange space navigation background\n```java\nspaceNavigationView.setSpaceBackgroundColor(ContextCompat.getColor(this, R.color.yourColor));\n```\n\nChange centre button icon \n```java\nspaceNavigationView.setCentreButtonIcon(R.drawable.yourDrawable);\n```\n\nChange centre button background color \n```java\nspaceNavigationView.setCentreButtonColor(ContextCompat.getColor(this, R.color.yourColor));\n```\n\nChange selected item text and icon color\n```java\nspaceNavigationView.setActiveSpaceItemColor(ContextCompat.getColor(this, R.color.yourColor));\n```\n\nChange unselected item text and icon color\n```java\nspaceNavigationView.setInActiveSpaceItemColor(ContextCompat.getColor(this, R.color.yourColor));\n```\n\nChange space item icon size\n```java\nspaceNavigationView.setSpaceItemIconSize((int) getResources().getDimension(R.dimen.yourDimen));\n```\n\nChange space item icon size when ```showIconOnly();``` mode activated\n```java\nspaceNavigationView.setSpaceItemIconSizeInOnlyIconMode((int) getResources().getDimension(R.dimen.yourDimen));\n```\n\nChange space item text size\n```java\nspaceNavigationView.setSpaceItemTextSize((int) getResources().getDimension(R.dimen.yourDimen));\n```\n\nHide items text and show only icons\n```java\nspaceNavigationView.showIconOnly();\n```\n![](screens/screen2.png)\n\nHide items icon and show only texts\n```java\nspaceNavigationView.showTextOnly();\n```\n![](screens/screen5.png)\n\nYou can change selected item programmatically\n```java\nspaceNavigationView.changeCurrentItem(int tabIndexToSelect);\n```\n\nShow badge\n```java\nspaceNavigationView.showBadgeAtIndex(int itemIndexToShowBadge, int badgeCountText, int badgeBackgroundColor);\n```\n![](screens/gif1.gif)\n\nHide badge at index\n```java\nspaceNavigationView.hideBadgeAtIndex(int itemIndexToHideBadge);\n```\n![](screens/gif2.gif)\n\nHide all badges\n```java\nspaceNavigationView.hideAllBadges();\n```\n\nChange badge text\n```java\nspaceNavigationView.changeBadgeTextAtIndex(int itemIndexToChangeBadge, int badgeCountText);\n```\n\nSet your custom font\n```java\nspaceNavigationView.setFont(Typeface.createFromAsset(getAssets(), \"your_cutom_font.ttf\"));\n```\n\nSet centre button pressed state color\n```java\nspaceNavigationView.setCentreButtonRippleColor(ContextCompat.getColor(this, R.color.yourColor));\n```\n\nNow you can change centre button icon if space navigation view already set up\n```java\nspaceNavigationView.changeCenterButtonIcon(R.drawable.yourDrawable);\n```\n\nAlso you can change item text and icon  if space navigation view already set up\n```java\nspaceNavigationView.changeItemTextAtPosition(0, \"NEW TEXT\");\nspaceNavigationView.changeItemIconAtPosition(1, R.drawable.yourDrawable);\n```\n\nNow you can change space navigation view background color if it already set up\n```java\n spaceNavigationView.changeSpaceBackgroundColor(ContextCompat.getColor(context,R.color.yourColor));\n```\n![](screens/gif3.gif)\n\nIf you want to show full badge text or show 9+\n```java\nspaceNavigationView.shouldShowFullBadgeText(true);\n```\n\nSet centre button icon color\n```java\nspaceNavigationView.setCentreButtonIconColor(ContextCompat.getColor(context,R.color.yourColor));\n```\nIf you want to disable default white color filter, just call\n```java\nspaceNavigationView.setCentreButtonIconColorFilterEnabled(false);\n```\n\nAdd recycler view scroll behavior\n```groovy\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003candroid.support.design.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/main_content\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\"com.luseen.spacenavigationview.MainActivity\"\u003e\n\n    \u003candroid.support.v7.widget.RecyclerView\n        android:id=\"@+id/recyclerView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" /\u003e\n\n    \u003ccom.luseen.spacenavigation.SpaceNavigationView\n        android:id=\"@+id/space\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"bottom\"\n        app:layout_behavior=\"com.luseen.spacenavigation.SpaceNavigationViewBehavior\" /\u003e\n\u003c/android.support.design.widget.CoordinatorLayout\u003e\n```\n\n[10]: https://github.com/armcha/Space-Navigation-View/issues/16\n[11]: https://github.com/armcha/Space-Navigation-View/issues/18\n[12]: https://github.com/armcha/Space-Navigation-View/issues/17\n[13]: https://github.com/armcha/Space-Navigation-View/issues/25\n[14]: https://github.com/armcha/Space-Navigation-View/issues/29\n[16]: https://github.com/armcha/Space-Navigation-View/issues/34\n[17]: https://github.com/armcha/Space-Navigation-View/issues/32\n[20]: https://github.com/armcha/Space-Navigation-View/issues/41\n[15]: https://github.com/ankitpopli1891\n[18]: https://github.com/akiraspeirs\n[19]: https://github.com/nextdimension\n\n##Versions\n\n##1.6.0\n* Added saving translation height on rotation. Thanks to [akiraspeirs][18]\n* Fixed requestLayout being improperly called. Thanks to [akiraspeirs][18]\n* Fixed inActiveCentreButtonIconColor not being used initially. Thanks to [nextdimension][19]\n* Fixed issue [#41][20]\n\n## 1.5.0\n* Added SpaceNavigationViewBehavior\n* Fixed issue [#32][17]\n\n## 1.4.2\n* Fixed issue [#34][16]\n\n## 1.4.1\n* Changing center icon from layout\n* Fixed issue [#29][14] Thanks to [ankitpopli1891][15]\n\n## 1.4.0\n* Added method do disable centre button default color filter\n* Fixed issue [#25][13]\n\n## 1.3.2\n* Added method setCentreButtonIconColor [#17][12]\n\n## 1.3.1\n* Added method shouldShowFullBadgeText\n* Fixed issue [#16][10] , [#18][11]\n\n## 1.3.0\n* Added SpaceOnLongClickListener\n* Added changeSpaceBackgroundColor method\n* Fixed rendering problem when view is in edit mode\n\n## 1.2.0\n* Fixed centre button issue\n* Added API 14+ support\n\n## 1.1.0 \n* Added ```changeItemTextAtPosition, changeItemIconAtPosition, changeCenterButtonIcon,setCentreButtonRippleColor``` methods\n* Now you can set onItemReselect listener\n\n## 1.0.0\n* Initial release\n\n## Apps using the Space Navigation View\n* [Book Share - Share Ebooks and files](https://play.google.com/store/apps/details?id=com.rvnd.bookshare)\n* [WiFi FTP Server +File Transfer](https://play.google.com/store/apps/details?id=com.transfer.file)\n\nKindly please let me know if you used or planning to use the library in your projects\n\n##Project development\nSome crazy [pics][8]\n[8]: https://github.com/armcha/Space-Navigation-View/tree/master/development\n\n## Contact \n\nPull requests are more than welcome.\nPlease fell free to contact me if there is any problem when using the library.\n\n- **Email**: armcha01@gmail.com\n- **Facebook**: https://web.facebook.com/chatikyana\n- **Twitter**: https://twitter.com/ArmanChatikyan\n- **Google +**: https://plus.google.com/112011638040018774140\n- **Website**: https://armcha.github.io/\n\nLicense\n--------\n\n\n      Space Navigation library for Android\n      Copyright (c) 2016 Arman Chatikyan (https://github.com/armcha/Space-Navigation-View).\n      \n      Licensed under the Apache License, Version 2.0 (the \"License\");\n      you may not use this file except in compliance with the License.\n      You may obtain a copy of the License at\n\n         http://www.apache.org/licenses/LICENSE-2.0\n\n      Unless required by applicable law or agreed to in writing, software\n      distributed under the License is distributed on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n      See the License for the specific language governing permissions and\n      limitations under the License.\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmcha%2Fspace-navigation-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmcha%2Fspace-navigation-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmcha%2Fspace-navigation-view/lists"}