|
|
@@ -3,6 +3,7 @@ package com.yingyang.personalcenter.setting
|
|
|
import android.annotation.SuppressLint
|
|
|
import android.content.Intent
|
|
|
import android.provider.Settings
|
|
|
+import android.text.TextUtils
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
@@ -14,6 +15,7 @@ import com.yingyangfly.baselib.ext.getScaleAnimation
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
import com.yingyangfly.baselib.utils.AppUtil
|
|
|
import com.yingyangfly.baselib.utils.JumpUtil
|
|
|
+import com.yingyangfly.baselib.utils.User
|
|
|
|
|
|
/**
|
|
|
* 设置页面
|
|
|
@@ -22,7 +24,11 @@ import com.yingyangfly.baselib.utils.JumpUtil
|
|
|
class SettingActivity : BaseActivity<ActivitySettingBinding>(), View.OnTouchListener {
|
|
|
|
|
|
override fun initViews() {
|
|
|
-
|
|
|
+ binding.tvSnCode.text = if (TextUtils.isEmpty(User.getPadNo())) {
|
|
|
+ ""
|
|
|
+ } else {
|
|
|
+ "设备编码:" + User.getPadNo()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
@@ -60,6 +66,7 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>(), View.OnTouchList
|
|
|
v.startAnimation(getScaleAnimation())
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_UP -> {
|
|
|
v.startAnimation(getEndAnimation())
|
|
|
when (v.id) {
|
|
|
@@ -67,32 +74,38 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>(), View.OnTouchList
|
|
|
//返回上一页
|
|
|
finish()
|
|
|
}
|
|
|
+
|
|
|
R.id.wifiLayout -> {
|
|
|
//WLAN
|
|
|
val intent = Intent(Settings.ACTION_WIFI_SETTINGS)
|
|
|
startActivity(intent)
|
|
|
}
|
|
|
+
|
|
|
R.id.mobileNetworkLayout -> {
|
|
|
//移动网络
|
|
|
val intent = Intent(Settings.ACTION_DATA_ROAMING_SETTINGS)
|
|
|
startActivity(intent)
|
|
|
}
|
|
|
+
|
|
|
R.id.brightnessLayout -> {
|
|
|
//显示与亮度
|
|
|
val intent = Intent(Settings.ACTION_DISPLAY_SETTINGS)
|
|
|
startActivity(intent)
|
|
|
}
|
|
|
+
|
|
|
R.id.soundLayout -> {
|
|
|
//声音
|
|
|
val intent = Intent(Settings.ACTION_SOUND_SETTINGS)
|
|
|
startActivity(intent)
|
|
|
}
|
|
|
+
|
|
|
R.id.versionLayout -> {
|
|
|
//版本记录
|
|
|
JumpUtil.jumpActivity(RouterUrlCommon.versionRecord, mContext)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_CANCEL -> {
|
|
|
if (v.id == R.id.backLayout || v.id == R.id.wifiLayout || v.id == R.id.mobileNetworkLayout ||
|
|
|
v.id == R.id.brightnessLayout || v.id == R.id.soundLayout || v.id == R.id.versionLayout
|