diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..82068d0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Device Info:** + - Device: [e.g. Google Pixel 4] + - OS: [e.g. Android 12] + - LiveKit SDK version: [e.g. 1.0.0] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..4c06103 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: davidliu + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 0000000..36faba7 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1 @@ +Use https://github.com/nektos/act to test github actions locally. diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..9c2b04b --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,59 @@ +name: Android CI + +on: + push: + branches: [ main ] + paths-ignore: + - '**.md' + - 'LICENSE' + - 'NOTICE' + - '.gitignore' + pull_request: + branches: [ main ] + paths-ignore: + - '**.md' + - 'LICENSE' + - 'NOTICE' + - '.gitignore' + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./android-components-meet + steps: + - name: checkout android-components-meet + uses: actions/checkout@v4.0.0 + with: + path: ./android-components-meet + submodules: recursive + + - name: set up JDK 17 + uses: actions/setup-java@v3.12.0 + with: + java-version: '17' + distribution: 'adopt' + + - uses: actions/cache@v3.3.2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Gradle clean + run: ./gradlew clean + + - name: Spotless check + if: github.event_name == 'pull_request' + run: | + git fetch origin main --depth 1 + ./gradlew spotlessCheck + + - name: Build with Gradle + run: ./gradlew assembleRelease + diff --git a/LicenseHeaderFile.txt b/LicenseHeaderFile.txt new file mode 100644 index 0000000..e4747d1 --- /dev/null +++ b/LicenseHeaderFile.txt @@ -0,0 +1,16 @@ +/* + * Copyright $YEAR LiveKit, Inc. + * + * 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 + * + * http://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. + */ + diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2ba8bfd..efb8a67 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -90,7 +90,6 @@ dependencies { implementation(libs.accompanist.permissions) - testImplementation(libs.junit) androidTestImplementation(libs.androidx.test.ext.junit) androidTestImplementation(libs.espresso.core) @@ -98,4 +97,4 @@ dependencies { androidTestImplementation(libs.androidx.compose.ui.test.junit4) debugImplementation(libs.androidx.compose.ui.tooling) debugImplementation(libs.androidx.compose.ui.test.manifest) -} \ No newline at end of file +} diff --git a/app/src/androidTest/java/io/livekit/android/compose/meet/ExampleInstrumentedTest.kt b/app/src/androidTest/java/io/livekit/android/compose/meet/ExampleInstrumentedTest.kt deleted file mode 100644 index eb7fc52..0000000 --- a/app/src/androidTest/java/io/livekit/android/compose/meet/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package io.livekit.android.compose.meet - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("io.livekit.android.compose.meet", appContext.packageName) - } -} \ No newline at end of file diff --git a/app/src/main/java/io/livekit/android/compose/meet/Application.kt b/app/src/main/java/io/livekit/android/compose/meet/Application.kt index cb2fc7f..4319d11 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/Application.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/Application.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2024 LiveKit, Inc. + * + * 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 + * + * http://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 io.livekit.android.compose.meet import com.github.ajalt.timberkt.Timber @@ -5,7 +21,6 @@ import io.livekit.android.LiveKit import io.livekit.android.util.LoggingLevel import timber.log.Timber.DebugTree - class Application : android.app.Application() { override fun onCreate() { @@ -16,4 +31,4 @@ class Application : android.app.Application() { // Change logging level, defaults to OFF LiveKit.loggingLevel = LoggingLevel.INFO } -} \ No newline at end of file +} diff --git a/app/src/main/java/io/livekit/android/compose/meet/CallActivity.kt b/app/src/main/java/io/livekit/android/compose/meet/CallActivity.kt index 9e1381f..4236540 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/CallActivity.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/CallActivity.kt @@ -98,7 +98,7 @@ class CallActivity : ComponentActivity() { Content( url = args.url, token = args.token, - e2eeOptions = e2eeOptions + e2eeOptions = e2eeOptions, ) } } @@ -109,7 +109,6 @@ class CallActivity : ComponentActivity() { token: String, e2eeOptions: E2EEOptions?, ) { - // Track whether user wants their camera/mic enabled. var userEnabledCamera by rememberSaveable { mutableStateOf(false) } var userEnabledMic by rememberSaveable { mutableStateOf(false) } @@ -134,7 +133,7 @@ class CallActivity : ComponentActivity() { Timber.e(exception) Toast.makeText(this@CallActivity, "Error: $exception", Toast.LENGTH_LONG).show() }, - passedRoom = null + passedRoom = null, ) { room -> // Setup for screen capture intent launching. @@ -149,6 +148,8 @@ class CallActivity : ComponentActivity() { } } + // If we ever have a valid screen capture intent, start the screen capture track. + // Otherwise disable it. LaunchedEffect(enableScreenCapture) { val intent = enableScreenCapture @@ -195,12 +196,12 @@ class CallActivity : ComponentActivity() { val trackReferences = rememberTracks( sources = listOf( Track.Source.CAMERA, - Track.Source.SCREEN_SHARE + Track.Source.SCREEN_SHARE, ), usePlaceholders = setOf( Track.Source.CAMERA, ), - onlySubscribed = false + onlySubscribed = false, ) // Audience row to display all participants. @@ -241,22 +242,20 @@ class CallActivity : ComponentActivity() { horizontalArrangement = Arrangement.SpaceEvenly, verticalAlignment = Alignment.Bottom, ) { - val micResource = if (userEnabledMic) R.drawable.outline_mic_24 else R.drawable.outline_mic_off_24 ControlButton( resourceId = micResource, contentDescription = "Mic", - onClick = { userEnabledMic = !userEnabledMic } + onClick = { userEnabledMic = !userEnabledMic }, ) - val cameraResource = if (userEnabledCamera) R.drawable.outline_videocam_24 else R.drawable.outline_videocam_off_24 ControlButton( resourceId = cameraResource, contentDescription = "Camera", - onClick = { userEnabledCamera = !userEnabledCamera } + onClick = { userEnabledCamera = !userEnabledCamera }, ) ControlButton( @@ -271,7 +270,7 @@ class CallActivity : ComponentActivity() { cameraPosition = cameraPosition.flipped() cameraTrack.switchCamera(position = cameraPosition) - } + }, ) val screenShareResource = @@ -287,27 +286,27 @@ class CallActivity : ComponentActivity() { } else { enableScreenCapture = null } - } + }, ) var showMessageDialog by rememberSaveable { mutableStateOf(false) } ControlButton( resourceId = R.drawable.baseline_chat_24, contentDescription = "Send Message", - onClick = { showMessageDialog = true } + onClick = { showMessageDialog = true }, ) if (showMessageDialog) { SendMessageDialog( onDismissRequest = { showMessageDialog = false }, - onSendMessage = { /* TODO */ } + onSendMessage = { /* TODO */ }, ) } ControlButton( resourceId = R.drawable.ic_baseline_cancel_24, contentDescription = "Disconnect", - onClick = { finish() } + onClick = { finish() }, ) } } @@ -322,7 +321,7 @@ class CallActivity : ComponentActivity() { videoTrackPublishDefaults = VideoTrackPublishDefaults( videoEncoding = VideoPreset169.H720.encoding.copy(maxBitrate = 3_000_000), simulcast = true, - ) + ), ) return customizer(roomOptions) @@ -337,10 +336,10 @@ class CallActivity : ComponentActivity() { AudioDevice.BluetoothHeadset::class.java, AudioDevice.WiredHeadset::class.java, AudioDevice.Speakerphone::class.java, - AudioDevice.Earpiece::class.java + AudioDevice.Earpiece::class.java, ) - } - ) + }, + ), ) companion object { diff --git a/app/src/main/java/io/livekit/android/compose/meet/MainActivity.kt b/app/src/main/java/io/livekit/android/compose/meet/MainActivity.kt index cacd361..ab5ce20 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/MainActivity.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/MainActivity.kt @@ -80,7 +80,7 @@ class MainActivity : ComponentActivity() { token, e2eeKey, e2eeOn, - ) + ), ) } startActivity(intent) @@ -120,16 +120,16 @@ class MainActivity : ComponentActivity() { Surface( color = MaterialTheme.colorScheme.background, modifier = Modifier - .fillMaxSize() + .fillMaxSize(), ) { Box( modifier = Modifier - .verticalScroll(scrollState) + .verticalScroll(scrollState), ) { Column( horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier - .padding(10.dp) + .padding(10.dp), ) { Spacer(modifier = Modifier.height(50.dp)) Image( @@ -158,7 +158,7 @@ class MainActivity : ComponentActivity() { onValueChange = { e2eeKey = it }, label = { Text("E2EE Key") }, modifier = Modifier.fillMaxWidth(), - enabled = e2eeOn + enabled = e2eeOn, ) } @@ -166,13 +166,13 @@ class MainActivity : ComponentActivity() { Row( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.fillMaxWidth() + modifier = Modifier.fillMaxWidth(), ) { Text("Enable end-to-end encryption (E2EE)") Switch( checked = e2eeOn, onCheckedChange = { e2eeOn = it }, - modifier = Modifier.defaultMinSize(minHeight = 100.dp) + modifier = Modifier.defaultMinSize(minHeight = 100.dp), ) } @@ -196,4 +196,4 @@ class MainActivity : ComponentActivity() { } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/io/livekit/android/compose/meet/MainViewModel.kt b/app/src/main/java/io/livekit/android/compose/meet/MainViewModel.kt index b681304..ff5937f 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/MainViewModel.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/MainViewModel.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2024 LiveKit, Inc. + * + * 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 + * + * http://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 io.livekit.android.compose.meet import android.app.Application diff --git a/app/src/main/java/io/livekit/android/compose/meet/state/RememberPrimarySpeaker.kt b/app/src/main/java/io/livekit/android/compose/meet/state/RememberPrimarySpeaker.kt index 4c9e159..4565f97 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/state/RememberPrimarySpeaker.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/state/RememberPrimarySpeaker.kt @@ -35,21 +35,20 @@ import kotlinx.coroutines.flow.combine */ @Composable fun rememberPrimarySpeaker(room: Room): Participant { - var participantState by remember { mutableStateOf( calculatePrimarySpeaker( previousSpeaker = null, - room = room - ) + room = room, + ), ) } LaunchedEffect(room) { - combine(room::remoteParticipants.flow, room::activeSpeakers.flow) { remoteParticipants, activeSpeakers -> + combine(room::remoteParticipants.flow, room::activeSpeakers.flow) { _, _ -> participantState = calculatePrimarySpeaker( previousSpeaker = participantState, - room = room + room = room, ) } } @@ -58,7 +57,7 @@ fun rememberPrimarySpeaker(room: Room): Participant { private fun calculatePrimarySpeaker( previousSpeaker: Participant?, - room: Room + room: Room, ): Participant { val activeSpeakers = room.activeSpeakers val participantsList = room.remoteParticipants.values + room.localParticipant diff --git a/app/src/main/java/io/livekit/android/compose/meet/ui/ControlButton.kt b/app/src/main/java/io/livekit/android/compose/meet/ui/ControlButton.kt index 92f2629..995944a 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/ui/ControlButton.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/ui/ControlButton.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2024 LiveKit, Inc. + * + * 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 + * + * http://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 io.livekit.android.compose.meet.ui import androidx.compose.foundation.layout.padding @@ -10,16 +26,20 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp +import io.livekit.android.compose.meet.CallActivity private val controlSize = 40.dp private val controlPadding = 4.dp +/** + * A standardized button for displaying controls in the [CallActivity] + */ @Composable fun ControlButton( painter: Painter, contentDescription: String, onClick: () -> Unit, - modifier: Modifier = Modifier + modifier: Modifier = Modifier, ) { Surface( onClick = onClick, @@ -40,12 +60,12 @@ fun ControlButton( resourceId: Int, contentDescription: String, onClick: () -> Unit, - modifier: Modifier = Modifier + modifier: Modifier = Modifier, ) { ControlButton( painter = painterResource(id = resourceId), contentDescription = contentDescription, onClick = onClick, - modifier = modifier + modifier = modifier, ) -} \ No newline at end of file +} diff --git a/app/src/main/java/io/livekit/android/compose/meet/ui/PrimarySpeakerView.kt b/app/src/main/java/io/livekit/android/compose/meet/ui/PrimarySpeakerView.kt index d5ebcc5..7481f35 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/ui/PrimarySpeakerView.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/ui/PrimarySpeakerView.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2024 LiveKit, Inc. + * + * 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 + * + * http://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 io.livekit.android.compose.meet.ui import androidx.compose.runtime.Composable @@ -6,6 +22,9 @@ import io.livekit.android.compose.state.rememberParticipantTrackReferences import io.livekit.android.room.participant.Participant import io.livekit.android.room.track.Track +/** + * Handles finding the preferred track for a participant and displaying it. + */ @Composable fun PrimarySpeakerView( participant: Participant, @@ -23,6 +42,6 @@ fun PrimarySpeakerView( TrackItem( trackReference = trackToShow, - modifier = modifier + modifier = modifier, ) -} \ No newline at end of file +} diff --git a/app/src/main/java/io/livekit/android/compose/meet/ui/SendMessageDialog.kt b/app/src/main/java/io/livekit/android/compose/meet/ui/SendMessageDialog.kt index 5956503..fa2f7fe 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/ui/SendMessageDialog.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/ui/SendMessageDialog.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2024 LiveKit, Inc. + * + * 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 + * + * http://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 io.livekit.android.compose.meet.ui import androidx.compose.foundation.layout.fillMaxWidth @@ -18,7 +34,6 @@ fun SendMessageDialog( onDismissRequest: () -> Unit, onSendMessage: (String) -> Unit, ) { - var messageToSend by rememberSaveable { mutableStateOf("") } @@ -49,4 +64,4 @@ fun SendMessageDialog( }, containerColor = Color.Black, ) -} \ No newline at end of file +} diff --git a/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Color.kt b/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Color.kt index e83d55a..d003bd2 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Color.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Color.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2024 LiveKit, Inc. + * + * 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 + * + * http://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 io.livekit.android.compose.meet.ui.theme import androidx.compose.ui.graphics.Color diff --git a/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Theme.kt b/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Theme.kt index 2f906ed..9b74915 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Theme.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Theme.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2024 LiveKit, Inc. + * + * 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 + * + * http://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 io.livekit.android.compose.meet.ui.theme import android.app.Activity @@ -11,7 +27,6 @@ import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.LocalView import androidx.core.view.WindowCompat - private val DarkColorScheme = darkColorScheme( primary = BlueMain, primaryContainer = BlueMain, @@ -45,7 +60,7 @@ private val LightColorScheme = lightColorScheme( @Composable fun LKMeetAppTheme( darkTheme: Boolean = true, - content: @Composable () -> Unit + content: @Composable () -> Unit, ) { val colorScheme = when { darkTheme -> DarkColorScheme @@ -63,6 +78,6 @@ fun LKMeetAppTheme( MaterialTheme( colorScheme = colorScheme, typography = Typography, - content = content + content = content, ) -} \ No newline at end of file +} diff --git a/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Type.kt b/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Type.kt index 1d3cf41..b8e4e74 100644 --- a/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Type.kt +++ b/app/src/main/java/io/livekit/android/compose/meet/ui/theme/Type.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2024 LiveKit, Inc. + * + * 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 + * + * http://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 io.livekit.android.compose.meet.ui.theme import androidx.compose.material3.Typography @@ -13,8 +29,8 @@ val Typography = Typography( fontWeight = FontWeight.Normal, fontSize = 16.sp, lineHeight = 24.sp, - letterSpacing = 0.5.sp - ) + letterSpacing = 0.5.sp, + ), /* Other default text styles to override titleLarge = TextStyle( fontFamily = FontFamily.Default, @@ -30,5 +46,5 @@ val Typography = Typography( lineHeight = 16.sp, letterSpacing = 0.5.sp ) - */ -) \ No newline at end of file + */ +) diff --git a/app/src/test/java/io/livekit/android/compose/meet/ExampleUnitTest.kt b/app/src/test/java/io/livekit/android/compose/meet/ExampleUnitTest.kt deleted file mode 100644 index 1bcab33..0000000 --- a/app/src/test/java/io/livekit/android/compose/meet/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package io.livekit.android.compose.meet - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 20d87a7..a15679a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,38 @@ +@file:Suppress("UNUSED_EXPRESSION") + // Top-level build file where you can add configuration options common to all sub-projects/modules. @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed plugins { alias(libs.plugins.androidApplication) apply false alias(libs.plugins.kotlinAndroid) apply false + id("com.diffplug.spotless") version "6.19.0" apply false } -true // Needed to make the Suppress annotation work for the plugins block \ No newline at end of file +true // Needed to make the Suppress annotation work for the plugins block + +subprojects { + apply(plugin = "com.diffplug.spotless") + configure { + kotlin { + target("**/*.kt") + targetExclude("$buildDir/**/*.kt") + + ktlint() + licenseHeaderFile(rootProject.file("LicenseHeaderFile.txt")) + } + java { + target("**/*.java") + targetExclude("$buildDir/**/*.java") + // apply a specific flavor of google-java-format + googleJavaFormat() + // fix formatting of type annotations + formatAnnotations() + removeUnusedImports() + toggleOffOn() + licenseHeaderFile(rootProject.file("LicenseHeaderFile.txt")) + } + kotlinGradle { + target("*.gradle.kts") + ktlint() + } + } +} \ No newline at end of file