Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion views/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}

android {
namespace = "com.example.example.snippet.views"
namespace = "com.example.android.views"
compileSdk = 35

defaultConfig {
Expand Down Expand Up @@ -48,6 +48,8 @@ android {

dependencies {

implementation("androidx.core:core:1.13.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.google.android.material)
Expand Down
10 changes: 9 additions & 1 deletion views/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,13 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity android:name=".notifications.NotificationSnippets$MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.example.android.views.notifications;

import android.app.Activity;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import com.example.android.views.R;

public class NotificationSnippets {
private static final String CHANNEL_ID = "channel_id";
private static final String textTitle = "Notification Title";
private static final String textContent = "Notification Content";

public static class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// [START android_views_notifications_build_basic]
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle(textTitle)
.setContentText(textContent)
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
// [END android_views_notifications_build_basic]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import android.widget.RemoteViews
import androidx.glance.GlanceId
import androidx.glance.appwidget.GlanceAppWidget
import androidx.glance.appwidget.compose
import com.example.example.snippet.views.R
import com.example.android.views.R

class ExampleAppWidget : GlanceAppWidget() {
override suspend fun provideGlance(context: Context, id: GlanceId) {
Expand Down
2 changes: 1 addition & 1 deletion views/src/main/java/insets/SystemBarProtectionSnippet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.insets.GradientProtection
import androidx.core.view.insets.ProtectionLayout
import com.example.example.snippet.views.R
import com.example.android.views.R

class SystemBarProtectionSnippet : AppCompatActivity() {

Expand Down
22 changes: 22 additions & 0 deletions views/src/main/res/drawable/notification_icon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FF0000" />
<size android:width="24dp"
android:height="24dp" />
</shape>
4 changes: 4 additions & 0 deletions watchfacepush/validator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ plugins {
application
}

kotlin {
jvmToolchain(17)
}

application {
mainClass.set("com.example.validator.Main")
}
Expand Down
6 changes: 3 additions & 3 deletions xr/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ android {
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(11)
jvmToolchain(17)
}
buildFeatures {
compose = true
Expand Down