Skip to content

Commit

Permalink
Repo cleanup and ci (#2)
Browse files Browse the repository at this point in the history
* Repo cleanup and ci

* More cleanup
  • Loading branch information
davidliu committed Mar 27, 2024
1 parent a3ae122 commit ad68b08
Show file tree
Hide file tree
Showing 20 changed files with 341 additions and 94 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use https://github.com/nektos/act to test github actions locally.
59 changes: 59 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -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

16 changes: 16 additions & 0 deletions LicenseHeaderFile.txt
Original file line number Diff line number Diff line change
@@ -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.
*/

3 changes: 1 addition & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,11 @@ dependencies {

implementation(libs.accompanist.permissions)


testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)
}
}

This file was deleted.

19 changes: 17 additions & 2 deletions app/src/main/java/io/livekit/android/compose/meet/Application.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
/*
* 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
import io.livekit.android.LiveKit
import io.livekit.android.util.LoggingLevel
import timber.log.Timber.DebugTree


class Application : android.app.Application() {

override fun onCreate() {
Expand All @@ -16,4 +31,4 @@ class Application : android.app.Application() {
// Change logging level, defaults to OFF
LiveKit.loggingLevel = LoggingLevel.INFO
}
}
}
35 changes: 17 additions & 18 deletions app/src/main/java/io/livekit/android/compose/meet/CallActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class CallActivity : ComponentActivity() {
Content(
url = args.url,
token = args.token,
e2eeOptions = e2eeOptions
e2eeOptions = e2eeOptions,
)
}
}
Expand All @@ -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) }
Expand All @@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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(
Expand All @@ -271,7 +270,7 @@ class CallActivity : ComponentActivity() {

cameraPosition = cameraPosition.flipped()
cameraTrack.switchCamera(position = cameraPosition)
}
},
)

val screenShareResource =
Expand All @@ -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() },
)
}
}
Expand All @@ -322,7 +321,7 @@ class CallActivity : ComponentActivity() {
videoTrackPublishDefaults = VideoTrackPublishDefaults(
videoEncoding = VideoPreset169.H720.encoding.copy(maxBitrate = 3_000_000),
simulcast = true,
)
),
)

return customizer(roomOptions)
Expand All @@ -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 {
Expand Down
Loading

0 comments on commit ad68b08

Please sign in to comment.