[6.5.0]自动扫描
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.exploration
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.ImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
|
||||
|
||||
/**
|
||||
* 自动探查
|
||||
* 鹰眼6.5.0需求
|
||||
*/
|
||||
class AutomaticExplorationView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
private var ivClose: ImageView ?= null //关闭按钮
|
||||
private var ivScan: ImageView ?= null //扫描视图
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AutomaticExplorationView"
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.view_automatic_exploration, this, true)
|
||||
initEvent()
|
||||
}
|
||||
|
||||
private fun initEvent(){
|
||||
ivClose = findViewById(R.id.ivClose)
|
||||
ivScan = findViewById(R.id.ivScan)
|
||||
//隐藏自动探索视图
|
||||
ivClose?.setOnClickListener {
|
||||
this.visibility = View.GONE
|
||||
}
|
||||
//启动扫描
|
||||
ivScan?.let {
|
||||
val rotationAnim = ObjectAnimator.ofFloat(it, "rotation", 0f, 360f)
|
||||
rotationAnim.repeatCount = ValueAnimator.INFINITE
|
||||
rotationAnim.repeatMode = ValueAnimator.RESTART
|
||||
rotationAnim.duration = 2000
|
||||
rotationAnim.interpolator = LinearInterpolator()
|
||||
rotationAnim.start()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 858 B |
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_580"
|
||||
android:layout_height="@dimen/dp_500"
|
||||
android:background="@drawable/bg_automatic_exploration"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivScan"
|
||||
android:layout_width="@dimen/dp_67"
|
||||
android:layout_height="@dimen/dp_67"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:src="@drawable/icon_scan"
|
||||
android:contentDescription="@string/exploration_scan"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
app:layout_constraintTop_toTopOf="@id/ivScan"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivScan"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivScan"
|
||||
app:layout_constraintRight_toRightOf="@id/ivScan"
|
||||
android:src="@drawable/icon_vehicle_lane"
|
||||
android:contentDescription="@string/exploration_vehicle_lane"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvExplorationTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivScan"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivScan"
|
||||
app:layout_constraintStart_toEndOf="@id/ivScan"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/exploration_title"
|
||||
android:text="@string/exploration_title"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivClose"
|
||||
android:layout_width="@dimen/dp_26"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/icon_exploration_close"
|
||||
android:contentDescription="@string/exploration_close"
|
||||
android:padding="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user