This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
... | |
compile 'com.android.support:customtabs:23.1.0' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FragmentChromeCustomTabs | |
extends Fragment | |
implements CustomTabsSceneHelper.ConnectionCallback { | |
public static enum CustomTabsAction { | |
GOOGLE_PLUS ("Open Google+", "https://plus.google.com/+ЕгорМалышев"), | |
MEDIUM ("Open Medium", "https://medium.com/@brainail"), | |
ABOUT_ME ("Open About.Me", "https://about.me/brainail"); | |
private final String mActionDescription; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomTabsSceneHelper { | |
/** | |
* A Callback for when the service is connected or disconnected. Use those callbacks to | |
* handle UI changes when the service is connected or disconnected | |
*/ | |
public static interface ConnectionCallback { | |
public void onCustomTabsConnected (); | |
public void onCustomTabsDisconnected (); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class CustomTabsHelper { | |
public static abstract class ChromePackages { | |
public static final String STABLE_PACKAGE = "com.android.chrome"; | |
public static final String BETA_PACKAGE = "com.chrome.beta"; | |
public static final String DEV_PACKAGE = "com.chrome.dev"; | |
public static final String LOCAL_PACKAGE = "com.google.android.apps.chrome"; | |
} | |
public static String sPackageNameToUse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class CustomTabsKeepAliveService extends Service { | |
private static final Binder sBinder = new Binder (); | |
@Override public IBinder onBind (Intent intent) { | |
return sBinder; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"cmd": ["/usr/local/Cellar/gcc49/4.9.3/bin/g++-4.9", "-std=c++11", "${file}", "-o", "${file_path}/${file_base_name}"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c, source.c++", | |
"variants": | |
[ | |
{ | |
"name": "Run", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Base auth task | |
public abstract class AbstractAuthTask extends AsyncTask<Void, Void, Void> { | |
protected final AuthorizationFlow mAuthFlow; | |
AbstractAuthTask(final AuthorizationFlow authFlow) { | |
mAuthFlow = authFlow; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
// Libs folder | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
// ... | |
// Google auth, drive, etc | |
compile 'com.google.code.gson:gson:2.3' | |
compile 'com.google.api-client:google-api-client:1.19.0' | |
compile 'com.google.api-client:google-api-client-android:1.19.0' |