|
|
@@ -3,6 +3,7 @@ package com.yc.module_live.view.live.livepopup
|
|
|
//import com.yc.module_live.view.live.beauty.BeautyViewDialog
|
|
|
import android.content.Intent
|
|
|
import android.net.Uri
|
|
|
+import android.util.Log
|
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
|
import com.hunliji.hlj_dialog.showDialogBottom
|
|
|
@@ -324,33 +325,49 @@ abstract class TopLivePopupFragment<T : BaseRoomVm> : TopLiveBaseFragment<T>(),
|
|
|
}
|
|
|
|
|
|
fun openGameWebView(game: Game) {
|
|
|
- when (game.openType) {
|
|
|
- GameOpenType.APP_H5.type -> {
|
|
|
- launchActivity<WebViewActivity> {
|
|
|
- putExtra(WebViewVm.H5_URL, game.url)
|
|
|
- putExtra(WebViewVm.H5_TITLE, game.name)
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- GameOpenType.BROWSER.type -> {
|
|
|
- val intent = Intent(Intent.ACTION_VIEW, Uri.parse(game.url))
|
|
|
- startActivity(intent)
|
|
|
- }
|
|
|
+ val token = LiveSession.getUserToken()
|
|
|
+ val baseUrl = game.url?.trim()?.trim('`')?.trim() ?: return
|
|
|
+ val gameUrl = Uri.parse(baseUrl).buildUpon()
|
|
|
+ .appendQueryParameter("gtoken", token)
|
|
|
+ .build()
|
|
|
+ .toString()
|
|
|
+ Log.d("openType", "openType=${game.openType}")
|
|
|
+ Log.d("openGameWebView", "openGameWebView: $gameUrl")
|
|
|
|
|
|
- GameOpenType.APP_ALL.type -> {
|
|
|
- launchActivity<WebViewJsActivity> {
|
|
|
- putExtra(WebViewVm.H5_URL, game.url)
|
|
|
- putExtra(WebViewVm.H5_TITLE, game.name)
|
|
|
- }
|
|
|
- }
|
|
|
+ val roomGameBottomDialog = RoomGameBottomDialog(requireActivity(), game.url)
|
|
|
+ requireContext().showDialogBottom(roomGameBottomDialog, init = {
|
|
|
+ showBehind(false)
|
|
|
+ })
|
|
|
|
|
|
- GameOpenType.APP_HALF.type -> {
|
|
|
- val roomGameBottomDialog = RoomGameBottomDialog(requireActivity(), game.url)
|
|
|
- requireContext().showDialogBottom(roomGameBottomDialog, init = {
|
|
|
- showBehind(false)
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ // when (game.openType) {
|
|
|
+ // GameOpenType.APP_H5.type -> {
|
|
|
+ // launchActivity<WebViewActivity> {
|
|
|
+ // putExtra(WebViewVm.H5_URL, game.url)
|
|
|
+ // putExtra(WebViewVm.H5_TITLE, game.name)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // GameOpenType.BROWSER.type -> {
|
|
|
+ // val intent = Intent(Intent.ACTION_VIEW, Uri.parse(game.url))
|
|
|
+ // startActivity(intent)
|
|
|
+ // }
|
|
|
+
|
|
|
+ // GameOpenType.APP_ALL.type -> {
|
|
|
+ // launchActivity<WebViewJsActivity> {
|
|
|
+ // putExtra(WebViewVm.H5_URL, game.url)
|
|
|
+ // putExtra(WebViewVm.H5_TITLE, game.name)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // GameOpenType.APP_HALF.type -> {
|
|
|
+ // val roomGameBottomDialog = RoomGameBottomDialog(requireActivity(), game.url)
|
|
|
+ // requireContext().showDialogBottom(roomGameBottomDialog, init = {
|
|
|
+ // showBehind(false)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
//用户列表
|