├── direct-share-done ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── xml │ │ │ │ ├── file_paths.xml │ │ │ │ └── shortcuts.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── activity_select_contact.xml │ │ │ │ ├── item_contact.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── activity_send_message.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── android │ │ │ │ └── directshare │ │ │ │ ├── Contact.kt │ │ │ │ ├── SelectContactActivity.kt │ │ │ │ ├── SharingShortcutsManager.kt │ │ │ │ ├── SendMessageActivity.kt │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── build.gradle ├── gradlew.bat └── gradlew ├── direct-share-start ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── logo_avatar.png │ │ │ ├── xml │ │ │ │ ├── file_paths.xml │ │ │ │ └── shortcuts.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── activity_select_contact.xml │ │ │ │ ├── item_contact.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── activity_send_message.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── android │ │ │ │ └── directshare │ │ │ │ ├── Contact.kt │ │ │ │ ├── SelectContactActivity.kt │ │ │ │ ├── SharingShortcutsManager.kt │ │ │ │ ├── SendMessageActivity.kt │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── build.gradle ├── gradlew.bat └── gradlew ├── settings.gradle ├── screenshots ├── app.gif ├── 1_main.png ├── 2_sharing_text.png ├── 6_android_P_bc.png ├── 5_android_P_no_bc.png ├── 7_android_L_sharing.png ├── 3_launcher_shortcuts.png └── 4_sharing_no_content_preview.png ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── README.md ├── gradle.properties ├── CONTRIBUTING.md ├── .github └── workflows │ └── build_test.yml ├── gradlew.bat ├── gradlew └── LICENSE /direct-share-done/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /direct-share-start/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /direct-share-done/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /direct-share-start/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':direct-share-start:app', ':direct-share-done:app' 2 | -------------------------------------------------------------------------------- /screenshots/app.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/screenshots/app.gif -------------------------------------------------------------------------------- /screenshots/1_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/screenshots/1_main.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea* 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /screenshots/2_sharing_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/screenshots/2_sharing_text.png -------------------------------------------------------------------------------- /screenshots/6_android_P_bc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/screenshots/6_android_P_bc.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /screenshots/5_android_P_no_bc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/screenshots/5_android_P_no_bc.png -------------------------------------------------------------------------------- /screenshots/7_android_L_sharing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/screenshots/7_android_L_sharing.png -------------------------------------------------------------------------------- /screenshots/3_launcher_shortcuts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/screenshots/3_launcher_shortcuts.png -------------------------------------------------------------------------------- /screenshots/4_sharing_no_content_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/screenshots/4_sharing_no_content_preview.png -------------------------------------------------------------------------------- /direct-share-done/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /direct-share-start/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-hdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-hdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-mdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-mdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-xhdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-xhdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-hdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-hdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-mdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-mdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-xxhdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-xxhdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/mipmap-xxxhdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-done/app/src/main/res/mipmap-xxxhdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-xhdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-xhdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-xxhdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-xxhdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/mipmap-xxxhdpi/logo_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android/codelab-android-direct-share/HEAD/direct-share-start/app/src/main/res/mipmap-xxxhdpi/logo_avatar.png -------------------------------------------------------------------------------- /direct-share-done/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | .build 12 | .captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /direct-share-start/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | .build 12 | .captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Mar 15 12:33:15 CET 2019 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-7.0.2-bin.zip 7 | -------------------------------------------------------------------------------- /direct-share-done/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Mar 15 09:30:55 CET 2019 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-4.10.1-all.zip 7 | -------------------------------------------------------------------------------- /direct-share-start/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Mar 15 09:30:55 CET 2019 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-4.10.1-all.zip 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Direct Share to an Android app 2 | 3 | This folder contains the source code for the [Direct Share to an Android app codelab](https://codelabs.developers.google.com/codelabs/android-direct-share/#0). 4 | 5 | ## License 6 | 7 | Copyright 2019 Google LLC 8 | 9 | Licensed under the Apache License, Version 2.0 (the "License"); 10 | you may not use this file except in compliance with the License. 11 | You may obtain a copy of the License at 12 | 13 | https://www.apache.org/licenses/LICENSE-2.0 14 | 15 | Unless required by applicable law or agreed to in writing, software 16 | distributed under the License is distributed on an "AS IS" BASIS, 17 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | See the License for the specific language governing permissions and 19 | limitations under the License. 20 | -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 22 | -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | android.useAndroidX=true 17 | android.enableJetifier=true 18 | -------------------------------------------------------------------------------- /direct-share-done/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | android.useAndroidX=true 17 | android.enableJetifier=true 18 | -------------------------------------------------------------------------------- /direct-share-start/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | android.useAndroidX=true 17 | android.enableJetifier=true 18 | -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/xml/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/xml/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | #3F51B5 20 | #303F9F 21 | #C5CAE9 22 | #00BCD4 23 | #212121 24 | #727272 25 | #FFFFFF 26 | #B6B6B6 27 | 28 | -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | #3F51B5 20 | #303F9F 21 | #C5CAE9 22 | #00BCD4 23 | #212121 24 | #727272 25 | #FFFFFF 26 | #B6B6B6 27 | 28 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution; 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | 25 | ## Community Guidelines 26 | 27 | This project follows [Google's Open Source Community 28 | Guidelines](https://opensource.google.com/conduct/). -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/layout/activity_select_contact.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 28 | -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/layout/activity_select_contact.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 28 | -------------------------------------------------------------------------------- /direct-share-done/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 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 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 18 | 19 | buildscript { 20 | repositories { 21 | google() 22 | mavenCentral() 23 | } 24 | dependencies { 25 | classpath "com.android.tools.build:gradle:${versions.android_gradle_plugin}" 26 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin_version}" 27 | // NOTE: Do not place your application dependencies here; they belong 28 | // in the individual module build.gradle files 29 | } 30 | } 31 | 32 | task clean(type: Delete) { 33 | delete rootProject.buildDir 34 | } 35 | -------------------------------------------------------------------------------- /direct-share-start/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 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 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 18 | 19 | buildscript { 20 | repositories { 21 | google() 22 | mavenCentral() 23 | } 24 | dependencies { 25 | classpath "com.android.tools.build:gradle:${versions.android_gradle_plugin}" 26 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin_version}" 27 | // NOTE: Do not place your application dependencies here; they belong 28 | // in the individual module build.gradle files 29 | } 30 | } 31 | 32 | task clean(type: Delete) { 33 | delete rootProject.buildDir 34 | } 35 | -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 4dp 21 | 8dp 22 | 16dp 23 | 32dp 24 | 64dp 25 | 26 | 16dp 27 | 28 | @dimen/margin_medium 29 | @dimen/margin_medium 30 | 31 | 24dp 32 | 8dp 33 | 34 | -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 4dp 21 | 8dp 22 | 16dp 23 | 32dp 24 | 64dp 25 | 26 | 16dp 27 | 28 | @dimen/margin_medium 29 | @dimen/margin_medium 30 | 31 | 24dp 32 | 8dp 33 | 34 | -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 25 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 25 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/layout/item_contact.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 32 | -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/layout/item_contact.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 32 | -------------------------------------------------------------------------------- /.github/workflows/build_test.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | # Controls when the action will run. Triggers the workflow on push or pull request 4 | # events but only for the master branch 5 | on: 6 | push: 7 | branches: [ master ] 8 | pull_request: 9 | branches: [ master ] 10 | 11 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 12 | jobs: 13 | 14 | # Build will compile APK, test APK and run tests, lint, etc. 15 | build: 16 | 17 | # The type of runner that the job will run on 18 | runs-on: ubuntu-latest 19 | timeout-minutes: 45 20 | env: 21 | TERM: dumb 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | 26 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 27 | - uses: actions/checkout@v2 28 | 29 | - name: set up JDK 30 | uses: actions/setup-java@v1 31 | with: 32 | java-version: 11 33 | 34 | - name: Build and check all modules 35 | run: ./gradlew assembleDebug assembleDebugAndroidTest lintDebug testDebug 36 | 37 | - name: Upload build reports (direct-share-start) 38 | if: always() 39 | uses: actions/upload-artifact@v1 40 | with: 41 | name: build-reports-direct-share-start 42 | path: direct-share-start/app/build/reports 43 | 44 | - name: Upload build reports (direct-share-done) 45 | if: always() 46 | uses: actions/upload-artifact@v1 47 | with: 48 | name: build-reports-direct-share-done 49 | path: direct-share-done/app/build/reports 50 | 51 | # Project have not tests; omitting steps for publishing test artifacts 52 | -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | Direct Share 21 | 22 | 23 | 24 | Send message 25 | 26 | This app demonstrates how to implement Direct Share. Use some other app and share a text. 27 | For your convenience, you can also use the input below to share the text. 28 | 29 | Text to share 30 | Hello! 31 | Share 32 | 33 | 34 | 35 | Sending a message 36 | To: 37 | Send 38 | Body: 39 | Edit your message 40 | Sent a message \"%1$s\" to %2$s 41 | 42 | -------------------------------------------------------------------------------- /direct-share-start/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | Direct Share 21 | 22 | 23 | 24 | Send message 25 | 26 | This app demonstrates how to implement Direct Share. Use some other app and share a text. 27 | For your convenience, you can also use the input below to share the text. 28 | 29 | Text to share 30 | Hello! 31 | Share 32 | 33 | 34 | 35 | Sending a message 36 | To: 37 | Send 38 | Body: 39 | Edit your message 40 | Sent a message \"%1$s\" to %2$s 41 | 42 | -------------------------------------------------------------------------------- /direct-share-done/app/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 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 | apply plugin: 'com.android.application' 18 | apply plugin: 'kotlin-android' 19 | 20 | android { 21 | compileSdkVersion versions.compileSdk 22 | defaultConfig { 23 | applicationId names.applicationId 24 | minSdkVersion versions.minSdk 25 | targetSdkVersion versions.targetSdk 26 | versionCode 1 27 | versionName "1.0" 28 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation "androidx.core:core-ktx:${versions.androidxCore}" 34 | implementation "androidx.appcompat:appcompat:${versions.appcompat}" 35 | implementation "androidx.sharetarget:sharetarget:${versions.shareTarget}" 36 | implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}" 37 | 38 | testImplementation "junit:junit:${versions.junit}" 39 | androidTestImplementation "androidx.test:runner:${versions.test_runner}" 40 | androidTestImplementation "androidx.test.espresso:espresso-core:${versions.espresso}" 41 | } 42 | -------------------------------------------------------------------------------- /direct-share-start/app/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 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 | apply plugin: 'com.android.application' 18 | apply plugin: 'kotlin-android' 19 | 20 | android { 21 | compileSdkVersion versions.compileSdk 22 | defaultConfig { 23 | applicationId names.applicationId 24 | minSdkVersion versions.minSdk 25 | targetSdkVersion versions.targetSdk 26 | versionCode 1 27 | versionName "1.0" 28 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation "androidx.core:core-ktx:${versions.androidxCore}" 34 | implementation "androidx.appcompat:appcompat:${versions.appcompat}" 35 | implementation "androidx.sharetarget:sharetarget:${versions.shareTarget}" 36 | implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}" 37 | 38 | testImplementation "junit:junit:${versions.junit}" 39 | androidTestImplementation "androidx.test:runner:${versions.test_runner}" 40 | androidTestImplementation "androidx.test.espresso:espresso-core:${versions.espresso}" 41 | } 42 | -------------------------------------------------------------------------------- /direct-share-done/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | 23 | 28 | 29 | 33 | 34 | 44 | 45 |