|
@@ -4,6 +4,7 @@ import android.graphics.Rect
|
|
import android.text.TextUtils
|
|
import android.text.TextUtils
|
|
import android.view.View
|
|
import android.view.View
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
|
|
+import android.widget.Toast
|
|
import androidx.constraintlayout.widget.ConstraintLayout
|
|
import androidx.constraintlayout.widget.ConstraintLayout
|
|
import androidx.fragment.app.activityViewModels
|
|
import androidx.fragment.app.activityViewModels
|
|
import androidx.lifecycle.lifecycleScope
|
|
import androidx.lifecycle.lifecycleScope
|
|
@@ -327,20 +328,26 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
}
|
|
}
|
|
|
|
|
|
fun openGameDialog() {
|
|
fun openGameDialog() {
|
|
-
|
|
|
|
SwagoRoomManager.iRoomInfo?.let {
|
|
SwagoRoomManager.iRoomInfo?.let {
|
|
- val download = checkGameVersion(
|
|
|
|
- it.getGameType().toString(),
|
|
|
|
- it.getGameDownLoadUrl(),
|
|
|
|
- it.getGameVersion().toString()
|
|
|
|
- )
|
|
|
|
- if (download) {
|
|
|
|
- gameDialog =
|
|
|
|
- GamePlayDialog.newInstance("file://" + UrlConstant.appGameRootPath + File.separator + it.getGameType() + File.separator + "index.html")
|
|
|
|
- } else {
|
|
|
|
- gameDialog = GamePlayDialog.newInstance(it.getGameUrl())
|
|
|
|
|
|
+ when(it.getGameType()){
|
|
|
|
+ 1,2 -> {
|
|
|
|
+ val download = checkGameVersion(
|
|
|
|
+ it.getGameType().toString(),
|
|
|
|
+ it.getGameDownLoadUrl(),
|
|
|
|
+ it.getGameVersion().toString()
|
|
|
|
+ )
|
|
|
|
+ if (download) {
|
|
|
|
+ gameDialog =
|
|
|
|
+ GamePlayDialog.newInstance("file://" + UrlConstant.appGameRootPath + File.separator + it.getGameType() + File.separator + "index.html")
|
|
|
|
+ } else {
|
|
|
|
+ gameDialog = GamePlayDialog.newInstance(it.getGameUrl())
|
|
|
|
+ }
|
|
|
|
+ gameDialog?.show(childFragmentManager, "GamePlayDialog")
|
|
|
|
+ }
|
|
|
|
+ else -> {
|
|
|
|
+ Toast.makeText(AppContext.getContext(), AppContext.getContext().resources.getString(R.string.please_update), Toast.LENGTH_SHORT).show()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- gameDialog?.show(childFragmentManager, "GamePlayDialog")
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|