{"id":21130209,"url":"https://github.com/Takhion/android-extendedactionbar","last_synced_at":"2025-07-09T01:32:41.906Z","repository":{"id":13699834,"uuid":"16393704","full_name":"Takhion/android-extendedactionbar","owner":"Takhion","description":"An example of how to extend the ActionBar under the status bar from the theme","archived":false,"fork":false,"pushed_at":"2014-02-02T21:53:29.000Z","size":331,"stargazers_count":158,"open_issues_count":1,"forks_count":26,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-20T05:32:33.383Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Takhion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-30T22:57:22.000Z","updated_at":"2024-08-13T18:14:16.000Z","dependencies_parsed_at":"2022-09-10T12:11:09.124Z","dependency_job_id":null,"html_url":"https://github.com/Takhion/android-extendedactionbar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Takhion/android-extendedactionbar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takhion%2Fandroid-extendedactionbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takhion%2Fandroid-extendedactionbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takhion%2Fandroid-extendedactionbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takhion%2Fandroid-extendedactionbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Takhion","download_url":"https://codeload.github.com/Takhion/android-extendedactionbar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takhion%2Fandroid-extendedactionbar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264375431,"owners_count":23598374,"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-20T05:32:25.114Z","updated_at":"2025-07-09T01:32:41.590Z","avatar_url":"https://github.com/Takhion.png","language":"Java","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"Extended ActionBar\n===\n\nThe problem:\n---\nAndroid 4.4 Kitkat introduced a wonderful new opportunity: __translucent bars__.\n\nIt's as simple as adding the following to your theme:\n```xml\n\u003citem name=\"android:windowTranslucentStatus\"\u003etrue\u003c/item\u003e\n\u003citem name=\"android:windowTranslucentNavigation\"\u003etrue\u003c/item\u003e\n```\nAwesome, right? Well, almost.\u003cbr\u003e\nThe thing is, if you happen to have an ActionBar (like 99.9% of apps out there) than it won't automatically extend behind the status bar: the status bar will be translucent and the window background will be showed...\u003cbr\u003e\nA picture is worth a thousand words:\n\n![Image](../master/imgs/problem.png?raw=true)\n\nThere are many ways to fix this programmatically or with some wise layouts, but when the application is launched or recreated only the theme will be used (before loading ANY code or layout) and the problem will still be annoyingly present.\n\nThe solution:\n---\nIn this repository I show how to achieve an illusion of \"ActionBar extension\" (look at the code to see what it means).\nIt is unfortunately more of a hack than a proper solution, but that is due to the fact that the required components (namely \u003ccode\u003e@android:dimen/status_bar_height\u003c/code\u003e and the ability to create custom drawables, as the ones provided are barely usable and highly bugged) have been banned by the Gods.\n\n_Please use it with careful consideration and don't blame me if your device explodes or you cat conquers the world!_\n\n![Image](../master/imgs/solution.png?raw=true)\n\nThe extra mile:\n---\nWhile I was there I took the opportunity to create a simple \u003ccode\u003eActivity\u003c/code\u003e that removes the hacky window background and does things properly in order to eliminate any overdraw.\u003cbr\u003e\nIt's supposed to be a starting point, though I hope to make it into a real library someday.\n\nBefore:\n\n![Image](../master/imgs/overdraw_before.png?raw=true)\n\nAfter:\n\n![Image](../master/imgs/overdraw_after.png?raw=true)\n\nNotes:\n---\nI will start using a variation of this code in my apps along with a \"secret agent\" that will notify me if it ever encounters a device with a status bar bigger than 25dp (if it's smaller or not at the top, it won't be a problem as it will get drawn behind the ActionBar).\u003cbr\u003e\nIf such a thing happens, I will update this accordingly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTakhion%2Fandroid-extendedactionbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTakhion%2Fandroid-extendedactionbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTakhion%2Fandroid-extendedactionbar/lists"}