Skip to content

Commit

Permalink
Merge pull request #715 from 100mslive/dev
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
AniketSK authored May 20, 2024
2 parents 6d88939 + 153f20f commit bad37dd
Show file tree
Hide file tree
Showing 15 changed files with 344 additions and 267 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies {
implementation "live.100ms:room-kit:$HMS_ROOM_KIT_VERSION"

//100ms noise cancellation dep
def hmsVersion = "2.9.55"
def hmsVersion = "2.9.57"
implementation "live.100ms:hms-noise-cancellation-android:$hmsVersion"

// Navigation
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
<!--Permissions needed for Android 14 -->
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
100MS_APP_VERSION_CODE=371
100MS_APP_VERSION_NAME=5.0.5
100MS_APP_VERSION_CODE=373
100MS_APP_VERSION_NAME=5.0.7
hmsRoomKitGroup=live.100ms
HMS_ROOM_KIT_VERSION=1.2.11
HMS_ROOM_KIT_VERSION=1.2.12
android.suppressUnsupportedCompileSdk=33
2 changes: 1 addition & 1 deletion room-kit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies {
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
def hmsVersion = "2.9.55"
def hmsVersion = "2.9.57"
implementation "com.otaliastudios:zoomlayout:1.9.0"
// To add dependencies of specific module
implementation "live.100ms:android-sdk:$hmsVersion"
Expand Down
99 changes: 99 additions & 0 deletions room-kit/src/main/java/live/hms/roomkit/ui/meeting/AudioItem.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package live.hms.roomkit.ui.meeting

import android.graphics.PorterDuff
import android.os.Build
import android.view.View
import androidx.annotation.DrawableRes
import androidx.core.text.bold
import androidx.core.text.buildSpannedString
import com.xwray.groupie.viewbinding.BindableItem
import live.hms.roomkit.R
import live.hms.roomkit.databinding.ItemDeviceDetailBinding
import live.hms.roomkit.drawableEnd
import live.hms.roomkit.drawableStart
import live.hms.roomkit.setDrawables
import live.hms.roomkit.setOnSingleClickListener
import live.hms.roomkit.ui.theme.HMSPrebuiltTheme
import live.hms.roomkit.ui.theme.getColorOrDefault
import live.hms.video.audio.HMSAudioManager
import live.hms.video.audio.manager.AudioManagerUtil
import kotlin.math.roundToInt

class AudioItem(
private var title: String,
private var subTitle: String? = null,
private val isSelected: Boolean,
@DrawableRes private val drawableRes: Int,
val type: HMSAudioManager.AudioDevice = HMSAudioManager.AudioDevice.AUTOMATIC,
val id: Int? = null,
private val onClick: (HMSAudioManager.AudioDevice, Int?) -> Unit,

) : BindableItem<ItemDeviceDetailBinding>() {


override fun bind(binding: ItemDeviceDetailBinding, position: Int) {
if (isSelected) binding.audioText.setDrawables(
end = binding.audioText.context?.getDrawable(
R.drawable.tick
)
)
else binding.audioText.setDrawables(end = null)

binding.audioText.setDrawables(
start = binding.audioText.context?.getDrawable(
drawableRes
)
)


binding.audioText.text = buildSpannedString {
append(title)
if (subTitle.isNullOrEmpty().not() && type.toString() == AudioManagerUtil.AudioDevice.BLUETOOTH.toString()) {
bold { append(" ( ${subTitle.orEmpty()} )") }
}
}

binding.root.setOnSingleClickListener {
onClick.invoke(type, id)
}


binding.audioText.setTextColor(
getColorOrDefault(
HMSPrebuiltTheme.getColours()?.onSurfaceHigh,
HMSPrebuiltTheme.getDefaults().onsurface_high_emp
)
)

binding.audioText.drawableEnd?.setTint(
getColorOrDefault(
HMSPrebuiltTheme.getColours()?.onSurfaceHigh,
HMSPrebuiltTheme.getDefaults().onsurface_high_emp
)
)

binding.audioText.drawableStart?.setTint(
getColorOrDefault(
HMSPrebuiltTheme.getColours()?.onSurfaceHigh,
HMSPrebuiltTheme.getDefaults().onsurface_high_emp
)
)




binding.border4.setBackgroundColor(
getColorOrDefault(
HMSPrebuiltTheme.getColours()?.borderDefault,
HMSPrebuiltTheme.getDefaults().border_bright
)
)
}


override fun getLayout(): Int = R.layout.item_device_detail


override fun initializeViewBinding(view: View) = ItemDeviceDetailBinding.bind(view)

}
Loading

0 comments on commit bad37dd

Please sign in to comment.