Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/redth/xamarin.chromecustomtabs
How to use Chrome Custom Tabs in your Xamarin.Android apps!
https://github.com/redth/xamarin.chromecustomtabs
Last synced: 23 days ago
JSON representation
How to use Chrome Custom Tabs in your Xamarin.Android apps!
- Host: GitHub
- URL: https://github.com/redth/xamarin.chromecustomtabs
- Owner: Redth
- License: apache-2.0
- Created: 2015-05-29T06:00:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-04T19:50:57.000Z (over 8 years ago)
- Last Synced: 2024-10-13T15:08:10.436Z (25 days ago)
- Language: C#
- Size: 235 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## NOTE: This code is now deprecated since Android Support Library now includes Custom Tabs. You can find the Xamarin bindings and samples in the component: https://components.xamarin.com/view/xamandroidsupportcustomtabs
----
# Xamarin.ChromeCustomTabs
Google just announced the ability to use the Chrome browser's tabs within your own app at Google I/O 2015.
This is currently only available in Chrome for Android version 44 and higher, which as of the time of this document is available as the *Chrome Dev* app on the Play Store.
![Chrome Custom Tabs in Xamarin.Android](ChromeCustomTabs.png)
## Setup
Once you've installed the [*Chrome Dev*](https://play.google.com/store/apps/details?id=com.chrome.dev) app, you need to navigate to [chrome://flags](chrome://flags) and enable **Enable Hosted Mode**, and restart your browser.## Loading a Page
You can load pages without any customization very easily:```csharp
var hostedManager = new HostedActivityManager (this);
var uiBuilder = new HostedUIBuilder ();hostedManager.LoadUrl ("http://google.com", uiBuilder);
```## Customization
You can also customize the look and feel of the browser tab. You can change the background colour of the toolbar, customize start and exit animations, add items to the overflow menu, and even add icons to the action bar!```csharp
// Xamarin Blue
uiBuilder.SetToolbarColor (Color.Argb (255, 52, 152, 219));// Customize animations
uiBuilder.SetStartAnimations (this, Resource.Animation.slide_in_right, Resource.Animation.slide_out_left);
uiBuilder.SetExitAnimations (this, Resource.Animation.slide_in_left, Resource.Animation.slide_out_right);
```
See the sample for more information about adding menu and action bar items.## NuGet
There is a package available on NuGet: http://www.nuget.org/packages/Xamarin.Android.ChromeCustomTabs
There will be a component in the Xamarin Component Store soon with Samples and documentation!