diff --git a/androidapp/app/src/main/java/com/droidknights/app2020/binding/ViewBinding.kt b/androidapp/app/src/main/java/com/droidknights/app2020/binding/ViewBinding.kt index 63315a0..ff7b560 100644 --- a/androidapp/app/src/main/java/com/droidknights/app2020/binding/ViewBinding.kt +++ b/androidapp/app/src/main/java/com/droidknights/app2020/binding/ViewBinding.kt @@ -1,5 +1,6 @@ package com.droidknights.app2020.binding +import android.view.View import android.webkit.WebView import android.widget.ImageView import android.widget.TextView @@ -130,4 +131,13 @@ fun ImageView.bindSponsorLogo(@DrawableRes imageResId: Int?) { @BindingAdapter("isActiveEvent") fun ImageView.isActiveEvent(_isActivated: Boolean?) { this.isActivated = _isActivated ?: false -} \ No newline at end of file +} + +@BindingAdapter(value = ["onAir"]) +fun setOnAir(imageView: ImageView, onAir: Boolean) { + if (onAir) { + imageView.visibility = View.VISIBLE + } else { + imageView.visibility = View.INVISIBLE + } +} diff --git a/androidapp/app/src/main/java/com/droidknights/app2020/data/Session.kt b/androidapp/app/src/main/java/com/droidknights/app2020/data/Session.kt index 49876f4..cefc138 100644 --- a/androidapp/app/src/main/java/com/droidknights/app2020/data/Session.kt +++ b/androidapp/app/src/main/java/com/droidknights/app2020/data/Session.kt @@ -10,5 +10,6 @@ data class Session( val speakerName: String? = "", val videoLink: String? = "", val qnaLink: String? = "", - val speaker: List? = null + val speaker: List? = null, + var isLive:Boolean = false ) \ No newline at end of file diff --git a/androidapp/app/src/main/java/com/droidknights/app2020/ui/model/Mapper.kt b/androidapp/app/src/main/java/com/droidknights/app2020/ui/model/Mapper.kt index aec1264..6252e64 100644 --- a/androidapp/app/src/main/java/com/droidknights/app2020/ui/model/Mapper.kt +++ b/androidapp/app/src/main/java/com/droidknights/app2020/ui/model/Mapper.kt @@ -10,7 +10,8 @@ fun Session.asUiModel() = title = title, time = time, tag = tag?.map { Tag(it, true) }, - speakerName = speakerName ?: "" + speakerName = speakerName ?: "", + isLive = isLive ) fun Sponsor.asUiModel() = diff --git a/androidapp/app/src/main/java/com/droidknights/app2020/ui/model/UiSessionModel.kt b/androidapp/app/src/main/java/com/droidknights/app2020/ui/model/UiSessionModel.kt index 4fd5625..4a916be 100644 --- a/androidapp/app/src/main/java/com/droidknights/app2020/ui/model/UiSessionModel.kt +++ b/androidapp/app/src/main/java/com/droidknights/app2020/ui/model/UiSessionModel.kt @@ -7,5 +7,6 @@ data class UiSessionModel( val title: String, val time: String, val tag: List?, - val speakerName: String + val speakerName: String, + val isLive:Boolean ) diff --git a/androidapp/app/src/main/res/drawable/ic_onair.png b/androidapp/app/src/main/res/drawable/ic_onair.png new file mode 100644 index 0000000..7b4e3d7 Binary files /dev/null and b/androidapp/app/src/main/res/drawable/ic_onair.png differ diff --git a/androidapp/app/src/main/res/layout/item_session.xml b/androidapp/app/src/main/res/layout/item_session.xml index 1684030..6062260 100644 --- a/androidapp/app/src/main/res/layout/item_session.xml +++ b/androidapp/app/src/main/res/layout/item_session.xml @@ -8,6 +8,7 @@ + @@ -16,12 +17,12 @@ + + + + type="com.droidknights.app2020.ui.schedule.Sched0uleEmptyViewModel" />