Quellcode durchsuchen

提交人:jtm
提交内容:010D

江天明 vor 11 Monaten
Ursprung
Commit
8b0baf3160

+ 15 - 0
BusinessAuth/src/main/java/com/develop/auth/ui/MemberForgotFragment.kt

@@ -1,12 +1,15 @@
 package com.develop.auth.ui
 
 import android.os.Bundle
+import android.text.InputType
+import android.text.method.DigitsKeyListener
 import android.view.LayoutInflater
 import android.view.ViewGroup
 import com.develop.auth.R
 import com.develop.auth.databinding.FragmentMemberForgotBinding
 import com.develop.auth.viewmodel.FragmentTag
 import com.develop.auth.viewmodel.MemberViewModel
+import com.develop.base.ext.getSN
 import com.develop.base.ext.globalApp
 import com.develop.base.ext.isNightTheme
 import com.develop.base.ext.resId2Dimension
@@ -86,6 +89,18 @@ class MemberForgotFragment : CommonBVMFragment<FragmentMemberForgotBinding, Memb
                 showToast(this)
             }
         }
+        if (getSN().startsWith("010D")) {
+            val digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@#€%&-+()~`|•√π÷׶∆}{=°^¢\$¥£\\©®™℅[]¡¿.><,:;?*'!\""
+            binding.etPassword.keyListener = object : DigitsKeyListener() {
+                override fun getInputType(): Int {
+                    return InputType.TYPE_TEXT_VARIATION_PASSWORD
+                }
+
+                override fun getAcceptedChars(): CharArray {
+                    return digits.toCharArray()
+                }
+            }
+        }
     }
     var dp10 = (com.develop.common.R.dimen.convert_10px).resId2Dimension()
     override fun createViewModel(): MemberViewModel {

+ 16 - 0
BusinessAuth/src/main/java/com/develop/auth/ui/MemberLoginFragment.kt

@@ -1,6 +1,8 @@
 package com.develop.auth.ui
 
 import android.os.Bundle
+import android.text.InputType
+import android.text.method.DigitsKeyListener
 import android.util.Log
 import android.view.LayoutInflater
 import android.view.View
@@ -11,6 +13,7 @@ import com.develop.auth.R
 import com.develop.auth.databinding.FragmentMemberLoginBinding
 import com.develop.auth.viewmodel.FragmentTag
 import com.develop.auth.viewmodel.MemberViewModel
+import com.develop.base.ext.getSN
 import com.develop.base.ext.navigateTo
 import com.develop.base.ext.resId2Dimension
 import com.develop.base.mvvm.BaseBVMFragment
@@ -44,6 +47,19 @@ class MemberLoginFragment : CommonBVMFragment<FragmentMemberLoginBinding, Member
             viewModel.fragmentChangeLiveData.postValue(FragmentTag.MEMBER_FORGER)
         }
         KeyboardUtils.registerSoftInputChangedListener(requireActivity(), this)
+
+        if (getSN().startsWith("010D")) {
+            val digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@#€%&-+()~`|•√π÷׶∆}{=°^¢\$¥£\\©®™℅[]¡¿.><,:;?*'!\""
+            binding.etPassword.keyListener = object : DigitsKeyListener() {
+                override fun getInputType(): Int {
+                    return InputType.TYPE_TEXT_VARIATION_PASSWORD
+                }
+
+                override fun getAcceptedChars(): CharArray {
+                    return digits.toCharArray()
+                }
+            }
+        }
     }
 
     override fun onCreate(savedInstanceState: Bundle?) {

+ 24 - 1
BusinessAuth/src/main/java/com/develop/auth/ui/MemberRegisterFragment.kt

@@ -1,11 +1,14 @@
 package com.develop.auth.ui
 
+import android.text.InputType
 import android.text.TextUtils
+import android.text.method.DigitsKeyListener
 import android.view.LayoutInflater
 import android.view.ViewGroup
 import com.develop.auth.databinding.FragmentMemberRegisterBinding
 import com.develop.auth.viewmodel.FragmentTag
 import com.develop.auth.viewmodel.MemberViewModel
+import com.develop.base.ext.getSN
 import com.develop.common.ui.CommonBVMFragment
 
 class MemberRegisterFragment : CommonBVMFragment<FragmentMemberRegisterBinding, MemberViewModel>() {
@@ -38,6 +41,27 @@ class MemberRegisterFragment : CommonBVMFragment<FragmentMemberRegisterBinding,
                 viewModel.fragmentChangeLiveData.postValue(FragmentTag.MEMBER_PROFILE)
             }
         }
+        if (getSN().startsWith("010D")) {
+            val digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@#€%&-+()~`|•√π÷׶∆}{=°^¢\$¥£\\©®™℅[]¡¿.><,:;?*'!\""
+            binding.etPassword.keyListener = object : DigitsKeyListener() {
+                override fun getInputType(): Int {
+                    return InputType.TYPE_TEXT_VARIATION_PASSWORD
+                }
+
+                override fun getAcceptedChars(): CharArray {
+                    return digits.toCharArray()
+                }
+            }
+            binding.etPasswordAgain.keyListener = object : DigitsKeyListener() {
+                override fun getInputType(): Int {
+                    return InputType.TYPE_TEXT_VARIATION_PASSWORD
+                }
+
+                override fun getAcceptedChars(): CharArray {
+                    return digits.toCharArray()
+                }
+            }
+        }
     }
 
     private fun checkInputs(): Boolean {
@@ -73,7 +97,6 @@ class MemberRegisterFragment : CommonBVMFragment<FragmentMemberRegisterBinding,
     }
 
 
