{"id":18425672,"url":"https://github.com/zhanghai/customtabshelper","last_synced_at":"2025-04-07T12:09:19.342Z","repository":{"id":57736798,"uuid":"47093978","full_name":"zhanghai/CustomTabsHelper","owner":"zhanghai","description":"Custom tabs, made easy.","archived":false,"fork":false,"pushed_at":"2019-05-16T04:29:58.000Z","size":837,"stargazers_count":385,"open_issues_count":1,"forks_count":47,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-31T11:02:48.131Z","etag":null,"topics":["android","android-library","customtabs"],"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/zhanghai.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":"2015-11-30T03:49:31.000Z","updated_at":"2024-12-21T16:43:51.000Z","dependencies_parsed_at":"2022-08-24T14:57:21.656Z","dependency_job_id":null,"html_url":"https://github.com/zhanghai/CustomTabsHelper","commit_stats":null,"previous_names":["dreamingincodezh/customtabshelper"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FCustomTabsHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FCustomTabsHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FCustomTabsHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FCustomTabsHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhanghai","download_url":"https://codeload.github.com/zhanghai/CustomTabsHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"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":["android","android-library","customtabs"],"created_at":"2024-11-06T05:04:52.062Z","updated_at":"2025-04-07T12:09:19.316Z","avatar_url":"https://github.com/zhanghai.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CustomTabsHelper\n\nCustom tabs, made easy.\n\n## Why custom tabs?\n\n\u003e Chrome Custom Tabs provides a way for an application to customize and interact with a Chrome Activity on Android. This makes the web content feel like being a part of the application, while retaining the full functionality and performance of a complete web browser.\n\u003e\n\u003e ——[GoogleChrome/custom-tabs-client](https://github.com/GoogleChrome/custom-tabs-client)\n\n![Chrome custom tabs with pre-loading vs. Chrome and WebView](image/custom-tabs-vs-chrome-vs-webview.gif)\n\n[Chrome custom tabs smooth the transition between apps and the web - Android Developers Blog](http://android-developers.blogspot.com/2015/09/chrome-custom-tabs-smooth-transition.html)\n\n[Google documentation on using custom tabs](https://github.com/GoogleChrome/custom-tabs-client/blob/master/Using.md)\n\n## Why this library?\n\nApart from the [custom tabs support library](http://developer.android.com/tools/support-library/features.html#custom-tabs), Google has also published a detailed sample ([GoogleChrome/custom-tabs-client](https://github.com/GoogleChrome/custom-tabs-client)) for reference.\n\nThe Google sample included a [CustomTabActivityHelper](https://github.com/GoogleChrome/custom-tabs-client/blob/master/demos/src/main/java/org/chromium/customtabsdemos/CustomTabActivityHelper.java) and some other utilities, which can be of great convenience for developers. However, manually integrating them is still tedious.\n\nThis library packaged those utility classes and service declaration for easy integration. Furthermore, a `CustomTabsHelperFragment` is added for managing the `CustomTabActivityHelper` with your activity life cycle automatically. Now you can enjoy the warm up boost within lines of code.\n\n[Sample APK](//github.com/zhanghai/CustomTabsHelper/releases/download/v1.0.6/sample-release.apk)\n\n## Integration\n\nGradle:\n\n```gradle\ncompile 'me.zhanghai.android.customtabshelper:library:1.0.6'\n```\n\n## Usage\n\nTo attach a [CustomTabsHelperFragment](library/src/main/java/me/zhanghai/android/customtabshelper/CustomTabsHelperFragment.java) to an activity:\n\n```java\nprivate CustomTabsHelperFragment mCustomTabsHelperFragment;\n...\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n    ...\n    mCustomTabsHelperFragment = CustomTabsHelperFragment.attachTo(this);\n    ...\n}\n```\n\nCalling `attachTo()` for a fragment also works fine because the `CustomTabsHelperFragment` is always attached to the host activity. So in this way, you can call `attachTo()` whenever your fragment or activity itself needs to use custom tabs, thus managing custom tabs usage independently.\n\nTo hint for a likely URL:\n\n```java\nmCustomTabsHelperFragment.mayLaunchUrl(YOUR_URI, null, null);\n```\n\nBut it is likely that you need to wrap this call in a `CustomTabsActivityHelper.ConnectionCallback` just as [in the sample app](sample/src/main/java/me/zhanghai/android/customtabshelper/sample/MainActivity.java).\n\nTo open a URL with custom tabs:\n\n```java\nCustomTabsHelperFragment.open(this, mCustomTabsIntent, YOUR_URI, yourFallback);\n```\n\nA more detailed sample is available in the sample app's [MainActivity](sample/src/main/java/me/zhanghai/android/customtabshelper/sample/MainActivity.java).\n\n## License\n\n    Copyright 2015 Zhang Hai\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghai%2Fcustomtabshelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhanghai%2Fcustomtabshelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghai%2Fcustomtabshelper/lists"}