{"id":19317904,"url":"https://github.com/queeniecplusplus/android_review_2_app","last_synced_at":"2026-04-21T16:33:00.109Z","repository":{"id":104588054,"uuid":"336950440","full_name":"QueenieCplusplus/Android_Review_2_app","owner":"QueenieCplusplus","description":"Bottom Navigation Bar","archived":false,"fork":false,"pushed_at":"2021-02-08T04:25:13.000Z","size":1859,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T19:05:54.210Z","etag":null,"topics":["android","bottomnavigationview","kotlin"],"latest_commit_sha":null,"homepage":"https://github.com/QueenieCplusplus/QuickGoThru/blob/master/README.md#google-android-kotlin-溫故安卓---計畫復甦","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/QueenieCplusplus.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":"2021-02-08T03:36:11.000Z","updated_at":"2021-02-08T04:25:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6fd39e6-625d-4a6e-873a-30e0ecf62ce3","html_url":"https://github.com/QueenieCplusplus/Android_Review_2_app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/QueenieCplusplus/Android_Review_2_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FAndroid_Review_2_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FAndroid_Review_2_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FAndroid_Review_2_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FAndroid_Review_2_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QueenieCplusplus","download_url":"https://codeload.github.com/QueenieCplusplus/Android_Review_2_app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FAndroid_Review_2_app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32100085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","bottomnavigationview","kotlin"],"created_at":"2024-11-10T01:16:36.304Z","updated_at":"2026-04-21T16:33:00.073Z","avatar_url":"https://github.com/QueenieCplusplus.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android_Review_2_app\nBottom Navigation Bar\n\n\n\n1. add dependency\n\n       // BottomNaviationUI\n       implementation 'com.google.android.material:material:1.1.0'\n       implementation 'androidx.legacy:legacy-support-v4:1.0.0'\n\n2. add menu item for click bars \u0026 drawable/vectorXML for buttom icon \u0026 Fragements to change view from Mainpage.\n\n\n\n    for Menu Items=\u003e\n\n\n              \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n              \u003cmenu xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n                  \u003citem\n                      android:id=\"@+id/home\"\n                      android:icon=\"@drawable/home\"\n                      android:title=\"Home\" /\u003e\n\n                  \u003citem\n                      android:id=\"@+id/clean\"\n                      android:icon=\"@drawable/clean\"\n                      android:title=\"Attentions\" /\u003e\n\n                  \u003citem\n                      android:id=\"@+id/chat\"\n                      android:icon=\"@drawable/coffee\"\n                      android:title=\"Info\" /\u003e\n\n                  \u003citem\n                      android:id=\"@+id/contact\"\n                      android:icon=\"@drawable/contact\"\n                      android:title=\"Remote Care\" /\u003e\n\n\n              \u003c/menu\u003e\n\n\n\n      for Fragments=\u003e\n      \n              wrapper in Framelayout, and inside view using RelativeLayout\n\n3. add frameLayout for different fragements to be inflatered \u0026 BottomNavigation Component for User to click inside Activity_Main.xml.\n\n    ![](https://raw.githubusercontent.com/QueenieCplusplus/Android_Review_2_app/main/Bar%20%26%20Nav.png)\n\n\n       \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n       \u003candroidx.constraintlayout.widget.ConstraintLayout 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:layout_width=\"match_parent\"\n           android:layout_height=\"match_parent\"\n           tools:context=\".MainActivity\"\u003e\n\n                  \u003cFrameLayout\n                      android:id=\"@+id/frame_wrapper\"\n                      android:layout_width=\"match_parent\"\n                      android:layout_height=\"match_parent\"\n                      android:background=\"@color/wood\"/\u003e\n\n                  \u003ccom.google.android.material.bottomnavigation.BottomNavigationView\n                      android:id=\"@+id/bottomNav\"\n                      android:layout_width=\"match_parent\"\n                      android:layout_height=\"wrap_content\"\n                      android:layout_marginTop=\"550dp\"\n                      android:background=\"?android:attr/windowBackground\"\n                      app:itemBackground=\"@color/apricot\"\n                      app:menu=\"@menu/nav_menu\" /\u003e\n                      \n                      \n       \u003c/androidx.constraintlayout.widget.ConstraintLayout\u003e\n\n\n\n\n4. init instance from fragment inside MainActivity class.\n\n\n              val a = AFragment()\n\n\n5. snippet hereby:\n\n\n              super.onCreate(savedInstanceState)\n                      setContentView(R.layout.activity_main)\n\n                      initFragment(h)\n\n                      bottomNav.setOnNavigationItemReselectedListener {\n\n                          when(it.itemId){\n\n                              // see item id in menu\n                              // not drawable id\n                              R.id.home -\u003e initFragment(h)\n                              R.id.clean -\u003e initFragment(a)\n                              R.id.chat -\u003e initFragment(i)\n                              R.id.contact -\u003e initFragment(c)\n\n                          }\n\n                      }\n\n                  }\n\n                  // 初始的碎片畫面\n                  private fun initFragment(fragment: Fragment){\n                      \n                      // to pass k/v pairs\n                      //supportFragmentManager.getFragment()\n\n                      supportFragmentManager.beginTransaction().apply {\n                          replace(R.id.frame_wrapper, fragment)\n                          commit()\n                      }\n\n                  }\n\n6. be careful that if you add modules for safe args, then downgrade the Gradle version.\n\n7. be attention to add on utf-8 encode tag on the top of your vectorized drawable, otherwise you got build error for String--toooooo-Loooooong ~\n\n   \n8. for Safe Args:\n\n   (1) at top level gradle\n   \n   \n               buildscript {\n\n                  dependencies {\n                      // 4.1.2 downgrade for safe-args to 3.6.4\n                      classpath \"com.android.tools.build:gradle:3.6.4\"\n                      classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n\n                      // for safe-args\n                      classpath 'com.google.gms:google-services:4.3.4'\n\n                      // safe-args =\u003e 2.3.3\n                      classpath \"androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version\"\n   \n   \n         \n   (2) at app level gradle\n   \n      \n               plugins {\n\n                      id 'androidx.navigation.safeargs.kotlin'\n                }\n\n         \n   \n![](https://raw.githubusercontent.com/QueenieCplusplus/Android_Review_2_app/main/output1.png)\n\n![](https://raw.githubusercontent.com/QueenieCplusplus/Android_Review_2_app/main/output2.png)\n\n![](https://raw.githubusercontent.com/QueenieCplusplus/Android_Review_2_app/main/output3.png)\n\nref: https://www.youtube.com/watch?v=fODp1hZxfng\n\n          \u0026\n\n   Material Design IO\n   https://material.io/components/bottom-navigation/android#bottom-navigation-bar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueeniecplusplus%2Fandroid_review_2_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqueeniecplusplus%2Fandroid_review_2_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueeniecplusplus%2Fandroid_review_2_app/lists"}