Giter Site home page Giter Site logo

novoda / simple-chrome-custom-tabs Goto Github PK

View Code? Open in Web Editor NEW
129.0 32.0 18.0 9.14 MB

Easy integration of Chrome Custom Tabs into your project. Just connect it to your activity, and navigate to the external website styling your tab as you wish.

License: Other

XSLT 7.49% Java 92.51%
android chrome-tabs chrome novoda open-source

simple-chrome-custom-tabs's Introduction

๐Ÿ›‘ THIS REPOSITORY IS OFFICIALLY NO LONGER UNDER MAINTENANCE since 10/02/2022 ๐Ÿ›‘

simple-chrome-custom-tabs Download

  • Navigating to external websites from your app?
  • "Yes, that one is easy"
  • Wondering how to keep the user in context?
  • "I know... it can be done using WebView, but I don't like it that much"
  • Aha! Why don't you try Chrome Custom Tabs?
  • "Integrating it into my app can be a pain..."
  • Not anymore!

simple-chrome-custom-tabs will help you with that.

Description

simple-chrome-custom-tabs provides easy integration of Chrome Custom Tabs into your project. Just connect it to your activity, and navigate to the external website styling your tab as you wish. Moreover with Custom Tabs the navigation can be nearly instantaneous!

More information about Chrome Custom Tabs available at: https://developer.chrome.com/multidevice/android/customtabs

Adding to your project

To start using this library, add these lines to the build.gradle of your project:

repositories {
    maven {
        url  "http://dl.bintray.com/novoda/maven" 
    }
}

dependencies {
    compile 'com.novoda:simple-chrome-custom-tabs:0.1.6'
}

Simple usage

  1. Initialize simple-chrome-custom-tabs, you only have to this once.
SimpleChromeCustomTabs.initialize(context);
  1. Connect simple-chrome-custom-tabs to your Activity as soon as it is resumed.
@Override
public void onResume() {
    super.onResume();
    SimpleChromeCustomTabs.getInstance().connectTo(this);
}

And don't forget to disconnect when the Activity is paused.

@Override
public void onPause() {
    SimpleChromeCustomTabs.getInstance().disconnectFrom(this);
    super.onPause();
}
  1. Navigate!
Uri url = ANY_WEBSITE_URL;
NavigationFallback fallback = ANY_FALLBACK_MECHANISM; //In case something goes wrong.
IntentCustomizer customizer = ANY_INTENT_CUSTOMIZER; //To theme your tab.

SimpleChromeCustomTabs.getInstance().withFallback(fallback)
    .withIntentCustomizer(customizer)
    .navigateTo(url, activity);

And voilร !!

External Browser simple-chrome-custom-tabs
external_browser simplechromecustomtabs

Note: Check the extended demo for further usage examples.

Links

Here are a list of useful links:

  • We always welcome people to contribute new features or bug fixes, here is how
  • If you have a problem or you feel that important functionality is missing check the Issues Page first to see if we are working on it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.