-
     /**
      * 检测输入密码是否符合规范
      * 8~16位数字和字母组成

+ 43 - 0
BusinessCommon/src/main/java/com/develop/common/data_repo/db/DataFactory.kt

@@ -203,6 +203,49 @@ object DataFactory {
         return result
     }
 
+    fun genSetting010DModesList(resource: Resources): MutableList<SettingModel> {
+        val result = mutableListOf<SettingModel>()
+        val resIdList = mutableListOf(
+            R.drawable.ic_setting_language,
+            R.drawable.ic_setting_wifi,
+//            R.drawable.ic_setting_voice,
+//            R.drawable.ic_setting_brightness,
+            R.drawable.ic_setting_user,
+//            R.drawable.ic_setting_folder,
+            R.drawable.ic_setting_reset,
+            R.drawable.ic_setting_about,
+        )
+
+        val nameList = mutableListOf(
+            resource.getString(R.string.language), resource.getString(R.string.wifi),
+//            resource.getString(R.string.sound),
+//            resource.getString(R.string.brightness),
+            resource.getString(R.string.user_account),
+//            resource.getString(R.string.storage),
+            resource.getString(R.string.reset), resource.getString(R.string.about)
+
+        )
+        val settingTypeList = mutableListOf(
+            SettingType.LANGUAGE, SettingType.WIFI,
+//            SettingType.SOUND,
+//            SettingType.BRIGHTNESS,
+            SettingType.USER_ACCOUNT,
+//            SettingType.STORAGE,
+            SettingType.RESTORE_FACTORY_SETTINGS, SettingType.ABOUT
+        )
+
+        var tuyaConfig =  ConfigUtils.loadTuyaConfig()
+        if(tuyaConfig != null){
+            settingTypeList.add(SettingType.TUYA)
+            nameList.add(resource.getString(R.string.tuya))
+            resIdList.add(R.drawable.ic_setting_tuya)
+        }
+
+        for (i in resIdList.indices) {
+            result.add(SettingModel(resIdList[i], nameList[i], settingTypeList[i]))
+        }
+        return result
+    }
 
     fun genLocalRecipes(
         categoryName: String,

+ 15 - 9
BusinessSetting/src/main/java/com/develop/setting/ui/SettingMainActivity.kt

@@ -13,6 +13,8 @@ import androidx.recyclerview.widget.RecyclerView
 import com.develop.base.ext.load
 import com.alibaba.android.arouter.facade.annotation.Route
 import com.blankj.utilcode.util.ToastUtils
+import com.develop.base.ext.getSN
+import com.develop.base.ext.isBrand036I
 import com.develop.base.ext.navigateTo
 import com.develop.base.ext.resId2Dimension
 import com.develop.base.ext.src
@@ -46,9 +48,13 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         var ctx = this
-        dataList = DataFactory.genSettingModesList(resources)
+        dataList = if (getSN().startsWith("010D")) {
+            DataFactory.genSetting010DModesList(resources)
+        } else {
+            DataFactory.genSettingModesList(resources)
+        }
         binding.tvTitle.updateText(getString(com.develop.common.R.string.settings))
-        binding.ivClose.setImageResource( com.develop.common.R.drawable.ic_close)
+        binding.ivClose.setImageResource(com.develop.common.R.drawable.ic_close)
         binding.ivClose.setOnClickListener {
             finish()
         }
@@ -113,14 +119,17 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
                         SettingType.STORAGE -> {
                             openFileManager()
                         }
+
                         SettingType.TUYA -> {
 
-                            if(CofarSDK.devInfo().status !== DevStatus.STOP.toInt()){
+                            if (CofarSDK.devInfo().status !== DevStatus.STOP.toInt()) {
                                 ToastUtils.showShort(getString(com.develop.common.R.string.change_lang_tips))
-                            }else{
-                                if( NetworkInfo.DetailedState.CONNECTED == WifiHelp.Build(ctx).build().getDetailedState()){
+                            } else {
+                                if (NetworkInfo.DetailedState.CONNECTED == WifiHelp.Build(ctx)
+                                        .build().getDetailedState()
+                                ) {
                                     navigateTo(Screens.Setting.TUYA)
-                                }else{
+                                } else {
                                     navigateTo(Screens.Setting.WIFI) {
                                         val bundle = Bundle()
                                         bundle.putBoolean(WIFI_FROM_MAIN_SETTING, true)
@@ -130,9 +139,6 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
                             }
 
 
-
-
-
                         }
                     }
                 }

+ 1 - 1
libBase/src/main/java/com/develop/base/ext/GlobaExt.kt

@@ -189,7 +189,7 @@ fun getBrandNum(): String {
 fun getSN(): String {
     var serial: String
 
-    return "036I21060020123010190001"
+//    return "010D10390020123010190001"
     //通过反射获取sn号
     try {
         val c = Class.forName("android.os.SystemProperties")