File tree Expand file tree Collapse file tree 7 files changed +39
-5
lines changed
java/com/example/android/taskinterop Expand file tree Collapse file tree 7 files changed +39
-5
lines changed Original file line number Diff line number Diff line change 22
33name : CI
44
5- # Controls when the action will run.
5+ # Controls when the action will run.
66on :
7- # Triggers the workflow on push or pull request events but only for the master branch
7+ # Triggers the workflow on push or pull request events but only for the main branch
88 push :
9- branches : [ master ]
9+ branches : [ main ]
1010 pull_request :
11- branches : [ master ]
11+ branches : [ main ]
1212
1313 # Allows you to run this workflow manually from the Actions tab
1414 workflow_dispatch :
Original file line number Diff line number Diff line change 1515apply plugin : ' com.android.application'
1616apply plugin : ' kotlin-android'
1717apply plugin : ' kotlin-android-extensions'
18+ apply plugin : ' com.google.android.gms.oss-licenses-plugin'
1819
1920android {
2021 compileSdkVersion 30
@@ -54,6 +55,7 @@ dependencies {
5455 implementation ' com.google.android.material:material:1.2.0'
5556 implementation ' androidx.constraintlayout:constraintlayout:2.0.1'
5657 implementation ' com.google.android.gms:play-services-tasks:17.2.0'
58+ implementation ' com.google.android.gms:play-services-oss-licenses:17.0.0'
5759 // Coroutines dependencies
5860 implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
5961 implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
Original file line number Diff line number Diff line change 2525 <category android : name =" android.intent.category.LAUNCHER" />
2626 </intent-filter >
2727 </activity >
28+
29+ <activity
30+ android : name =" com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
31+ android : theme =" @style/Theme.AppCompat.Light.DarkActionBar"
32+ android : exported =" false" />
33+
34+ <activity
35+ android : name =" com.google.android.gms.oss.licenses.OssLicensesActivity"
36+ android : theme =" @style/Theme.AppCompat.Light.DarkActionBar"
37+ android : exported =" false" />
2838 </application >
2939
30- </manifest >
40+ </manifest >
Original file line number Diff line number Diff line change 1414 */
1515package com.example.android.taskinterop
1616
17+ import android.content.Intent
1718import android.os.Bundle
1819import android.widget.Button
1920import android.widget.TextView
@@ -23,6 +24,7 @@ import androidx.concurrent.futures.CallbackToFutureAdapter
2324import androidx.concurrent.futures.DirectExecutor
2425import androidx.core.content.ContextCompat
2526import androidx.lifecycle.lifecycleScope
27+ import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
2628import com.google.android.gms.tasks.Task
2729import com.google.android.gms.tasks.TaskCompletionSource
2830// [START guava_import]
@@ -100,6 +102,10 @@ class MainActivity : AppCompatActivity() {
100102 simpleTask.toSingle(this ).subscribe { result -> textView.text = result }
101103 // [END rx_task]
102104 }
105+
106+ findViewById<Button >(R .id.license_button).setOnClickListener {
107+ startActivity(Intent (this , OssLicensesMenuActivity ::class .java))
108+ }
103109 }
104110
105111 override fun onStop () {
Original file line number Diff line number Diff line change 4242 app : layout_constraintStart_toStartOf =" parent"
4343 app : layout_constraintTop_toBottomOf =" @id/tasks_button"
4444 app : layout_constraintVertical_bias =" 0.087" />
45+
4546 <Button
4647 android : id =" @+id/rx_button"
4748 android : layout_width =" wrap_content"
5354 app : layout_constraintStart_toStartOf =" parent"
5455 app : layout_constraintTop_toBottomOf =" @id/guava_button"
5556 app : layout_constraintVertical_bias =" 0.191" />
57+
5658 <Button
5759 android : id =" @+id/guava_button"
5860 android : layout_width =" wrap_content"
6466 app : layout_constraintStart_toStartOf =" parent"
6567 app : layout_constraintTop_toBottomOf =" @id/ktx_button"
6668 app : layout_constraintVertical_bias =" 0.122" />
69+
70+ <Button
71+ android : id =" @+id/license_button"
72+ android : layout_width =" wrap_content"
73+ android : layout_height =" wrap_content"
74+ android : text =" @string/license_button_txt"
75+ app : layout_constraintBottom_toBottomOf =" parent"
76+ app : layout_constraintEnd_toEndOf =" parent"
77+ app : layout_constraintStart_toStartOf =" parent"
78+ app : layout_constraintTop_toBottomOf =" @id/rx_button"
79+ app : layout_constraintVertical_bias =" 0.255" />
80+
6781 <TextView
6882 android : id =" @+id/textview_first"
6983 android : layout_width =" wrap_content"
Original file line number Diff line number Diff line change 1515 <string name =" ktx_button_txt" description =" Kotlin coroutines button text. [CHAR LIMIT=NONE]" >KTX Coroutine</string >
1616 <string name =" guava_button_txt" description =" Guava button text. [CHAR LIMIT=NONE]" >Guava ListenableFuture</string >
1717 <string name =" rx_button_txt" description =" RxJava button text. [CHAR LIMIT=NONE]" >RxJava Observable</string >
18+ <string name =" license_button_txt" description =" See licenses button text. [CHAR LIMIT=NONE]" >See Licenses</string >
1819</resources >
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ buildscript {
2222 dependencies {
2323 classpath " com.android.tools.build:gradle:4.1.1"
2424 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
25+ classpath ' com.google.android.gms:oss-licenses-plugin:0.10.2'
2526
2627 // NOTE: Do not place your application dependencies here; they belong
2728 // in the individual module build.gradle files
You can’t perform that action at this time.
0 commit comments