{"id":23898091,"url":"https://github.com/byteszero/actionbardemo","last_synced_at":"2026-06-19T17:32:42.275Z","repository":{"id":31273579,"uuid":"34835433","full_name":"BytesZero/ActionBarDemo","owner":"BytesZero","description":"actionBar的示例","archived":false,"fork":false,"pushed_at":"2015-05-03T04:34:54.000Z","size":268,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-13T17:30:05.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/BytesZero.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}},"created_at":"2015-04-30T05:10:08.000Z","updated_at":"2025-02-24T03:00:28.000Z","dependencies_parsed_at":"2022-09-09T07:40:15.460Z","dependency_job_id":null,"html_url":"https://github.com/BytesZero/ActionBarDemo","commit_stats":null,"previous_names":["byteszero/actionbardemo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BytesZero/ActionBarDemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FActionBarDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FActionBarDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FActionBarDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FActionBarDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BytesZero","download_url":"https://codeload.github.com/BytesZero/ActionBarDemo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FActionBarDemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34541894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"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":[],"created_at":"2025-01-04T17:19:58.933Z","updated_at":"2026-06-19T17:32:42.254Z","avatar_url":"https://github.com/BytesZero.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActionBarDemo\nactionBar的教程\n---\n1.获得ActionBar | [link](https://github.com/yy1300326388/ActionBarDemo/commit/e1c8ded7846d974c0ef1717d2fcd9eab9a8e3a24)\n```java\n//  获得ActionBar\nActionBar actionBar = getSupportActionBar();\n```\n2.显示／隐藏ActionBar | [link](https://github.com/yy1300326388/ActionBarDemo/commit/925949f4c5a2397448e859653292bf8e1e7a63a3)\n```java\n//显示ActionBar\nactionBar.show();\n//隐藏ActionBar\nactionBar.hide();\n```\n3.设置ActionBar 的背景颜色| [link](https://github.com/yy1300326388/ActionBarDemo/commit/79d4926d0292228708903676697e2a3306818ffe)\n![](https://github.com/yy1300326388/ActionBarDemo/blob/71bef6292a6cbfd51a7be9ca1b76de12221256ba/images_demo/set_bg.png)\n```java\nDrawable drawable=getResources().getDrawable(R.drawable.actionbar_bg);\n//设置ActionBar的背景\nactionBar.setBackgroundDrawable(drawable);\n```\n4.设置ActionBar 的Back| [link](https://github.com/yy1300326388/ActionBarDemo/commit/71bef6292a6cbfd51a7be9ca1b76de12221256ba)\n![](https://github.com/yy1300326388/ActionBarDemo/blob/71bef6292a6cbfd51a7be9ca1b76de12221256ba/images_demo/show_back.png)\n```java\n//设置返回键\nactionBar.setDisplayHomeAsUpEnabled(true);\n```\n5.设置ActionBar Back的返回事件| [link](https://github.com/yy1300326388/ActionBarDemo/commit/6c7d264f94553f8fbfd25ffc0c75cf5affaf279c)\n```java\n@Override\npublic boolean onOptionsItemSelected(MenuItem item) {\n   switch (item.getItemId()){\n       case android.R.id.home:{\n            onBackPressed();\n            break;\n       }\n   }\n   return true;\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Factionbardemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteszero%2Factionbardemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Factionbardemo/lists"}