Skip to content

Commit

Permalink
Merge pull request #45 from MJLblabla/main
Browse files Browse the repository at this point in the history
优化不能activity xml 预览bug
  • Loading branch information
MJLblabla authored Dec 5, 2022
2 parents 1adc01c + 31e7d99 commit b97391c
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 20 deletions.
Binary file modified app-sdk/qlive-sdk-uikit/qlive-uikit-1.0.5.aar
Binary file not shown.
14 changes: 10 additions & 4 deletions app/src/main/res/layout/custom_layout_ktv_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
tools:context=".RoomPushActivity">
tools:context=".DemoSelectActivity">

<!-- 被邀请监听 功能组件-->
<com.qlive.uikitlinkmic.FuncCPTBeInvitedLinkMicMonitor
android:layout_width="0dp"
android:layout_height="0dp" />
android:layout_height="0dp"
android:visibility="gone"
/>
<!-- 房间状态变化监听 功能组件-->
<com.qlive.uikit.component.FuncCPTRoomStatusMonitor
android:layout_width="0dp"
android:layout_height="0dp" />
android:layout_height="0dp"
android:visibility="gone"
/>
<!-- activity默认事件虚拟拦截 功能组件-->
<com.qlive.uikit.component.FuncCPTDefaultKeyDownMonitor
android:layout_width="0dp"
android:layout_height="0dp" />
android:layout_height="0dp"
android:visibility="gone"
/>

<com.qlive.uikit.component.TouchEventBusViewPager
android:layout_width="match_parent"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/custom_layout_ktv_pusher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
tools:context=".RoomPushActivity">
tools:context=".DemoSelectActivity">

<!-- 用户申请连麦监听 功能组件-->
<com.qlive.uikitlinkmic.FuncCPTLinkMicApplyMonitor
Expand Down Expand Up @@ -50,6 +50,7 @@
android:id="@+id/preTextureView"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<!-- pk预览-->
<com.qlive.uikitpk.PKAnchorPreview
android:layout_width="match_parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,38 @@ package com.qlive.rtclive

import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.qiniu.droid.rtc.QNRenderView
import com.qiniu.droid.rtc.QNTextureView

open class QPushTextureView : FrameLayout, RTCRenderView {
private var renderView: QNTextureView? = null

constructor(context: Context) : this(context, null)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
renderView = QNTextureView(context)
addView(
renderView,
ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
)
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
){
}

override fun getView(): View {
return this
}

override fun getQNRender(): QNTextureView {
if(renderView==null){
renderView = QNTextureView(context)
addView(
renderView,
ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
)
}
return renderView!!
}
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class DanmakuTrackManagerView : QKitLinearLayout {

override fun onFinishInflate() {
super.onFinishInflate()
kitContext?:return
for (i in 0 until mDanmukeViewSlot.getIDanmakuViewCount()) {
val itemView = mDanmukeViewSlot.createView(
kitContext!!.lifecycleOwner,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
package com.qlive.uikit.component

import android.content.Context
import android.util.AttributeSet
import android.view.KeyEvent
import com.qlive.roomservice.QRoomService
import com.qlive.uikitcore.QLiveFuncComponent

abstract class OnKeyDownMonitor(context: Context) : QLiveFuncComponent(context, null) {
abstract class OnKeyDownMonitor : QLiveFuncComponent {
constructor(context: Context) : this(context, null)
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
abstract fun onActivityKeyDown(keyCode: Int, event: KeyEvent): Boolean
}

/**
* activity默认事件虚拟拦截 功能组件
* @param context
*/
class FuncCPTDefaultKeyDownMonitor(context: Context) :OnKeyDownMonitor(context){
class FuncCPTDefaultKeyDownMonitor :OnKeyDownMonitor{
constructor(context: Context) : this(context, null)
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
override fun onActivityKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK
&& client?.getService(QRoomService::class.java)?.roomInfo != null
Expand Down
7 changes: 5 additions & 2 deletions qlive-uikit/src/main/res/layout/kit_activity_room_pusher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<com.qlive.rtclive.QPushTextureView
android:id="@+id/preTextureView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
tools:ignore="UselessParent"
/>

<!-- pk预览-->
<com.qlive.uikitpk.PKAnchorPreview
android:layout_width="match_parent"
Expand All @@ -70,7 +73,7 @@
android:orientation="vertical"
android:padding="10dp"
android:src="@mipmap/kit_ic_close_white"
tools:ignore="MissingDefaultResource"
tools:ignore="MissingDefaultResource,SpeakableTextPresentCheck,SpeakableTextPresentCheck,SpeakableTextPresentCheck,SpeakableTextPresentCheck,SpeakableTextPresentCheck"
tools:visibility="visible" />

</com.qlive.uikit.component.FrameLayoutBgCover>
Expand Down

0 comments on commit b97391c

Please sign in to comment.