diff --git a/app/src/main/java/com/tencent/iot/explorer/link/customview/dialog/DevModeSetDialog.java b/app/src/main/java/com/tencent/iot/explorer/link/customview/dialog/DevModeSetDialog.java
index 2fe1e1462..f46a2e135 100644
--- a/app/src/main/java/com/tencent/iot/explorer/link/customview/dialog/DevModeSetDialog.java
+++ b/app/src/main/java/com/tencent/iot/explorer/link/customview/dialog/DevModeSetDialog.java
@@ -17,6 +17,7 @@
import com.tencent.iot.explorer.link.customview.dialog.adapter.DevModeOptionsAdapter;
import com.tencent.iot.explorer.link.kitlink.entity.ModeInt;
import com.tencent.iot.explorer.link.core.auth.entity.OpValue;
+import com.tencent.iot.explorer.link.kitlink.util.Utils;
import java.util.ArrayList;
import java.util.List;
@@ -154,9 +155,10 @@ private void resetStartEqBtnStatus() {
@Override
public void onRangeChanged(RangeSeekBar view, float leftValue, float rightValue, boolean isFromUser) {
progress = leftValue;
-// String.format("%.2f", leftValue)
if (!modeInt.getIfInteger()) {
- view.getLeftSeekBar().setIndicatorText(String.format("%.1f", leftValue) + modeInt.getUnit());
+
+ int len = Utils.Companion.length(modeInt.getStep());
+ view.getLeftSeekBar().setIndicatorText(String.format("%." + len + "f", leftValue) + modeInt.getUnit());
} else {
view.getLeftSeekBar().setIndicatorText((int)leftValue + modeInt.getUnit());
}
diff --git a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/FamilyAddressActivity.kt b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/FamilyAddressActivity.kt
index 2ce47a856..9bd9fd5ac 100644
--- a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/FamilyAddressActivity.kt
+++ b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/FamilyAddressActivity.kt
@@ -89,26 +89,6 @@ class FamilyAddressActivity : BaseActivity(), TencentLocationListener {
smart_refreshLayout.setRefreshFooter(ClassicsFooter(this@FamilyAddressActivity))
}
- override fun startHere() {
- super.startHere()
-
- Thread {
- Thread.sleep(1000)
- runOnUiThread {
- tencentMap.setOnMapCameraChangeListener(OnMapCameraChangeListener)
- if (checkPermissions(permissions)) {
- if (TextUtils.isEmpty(defaultAddress)) {
- startLocation()
- } else {
- tagPostionByAddress(defaultAddress)
- }
- } else {
- requestPermission(permissions)
- }
- }
- }.start()
- }
-
override fun setListener() {
layout_seach.setOnClickListener {
var postionIntent = Intent(this@FamilyAddressActivity, SelectPointActivity::class.java)
@@ -191,9 +171,10 @@ class FamilyAddressActivity : BaseActivity(), TencentLocationListener {
justMaskTag(target, "")
}
})
+ tencentMap.setOnMapCameraChangeListener(initOnMapCameraChangeListener)
}
- private var OnMapCameraChangeListener = object : TencentMap.OnMapCameraChangeListener {
+ private var onMapCameraChangeListener = object : TencentMap.OnMapCameraChangeListener {
override fun onCameraChangeFinish(cp: CameraPosition) {
L.e("onCameraChangeFinish=${cp.target.latitude},${cp.target.longitude}")
if (requestFlag) {
@@ -207,6 +188,23 @@ class FamilyAddressActivity : BaseActivity(), TencentLocationListener {
override fun onCameraChange(cp: CameraPosition) {}
}
+ private var initOnMapCameraChangeListener = object : TencentMap.OnMapCameraChangeListener {
+ override fun onCameraChangeFinish(cp: CameraPosition) {
+ tencentMap.setOnMapCameraChangeListener(onMapCameraChangeListener)
+ if (checkPermissions(permissions)) {
+ if (TextUtils.isEmpty(defaultAddress)) {
+ startLocation()
+ } else {
+ tagPostionByAddress(defaultAddress)
+ }
+ } else {
+ requestPermission(permissions)
+ }
+ }
+
+ override fun onCameraChange(cp: CameraPosition) {}
+ }
+
private fun initMap() {
locationManager = TencentLocationManager.getInstance(this)
tencentMap = mapView.map
diff --git a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/fragment/HomeFragment.kt b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/fragment/HomeFragment.kt
index d9ba63139..a67c88c6c 100644
--- a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/fragment/HomeFragment.kt
+++ b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/fragment/HomeFragment.kt
@@ -396,7 +396,8 @@ class HomeFragment : BaseFragment(), HomeFragmentView, MyCallback, PayloadMessag
override fun onSaveClicked() {
var value = ""
if (!devOption.modeInt!!.ifInteger) {
- value = String.format("%.1f", dialog.progress)
+ var len = Utils.length(devOption!!.modeInt!!.step)
+ value = String.format("%.${len}f", dialog.progress)
} else {
value = dialog.progress.toInt().toString()
}
diff --git a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/util/Utils.kt b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/util/Utils.kt
index e5ff7f2c8..a5cdf62db 100644
--- a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/util/Utils.kt
+++ b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/util/Utils.kt
@@ -15,5 +15,23 @@ class Utils {
LocalBroadcastManager.getInstance(context).sendBroadcast(intent)
context.sendBroadcast(intent)
}
+
+ fun length(num: Float): Int {
+ var len = 1
+ val str = num.toString()
+ val parts = str.split(".")
+ if (parts != null && parts.size == 2) {
+ for (i in parts[1].length - 1 downTo 1) {
+ if (parts[1][i].toString() != "0") {
+ len = i + 1
+ break
+ }
+ }
+ }
+ if (len <= 0) {
+ len = 1
+ }
+ return len
+ }
}
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_forgot_password.xml b/app/src/main/res/layout/activity_forgot_password.xml
index 9254d407f..a3d65d839 100644
--- a/app/src/main/res/layout/activity_forgot_password.xml
+++ b/app/src/main/res/layout/activity_forgot_password.xml
@@ -80,15 +80,15 @@
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_country_code_key.xml b/app/src/main/res/layout/item_country_code_key.xml
index d0c87db1a..e20548692 100644
--- a/app/src/main/res/layout/item_country_code_key.xml
+++ b/app/src/main/res/layout/item_country_code_key.xml
@@ -2,13 +2,13 @@
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_country_code_value.xml b/app/src/main/res/layout/item_country_code_value.xml
index 5818d9f8b..f12f41f5e 100644
--- a/app/src/main/res/layout/item_country_code_value.xml
+++ b/app/src/main/res/layout/item_country_code_value.xml
@@ -1,7 +1,7 @@
+ android:textColor="@color/black_15161A"
+ android:textSize="@dimen/ts_16" />
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:background="@color/gray_E7E8EB" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/layout_email_forgot_pwd.xml b/app/src/main/res/layout/layout_email_forgot_pwd.xml
index 9d963d12e..520684807 100644
--- a/app/src/main/res/layout/layout_email_forgot_pwd.xml
+++ b/app/src/main/res/layout/layout_email_forgot_pwd.xml
@@ -10,8 +10,8 @@
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:text="@string/email"
- android:textColor="@color/black"
- android:textSize="@dimen/ts_16"
+ android:textColor="@color/black_15161A"
+ android:textSize="@dimen/ts_14"
android:gravity="center_vertical"
app:layout_constraintBottom_toBottomOf="@id/et_forgot_email"
app:layout_constraintStart_toStartOf="parent"
@@ -25,9 +25,9 @@
android:background="@color/white"
android:hint="@string/email_address"
android:inputType="textEmailAddress"
- android:textColor="@color/black"
+ android:textColor="@color/black_15161A"
android:textCursorDrawable="@drawable/edit_blue_cursor"
- android:textSize="@dimen/ts_16"
+ android:textSize="@dimen/ts_14"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
app:layout_constraintTop_toTopOf="parent"
@@ -51,7 +51,7 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="20dp"
- android:background="@color/gray_dddddd"
+ android:background="@color/gray_E7E8EB"
app:layout_constraintTop_toBottomOf="@id/et_forgot_email" />
Retry
Connect
All
- 所有设备(%s)
- 共享设备(%s)
+ 所有设备(%s)
+ 共享设备(%s)
当前暂无设备,请添加设备
Living room
Bedroom
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 620924647..b634f1788 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -459,8 +459,8 @@
重试
连接
全部
- 所有设备(%s)
- 共享设备(%s)
+ 所有设备(%s)
+ 共享设备(%s)
当前暂无设备,请添加设备
客厅
卧室