-
Notifications
You must be signed in to change notification settings - Fork 22
Dev/2.8.120 #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Loren-Wang
wants to merge
12
commits into
AgoraIO-Community:feature/2.8.120
Choose a base branch
from
Loren-Wang:dev/2.8.120
base: feature/2.8.120
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dev/2.8.120 #75
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8a33c79
新增资源文件
Loren-Wang 2327a42
弹窗以及吐司调整
Loren-Wang 64609bd
新增rtt相关组件
Loren-Wang 6df296f
添加rtt管理类以及入口修改
Loren-Wang 2853c12
修改rtt的proto报错
Loren-Wang 29caf84
widget新增
Loren-Wang b6e3552
rtt逻辑调整
Loren-Wang 5fa522c
ui调整
Loren-Wang a09136c
接口请求调整
Loren-Wang 2fbbbd3
调整弹窗
Loren-Wang 20f3a05
初始化调整
Loren-Wang 2024a1b
调整代码格式
Loren-Wang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
AgoraCloudScene/src/main/java/io/agora/online/component/FcrRttToolBoxComponent.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package io.agora.online.component | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.core.content.ContextCompat | ||
import io.agora.agoraeducore.core.internal.framework.impl.managers.AgoraWidgetActiveObserver | ||
import io.agora.agoraeducore.core.internal.framework.impl.managers.AgoraWidgetRoomPropsUpdateReq | ||
import io.agora.online.component.common.AbsAgoraEduComponent | ||
import io.agora.online.component.common.IAgoraUIProvider | ||
import io.agora.online.databinding.FcrOnlineEduRttComponentBinding | ||
import io.agora.online.options.AgoraEduOptionsComponent | ||
import io.agora.online.options.AgoraEduRttOptionsComponent | ||
import io.agora.online.widget.FcrWidgetManager.WIDGETS_RTT_ID | ||
import io.agora.online.widget.rtt.FcrRttToolBoxWidget | ||
|
||
class FcrRttToolBoxComponent : AbsAgoraEduComponent { | ||
constructor(context: Context) : super(context) | ||
constructor(context: Context, attr: AttributeSet) : super(context, attr) | ||
constructor(context: Context, attr: AttributeSet, defStyleAttr: Int) : super(context, attr, defStyleAttr) | ||
|
||
|
||
private var binding: FcrOnlineEduRttComponentBinding = FcrOnlineEduRttComponentBinding.inflate(LayoutInflater.from(context), this, true) | ||
|
||
/** | ||
* widget插件 | ||
*/ | ||
private var widget: FcrRttToolBoxWidget? = null | ||
|
||
/** | ||
* 界面上设置好的布局 | ||
*/ | ||
private var conversionStatusView: ViewGroup? = null | ||
private var subtitleView: AgoraEduRttOptionsComponent? = null | ||
private var agoraEduOptionsComponent: AgoraEduOptionsComponent? = null | ||
|
||
/** | ||
* 插件注册监听 | ||
*/ | ||
private val widgetActiveObserver = object : AgoraWidgetActiveObserver { | ||
override fun onWidgetActive(widgetId: String) { | ||
if (widget == null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. widget一直没有赋值操作 |
||
val widgetConfig = eduContext?.widgetContext()?.getWidgetConfig(widgetId) | ||
widgetConfig?.let { config -> | ||
widget = eduContext?.widgetContext()?.create(config) as FcrRttToolBoxWidget? | ||
widget?.init(binding.root, agoraUIProvider, agoraEduOptionsComponent!!, conversionStatusView!!, subtitleView!!) | ||
} | ||
} | ||
} | ||
|
||
override fun onWidgetInActive(widgetId: String) { | ||
ContextCompat.getMainExecutor(binding.root.context).execute { widget?.release() } | ||
} | ||
} | ||
|
||
/** | ||
* 重置工具准提 | ||
*/ | ||
fun resetEduRttToolBoxStatus() { | ||
widget?.resetEduRttToolBoxStatus() | ||
} | ||
|
||
fun initView( | ||
agoraUIProvider: IAgoraUIProvider, agoraEduOptionsComponent: AgoraEduOptionsComponent, conversionStatusView: ViewGroup, | ||
subtitleView: AgoraEduRttOptionsComponent, | ||
) { | ||
super.initView(agoraUIProvider) | ||
this.agoraEduOptionsComponent = agoraEduOptionsComponent | ||
this.conversionStatusView = conversionStatusView | ||
this.subtitleView = subtitleView | ||
eduContext?.widgetContext()?.addWidgetActiveObserver(widgetActiveObserver, WIDGETS_RTT_ID) | ||
eduContext?.widgetContext()?.setWidgetActive(WIDGETS_RTT_ID, AgoraWidgetRoomPropsUpdateReq(state = 1)) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protobuf 不需要重复引用,底层core已经依赖了,可以直接使用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
底层并没有依赖,无法使用