Skip to content

Commit 6f6ac5f

Browse files
SDK Samplescaller9
authored andcommitted
Internal change
PiperOrigin-RevId: 363441395
1 parent d4c9c9c commit 6f6ac5f

File tree

7 files changed

+39
-5
lines changed

7 files changed

+39
-5
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
name: CI
44

5-
# Controls when the action will run.
5+
# Controls when the action will run.
66
on:
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:

app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
apply plugin: 'com.android.application'
1616
apply plugin: 'kotlin-android'
1717
apply plugin: 'kotlin-android-extensions'
18+
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
1819

1920
android {
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'

app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@
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>

app/src/main/java/com/example/android/taskinterop/MainActivity.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515
package com.example.android.taskinterop
1616

17+
import android.content.Intent
1718
import android.os.Bundle
1819
import android.widget.Button
1920
import android.widget.TextView
@@ -23,6 +24,7 @@ import androidx.concurrent.futures.CallbackToFutureAdapter
2324
import androidx.concurrent.futures.DirectExecutor
2425
import androidx.core.content.ContextCompat
2526
import androidx.lifecycle.lifecycleScope
27+
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
2628
import com.google.android.gms.tasks.Task
2729
import 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() {

app/src/main/res/layout/activity_main.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
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"
@@ -53,6 +54,7 @@
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"
@@ -64,6 +66,18 @@
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"

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
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>

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)