desc:气泵转速设置 TODO

main
xiaowusky 1 year ago
parent 86d9b53522
commit 557f401aa7

@ -98,6 +98,10 @@
android:name=".watcher.ui.LightSettingActivity" android:name=".watcher.ui.LightSettingActivity"
android:exported="false" android:exported="false"
android:screenOrientation="landscape" /> android:screenOrientation="landscape" />
<activity
android:name=".watcher.ui.SpeedSettingActivity"
android:exported="false"
android:screenOrientation="landscape" />
<activity <activity
android:name=".watcher.ui.SensorThresholdSetActivity" android:name=".watcher.ui.SensorThresholdSetActivity"
android:exported="false" android:exported="false"

@ -49,6 +49,9 @@ class SettingActivity : NoOptionsActivity() {
itemSensor.setOnClickListener { itemSensor.setOnClickListener {
startActivity(Intent(this@SettingActivity, SensorActivity::class.java)) startActivity(Intent(this@SettingActivity, SensorActivity::class.java))
} }
itemSpeed.setOnClickListener {
startActivity(Intent(this@SettingActivity, SpeedSettingActivity::class.java))
}
itemCloud.setOnClickListener { itemCloud.setOnClickListener {
startActivity(Intent(this@SettingActivity, CloudActivity::class.java)) startActivity(Intent(this@SettingActivity, CloudActivity::class.java))
} }

@ -0,0 +1,61 @@
package com.yinuo.safetywatcher.watcher.ui
import android.view.View
import android.widget.SeekBar
import android.widget.SeekBar.OnSeekBarChangeListener
import com.yinuo.safetywatcher.R
import com.yinuo.safetywatcher.databinding.ActivitySpeedSettingBinding
import com.yinuo.safetywatcher.watcher.base.NoOptionsActivity
class SpeedSettingActivity : NoOptionsActivity() {
private val mBinding by lazy {
ActivitySpeedSettingBinding.inflate(layoutInflater)
}
override fun getTopBarTitle(): String? {
return getString(R.string.speed_setting)
}
override fun generateContentView(): View {
return mBinding.root
}
override fun initView() {
val initLight = 0
mBinding.sbSpeed.progress = initLight
mBinding.tvSpeed.text = getShowPercent(initLight)
mBinding.sbSpeed.setOnSeekBarChangeListener(object : OnSeekBarChangeListener {
override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
mBinding.tvSpeed.text = getShowPercent(p1)
}
override fun onStartTrackingTouch(p0: SeekBar?) {
}
override fun onStopTrackingTouch(p0: SeekBar?) {
}
})
mBinding.sbSpeed.keyProgressIncrement = 1
mBinding.tvCancel.setOnClickListener {
onBackPressed()
}
mBinding.tvConfirm.setOnClickListener {
setSpeed()
onBackPressed()
}
}
/**
* 设置转速
*/
private fun setSpeed() {
TODO("Not yet implemented")
}
private fun getShowPercent(initLight: Int): CharSequence? {
val percent = (initLight/255f * 100).toInt()
return "$percent%"
}
}

@ -1,255 +1,283 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<LinearLayout <LinearLayout
android:id="@+id/item_time"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_108dp" android:layout_height="wrap_content"
android:gravity="center_vertical" android:orientation="vertical"
android:orientation="horizontal" tools:ignore="MissingDefaultResource">
android:focusable="true"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_time" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/time_setting"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<LinearLayout
android:id="@+id/item_light"
android:layout_width="match_parent"
android:layout_height="@dimen/_108dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_sun" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/light_setting"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<LinearLayout
android:id="@+id/item_query"
android:layout_width="match_parent"
android:layout_height="@dimen/_108dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_query" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/query_data"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<LinearLayout <LinearLayout
android:id="@+id/item_wraning" android:id="@+id/item_time"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_108dp" android:layout_height="@dimen/_108dp"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="@dimen/_121dp"> android:paddingStart="@dimen/_121dp">
<ImageView <ImageView
android:layout_width="@dimen/_32dp" android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp" android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_wraning" /> android:src="@mipmap/ic_time" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp" android:layout_marginStart="@dimen/_21dp"
android:text="@string/warn_data" android:text="@string/time_setting"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_36dp" /> android:textSize="@dimen/_36dp" />
</LinearLayout> </LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_2dp" android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" /> android:background="@color/_242f4d" />
<LinearLayout
android:id="@+id/item_video"
android:layout_width="match_parent"
android:layout_height="@dimen/_108dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_video" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/history_video"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<View <LinearLayout
android:layout_width="match_parent" android:id="@+id/item_light"
android:layout_height="@dimen/_2dp" android:layout_width="match_parent"
android:background="@color/_242f4d" /> android:layout_height="@dimen/_108dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_sun" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/light_setting"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<LinearLayout <LinearLayout
android:id="@+id/item_sensor" android:id="@+id/item_query"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_108dp" android:layout_height="@dimen/_108dp"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="@dimen/_121dp"> android:paddingStart="@dimen/_121dp">
<ImageView <ImageView
android:layout_width="@dimen/_32dp" android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp" android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_sensor" /> android:src="@mipmap/ic_query" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp" android:layout_marginStart="@dimen/_21dp"
android:text="@string/sensor" android:text="@string/query_data"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_36dp" /> android:textSize="@dimen/_36dp" />
</LinearLayout> </LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<View <LinearLayout
android:layout_width="match_parent" android:id="@+id/item_wraning"
android:layout_height="@dimen/_2dp" android:layout_width="match_parent"
android:background="@color/_242f4d" /> android:layout_height="@dimen/_108dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_wraning" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/warn_data"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<LinearLayout <LinearLayout
android:id="@+id/item_cloud" android:id="@+id/item_video"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_108dp" android:layout_height="@dimen/_108dp"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="@dimen/_121dp"> android:paddingStart="@dimen/_121dp">
<ImageView <ImageView
android:layout_width="@dimen/_32dp" android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp" android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_cloud" /> android:src="@mipmap/ic_video" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp" android:layout_marginStart="@dimen/_21dp"
android:text="@string/cloud" android:text="@string/history_video"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_36dp" /> android:textSize="@dimen/_36dp" />
</LinearLayout> </LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<View <LinearLayout
android:layout_width="match_parent" android:id="@+id/item_sensor"
android:layout_height="@dimen/_2dp" android:layout_width="match_parent"
android:background="@color/_242f4d" /> android:layout_height="@dimen/_108dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_sensor" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/sensor"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/item_speed"
android:layout_width="match_parent"
android:layout_height="@dimen/_108dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_sensor" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/speed_setting"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<LinearLayout <LinearLayout
android:id="@+id/item_net" android:id="@+id/item_cloud"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_108dp" android:layout_height="@dimen/_108dp"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="@dimen/_121dp"> android:paddingStart="@dimen/_121dp">
<ImageView <ImageView
android:layout_width="@dimen/_32dp" android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp" android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_net" /> android:src="@mipmap/ic_cloud" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp" android:layout_marginStart="@dimen/_21dp"
android:text="@string/net_setting" android:text="@string/cloud"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_36dp" /> android:textSize="@dimen/_36dp" />
</LinearLayout> </LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<View <LinearLayout
android:layout_width="match_parent" android:id="@+id/item_net"
android:layout_height="@dimen/_2dp" android:layout_width="match_parent"
android:background="@color/_242f4d" /> android:layout_height="@dimen/_108dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_121dp">
<ImageView
android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_net" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp"
android:text="@string/net_setting"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_2dp"
android:background="@color/_242f4d" />
<LinearLayout <LinearLayout
android:id="@+id/item_recovery" android:id="@+id/item_recovery"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_108dp" android:layout_height="@dimen/_108dp"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="@dimen/_121dp"> android:paddingStart="@dimen/_121dp">
<ImageView <ImageView
android:layout_width="@dimen/_32dp" android:layout_width="@dimen/_32dp"
android:layout_height="@dimen/_32dp" android:layout_height="@dimen/_32dp"
android:src="@mipmap/ic_recovery" /> android:src="@mipmap/ic_recovery" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_21dp" android:layout_marginStart="@dimen/_21dp"
android:text="@string/recovery_setting" android:text="@string/recovery_setting"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_36dp" /> android:textSize="@dimen/_36dp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </ScrollView>

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<RelativeLayout
android:layout_width="@dimen/_960dp"
android:layout_height="@dimen/_511dp"
android:layout_marginTop="@dimen/_201dp"
android:background="@drawable/warn_setting_btn_bg">
<SeekBar
android:id="@+id/sb_speed"
style="@style/LightSeekbarStyle"
android:focusable="true"
android:layout_width="@dimen/_630dp"
android:layout_height="@dimen/_100dp"
android:layout_marginStart="@dimen/_140dp"
android:layout_marginTop="@dimen/_160dp"
android:max="100"
android:min="0"
android:padding="0dp"
android:progress="20" />
<TextView
android:id="@+id/tv_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/_185dp"
android:layout_marginEnd="@dimen/_121dp"
android:text="55%"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
<TextView
android:id="@+id/tv_cancel"
android:layout_width="@dimen/_480dp"
android:layout_height="@dimen/_81dp"
android:layout_alignParentBottom="true"
android:background="@drawable/cancel_btn_bg"
android:gravity="center"
android:text="@string/cancel"
android:focusable="true"
android:textColor="@color/white_30"
android:textSize="@dimen/_36dp" />
<TextView
android:id="@+id/tv_confirm"
android:layout_width="@dimen/_480dp"
android:layout_height="@dimen/_81dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:background="@drawable/confirm_btn_bg"
android:gravity="center"
android:text="@string/confirm"
android:focusable="true"
android:textColor="@color/white"
android:textSize="@dimen/_36dp" />
</RelativeLayout>
</LinearLayout>

@ -11,6 +11,7 @@
<string name="warn_data">报警数据</string> <string name="warn_data">报警数据</string>
<string name="history_video">历史视频</string> <string name="history_video">历史视频</string>
<string name="sensor">传感器</string> <string name="sensor">传感器</string>
<string name="speed_setting">气泵转速设置</string>
<string name="sensor_data">传感器数据详情</string> <string name="sensor_data">传感器数据详情</string>
<string name="sensor_setting">传感器设置</string> <string name="sensor_setting">传感器设置</string>
<string name="sensor_threshold_setting">传感器阈值设置</string> <string name="sensor_threshold_setting">传感器阈值设置</string>

Loading…
Cancel
Save