|
@@ -8,6 +8,7 @@ import android.view.View
|
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
|
import androidx.annotation.RequiresApi
|
|
import androidx.annotation.RequiresApi
|
|
|
import androidx.appcompat.widget.AppCompatImageView
|
|
import androidx.appcompat.widget.AppCompatImageView
|
|
|
|
|
+import androidx.appcompat.widget.AppCompatTextView
|
|
|
import androidx.fragment.app.DialogFragment
|
|
import androidx.fragment.app.DialogFragment
|
|
|
import com.bumptech.glide.Glide
|
|
import com.bumptech.glide.Glide
|
|
|
import com.gyf.immersionbar.BarHide
|
|
import com.gyf.immersionbar.BarHide
|
|
@@ -26,10 +27,12 @@ class CountdownDialog : DialogFragment() {
|
|
|
|
|
|
|
|
private lateinit var rxTimer: RxTimer
|
|
private lateinit var rxTimer: RxTimer
|
|
|
private var url = ""
|
|
private var url = ""
|
|
|
|
|
+ private var title: String = ""
|
|
|
private var gameImage: AppCompatImageView? = null
|
|
private var gameImage: AppCompatImageView? = null
|
|
|
private var imageCountdown: AppCompatImageView? = null
|
|
private var imageCountdown: AppCompatImageView? = null
|
|
|
var onDialogClickListener: ((bean: String) -> Unit)? = null
|
|
var onDialogClickListener: ((bean: String) -> Unit)? = null
|
|
|
private var loadingImage: AppCompatImageView? = null
|
|
private var loadingImage: AppCompatImageView? = null
|
|
|
|
|
+ private var tvTitle: AppCompatTextView? = null
|
|
|
private var countdown = false
|
|
private var countdown = false
|
|
|
private var loadingOver = false
|
|
private var loadingOver = false
|
|
|
|
|
|
|
@@ -39,8 +42,9 @@ class CountdownDialog : DialogFragment() {
|
|
|
dialog?.setCanceledOnTouchOutside(true)
|
|
dialog?.setCanceledOnTouchOutside(true)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- fun setContentBackground(url: String) {
|
|
|
|
|
|
|
+ fun setContentBackground(url: String, title: String) {
|
|
|
this.url = url
|
|
this.url = url
|
|
|
|
|
+ this.title = title
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override fun onStart() {
|
|
override fun onStart() {
|
|
@@ -72,6 +76,8 @@ class CountdownDialog : DialogFragment() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private fun findId(rootView: View) {
|
|
private fun findId(rootView: View) {
|
|
|
|
|
+ tvTitle = rootView.findViewById(R.id.tvTitle)
|
|
|
|
|
+ tvTitle?.text = title
|
|
|
gameImage = rootView.findViewById(R.id.gameImage)
|
|
gameImage = rootView.findViewById(R.id.gameImage)
|
|
|
ImgUtil.loadGameBackground(requireActivity(), url, gameImage!!)
|
|
ImgUtil.loadGameBackground(requireActivity(), url, gameImage!!)
|
|
|
imageCountdown = rootView.findViewById(R.id.imageCountdown)
|
|
imageCountdown = rootView.findViewById(R.id.imageCountdown)
|