作者 liyan

DialogTitle新增是否隐藏title

... ... @@ -398,6 +398,11 @@ class VerifyCameraActivity :
}
}
override fun onDestroy() {
super.onDestroy()
cameraExecutor.shutdown()
}
companion object {
private const val TAG = "CameraXBasic"
... ...
... ... @@ -47,6 +47,7 @@ class AcademicFeedbackActivity :
.setImageTitle(R.mipmap.jiangshipingxi_bg)
.setInfo("烦得很工蜂都是第三方还是对方号是否得换个始发地和啥地方还是对方恢复单身")
.hideCompleteButton(true)
.setTitleIsVisible(false)
.show()
}
... ...
... ... @@ -10,6 +10,7 @@ import android.text.style.ForegroundColorSpan
import android.view.LayoutInflater
import android.view.View
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.DialogTitleBinding
import com.br_technology.securitytrain_master.expand.dp2px
... ... @@ -73,13 +74,21 @@ class DialogTitle(context: Context) : Dialog(context, R.style.UserDefaultDialog)
return this
}
fun setTitleIsVisible(isVisible: Boolean) : DialogTitle {
if (isVisible) {
binding.title.isVisible = true
}else{
binding.title.isVisible = false
}
return this
}
fun setImageTitle(ivTitle: Int): DialogTitle {
binding.ivTitle.setImageResource(ivTitle)
return this
}
fun hideCompleteButton(boolean: Boolean): DialogTitle {
if (boolean) {
binding.complete.visibility = View.GONE
... ...
... ... @@ -35,7 +35,9 @@
android:id="@+id/info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:gravity="center"
android:text="共9道题"
... ...