├── AarDemo ├── .gitignore ├── .idea │ ├── caches │ │ └── build_file_checksums.ser │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ └── runConfigurations.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── org │ │ │ └── techbooster │ │ │ └── sample │ │ │ └── aardemo │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── techbooster │ │ │ │ └── sample │ │ │ │ └── aardemo │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ └── content_main.xml │ │ │ ├── menu │ │ │ └── menu_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── org │ │ └── techbooster │ │ └── sample │ │ └── aardemo │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library-core │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── org │ │ │ └── techbooster │ │ │ └── sample │ │ │ └── library_core │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── techbooster │ │ │ │ └── sample │ │ │ │ └── library_core │ │ │ │ └── LibraryCoreActivity.kt │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ └── library.png │ │ │ ├── drawable-mdpi │ │ │ └── library.png │ │ │ ├── drawable-xhdpi │ │ │ └── library.png │ │ │ ├── drawable-xxhdpi │ │ │ └── library.png │ │ │ ├── drawable-xxxhdpi │ │ │ └── library.png │ │ │ ├── layout │ │ │ ├── activity_librarycore.xml │ │ │ └── lib_content_main.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── org │ │ └── techbooster │ │ └── sample │ │ └── library_core │ │ └── ExampleUnitTest.java └── settings.gradle ├── CustomTabs ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── CustomTabs.iml ├── CustomTabs.png ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── org │ │ │ └── techbooster │ │ │ └── sample │ │ │ └── customtabs │ │ │ └── ApplicationTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── techbooster │ │ │ │ └── sample │ │ │ │ └── customtabs │ │ │ │ └── MainActivity.java │ │ └── res │ │ │ ├── anim │ │ │ ├── slide_in_left.xml │ │ │ ├── slide_in_right.xml │ │ │ ├── slide_out_left.xml │ │ │ └── slide_out_right.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── menu │ │ │ └── menu_main.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ │ └── values │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── org │ │ └── techbooster │ │ └── sample │ │ └── customtabs │ │ └── ExampleUnitTest.java ├── build.gradle ├── customtabs │ ├── AndroidManifest.xml │ ├── api │ │ ├── current.txt │ │ └── removed.txt │ ├── build.gradle │ ├── customtabs.iml │ ├── src │ │ └── android │ │ │ └── support │ │ │ └── customtabs │ │ │ ├── CustomTabsCallback.java │ │ │ ├── CustomTabsClient.java │ │ │ ├── CustomTabsIntent.java │ │ │ ├── CustomTabsService.java │ │ │ ├── CustomTabsServiceConnection.java │ │ │ ├── CustomTabsSession.java │ │ │ ├── CustomTabsSessionToken.java │ │ │ ├── ICustomTabsCallback.aidl │ │ │ └── ICustomTabsService.aidl │ └── tests │ │ └── src │ │ └── android │ │ └── support │ │ └── customtabs │ │ └── CustomTabsIntentTest.java ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── shared │ ├── .gitignore │ ├── build.gradle │ ├── shared.iml │ └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── chromium │ └── customtabsclient │ └── shared │ ├── CustomTabsHelper.java │ └── KeepAliveService.java ├── CustomTabsBySupportLibrary ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── CustomTabsBySupportLibrary.iml ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── org │ │ │ └── techbooster │ │ │ └── sample │ │ │ └── customtabsbysupportlibrary │ │ │ └── ApplicationTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── techbooster │ │ │ │ └── sample │ │ │ │ └── customtabsbysupportlibrary │ │ │ │ └── MainActivity.java │ │ └── res │ │ │ ├── anim │ │ │ ├── slide_in_left.xml │ │ │ ├── slide_in_right.xml │ │ │ ├── slide_out_left.xml │ │ │ └── slide_out_right.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── menu │ │ │ └── menu_main.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ │ └── values │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── org │ │ └── techbooster │ │ └── sample │ │ └── customtabsbysupportlibrary │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── IntentActivity ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ └── runConfigurations.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── org │ │ │ └── techbooster │ │ │ └── sample │ │ │ └── intentactivity │ │ │ └── ApplicationTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── techbooster │ │ │ │ └── sample │ │ │ │ └── intentactivity │ │ │ │ ├── MainActivity.java │ │ │ │ └── SubActivity.java │ │ └── res │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── activity_sub.xml │ │ │ ├── content_main.xml │ │ │ └── content_sub.xml │ │ │ ├── menu │ │ │ └── menu_main.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-v21 │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── org │ │ └── techbooster │ │ └── sample │ │ └── intentactivity │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── LICENSE ├── README.md ├── ScreenCapture ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── scopes │ │ └── scope_settings.xml │ └── vcs.xml ├── ScreenCapture.iml ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── screencapture │ │ │ └── sample │ │ │ └── techbooster │ │ │ └── org │ │ │ └── screencapture │ │ │ └── ApplicationTest.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── screencapture │ │ │ └── sample │ │ │ └── techbooster │ │ │ └── org │ │ │ └── screencapture │ │ │ └── MainActivity.java │ │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── screencapture.png └── settings.gradle └── permissionbasic ├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── org │ │ └── techbooster │ │ └── sample │ │ └── permissionbasic │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── org │ │ │ └── techbooster │ │ │ └── sample │ │ │ └── permissionbasic │ │ │ └── MainActivity.java │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── org │ └── techbooster │ └── sample │ └── permissionbasic │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── permissionbasic.iml └── settings.gradle /AarDemo/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /AarDemo/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /AarDemo/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /AarDemo/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /AarDemo/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | -------------------------------------------------------------------------------- /AarDemo/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /AarDemo/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /AarDemo/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 27 6 | defaultConfig { 7 | applicationId "org.techbooster.sample.aardemo" 8 | minSdkVersion 21 9 | targetSdkVersion 27 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation project(':library-core') 24 | implementation fileTree(dir: 'libs', include: ['*.jar']) 25 | implementation 'com.android.support:appcompat-v7:27.1.0' 26 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 27 | implementation 'com.android.support:design:27.1.0' 28 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 31 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 32 | } 33 | repositories { 34 | mavenCentral() 35 | } 36 | -------------------------------------------------------------------------------- /AarDemo/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /AarDemo/app/src/androidTest/java/org/techbooster/sample/aardemo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package org.techbooster.sample.aardemo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("org.techbooster.sample.aardemo", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/java/org/techbooster/sample/aardemo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package org.techbooster.sample.aardemo 2 | 3 | import android.os.Bundle 4 | import android.support.design.widget.FloatingActionButton 5 | import android.support.v7.app.AppCompatActivity 6 | import android.support.v7.widget.Toolbar 7 | import android.view.View 8 | import android.view.Menu 9 | import android.view.MenuItem 10 | 11 | import org.techbooster.sample.library_core.LibraryCoreActivity 12 | 13 | class MainActivity : AppCompatActivity() { 14 | 15 | override fun onCreate(savedInstanceState: Bundle?) { 16 | super.onCreate(savedInstanceState) 17 | setContentView(R.layout.activity_main) 18 | val toolbar = findViewById(R.id.toolbar) as Toolbar 19 | setSupportActionBar(toolbar) 20 | 21 | val fab = findViewById(R.id.fab) as FloatingActionButton 22 | fab.setOnClickListener { startActivity(LibraryCoreActivity.createIntent(this@MainActivity)) } 23 | } 24 | 25 | override fun onCreateOptionsMenu(menu: Menu): Boolean { 26 | // Inflate the menu; this adds items to the action bar if it is present. 27 | menuInflater.inflate(R.menu.menu_main, menu) 28 | return true 29 | } 30 | 31 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 32 | // Handle action bar item clicks here. The action bar will 33 | // automatically handle clicks on the Home/Up button, so long 34 | // as you specify a parent activity in AndroidManifest.xml. 35 | val id = item.itemId 36 | 37 | 38 | return if (id == R.id.action_settings) { 39 | true 40 | } else super.onOptionsItemSelected(item) 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 32 | 33 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/AarDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AarDemo 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /AarDemo/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 10 | 11 | 15 | 16 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CustomTabs/app/src/test/java/org/techbooster/sample/customtabs/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package org.techbooster.sample.customtabs; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /CustomTabs/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/api/current.txt: -------------------------------------------------------------------------------- 1 | package android.support.customtabs { 2 | 3 | public class CustomTabsCallback { 4 | ctor public CustomTabsCallback(); 5 | method public void extraCallback(java.lang.String, android.os.Bundle); 6 | method public void onNavigationEvent(int, android.os.Bundle); 7 | field public static final int NAVIGATION_ABORTED = 4; // 0x4 8 | field public static final int NAVIGATION_FAILED = 3; // 0x3 9 | field public static final int NAVIGATION_FINISHED = 2; // 0x2 10 | field public static final int NAVIGATION_STARTED = 1; // 0x1 11 | } 12 | 13 | public class CustomTabsClient { 14 | method public static boolean bindCustomTabsService(android.content.Context, java.lang.String, android.support.customtabs.CustomTabsServiceConnection); 15 | method public android.os.Bundle extraCommand(java.lang.String, android.os.Bundle); 16 | method public android.support.customtabs.CustomTabsSession newSession(android.support.customtabs.CustomTabsCallback); 17 | method public boolean warmup(long); 18 | } 19 | 20 | public final class CustomTabsIntent { 21 | method public void launchUrl(android.app.Activity, android.net.Uri); 22 | field public static final java.lang.String EXTRA_ACTION_BUTTON_BUNDLE = "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE"; 23 | field public static final java.lang.String EXTRA_CLOSE_BUTTON_ICON = "android.support.customtabs.extra.CLOSE_BUTTON_ICON"; 24 | field public static final java.lang.String EXTRA_EXIT_ANIMATION_BUNDLE = "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE"; 25 | field public static final java.lang.String EXTRA_MENU_ITEMS = "android.support.customtabs.extra.MENU_ITEMS"; 26 | field public static final java.lang.String EXTRA_SESSION = "android.support.customtabs.extra.SESSION"; 27 | field public static final java.lang.String EXTRA_TITLE_VISIBILITY_STATE = "android.support.customtabs.extra.TITLE_VISIBILITY"; 28 | field public static final java.lang.String EXTRA_TOOLBAR_COLOR = "android.support.customtabs.extra.TOOLBAR_COLOR"; 29 | field public static final java.lang.String KEY_DESCRIPTION = "android.support.customtabs.customaction.DESCRIPTION"; 30 | field public static final java.lang.String KEY_ICON = "android.support.customtabs.customaction.ICON"; 31 | field public static final java.lang.String KEY_MENU_ITEM_TITLE = "android.support.customtabs.customaction.MENU_ITEM_TITLE"; 32 | field public static final java.lang.String KEY_PENDING_INTENT = "android.support.customtabs.customaction.PENDING_INTENT"; 33 | field public static final int NO_TITLE = 0; // 0x0 34 | field public static final int SHOW_PAGE_TITLE = 1; // 0x1 35 | field public final android.content.Intent intent; 36 | field public final android.os.Bundle startAnimationBundle; 37 | } 38 | 39 | public static final class CustomTabsIntent.Builder { 40 | ctor public CustomTabsIntent.Builder(); 41 | ctor public CustomTabsIntent.Builder(android.support.customtabs.CustomTabsSession); 42 | method public android.support.customtabs.CustomTabsIntent.Builder addMenuItem(java.lang.String, android.app.PendingIntent); 43 | method public android.support.customtabs.CustomTabsIntent build(); 44 | method public android.support.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, java.lang.String, android.app.PendingIntent); 45 | method public android.support.customtabs.CustomTabsIntent.Builder setCloseButtonIcon(android.graphics.Bitmap); 46 | method public android.support.customtabs.CustomTabsIntent.Builder setExitAnimations(android.content.Context, int, int); 47 | method public android.support.customtabs.CustomTabsIntent.Builder setShowTitle(boolean); 48 | method public android.support.customtabs.CustomTabsIntent.Builder setStartAnimations(android.content.Context, int, int); 49 | method public android.support.customtabs.CustomTabsIntent.Builder setToolbarColor(int); 50 | } 51 | 52 | public abstract class CustomTabsService extends android.app.Service { 53 | ctor public CustomTabsService(); 54 | method protected boolean cleanUpSession(android.support.customtabs.CustomTabsSessionToken); 55 | method protected abstract android.os.Bundle extraCommand(java.lang.String, android.os.Bundle); 56 | method protected abstract boolean mayLaunchUrl(android.support.customtabs.CustomTabsSessionToken, android.net.Uri, android.os.Bundle, java.util.List); 57 | method protected abstract boolean newSession(android.support.customtabs.CustomTabsSessionToken); 58 | method public android.os.IBinder onBind(android.content.Intent); 59 | method protected abstract boolean warmup(long); 60 | field public static final java.lang.String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService"; 61 | field public static final java.lang.String KEY_URL = "android.support.customtabs.otherurls.URL"; 62 | } 63 | 64 | public abstract class CustomTabsServiceConnection implements android.content.ServiceConnection { 65 | ctor public CustomTabsServiceConnection(); 66 | method public abstract void onCustomTabsServiceConnected(android.content.ComponentName, android.support.customtabs.CustomTabsClient); 67 | method public final void onServiceConnected(android.content.ComponentName, android.os.IBinder); 68 | } 69 | 70 | public final class CustomTabsSession { 71 | method public boolean mayLaunchUrl(android.net.Uri, android.os.Bundle, java.util.List); 72 | } 73 | 74 | public class CustomTabsSessionToken { 75 | method public android.support.customtabs.CustomTabsCallback getCallback(); 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/api/removed.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/CustomTabs/customtabs/api/removed.txt -------------------------------------------------------------------------------- /CustomTabs/customtabs/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android-library' 2 | 3 | dependencies { 4 | compile "com.android.support:support-annotations:22.2.0+" 5 | } 6 | 7 | android { 8 | compileSdkVersion 22 9 | buildToolsVersion "22.0.1" 10 | 11 | sourceSets { 12 | main.manifest.srcFile 'AndroidManifest.xml' 13 | main.java.srcDirs = ['src'] 14 | main.aidl.srcDirs = ['src'] 15 | main.res.srcDir 'res' 16 | main.assets.srcDir 'assets' 17 | main.resources.srcDir 'java' 18 | 19 | androidTest.setRoot('tests') 20 | androidTest.java.srcDir('tests/src/') 21 | } 22 | 23 | compileOptions { 24 | sourceCompatibility JavaVersion.VERSION_1_7 25 | targetCompatibility JavaVersion.VERSION_1_7 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/src/android/support/customtabs/CustomTabsCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package android.support.customtabs; 18 | 19 | import android.os.Bundle; 20 | 21 | /** 22 | * A callback class for custom tabs client to get messages regarding events in their custom tabs. 23 | */ 24 | public class CustomTabsCallback { 25 | /** 26 | * Sent when the tab has started loading a page. 27 | */ 28 | public static final int NAVIGATION_STARTED = 1; 29 | 30 | /** 31 | * Sent when the tab has finished loading a page. 32 | */ 33 | public static final int NAVIGATION_FINISHED = 2; 34 | 35 | /** 36 | * Sent when the tab couldn't finish loading due to a failure. 37 | */ 38 | public static final int NAVIGATION_FAILED = 3; 39 | 40 | /** 41 | * Sent when loading was aborted by a user action before it finishes like clicking on a link 42 | * or refreshing the page. 43 | */ 44 | public static final int NAVIGATION_ABORTED = 4; 45 | 46 | /** 47 | * Sent when the tab becomes visible. 48 | */ 49 | public static final int TAB_SHOWN = 5; 50 | 51 | /** 52 | * Sent when the tab becomes hidden. 53 | */ 54 | public static final int TAB_HIDDEN = 6; 55 | 56 | /** 57 | * To be called when a navigation event happens. 58 | * 59 | * @param navigationEvent The code corresponding to the navigation event. 60 | * @param extras Reserved for future use. 61 | */ 62 | public void onNavigationEvent(int navigationEvent, Bundle extras) {} 63 | 64 | /** 65 | * Unsupported callbacks that may be provided by the implementation. 66 | * 67 | *

68 | * Note:Clients should never rely on this callback to be 69 | * called and/or to have a defined behavior, as it is entirely implementation-defined and not 70 | * supported. 71 | * 72 | *

This can be used by implementations to add extra callbacks, for testing or experimental 73 | * purposes. 74 | * 75 | * @param callbackName Name of the extra callback. 76 | * @param args Arguments for the calback 77 | */ 78 | public void extraCallback(String callbackName, Bundle args) {} 79 | } 80 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/src/android/support/customtabs/CustomTabsClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package android.support.customtabs; 18 | 19 | import android.content.ComponentName; 20 | import android.content.Context; 21 | import android.content.Intent; 22 | import android.content.ServiceConnection; 23 | import android.net.Uri; 24 | import android.os.Bundle; 25 | import android.os.RemoteException; 26 | import android.text.TextUtils; 27 | 28 | import java.util.List; 29 | 30 | /** 31 | * Class to communicate with a {@link CustomTabsService} and create 32 | * {@link CustomTabsSession} from it. 33 | */ 34 | public class CustomTabsClient { 35 | private final ICustomTabsService mService; 36 | private final ComponentName mServiceComponentName; 37 | 38 | /**@hide*/ 39 | CustomTabsClient(ICustomTabsService service, ComponentName componentName) { 40 | mService = service; 41 | mServiceComponentName = componentName; 42 | } 43 | 44 | /** 45 | * Bind to a {@link CustomTabsService} using the given package name and 46 | * {@link ServiceConnection}. 47 | * @param context {@link Context} to use while calling 48 | * {@link Context#bindService(Intent, ServiceConnection, int)} 49 | * @param packageName Package name to set on the {@link Intent} for binding. 50 | * @param connection {@link CustomTabsServiceConnection} to use when binding. This will 51 | * return a {@link CustomTabsClient} on 52 | * {@link CustomTabsServiceConnection 53 | * #onCustomTabsServiceConnected(ComponentName, CustomTabsClient)} 54 | * @return Whether the binding was successful. 55 | */ 56 | public static boolean bindCustomTabsService(Context context, 57 | String packageName, CustomTabsServiceConnection connection) { 58 | Intent intent = new Intent(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION); 59 | if (!TextUtils.isEmpty(packageName)) intent.setPackage(packageName); 60 | return context.bindService(intent, connection, 61 | Context.BIND_AUTO_CREATE | Context.BIND_WAIVE_PRIORITY); 62 | } 63 | 64 | /** 65 | * Warm up the browser process. 66 | * @param flags Reserved for future use. 67 | * @return Whether the warmup was successful. 68 | */ 69 | public boolean warmup(long flags) { 70 | try { 71 | return mService.warmup(flags); 72 | } catch (RemoteException e) { 73 | return false; 74 | } 75 | } 76 | 77 | /** 78 | * Creates a new session through an ICustomTabsService with the optional callback. This session 79 | * can be used to associate any related communication through the service with an intent and 80 | * then later with a Custom Tab. The client can then send later service calls or intents to 81 | * through same session-intent-Custom Tab association. 82 | * @param callback The callback through which the client will receive updates about the created 83 | * session. Can be null. 84 | * @return The session object that was created as a result of the transaction. The client can 85 | * use this to relay {@link CustomTabsSession#mayLaunchUrl(Uri, Bundle, List)} calls. 86 | * Null on error. 87 | */ 88 | public CustomTabsSession newSession(final CustomTabsCallback callback) { 89 | ICustomTabsCallback.Stub wrapper = new ICustomTabsCallback.Stub() { 90 | @Override 91 | public void onNavigationEvent(int navigationEvent, Bundle extras) { 92 | if (callback != null) callback.onNavigationEvent(navigationEvent, extras); 93 | } 94 | 95 | @Override 96 | public void extraCallback(String callbackName, Bundle args) throws RemoteException { 97 | if (callback != null) callback.extraCallback(callbackName, args); 98 | } 99 | }; 100 | 101 | try { 102 | if (!mService.newSession(wrapper)) return null; 103 | } catch (RemoteException e) { 104 | return null; 105 | } 106 | return new CustomTabsSession(mService, wrapper, mServiceComponentName); 107 | } 108 | 109 | public Bundle extraCommand(String commandName, Bundle args) { 110 | try { 111 | return mService.extraCommand(commandName, args); 112 | } catch (RemoteException e) { 113 | return null; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/src/android/support/customtabs/CustomTabsServiceConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package android.support.customtabs; 18 | 19 | import android.content.ComponentName; 20 | import android.content.ServiceConnection; 21 | import android.os.IBinder; 22 | 23 | /** 24 | * Abstract {@link ServiceConnection} to use while binding to a {@link CustomTabsService}. Any 25 | * client implementing this is responsible for handling changes related with the lifetime of the 26 | * connection like rebinding on disconnect. 27 | */ 28 | public abstract class CustomTabsServiceConnection implements ServiceConnection { 29 | 30 | @Override 31 | public final void onServiceConnected(ComponentName name, IBinder service) { 32 | onCustomTabsServiceConnected(name, new CustomTabsClient( 33 | ICustomTabsService.Stub.asInterface(service), name) { 34 | }); 35 | } 36 | 37 | /** 38 | * Called when a connection to the {@link CustomTabsService} has been established. 39 | * @param name The concrete component name of the service that has been connected. 40 | * @param client {@link CustomTabsClient} that contains the {@link IBinder} with which the 41 | * connection have been established. All further communication should be initiated 42 | * using this client. 43 | */ 44 | public abstract void onCustomTabsServiceConnected(ComponentName name, CustomTabsClient client); 45 | } 46 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/src/android/support/customtabs/CustomTabsSession.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package android.support.customtabs; 18 | 19 | import android.content.ComponentName; 20 | import android.net.Uri; 21 | import android.os.Bundle; 22 | import android.os.IBinder; 23 | import android.os.RemoteException; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * A class to be used for Custom Tabs related communication. Clients that want to launch Custom Tabs 29 | * can use this class exclusively to handle all related communication. 30 | */ 31 | public final class CustomTabsSession { 32 | private static final String TAG = "CustomTabsSession"; 33 | private final ICustomTabsService mService; 34 | private final ICustomTabsCallback mCallback; 35 | private final ComponentName mComponentName; 36 | 37 | /* package */ CustomTabsSession( 38 | ICustomTabsService service, ICustomTabsCallback callback, ComponentName componentName) { 39 | mService = service; 40 | mCallback = callback; 41 | mComponentName = componentName; 42 | } 43 | 44 | /** 45 | * Tells the browser of a likely future navigation to a URL. 46 | * The most likely URL has to be specified first. Optionally, a list of 47 | * other likely URLs can be provided. They are treated as less likely than 48 | * the first one, and have to be sorted in decreasing priority order. These 49 | * additional URLs may be ignored. 50 | * All previous calls to this method will be deprioritized. 51 | * 52 | * @param url Most likely URL. 53 | * @param extras Reserved for future use. 54 | * @param otherLikelyBundles Other likely destinations, sorted in decreasing 55 | * likelihood order. Inside each Bundle, the client should provide a 56 | * {@link Uri} using {@link CustomTabsService#KEY_URL} with 57 | * {@link Bundle#putParcelable(String, android.os.Parcelable)}. 58 | * @return true for success. 59 | */ 60 | public boolean mayLaunchUrl(Uri url, Bundle extras, List otherLikelyBundles) { 61 | try { 62 | return mService.mayLaunchUrl(mCallback, url, extras, otherLikelyBundles); 63 | } catch (RemoteException e) { 64 | return false; 65 | } 66 | } 67 | 68 | /* package */ IBinder getBinder() { 69 | return mCallback.asBinder(); 70 | } 71 | 72 | /* package */ ComponentName getComponentName() { 73 | return mComponentName; 74 | } 75 | } -------------------------------------------------------------------------------- /CustomTabs/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package android.support.customtabs; 18 | 19 | import android.net.Uri; 20 | import android.os.Bundle; 21 | import android.os.IBinder; 22 | import android.os.RemoteException; 23 | import android.util.Log; 24 | 25 | /** 26 | * Wrapper class that can be used as a unique identifier for a session. Also contains an accessor 27 | * for the {@link CustomTabsCallback} for the session if there was any. 28 | */ 29 | public class CustomTabsSessionToken { 30 | private static final String TAG = "CustomTabsSessionToken"; 31 | private final ICustomTabsCallback mCallbackBinder; 32 | private final CustomTabsCallback mCallback; 33 | 34 | /**@hide*/ 35 | CustomTabsSessionToken(ICustomTabsCallback callbackBinder) { 36 | mCallbackBinder = callbackBinder; 37 | mCallback = new CustomTabsCallback() { 38 | 39 | @Override 40 | public void onNavigationEvent(int navigationEvent, Bundle extras) { 41 | try { 42 | mCallbackBinder.onNavigationEvent(navigationEvent, extras); 43 | } catch (RemoteException e) { 44 | Log.e(TAG, "RemoteException during ICustomTabsCallback transaction"); 45 | } 46 | } 47 | }; 48 | } 49 | 50 | /**@hide*/ 51 | IBinder getCallbackBinder() { 52 | return mCallbackBinder.asBinder(); 53 | } 54 | 55 | @Override 56 | public int hashCode() { 57 | return getCallbackBinder().hashCode(); 58 | } 59 | 60 | @Override 61 | public boolean equals(Object o) { 62 | if (!(o instanceof CustomTabsSessionToken)) return false; 63 | CustomTabsSessionToken token = (CustomTabsSessionToken) o; 64 | return token.getCallbackBinder().equals(mCallbackBinder.asBinder()); 65 | } 66 | 67 | /** 68 | * @return {@link CustomTabsCallback} corresponding to this session if there was any non-null 69 | * callbacks passed by the client. 70 | */ 71 | public CustomTabsCallback getCallback() { 72 | return mCallback; 73 | } 74 | } -------------------------------------------------------------------------------- /CustomTabs/customtabs/src/android/support/customtabs/ICustomTabsCallback.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package android.support.customtabs; 18 | 19 | import android.os.Bundle; 20 | 21 | /** 22 | * Interface to a CustomTabsCallback. 23 | * @hide 24 | */ 25 | oneway interface ICustomTabsCallback { 26 | void onNavigationEvent(int navigationEvent, in Bundle extras) = 1; 27 | void extraCallback(String callbackName, in Bundle args) = 2; 28 | } 29 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/src/android/support/customtabs/ICustomTabsService.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package android.support.customtabs; 18 | 19 | import android.net.Uri; 20 | import android.os.Bundle; 21 | import android.support.customtabs.ICustomTabsCallback; 22 | 23 | import java.util.List; 24 | 25 | /** 26 | * Interface to a CustomTabsService. 27 | * @hide 28 | */ 29 | interface ICustomTabsService { 30 | boolean warmup(long flags) = 1; 31 | boolean newSession(in ICustomTabsCallback callback) = 2; 32 | boolean mayLaunchUrl(in ICustomTabsCallback callback, in Uri url, 33 | in Bundle extras, in List otherLikelyBundles) = 3; 34 | Bundle extraCommand(String commandName, in Bundle args) = 4; 35 | } 36 | -------------------------------------------------------------------------------- /CustomTabs/customtabs/tests/src/android/support/customtabs/CustomTabsIntentTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package android.support.customtabs; 18 | 19 | import android.content.Intent; 20 | import android.graphics.Color; 21 | import android.test.AndroidTestCase; 22 | 23 | /** 24 | * Tests for CustomTabsIntent. 25 | */ 26 | public class CustomTabsIntentTest extends AndroidTestCase { 27 | 28 | public void testBareboneCustomTabIntent() { 29 | CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder().build(); 30 | Intent intent = customTabsIntent.intent; 31 | assertNotNull(intent); 32 | assertNull(customTabsIntent.startAnimationBundle); 33 | 34 | assertEquals(Intent.ACTION_VIEW, intent.getAction()); 35 | assertTrue(intent.hasExtra(CustomTabsIntent.EXTRA_SESSION)); 36 | assertNull(intent.getExtras().getBinder(CustomTabsIntent.EXTRA_SESSION)); 37 | assertNull(intent.getComponent()); 38 | } 39 | 40 | public void testToolbarColor() { 41 | int color = Color.RED; 42 | Intent intent = new CustomTabsIntent.Builder().setToolbarColor(color).build().intent; 43 | assertTrue(intent.hasExtra(CustomTabsIntent.EXTRA_TOOLBAR_COLOR)); 44 | assertEquals(color, intent.getIntExtra(CustomTabsIntent.EXTRA_TOOLBAR_COLOR, 0)); 45 | } 46 | 47 | public void testToolbarColorIsNotAResource() { 48 | int colorId = android.R.color.background_dark; 49 | int color = getContext().getResources().getColor(colorId); 50 | Intent intent = new CustomTabsIntent.Builder().setToolbarColor(colorId).build().intent; 51 | assertFalse("The color should not be a resource ID", 52 | color == intent.getIntExtra(CustomTabsIntent.EXTRA_TOOLBAR_COLOR, 0)); 53 | intent = new CustomTabsIntent.Builder().setToolbarColor(color).build().intent; 54 | assertEquals(color, intent.getIntExtra(CustomTabsIntent.EXTRA_TOOLBAR_COLOR, 0)); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /CustomTabs/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /CustomTabs/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechBooster/AndroidSamples/1557e0c90bb661a0375e9b5a56c9db4e38c289e4/CustomTabs/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /CustomTabs/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Sep 08 01:46:44 JST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 7 | -------------------------------------------------------------------------------- /CustomTabs/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /CustomTabs/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app',':shared',':customtabs' 2 | -------------------------------------------------------------------------------- /CustomTabs/shared/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /CustomTabs/shared/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 22 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | compile 'com.android.support:appcompat-v7:22.2.0' 24 | compile project(':customtabs') 25 | } 26 | -------------------------------------------------------------------------------- /CustomTabs/shared/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CustomTabs/shared/src/main/java/org/chromium/customtabsclient/shared/KeepAliveService.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package org.chromium.customtabsclient.shared; 16 | 17 | import android.app.Service; 18 | import android.content.Intent; 19 | import android.os.Binder; 20 | import android.os.IBinder; 21 | 22 | /** 23 | * Empty service used by the custom tab to bind to, raising the application's importance. 24 | */ 25 | public class KeepAliveService extends Service { 26 | private static final Binder sBinder = new Binder(); 27 | 28 | @Override 29 | public IBinder onBind(Intent intent) { 30 | return sBinder; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/.name: -------------------------------------------------------------------------------- 1 | CustomTabsBySupportLibrary -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 1.7 51 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/CustomTabsBySupportLibrary.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "org.techbooster.sample.customtabsbysupportlibrary" 9 | minSdkVersion 16 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:23.0.1' 26 | compile 'com.android.support:customtabs:23.0.1' 27 | } 28 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\mhidaka\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/src/androidTest/java/org/techbooster/sample/customtabsbysupportlibrary/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package org.techbooster.sample.customtabsbysupportlibrary; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/src/main/res/anim/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/src/main/res/anim/slide_in_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/src/main/res/anim/slide_out_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/src/main/res/anim/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | -------------------------------------------------------------------------------- /CustomTabsBySupportLibrary/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 10 | 11 |