Skip to content

Commit 6bdb702

Browse files
authored
Merge branch 'main' into e2e_pb
2 parents 8cc11e8 + 68b9a01 commit 6bdb702

File tree

195 files changed

+3175
-2226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+3175
-2226
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ jobs:
4242
- name: Build debug
4343
run: ./gradlew assembleDebug
4444

45-
- name: Run local tests
46-
run: ./gradlew testDebug
45+
# TODO: Temporarily disable unit tests until the infra is fixed
46+
# - name: Run local tests
47+
# run: ./gradlew testDebug
4748

4849
- name: Upload build outputs (APKs)
4950
uses: actions/upload-artifact@v4

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
This repository contains a collection of samples that demonstrate the use of different Android OS platform APIs. The samples are organized into folders by topic, and each folder contains a README file that provides more information about the samples in that folder.
66

77
> **Note:** These samples are intended to showcase specific functionality in isolation, and they may use
8-
> simplified code. They are not intended to be used as production-ready code. The project uses the
9-
> [casa-android](https://github.com/google/casa-android) (intended only for demo projects).
8+
> simplified code. They are not intended to be used as production-ready code.
109
> For best practices follow our documentation and check
1110
> [Now In Android](https://github.com/android/nowinandroid)
1211
@@ -22,9 +21,7 @@ Browse the samples inside each topic samples folder:
2221
- [User-interface](https://github.com/android/platform-samples/tree/main/samples/user-interface)
2322
- More to come...
2423

25-
We are constantly adding new samples to this repository. You can find a list of all the available samples [here](https://github.com/android/platform-samples/tree/main/samples/README.md).
26-
27-
> 🚧 **Work-in-Progress:** we are working on bringing more existing and new samples into this format.
24+
We regularly add new samples to this repository. You can find a list of all the available samples [here](https://github.com/android/platform-samples/tree/main/samples).
2825

2926
## How to run
3027

@@ -39,17 +36,6 @@ categories and available samples.
3936
> for their functionality, you can simply ignore it. The wiring is done under the hood and an
4037
> implementation detail not needed to understand any sample functionality.
4138
42-
### Deeplink to sample
43-
44-
To open a specific sample directly you can use one of the auto-generated configurations.
45-
46-
1. Build the project at least once
47-
2. Open `Run Configuration` dropdown
48-
3. Select sample name
49-
4. Run
50-
51-
> **Tip:** use `⌃⌥R` or `Alt+Shift+F10` shortcut to open the full list and launch the selected one.
52-
5339
## Reporting Issues
5440

5541
You can report an [issue with a sample](https://github.com/android/platform-samples/issues) using

app/build.gradle.kts

Lines changed: 59 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -13,103 +13,98 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
@Suppress("DSL_SCOPE_VIOLATION")
16+
1717
plugins {
1818
alias(libs.plugins.android.application)
1919
alias(libs.plugins.kotlin.android)
20-
alias(libs.plugins.ksp)
21-
alias(libs.plugins.hilt)
22-
id("com.example.platform.convention")
23-
}
24-
25-
java {
26-
toolchain {
27-
languageVersion.set(JavaLanguageVersion.of(17))
28-
}
20+
alias(libs.plugins.kotlin.compose)
21+
kotlin("plugin.serialization") version "2.1.10"
2922
}
3023

3124
android {
32-
namespace = "com.example.platform.app"
25+
namespace = "com.example.platform"
3326
compileSdk = 35
3427

3528
defaultConfig {
36-
applicationId = "com.example.platform.app"
29+
applicationId = "com.example.platform"
3730
minSdk = 21
3831
targetSdk = 35
3932
versionCode = 1
4033
versionName = "1.0"
4134

42-
testInstrumentationRunner = "com.example.platform.app.AppTestRunner"
43-
vectorDrawables {
44-
useSupportLibrary = true
45-
}
35+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
4636
}
4737

4838
buildTypes {
4939
release {
5040
isMinifyEnabled = false
5141
proguardFiles(
5242
getDefaultProguardFile("proguard-android-optimize.txt"),
53-
"proguard-rules.pro"
43+
"proguard-rules.pro",
5444
)
5545
}
5646
}
57-
5847
compileOptions {
59-
sourceCompatibility = JavaVersion.VERSION_17
60-
targetCompatibility = JavaVersion.VERSION_17
48+
sourceCompatibility = JavaVersion.VERSION_11
49+
targetCompatibility = JavaVersion.VERSION_11
50+
}
51+
kotlinOptions {
52+
jvmTarget = "11"
6153
}
62-
6354
buildFeatures {
6455
compose = true
6556
}
66-
composeOptions {
67-
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
68-
}
69-
packagingOptions {
70-
resources {
71-
excludes += "/META-INF/{AL2.0,LGPL2.1}"
72-
}
73-
}
7457
}
7558

7659
dependencies {
77-
implementation(platform(libs.compose.bom))
78-
implementation(libs.casa.ui)
79-
implementation(libs.androidx.appcompat)
80-
81-
implementation(libs.hilt.android)
82-
ksp(libs.hilt.compiler)
8360

84-
implementation(libs.coil.base)
85-
implementation(libs.coil.video)
61+
implementation(libs.androidx.core.ktx)
62+
implementation(libs.androidx.lifecycle.runtime.ktx)
63+
implementation(libs.androidx.activity.compose)
64+
implementation(platform(libs.androidx.compose.bom))
65+
implementation(libs.androidx.ui)
66+
implementation(libs.androidx.ui.graphics)
67+
implementation(libs.androidx.ui.tooling.preview)
68+
implementation(libs.androidx.material3)
69+
implementation(libs.androidx.navigation.compose)
8670

87-
// include all available samples.
88-
val samples: List<String> by project.extra
89-
samples.forEach {
90-
implementation(project(it))
91-
}
71+
implementation(libs.kotlinx.serialization.json)
72+
implementation(libs.androidx.fragment.compose)
9273

93-
// Testing
94-
kspAndroidTest(libs.hilt.compiler)
95-
androidTestImplementation(platform(libs.compose.bom))
96-
androidTestImplementation(libs.androidx.navigation.testing)
97-
androidTestImplementation(libs.compose.ui.test.manifest)
98-
debugImplementation(libs.compose.ui.test.manifest)
99-
androidTestImplementation(libs.compose.ui.test.junit4)
100-
androidTestImplementation(libs.androidx.test.core)
101-
androidTestImplementation(libs.androidx.test.espresso.core)
102-
androidTestImplementation(libs.androidx.test.rules)
103-
androidTestImplementation(libs.androidx.test.runner)
104-
androidTestImplementation(libs.hilt.testing)
105-
androidTestImplementation(libs.junit4)
106-
}
74+
implementation(project(":shared"))
75+
implementation(project(":samples:accessibility"))
76+
implementation(project(":samples:camera:camera2"))
77+
implementation(project(":samples:connectivity:audio"))
78+
implementation(project(":samples:connectivity:bluetooth:ble"))
79+
implementation(project(":samples:connectivity:bluetooth:companion"))
80+
implementation(project(":samples:connectivity:callnotification"))
81+
implementation(project(":samples:connectivity:telecom"))
82+
implementation(project(":samples:graphics:pdf"))
83+
implementation(project(":samples:graphics:ultrahdr"))
84+
implementation(project(":samples:location"))
85+
implementation(project(":samples:media:ultrahdr"))
86+
implementation(project(":samples:media:video"))
87+
implementation(project(":samples:privacy:data"))
88+
implementation(project(":samples:privacy:permissions"))
89+
implementation(project(":samples:privacy:transparency"))
90+
implementation(project(":samples:storage"))
91+
implementation(project(":samples:user-interface:appwidgets"))
92+
implementation(project(":samples:user-interface:constraintlayout"))
93+
implementation(project(":samples:user-interface:draganddrop"))
94+
implementation(project(":samples:user-interface:haptics"))
95+
implementation(project(":samples:user-interface:picture-in-picture"))
96+
implementation(project(":samples:user-interface:predictiveback"))
97+
implementation(project(":samples:user-interface:quicksettings"))
98+
implementation(project(":samples:user-interface:share"))
99+
implementation(project(":samples:user-interface:text"))
100+
implementation(project(":samples:user-interface:window-insets"))
101+
implementation(project(":samples:user-interface:windowmanager"))
107102

108-
tasks.register("syncSamplesInfo", com.example.platform.plugin.SyncSamplesInfo::class.java) {
109-
projectDir.set(project.rootDir)
110-
}
111-
// Link the assemble task to the sync task.
112-
// TODO: move syncSamplesInfo task here, as this can break isolated projects
113-
afterEvaluate {
114-
tasks.findByName("assembleDebug")?.finalizedBy(tasks.findByName("syncSamplesInfo"))
115-
}
103+
testImplementation(libs.junit)
104+
androidTestImplementation(libs.androidx.junit)
105+
androidTestImplementation(libs.androidx.espresso.core)
106+
androidTestImplementation(platform(libs.androidx.compose.bom))
107+
androidTestImplementation(libs.androidx.ui.test.junit4)
108+
debugImplementation(libs.androidx.ui.tooling)
109+
debugImplementation(libs.androidx.ui.test.manifest)
110+
}

app/src/androidTest/java/com/example/platform/app/AppTestRunner.kt

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/src/androidTest/java/com/example/platform/app/NavigationTest.kt

Lines changed: 0 additions & 90 deletions
This file was deleted.

app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@
1717
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1818

1919
<application
20-
android:name=".MainApp"
21-
android:allowBackup="true"
20+
android:enableOnBackInvokedCallback="true"
2221
android:icon="@mipmap/ic_launcher"
23-
android:roundIcon="@mipmap/ic_launcher"
2422
android:label="@string/app_name"
25-
android:supportsRtl="true"
26-
android:enableOnBackInvokedCallback="true">
23+
android:roundIcon="@mipmap/ic_launcher"
24+
android:supportsRtl="true">
2725
<activity
28-
android:name=".MainActivity"
26+
android:name=".app.MainActivity"
2927
android:exported="true"
30-
android:theme="@style/Theme.Material3.DayNight.NoActionBar">
28+
android:theme="@style/Theme.PlatformSamples">
3129
<intent-filter>
3230
<action android:name="android.intent.action.MAIN" />
3331

@@ -36,10 +34,12 @@
3634
</activity>
3735

3836
<!--required for TFLite/LiteRT style transfer demo -->
39-
<uses-library android:name="libOpenCL.so"
40-
android:required="false"/>
41-
<uses-library android:name="libOpenCL-pixel.so"
42-
android:required="false"/>
37+
<uses-library
38+
android:name="libOpenCL.so"
39+
android:required="false" />
40+
<uses-library
41+
android:name="libOpenCL-pixel.so"
42+
android:required="false" />
4343
</application>
4444

4545
</manifest>

0 commit comments

Comments
 (0)