修复部分ui上的问题
This commit is contained in:
parent
9dda10f1d4
commit
a9e71e277e
|
|
@ -1,15 +1,21 @@
|
||||||
package com.cheng.blzb.ui.fragment.mine.about
|
package com.cheng.blzb.ui.fragment.mine.about
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.view.MotionEvent
|
||||||
import com.cheng.blzb.databinding.FragmentAboutBinding
|
import com.cheng.blzb.databinding.FragmentAboutBinding
|
||||||
import com.cheng.blzb.ui.dialog.PopupDialog
|
import com.cheng.blzb.ui.dialog.PopupDialog
|
||||||
import com.cheng.blzb.utils.UrlHelper
|
import com.cheng.blzb.utils.UrlHelper
|
||||||
|
import com.example.base.common.RxCountDown
|
||||||
import com.example.base.extensions.onClick
|
import com.example.base.extensions.onClick
|
||||||
import com.example.base.ui.BaseFragment
|
import com.example.base.ui.BaseFragment
|
||||||
import com.example.base.utils.AppUtils
|
import com.example.base.utils.AppUtils
|
||||||
|
import io.reactivex.rxjava3.disposables.Disposable
|
||||||
import org.jetbrains.anko.sdk27.listeners.onLongClick
|
import org.jetbrains.anko.sdk27.listeners.onLongClick
|
||||||
|
import org.jetbrains.anko.sdk27.listeners.onTouch
|
||||||
|
|
||||||
class AboutFragment : BaseFragment<FragmentAboutBinding, AboutViewModel>() {
|
class AboutFragment : BaseFragment<FragmentAboutBinding, AboutViewModel>() {
|
||||||
|
private var countdownTask: Disposable? = null
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
override fun initView() {
|
override fun initView() {
|
||||||
super.initView()
|
super.initView()
|
||||||
|
|
@ -20,9 +26,17 @@ class AboutFragment : BaseFragment<FragmentAboutBinding, AboutViewModel>() {
|
||||||
|
|
||||||
override fun initListener() {
|
override fun initListener() {
|
||||||
super.initListener()
|
super.initListener()
|
||||||
binding.ivIco.onLongClick {
|
binding.ivIco.onTouch { v, event ->
|
||||||
PopupDialog.showAboutTip(requireContext(),binding.ivIco)
|
when(event.action) {
|
||||||
false
|
MotionEvent.ACTION_DOWN -> {
|
||||||
|
startCountdown()
|
||||||
|
}
|
||||||
|
|
||||||
|
MotionEvent.ACTION_UP -> {
|
||||||
|
stopCountdown()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
true
|
||||||
}
|
}
|
||||||
binding.tvAgreement.onClick {
|
binding.tvAgreement.onClick {
|
||||||
UrlHelper.startUserAgreement(requireContext())
|
UrlHelper.startUserAgreement(requireContext())
|
||||||
|
|
@ -40,4 +54,18 @@ class AboutFragment : BaseFragment<FragmentAboutBinding, AboutViewModel>() {
|
||||||
UrlHelper.startSDKList(requireContext())
|
UrlHelper.startSDKList(requireContext())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun startCountdown() {
|
||||||
|
stopCountdown()
|
||||||
|
countdownTask = RxCountDown.countdown(3).subscribe {
|
||||||
|
if (it == 0L) {
|
||||||
|
PopupDialog.showAboutTip(requireContext(),binding.ivIco)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun stopCountdown() {
|
||||||
|
countdownTask?.dispose()
|
||||||
|
countdownTask = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_25"
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
android:src="@mipmap/ic_guide_item_title_bg"
|
android:src="@mipmap/ic_guide_item_title_bg"
|
||||||
app:layout_constraintEnd_toEndOf="@id/tv_title"
|
app:layout_constraintEnd_toEndOf="@id/tv_title"
|
||||||
app:layout_constraintStart_toStartOf="@id/tv_title"
|
app:layout_constraintStart_toStartOf="@id/tv_title"
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_25"
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
android:src="@mipmap/ic_guide_item_title_bg"
|
android:src="@mipmap/ic_guide_item_title_bg"
|
||||||
app:layout_constraintEnd_toEndOf="@id/tv_title"
|
app:layout_constraintEnd_toEndOf="@id/tv_title"
|
||||||
app:layout_constraintStart_toStartOf="@id/tv_title"
|
app:layout_constraintStart_toStartOf="@id/tv_title"
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_25"
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
android:src="@mipmap/ic_guide_item_title_bg"
|
android:src="@mipmap/ic_guide_item_title_bg"
|
||||||
app:layout_constraintEnd_toEndOf="@id/tv_title"
|
app:layout_constraintEnd_toEndOf="@id/tv_title"
|
||||||
app:layout_constraintStart_toStartOf="@id/tv_title"
|
app:layout_constraintStart_toStartOf="@id/tv_title"
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_25"
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
android:src="@mipmap/ic_guide_item_title_bg"
|
android:src="@mipmap/ic_guide_item_title_bg"
|
||||||
app:layout_constraintEnd_toEndOf="@id/tv_title"
|
app:layout_constraintEnd_toEndOf="@id/tv_title"
|
||||||
app:layout_constraintStart_toStartOf="@id/tv_title"
|
app:layout_constraintStart_toStartOf="@id/tv_title"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="@dimen/dp_12">
|
android:paddingStart="@dimen/dp_12"
|
||||||
|
android:paddingEnd="@dimen/dp_12"
|
||||||
|
android:paddingBottom="@dimen/dp_12">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
|
|
@ -21,6 +23,7 @@
|
||||||
android:text="一元试用"
|
android:text="一元试用"
|
||||||
android:textColor="@color/color_1a1a1a"
|
android:textColor="@color/color_1a1a1a"
|
||||||
android:textSize="@dimen/sp_15"
|
android:textSize="@dimen/sp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
android:paddingBottom="@dimen/dp_10"
|
android:paddingBottom="@dimen/dp_10"
|
||||||
android:text="查看配置"
|
android:text="查看配置"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_14"
|
||||||
android:textColor="@color/color_1a1a1a"
|
android:textColor="@color/color_90ffffff"
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
android:paddingBottom="@dimen/dp_10"
|
android:paddingBottom="@dimen/dp_10"
|
||||||
android:text="查看引导页"
|
android:text="查看引导页"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_14"
|
||||||
android:textColor="@color/color_1a1a1a"
|
android:textColor="@color/color_90ffffff"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tvTip1" />
|
app:layout_constraintTop_toBottomOf="@+id/tvTip1" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue