diff --git a/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/DeviceScanActivity.kt b/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/DeviceScanActivity.kt index fd166299..8ed32d5f 100644 --- a/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/DeviceScanActivity.kt +++ b/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/DeviceScanActivity.kt @@ -1,3 +1,19 @@ +/* + * 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. + */ + package com.sample.android.bluetoothle.kotlin import android.app.ListActivity @@ -45,4 +61,4 @@ class DeviceScanActivity : ListActivity() { } } // [END start_and_stop_scan] -} \ No newline at end of file +} diff --git a/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/LeDeviceListAdapter.kt b/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/LeDeviceListAdapter.kt index c8670e09..42e37c07 100644 --- a/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/LeDeviceListAdapter.kt +++ b/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/LeDeviceListAdapter.kt @@ -1,3 +1,19 @@ +/* + * 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. + */ + package com.sample.android.bluetoothle.kotlin import android.bluetooth.BluetoothClass @@ -5,11 +21,11 @@ import android.bluetooth.BluetoothDevice import android.content.Context import android.widget.ArrayAdapter -class LeDeviceListAdapter(context: Context?, layout: Int) - : ArrayAdapter(context!!, layout) { +class LeDeviceListAdapter(context: Context?, layout: Int) : + ArrayAdapter(context!!, layout) { fun addDevice(device: BluetoothDevice?) { // This is where you can add devices to the adapter to // show a list of discovered devices in the UI. } -} \ No newline at end of file +} diff --git a/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/MainActivity.kt b/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/MainActivity.kt index 5555c720..a8857b4a 100644 --- a/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/MainActivity.kt +++ b/bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/MainActivity.kt @@ -1,3 +1,19 @@ +/* + * 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. + */ + package com.sample.android.bluetoothle.kotlin import android.bluetooth.BluetoothAdapter diff --git a/identity/credentialmanager/.gitignore b/identity/credentialmanager/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/identity/credentialmanager/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/identity/credentialmanager/build.gradle.kts b/identity/credentialmanager/build.gradle.kts new file mode 100644 index 00000000..560866d1 --- /dev/null +++ b/identity/credentialmanager/build.gradle.kts @@ -0,0 +1,54 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.compose.compiler) +} + +android { + namespace = "com.example.identity.credentialmanager" + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.identity.credentialmanager" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } + buildFeatures { + compose = true + } +} + +dependencies { + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime) + implementation(libs.androidx.activity.compose) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.ui.graphics) + implementation(libs.androidx.compose.ui.tooling.preview) + implementation(libs.androidx.compose.material3) + debugImplementation(libs.androidx.compose.ui.tooling) + debugImplementation(libs.androidx.compose.ui.test.manifest) +} \ No newline at end of file diff --git a/identity/credentialmanager/proguard-rules.pro b/identity/credentialmanager/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/identity/credentialmanager/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/identity/credentialmanager/src/main/AndroidManifest.xml b/identity/credentialmanager/src/main/AndroidManifest.xml new file mode 100644 index 00000000..09a3c839 --- /dev/null +++ b/identity/credentialmanager/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/identity/credentialmanager/src/main/java/com/example/identity/MainActivity.kt b/identity/credentialmanager/src/main/java/com/example/identity/MainActivity.kt new file mode 100644 index 00000000..58fae77d --- /dev/null +++ b/identity/credentialmanager/src/main/java/com/example/identity/MainActivity.kt @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package com.example.identity.credentialmanager + +import android.os.Bundle +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + } +} diff --git a/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Color.kt b/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Color.kt new file mode 100644 index 00000000..027a2e3f --- /dev/null +++ b/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Color.kt @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package com.example.identity.credentialmanager.ui.theme + +import androidx.compose.ui.graphics.Color + +val Purple80 = Color(0xFFD0BCFF) +val PurpleGrey80 = Color(0xFFCCC2DC) +val Pink80 = Color(0xFFEFB8C8) + +val Purple40 = Color(0xFF6650a4) +val PurpleGrey40 = Color(0xFF625b71) +val Pink40 = Color(0xFF7D5260) diff --git a/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Theme.kt b/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Theme.kt new file mode 100644 index 00000000..aa822378 --- /dev/null +++ b/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Theme.kt @@ -0,0 +1,63 @@ +/* + * 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. + */ + +package com.example.identity.credentialmanager.ui.theme + +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.LocalContext + +private val DarkColorScheme = darkColorScheme( + primary = Purple80, + secondary = PurpleGrey80, + tertiary = Pink80 +) + +private val LightColorScheme = lightColorScheme( + primary = Purple40, + secondary = PurpleGrey40, + tertiary = Pink40 +) + +@Composable +fun SnippetsTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = true, + content: @Composable () -> Unit +) { + val colorScheme = when { + dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { + val context = LocalContext.current + if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) + } + + darkTheme -> DarkColorScheme + else -> LightColorScheme + } + + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) +} diff --git a/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Type.kt b/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Type.kt new file mode 100644 index 00000000..5e0eaf6b --- /dev/null +++ b/identity/credentialmanager/src/main/java/com/example/identity/ui/theme/Type.kt @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package com.example.identity.credentialmanager.ui.theme + +import androidx.compose.material3.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +// Set of Material typography styles to start with +val Typography = Typography( + bodyLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ) +) diff --git a/identity/credentialmanager/src/main/res/drawable-v24/ic_launcher_foreground.xml b/identity/credentialmanager/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 00000000..2b068d11 --- /dev/null +++ b/identity/credentialmanager/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/identity/credentialmanager/src/main/res/drawable/ic_launcher_background.xml b/identity/credentialmanager/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..07d5da9c --- /dev/null +++ b/identity/credentialmanager/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/identity/credentialmanager/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/identity/credentialmanager/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..6f3b755b --- /dev/null +++ b/identity/credentialmanager/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/identity/credentialmanager/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/identity/credentialmanager/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..6f3b755b --- /dev/null +++ b/identity/credentialmanager/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/identity/credentialmanager/src/main/res/mipmap-hdpi/ic_launcher.webp b/identity/credentialmanager/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 00000000..c209e78e Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/identity/credentialmanager/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 00000000..b2dfe3d1 Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-mdpi/ic_launcher.webp b/identity/credentialmanager/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 00000000..4f0f1d64 Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/identity/credentialmanager/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 00000000..62b611da Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-xhdpi/ic_launcher.webp b/identity/credentialmanager/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 00000000..948a3070 Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/identity/credentialmanager/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..1b9a6956 Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/identity/credentialmanager/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 00000000..28d4b77f Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/identity/credentialmanager/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..9287f508 Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/identity/credentialmanager/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 00000000..aa7d6427 Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/identity/credentialmanager/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/identity/credentialmanager/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..9126ae37 Binary files /dev/null and b/identity/credentialmanager/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/identity/credentialmanager/src/main/res/values/colors.xml b/identity/credentialmanager/src/main/res/values/colors.xml new file mode 100644 index 00000000..f8c6127d --- /dev/null +++ b/identity/credentialmanager/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/identity/credentialmanager/src/main/res/values/strings.xml b/identity/credentialmanager/src/main/res/values/strings.xml new file mode 100644 index 00000000..3178959b --- /dev/null +++ b/identity/credentialmanager/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + credentialmanager + \ No newline at end of file diff --git a/identity/credentialmanager/src/main/res/values/themes.xml b/identity/credentialmanager/src/main/res/values/themes.xml new file mode 100644 index 00000000..65078ebe --- /dev/null +++ b/identity/credentialmanager/src/main/res/values/themes.xml @@ -0,0 +1,5 @@ + + + +