Giter Club home page Giter Club logo

tabby's Introduction

#Tabby Android Weekly Medium

Web Launcher

Tabby (Cat), is a simple sample application demoing the features of the new Chrome Custom Tabs support library for Android. Using this application you can demo:
  • Coloring the toolbar
  • Displaying the title
  • Customising the close icon
  • Adding an action bar icon
  • Adding menu items
  • Using custom animations

The application uses Helper Classes from the example project by Google.

Web Launcher

Requirements

  • Android SDK.
  • Android 5.1 (API 22) .
  • Android SDK Tools
  • Android SDK Build tools 23.0.0.0
  • Android Support Repository
  • Android Support library

Building

To build and install a debug version, run this from the root of the project:

./gradlew installDebug

Attributions

Thanks to the following for use of images off of Noun Project:

Theresa Berens - Cat Icon

tabby's People

Contributors

hitherejoe avatar jawnnypoo avatar niedzielski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tabby's Issues

WebViewActivity, if not callable?

Suggestion:
In the Fallback class do a check if the WebViewActivity is callable else open the url (Uri) with a standard action view intent:

        Intent i = new Intent(Intent.ACTION_VIEW);
        i.setData(uri);
        activity.startActivity(i);

mayLaunchUrl optimization never performed

In MainActivity, CustomTabActivityHelper.mayLaunchUrl can't be called during onCreate: neither the client or session are created because their creation happens after onCustomTabsServiceConnected callback, which is called in onStart.

The CustomTabsSession.mayLaunchUrl optimization needs to be called after the service connected callback (where warmup occurs).

I address this in my fix for CustomTabActivityHelper which changes mayLaunchUrl to set the Uri and Bundles as field variables and session.mayLaunchUrl is called after receiving the service connected callback. This allows you to keep MainActivity the way it is and let you set the preferred URL without waiting for the service callback within the Activity.

NullPointerException in opening custom tab

When I click launch custom tab, APP would crash certainly. It happens in HTC butterfly, but it work fine in Nexus 5. The log is below:

09-09 16:15:38.700 E/AndroidRuntime(14071): FATAL EXCEPTION: main
09-09 16:15:38.700 E/AndroidRuntime(14071): Process: com.hitherejoe.tabby, PID: 14071
09-09 16:15:38.700 E/AndroidRuntime(14071): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hitherejoe.tabby/com.hitherejoe.tabby.ui.activity.WebViewActivity}: java.lang.NullPointerException
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2653)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.app.ActivityThread.access$800(ActivityThread.java:156)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.os.Handler.dispatchMessage(Handler.java:102)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.os.Looper.loop(Looper.java:157)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.app.ActivityThread.main(ActivityThread.java:5872)
09-09 16:15:38.700 E/AndroidRuntime(14071): at java.lang.reflect.Method.invokeNative(Native Method)
09-09 16:15:38.700 E/AndroidRuntime(14071): at java.lang.reflect.Method.invoke(Method.java:515)
09-09 16:15:38.700 E/AndroidRuntime(14071): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1069)
09-09 16:15:38.700 E/AndroidRuntime(14071): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:885)
09-09 16:15:38.700 E/AndroidRuntime(14071): at dalvik.system.NativeStart.main(Native Method)
09-09 16:15:38.700 E/AndroidRuntime(14071): Caused by: java.lang.NullPointerException
09-09 16:15:38.700 E/AndroidRuntime(14071): at com.hitherejoe.tabby.ui.activity.WebViewActivity.onCreate(WebViewActivity.java:26)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.app.Activity.performCreate(Activity.java:5312)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)
09-09 16:15:38.700 E/AndroidRuntime(14071): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2552)
09-09 16:15:38.700 E/AndroidRuntime(14071): ... 11 more

can not run the demo

hi,i download your demo,but when i run , DaggerApplicationComponent do not exist

PendingIntent not overridden

https://github.com/hitherejoe/Tabby/blob/master/app/src/main/java/com/hitherejoe/tabby/ui/activity/MainActivity.java#L184

and

https://github.com/hitherejoe/Tabby/blob/master/app/src/main/java/com/hitherejoe/tabby/ui/activity/MainActivity.java#L177

You should use the PendingIntent.FLAG_UPDATE_CURRENT flag.
It's not really useful in your case as you always open the same Url. But if someone is using this code for multiple websites, the PendingIntentwon't be overridden and the share / email will be performed on the first opened website.

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.