Committed by
GitHub
Fix sample app speaker indicator appearance (#205)
正在显示
4 个修改的文件
包含
25 行增加
和
10 行删除
| @@ -30,6 +30,7 @@ class ParticipantItem( | @@ -30,6 +30,7 @@ class ParticipantItem( | ||
| 30 | override fun initializeViewBinding(view: View): ParticipantItemBinding { | 30 | override fun initializeViewBinding(view: View): ParticipantItemBinding { |
| 31 | val binding = ParticipantItemBinding.bind(view) | 31 | val binding = ParticipantItemBinding.bind(view) |
| 32 | room.initVideoRenderer(binding.renderer) | 32 | room.initVideoRenderer(binding.renderer) |
| 33 | + | ||
| 33 | return binding | 34 | return binding |
| 34 | } | 35 | } |
| 35 | 36 | ||
| @@ -168,17 +169,9 @@ private fun View.visibleOrInvisible(visible: Boolean) { | @@ -168,17 +169,9 @@ private fun View.visibleOrInvisible(visible: Boolean) { | ||
| 168 | } | 169 | } |
| 169 | 170 | ||
| 170 | private fun showFocus(binding: ParticipantItemBinding) { | 171 | private fun showFocus(binding: ParticipantItemBinding) { |
| 171 | - val border = GradientDrawable() | ||
| 172 | - border.setColor(Color.BLUE) | ||
| 173 | - border.setStroke(8, -0x1000000) | ||
| 174 | - binding.root.setPadding(16,16,16,16) | ||
| 175 | - binding.root.background = border | 172 | + binding.speakingIndicator.visibility = View.VISIBLE |
| 176 | } | 173 | } |
| 177 | 174 | ||
| 178 | private fun hideFocus(binding: ParticipantItemBinding) { | 175 | private fun hideFocus(binding: ParticipantItemBinding) { |
| 179 | - val border = GradientDrawable() | ||
| 180 | - border.setColor(Color.TRANSPARENT) | ||
| 181 | - border.setStroke(0, -0x1000000) | ||
| 182 | - binding.root.setPadding(0,0,0,0) | ||
| 183 | - binding.root.background = border | 176 | + binding.speakingIndicator.visibility = View.INVISIBLE |
| 184 | } | 177 | } |
| @@ -36,6 +36,13 @@ | @@ -36,6 +36,13 @@ | ||
| 36 | android:src="@drawable/wifi_strength_1" | 36 | android:src="@drawable/wifi_strength_1" |
| 37 | android:visibility="invisible" | 37 | android:visibility="invisible" |
| 38 | app:tint="#FF0000" /> | 38 | app:tint="#FF0000" /> |
| 39 | + | ||
| 40 | + <ImageView | ||
| 41 | + android:id="@+id/speaking_indicator" | ||
| 42 | + android:layout_width="match_parent" | ||
| 43 | + android:layout_height="match_parent" | ||
| 44 | + android:src="@drawable/speaker_indicator" | ||
| 45 | + android:visibility="invisible" /> | ||
| 39 | </FrameLayout> | 46 | </FrameLayout> |
| 40 | 47 | ||
| 41 | <FrameLayout | 48 | <FrameLayout |
| @@ -35,6 +35,13 @@ | @@ -35,6 +35,13 @@ | ||
| 35 | android:src="@drawable/wifi_strength_1" | 35 | android:src="@drawable/wifi_strength_1" |
| 36 | android:visibility="invisible" | 36 | android:visibility="invisible" |
| 37 | app:tint="#FF0000" /> | 37 | app:tint="#FF0000" /> |
| 38 | + | ||
| 39 | + <ImageView | ||
| 40 | + android:id="@+id/speaking_indicator" | ||
| 41 | + android:layout_width="match_parent" | ||
| 42 | + android:layout_height="match_parent" | ||
| 43 | + android:src="@drawable/speaker_indicator" | ||
| 44 | + android:visibility="invisible" /> | ||
| 38 | </FrameLayout> | 45 | </FrameLayout> |
| 39 | 46 | ||
| 40 | <FrameLayout | 47 | <FrameLayout |
-
请 注册 或 登录 后发表评论