Переглянути джерело

Merge branch 'master' of https://git.kuyuntech.com/developer/FoodCooking

wbspool 1 рік тому
батько
коміт
7eb82d60eb
100 змінених файлів з 3192 додано та 1039 видалено
  1. 2 1
      BusinessAuth/src/main/AndroidManifest.xml
  2. 3 1
      BusinessAuth/src/main/java/com/develop/auth/ui/AgeSelectDialog.kt
  3. 11 2
      BusinessAuth/src/main/java/com/develop/auth/ui/MemberAuthActivity.kt
  4. 10 7
      BusinessAuth/src/main/java/com/develop/auth/ui/MemberForgotFragment.kt
  5. 14 2
      BusinessAuth/src/main/java/com/develop/auth/ui/MemberLaunchFragment.kt
  6. 7 2
      BusinessAuth/src/main/java/com/develop/auth/ui/MemberLoginFragment.kt
  7. 48 16
      BusinessAuth/src/main/java/com/develop/auth/ui/MemberProfileFragment.kt
  8. 26 2
      BusinessAuth/src/main/java/com/develop/auth/ui/MemberRegisterFragment.kt
  9. 27 9
      BusinessAuth/src/main/java/com/develop/auth/ui/MemberViewModel.kt
  10. 134 0
      BusinessAuth/src/main/res/layout-ru/fragment_member_forgot.xml
  11. 5 5
      BusinessAuth/src/main/res/layout/activity_member_auth.xml
  12. 22 7
      BusinessAuth/src/main/res/layout/fragment_member_forgot.xml
  13. 6 7
      BusinessAuth/src/main/res/layout/fragment_member_launch.xml
  14. 20 9
      BusinessAuth/src/main/res/layout/fragment_member_login.xml
  15. 14 9
      BusinessAuth/src/main/res/layout/fragment_member_profile.xml
  16. 22 7
      BusinessAuth/src/main/res/layout/fragment_member_register.xml
  17. 29 4
      BusinessMain/src/main/java/com/develop/main/init/ui/FoodListActivity.kt
  18. 23 10
      BusinessMain/src/main/java/com/develop/main/init/ui/HomeActivity.kt
  19. 47 14
      BusinessMain/src/main/java/com/develop/main/init/ui/ModeEntranceActivity.kt
  20. 35 6
      BusinessMain/src/main/java/com/develop/main/init/ui/ModesFragment.kt
  21. 111 10
      BusinessMain/src/main/java/com/develop/main/init/ui/RecipesFragment.kt
  22. 41 4
      BusinessMain/src/main/java/com/develop/main/init/ui/adapter/CategoryAdapter.kt
  23. 9 3
      BusinessMain/src/main/java/com/develop/main/init/ui/adapter/HomeBannerAdapter.kt
  24. 3 5
      BusinessMain/src/main/java/com/develop/main/init/ui/adapter/ModesGalleryAdapter.kt
  25. 4 3
      BusinessMain/src/main/java/com/develop/main/init/ui/adapter/ModesGridAdapter.kt
  26. 2 1
      BusinessMain/src/main/java/com/develop/main/init/ui/adapter/RecipesListAdapter.kt
  27. 16 3
      BusinessMain/src/main/java/com/develop/main/init/ui/adapter/RecipesMainAdapter.kt
  28. 20 3
      BusinessMain/src/main/java/com/develop/main/init/ui/adapter/SortAdapter.kt
  29. 7 0
      BusinessMain/src/main/java/com/develop/main/init/ui/provider/HomeBannerProvider.kt
  30. 26 2
      BusinessMain/src/main/java/com/develop/main/init/ui/provider/RecipesContentProvider.kt
  31. 62 15
      BusinessMain/src/main/java/com/develop/main/init/ui/viewmodel/HomeViewModel.kt
  32. 10 0
      BusinessMain/src/main/res/layout/activity_food_list.xml
  33. 137 141
      BusinessMain/src/main/res/layout/activity_home.xml
  34. 6 2
      BusinessMain/src/main/res/layout/food_content_provider.xml
  35. 49 13
      BusinessMain/src/main/res/layout/fragment_modes.xml
  36. 1 1
      BusinessMain/src/main/res/layout/home_title_provider.xml
  37. 4 2
      BusinessMain/src/main/res/layout/item_grid_view.xml
  38. 1 1
      BusinessMain/src/main/res/layout/item_home_banner.xml
  39. 1 1
      BusinessMain/src/main/res/layout/item_mode_card_view.xml
  40. 40 0
      BusinessSetting/src/main/java/com/develop/setting/init/adapter/LanguageAdapterV3.kt
  41. 2 1
      BusinessSetting/src/main/java/com/develop/setting/init/adapter/ScreenBannerAdapter.kt
  42. 2 1
      BusinessSetting/src/main/java/com/develop/setting/init/adapter/SettingMainAdapter.kt
  43. 8 1
      BusinessSetting/src/main/java/com/develop/setting/init/adapter/WifiListAdapter.kt
  44. 98 0
      BusinessSetting/src/main/java/com/develop/setting/init/adapter/WifiListAdapter1.kt
  45. 264 64
      BusinessSetting/src/main/java/com/develop/setting/init/ui/AboutActivity.kt
  46. 8 7
      BusinessSetting/src/main/java/com/develop/setting/init/ui/BrightnessActivity.kt
  47. 67 30
      BusinessSetting/src/main/java/com/develop/setting/init/ui/LanguageActivity.kt
  48. 8 2
      BusinessSetting/src/main/java/com/develop/setting/init/ui/PowerAnimationActivity.kt
  49. 12 1
      BusinessSetting/src/main/java/com/develop/setting/init/ui/PrivacyPolicyActivity.kt
  50. 1 1
      BusinessSetting/src/main/java/com/develop/setting/init/ui/RestoreActivity.kt
  51. 101 43
      BusinessSetting/src/main/java/com/develop/setting/init/ui/WifiListActivity.kt
  52. 35 13
      BusinessSetting/src/main/res/layout/activity_about.xml
  53. 19 14
      BusinessSetting/src/main/res/layout/activity_birghtness.xml
  54. 3 1
      BusinessSetting/src/main/res/layout/activity_language.xml
  55. 4 2
      BusinessSetting/src/main/res/layout/activity_power_animation.xml
  56. 35 9
      BusinessSetting/src/main/res/layout/activity_privace_policy.xml
  57. 5 3
      BusinessSetting/src/main/res/layout/activity_restore.xml
  58. 1 1
      BusinessSetting/src/main/res/layout/activity_wifi_list.xml
  59. 26 0
      BusinessSetting/src/main/res/layout/item_language_view2.xml
  60. 1 1
      BusinessSetting/src/main/res/layout/item_setting_main_view.xml
  61. 104 0
      BusinessSetting/src/main/res/layout/item_wifi_content1.xml
  62. 0 0
      BusinessStep/src/main/assets/lang_config.json
  63. 187 0
      BusinessStep/src/main/assets/lang_config_034.json
  64. 73 23
      BusinessStep/src/main/java/com/develop/step/CookEvaluateActivity.kt
  65. 128 59
      BusinessStep/src/main/java/com/develop/step/CookStepActivity2.kt
  66. 21 1
      BusinessStep/src/main/java/com/develop/step/CookStepToolActivity.kt
  67. 190 59
      BusinessStep/src/main/java/com/develop/step/details/CookDetailActivity.kt
  68. 7 0
      BusinessStep/src/main/java/com/develop/step/details/CookDetailSourceAdapter.kt
  69. 16 1
      BusinessStep/src/main/java/com/develop/step/details/CookDetailSourceFragment.kt
  70. 2 2
      BusinessStep/src/main/java/com/develop/step/details/CookDetailToolAdapter.kt
  71. 1 2
      BusinessStep/src/main/java/com/develop/step/details/CookDetailViewModel.kt
  72. 223 134
      BusinessStep/src/main/java/com/develop/step/modes/ModesDetailActivity.kt
  73. 8 0
      BusinessStep/src/main/java/com/develop/step/viewmodel/CookModesViewModel.kt
  74. 2 1
      BusinessStep/src/main/java/com/develop/step/viewmodel/CookStepViewModel.kt
  75. 4 0
      BusinessStep/src/main/java/com/develop/step/widgets/NoteEditDialog.kt
  76. 23 4
      BusinessStep/src/main/java/com/develop/step/widgets/RingControlView.kt
  77. 60 8
      BusinessStep/src/main/res/layout/activity_cook_detail.xml
  78. 3 3
      BusinessStep/src/main/res/layout/activity_cook_evaluate.xml
  79. 158 144
      BusinessStep/src/main/res/layout/activity_food_step2.xml
  80. 12 12
      BusinessStep/src/main/res/layout/activity_mode_detail.xml
  81. 3 3
      BusinessStep/src/main/res/layout/dialog_recipe_delete_confirm.xml
  82. 25 22
      BusinessStep/src/main/res/layout/dialog_share_qr_code.xml
  83. 3 1
      BusinessStep/src/main/res/layout/fragment_detail_cook_desc.xml
  84. 2 0
      BusinessStep/src/main/res/layout/fragment_detail_cook_method.xml
  85. 2 0
      BusinessStep/src/main/res/layout/fragment_detail_cook_serving.xml
  86. 16 19
      BusinessStep/src/main/res/layout/fragment_detail_cook_source.xml
  87. 6 6
      BusinessStep/src/main/res/layout/item_cook_controller2.xml
  88. 12 6
      BusinessStep/src/main/res/layout/item_cook_source.xml
  89. 4 4
      BusinessStep/src/main/res/layout/item_cook_tool.xml
  90. 11 0
      BusinessStep/src/main/res/layout/item_note_dialog.xml
  91. 1 0
      LocalTools/.gitignore
  92. 15 0
      LocalTools/build.gradle
  93. BIN
      LocalTools/libs/gson-2.10.1.jar
  94. BIN
      LocalTools/libs/okhttp-4.9.0.jar
  95. BIN
      LocalTools/libs/okio-2.10.0.jar
  96. 29 0
      LocalTools/src/main/java/com/twm/tools/local/AndroidLanguage.kt
  97. 25 0
      LocalTools/src/main/java/com/twm/tools/local/BaiduLanguage.kt
  98. 12 0
      LocalTools/src/main/java/com/twm/tools/local/BaiduTranslateResponse.kt
  99. 49 0
      LocalTools/src/main/java/com/twm/tools/local/BaiduTranslateService.kt
  100. 0 0
      LocalTools/src/main/java/com/twm/tools/local/MainClass.kt

+ 2 - 1
BusinessAuth/src/main/AndroidManifest.xml

@@ -3,7 +3,8 @@
     package="com.develop.auth">
 
     <application>
-        <activity android:name=".ui.MemberAuthActivity"/>
+        <activity android:name=".ui.MemberAuthActivity"
+            android:configChanges="fontScale|keyboard|keyboardHidden|locale|orientation|screenLayout|uiMode|screenSize|navigation"/>
     </application>
 
 </manifest>

+ 3 - 1
BusinessAuth/src/main/java/com/develop/auth/ui/AgeSelectDialog.kt

@@ -9,10 +9,11 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
 class AgeSelectDialog(
     private val activity: AppCompatActivity,
     private val onConfirm: (index: Int, change: Boolean) -> Unit
-): BottomSheetDialog(activity, R.style.BottomSheetDialog) {
+) : BottomSheetDialog(activity, R.style.BottomSheetDialog) {
 
     private val binding = DialogDataPickerBinding.inflate(activity.layoutInflater)
     private val initIndex = 0
+
     init {
         val listData = createAgeListData()
         setContentView(binding.root)
@@ -36,6 +37,7 @@ class AgeSelectDialog(
 
     private fun createAgeListData(): List<String> {
         val list = mutableListOf<String>()
+        list.add(0, "18")
         for (index in 20..80) {
             list.add(index.toString())
         }

+ 11 - 2
BusinessAuth/src/main/java/com/develop/auth/ui/MemberAuthActivity.kt

@@ -4,6 +4,7 @@ import android.content.Context
 import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
+import android.widget.FrameLayout
 import androidx.activity.viewModels
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentManager
@@ -14,11 +15,13 @@ import com.develop.auth.R
 import com.develop.auth.databinding.ActivityMemberAuthBinding
 import com.develop.food.base.common.LOGIN_TAG
 import com.develop.food.base.event.TokenInvalidateEvent
+import com.develop.food.base.ext.background_drawable
 import com.develop.food.base.router.Screens
 import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.utils.GlobalToast
 import com.develop.food.base.utils.MmkvUtils
+import com.develop.food.base.utils.isNightTheme
 import org.greenrobot.eventbus.Subscribe
 
 @Route(path = Screens.Auth.MEMBER)
@@ -28,7 +31,6 @@ class MemberAuthActivity : BaseActivity<ActivityMemberAuthBinding>() {
     @Autowired(name = "enter_from_home")
     var enterFromHome: Boolean = false
 
-
     @JvmField
     @Autowired(name = "isTokenOut")
     var isTokenOut: Boolean = false
@@ -105,7 +107,14 @@ class MemberAuthActivity : BaseActivity<ActivityMemberAuthBinding>() {
             } else {
                 R.drawable.ic_icon6
             }
-            binding.ivUserIcon.setImageResource(icon)
+            binding.ivUserIcon.background_drawable = icon
+        }
+
+        if (isNightTheme()) {
+            val param = binding.ivBanner.layoutParams as FrameLayout.LayoutParams
+            param.width = FrameLayout.LayoutParams.MATCH_PARENT
+            param.height = FrameLayout.LayoutParams.MATCH_PARENT
+            binding.ivBanner.layoutParams = param
         }
     }
 

+ 10 - 7
BusinessAuth/src/main/java/com/develop/auth/ui/MemberForgotFragment.kt

@@ -2,7 +2,6 @@ package com.develop.auth.ui
 
 import android.view.LayoutInflater
 import android.view.ViewGroup
-import android.widget.Toast
 import androidx.fragment.app.activityViewModels
 import com.develop.auth.R
 import com.develop.auth.databinding.FragmentMemberForgotBinding
@@ -29,14 +28,14 @@ class MemberForgotFragment: ViewBindingFragment<FragmentMemberForgotBinding>() {
         binding.tvSendEmail.setOnClickListener {
             val email = binding.etEmailId.text.toString()
             if (email.isEmpty()) {
-                showToast("Please fill in your email")
+                showToast(getString(R.string.please_fill_in_your_email))
                 return@setOnClickListener
             }
             showDialog()
             viewModel.sendEmail(email).observe(viewLifecycleOwner) {
                 dismissDialog()
                 if (it) {
-                    showToast("Email send")
+                    showToast(getString(R.string.email_send))
                 }
             }
         }
@@ -45,22 +44,26 @@ class MemberForgotFragment: ViewBindingFragment<FragmentMemberForgotBinding>() {
             val captcha = binding.etCaptcha.text.toString()
             val password = binding.etPassword.text.toString()
             if (email.isEmpty()) {
-                showToast("Please fill in your email")
+                showToast(getString(R.string.please_fill_in_your_email))
                 return@setOnClickListener
             }
             if (captcha.isEmpty()) {
-                showToast("Captcha can not be empty!")
+                showToast(getString(R.string.captcha_can_not_be_empty))
                 return@setOnClickListener
             }
             if (password.isEmpty()) {
-                showToast("Please fill in the password")
+                showToast(getString(R.string.please_fill_in_the_password))
                 return@setOnClickListener
             }
             showDialog()
             viewModel.resetPassword(email, captcha, password).observe(viewLifecycleOwner) {
                 dismissDialog()
                 if (it) {
-                    showToast("Reset password success!")
+                    showToast(getString(R.string.reset_password_success))
+                    parentFragmentManager
+                        .beginTransaction()
+                        .replace(R.id.fl_container, MemberLoginFragment())
+                        .commitAllowingStateLoss()
                 }
             }
         }

+ 14 - 2
BusinessAuth/src/main/java/com/develop/auth/ui/MemberLaunchFragment.kt

@@ -7,6 +7,8 @@ import android.text.SpannableStringBuilder
 import android.text.style.ForegroundColorSpan
 import android.view.LayoutInflater
 import android.view.ViewGroup
+import androidx.activity.viewModels
+import androidx.fragment.app.activityViewModels
 import com.develop.auth.R
 import com.develop.auth.databinding.FragmentMemberLaunchBinding
 import com.develop.food.base.router.Screens
@@ -15,6 +17,8 @@ import com.develop.food.base.router.navigateTo
 
 class MemberLaunchFragment: ViewBindingFragment<FragmentMemberLaunchBinding>() {
 
+    private val viewModel by activityViewModels<MemberViewModel>()
+
     override fun createViewBinding(
         inflater: LayoutInflater,
         container: ViewGroup?
@@ -24,7 +28,11 @@ class MemberLaunchFragment: ViewBindingFragment<FragmentMemberLaunchBinding>() {
 
     override fun onPostCreateView() {
         val memberText = getString(R.string.member)
-        val description = getString(R.string.not_a_member_yet, memberText)
+        val description = try {
+            getString(R.string.not_a_member_yet, memberText)
+        } catch (ex: Exception) {
+            getString(R.string.not_a_member_yet)
+        }
         val memberIndex = description.indexOf(memberText)
         val spannable = SpannableString(description)
         spannable.setSpan(
@@ -41,7 +49,11 @@ class MemberLaunchFragment: ViewBindingFragment<FragmentMemberLaunchBinding>() {
                 .commitAllowingStateLoss()
         }
         binding.tvSkipForNow.setOnClickListener {
-            navigateTo(Screens.Main.ENTRANCE_CHOSEN)
+            if (viewModel.enterFromHome) {
+                requireActivity().finish()
+            } else {
+                navigateTo(Screens.Main.ENTRANCE_CHOSEN)
+            }
         }
     }
 }

+ 7 - 2
BusinessAuth/src/main/java/com/develop/auth/ui/MemberLoginFragment.kt

@@ -9,9 +9,9 @@ import com.develop.auth.R
 import com.develop.auth.databinding.FragmentMemberLoginBinding
 import com.develop.food.base.common.RECORD_ACCOUNT
 import com.develop.food.base.common.RECORD_PASSWORD
-import com.develop.food.base.ui.ViewBindingFragment
 import com.develop.food.base.router.Screens
 import com.develop.food.base.router.navigateTo
+import com.develop.food.base.ui.ViewBindingFragment
 import com.develop.food.base.utils.MmkvUtils
 import com.develop.food.base.utils.dimenRes
 
@@ -29,6 +29,7 @@ class MemberLoginFragment : ViewBindingFragment<FragmentMemberLoginBinding>(), K
     override fun onPostCreateView() {
         binding.tvLogin.setOnClickListener {
             if (!checkInputs()) {
+                showToast(getString(R.string.please_fill_in))
                 return@setOnClickListener
             }
             executeLogin(
@@ -54,6 +55,10 @@ class MemberLoginFragment : ViewBindingFragment<FragmentMemberLoginBinding>(), K
         }
         binding.cbRemember.setOnCheckedChangeListener { _, isChecked ->
             viewModel.loginRecord = isChecked
+            if (!isChecked) {
+                MmkvUtils.save(RECORD_ACCOUNT, null as? String?)
+                MmkvUtils.save(RECORD_PASSWORD, null as? String?)
+            }
         }
         val saveAccount = MmkvUtils.getString(RECORD_ACCOUNT)
         val savePassword = MmkvUtils.getString(RECORD_PASSWORD)
@@ -64,7 +69,7 @@ class MemberLoginFragment : ViewBindingFragment<FragmentMemberLoginBinding>(), K
             binding.etEmailId.setText(saveAccount)
             binding.etPassword.setText(savePassword)
         }
-        KeyboardUtils.registerSoftInputChangedListener(requireActivity(), this)
+       // KeyboardUtils.registerSoftInputChangedListener(requireActivity(), this)
     }
 
     override fun onSoftInputChanged(height: Int) {

+ 48 - 16
BusinessAuth/src/main/java/com/develop/auth/ui/MemberProfileFragment.kt

@@ -1,6 +1,5 @@
 package com.develop.auth.ui
 
-import android.graphics.Color
 import android.view.LayoutInflater
 import android.view.ViewGroup
 import androidx.fragment.app.activityViewModels
@@ -12,7 +11,12 @@ import com.develop.food.base.api.response.User
 import com.develop.food.base.common.API_TOKEN
 import com.develop.food.base.common.CURRENT_USER_ID_TAG
 import com.develop.food.base.common.LOGIN_TAG
+import com.develop.food.base.common.RECORD_ACCOUNT
+import com.develop.food.base.common.RECORD_PASSWORD
+import com.develop.food.base.event.FinishAtyEvent
+import com.develop.food.base.ext.text_color
 import com.develop.food.base.http.Resource
+import com.develop.food.base.repo.CURRENT_USER_ID
 import com.develop.food.base.repo.FoodDataProvider
 import com.develop.food.base.repo.entity.UserInfo
 import com.develop.food.base.router.Screens
@@ -21,6 +25,7 @@ import com.develop.food.base.ui.ViewBindingFragment
 import com.develop.food.base.utils.MmkvUtils
 import com.develop.food.base.utils.dimenRes
 import com.develop.food.base.utils.setVisible
+import org.greenrobot.eventbus.EventBus
 
 class MemberProfileFragment : ViewBindingFragment<FragmentMemberProfileBinding>() {
 
@@ -43,20 +48,24 @@ class MemberProfileFragment : ViewBindingFragment<FragmentMemberProfileBinding>(
         queryUserInfo()
         binding.tvChooseAge.setOnClickListener {
             AgeSelectDialog(hostActivity) { index, change ->
-                selectAge = index + 20
+                selectAge = if (index == 0) {
+                    18
+                } else {
+                    index + 20
+                }
                 binding.tvChooseAge.text = selectAge.toString()
-                binding.tvChooseAge.setTextColor(Color.BLACK)
+                binding.tvChooseAge.text_color = R.color.register_edit_color
             }.show()
         }
         binding.tvChooseSex.setOnClickListener {
             GenderSelectDialog {
                 selectGender = if (it) 2 else 1
                 if (selectGender == 2) {
-                    binding.tvChooseSex.text = "Male"
+                    binding.tvChooseSex.text = getString(R.string.male)
                 } else {
-                    binding.tvChooseSex.text = "Female"
+                    binding.tvChooseSex.text = getString(R.string.female)
                 }
-                binding.tvChooseSex.setTextColor(Color.BLACK)
+                binding.tvChooseSex.text_color = R.color.register_edit_color
             }.showDialog(parentFragmentManager, "gender")
         }
         binding.tvSave.setOnClickListener {
@@ -68,7 +77,12 @@ class MemberProfileFragment : ViewBindingFragment<FragmentMemberProfileBinding>(
             )
         }
         binding.tvSkipForNow.setOnClickListener {
-            if (binding.tvSkipForNow.text == "Sign out") {
+            if (binding.tvSkipForNow.text == getString(R.string.sign_out)) {
+                EventBus.getDefault().post(FinishAtyEvent())
+                FoodDataProvider
+                    .getUserDatabase()
+                    .userInfoDao()
+                    .deleteUserInfoByUserId(CURRENT_USER_ID)
                 MmkvUtils.save(LOGIN_TAG, false)
                 MmkvUtils.clear(API_TOKEN)
                 MmkvUtils.save(CURRENT_USER_ID_TAG, 0)
@@ -83,6 +97,24 @@ class MemberProfileFragment : ViewBindingFragment<FragmentMemberProfileBinding>(
 
         }
         binding.tvDestroyAccount.setOnClickListener {
+            viewModel.cancelAccount().observe(viewLifecycleOwner){
+                EventBus.getDefault().post(FinishAtyEvent())
+                FoodDataProvider
+                    .getUserDatabase()
+                    .userInfoDao()
+                    .deleteUserInfoByUserId(CURRENT_USER_ID)
+                val saveToken: String? = null
+                MmkvUtils.save(API_TOKEN, saveToken)
+                MmkvUtils.save(LOGIN_TAG, false)
+                MmkvUtils.save(CURRENT_USER_ID_TAG, 0)
+                MmkvUtils.save(RECORD_ACCOUNT, "")
+                MmkvUtils.save(RECORD_PASSWORD, "")
+                FoodDataProvider.getUserDatabase().userInfoDao().deleteAllUserInfo()
+                parentFragmentManager
+                    .beginTransaction()
+                    .replace(R.id.fl_container, MemberLoginFragment())
+                    .commitAllowingStateLoss()
+            }
 
         }
         userInfoLiveData.observe(viewLifecycleOwner) {
@@ -91,12 +123,12 @@ class MemberProfileFragment : ViewBindingFragment<FragmentMemberProfileBinding>(
                 selectGender = userGender?.toInt() ?: 2
                 binding.etNickname.setText(userName ?: "")
                 binding.tvChooseAge.text = userAge.toString()
-                binding.tvChooseSex.setTextColor(Color.BLACK)
-                binding.tvChooseAge.setTextColor(Color.BLACK)
+                binding.tvChooseSex.text_color = R.color.register_edit_color
+                binding.tvChooseAge.text_color = R.color.register_edit_color
                 if (selectGender == 2) {
-                    binding.tvChooseSex.text = "Male"
+                    binding.tvChooseSex.text = getString(R.string.male)
                 } else {
-                    binding.tvChooseSex.text = "Female"
+                    binding.tvChooseSex.text = getString(R.string.female)
                 }
                 viewModel.chooseAvatar.value = userAvatar?.toInt()
             }
@@ -114,7 +146,7 @@ class MemberProfileFragment : ViewBindingFragment<FragmentMemberProfileBinding>(
                 it.topMargin = dimenRes(R.dimen.convert_16px)
                 binding.tvSkipForNow.requestLayout()
             }
-            binding.tvSkipForNow.text = "Sign out"
+            binding.tvSkipForNow.text = getString(R.string.sign_out)
             binding.tvDestroyAccount.setVisible()
         }
     }
@@ -129,10 +161,10 @@ class MemberProfileFragment : ViewBindingFragment<FragmentMemberProfileBinding>(
             showToast("Please fill in nickname")
             return
         }
-        if (age == 0) {
-            showToast("Please fill in age")
-            return
-        }
+//        if (age == 0) {
+//            showToast("Please fill in age")
+//            return
+//        }
         showDialog(true)
         FoodRepository.perfectInfo(
             nickname, sex.toString(), portrait.toString(), age.toString()

+ 26 - 2
BusinessAuth/src/main/java/com/develop/auth/ui/MemberRegisterFragment.kt

@@ -42,11 +42,19 @@ class MemberRegisterFragment: ViewBindingFragment<FragmentMemberRegisterBinding>
         val inputPsd = binding.etPassword.text.toString()
         val inputPsdConfirm = binding.etPasswordAgain.text.toString()
         if (inputEmailId.isEmpty() || inputPsd.isEmpty()) {
-            showToast("Please fill in")
+            showToast(getString(R.string.please_fill_in))
             return false
         }
         if (!TextUtils.equals(inputPsd, inputPsdConfirm)) {
-            showToast("Password is not the same")
+            showToast(getString(R.string.password_is_not_the_same))
+            return false
+        }
+        if (inputPsd.length < 8) {
+            showToast(getString(R.string.password_should_more_than))
+            return false
+        }
+        if (!hasLetterAndDigit(inputPsd)) {
+            showToast(getString(R.string.password_should_include))
             return false
         }
         return true
@@ -68,4 +76,20 @@ class MemberRegisterFragment: ViewBindingFragment<FragmentMemberRegisterBinding>
         }
     }
 
+    private fun hasLetterAndDigit(str: String?): Boolean {
+        if (str.isNullOrEmpty()) {
+            return false
+        }
+        var hasLetter = false
+        var hasDigit = false
+        val array = str.toCharArray()
+        for (char in array) {
+            if (Character.isDigit(char)) {
+                hasDigit = true
+            } else if (Character.isLetter(char)) {
+                hasLetter = true
+            }
+        }
+        return hasDigit && hasLetter
+    }
 }

+ 27 - 9
BusinessAuth/src/main/java/com/develop/auth/ui/MemberViewModel.kt

@@ -1,14 +1,17 @@
 package com.develop.auth.ui
 
 import android.app.Application
-import android.content.Context
 import androidx.lifecycle.AndroidViewModel
 import androidx.lifecycle.LiveData
 import androidx.lifecycle.MutableLiveData
 import com.blankj.utilcode.util.ToastUtils
 import com.develop.auth.R
 import com.develop.food.base.api.FoodRepository
-import com.develop.food.base.common.*
+import com.develop.food.base.common.API_TOKEN
+import com.develop.food.base.common.CURRENT_USER_ID_TAG
+import com.develop.food.base.common.LOGIN_TAG
+import com.develop.food.base.common.RECORD_ACCOUNT
+import com.develop.food.base.common.RECORD_PASSWORD
 import com.develop.food.base.http.observeStatus
 import com.develop.food.base.repo.FoodDataProvider
 import com.develop.food.base.repo.entity.UserInfo
@@ -67,8 +70,12 @@ class MemberViewModel(application: Application) : AndroidViewModel(application)
                 dispatchLiveData.value = true
             },
             onFailed = {
-                it?.desc?.let { msg ->
-                    ToastUtils.showShort(getApplication<Application>().getString(R.string.account_password_error))
+                if (it?.code == -1) {
+                    ToastUtils.showShort(it.desc)
+                } else {
+                    it?.desc?.let { msg ->
+                        ToastUtils.showShort(getApplication<Application>().getString(R.string.account_password_error))
+                    }
                 }
                 dispatchLiveData.value = false
             }
@@ -107,15 +114,26 @@ class MemberViewModel(application: Application) : AndroidViewModel(application)
             },
             onFailed = {
                 it?.desc?.let { msg ->
-                   if("验证码不正确" == msg){
-                       ToastUtils.showShort(getApplication<Application>().getString(R.string.captcha_incorrect))
-                   }else{
-                       ToastUtils.showShort(msg)
-                   }
+                    if ("验证码不正确" == msg) {
+                        ToastUtils.showShort(getApplication<Application>().getString(R.string.captcha_incorrect))
+                    } else {
+                        ToastUtils.showShort(msg)
+                    }
                 }
                 liveData.value = false
             }
         )
         return liveData
     }
+
+
+    fun cancelAccount(): LiveData<Any> {
+        val liveData = MutableLiveData<Any>()
+        FoodRepository.cancelAccount().observeStatus(onSuccess = {
+            liveData.value = true
+        }, onFailed = {
+            liveData.value = false
+        })
+        return liveData
+    }
 }

+ 134 - 0
BusinessAuth/src/main/res/layout-ru/fragment_member_forgot.xml

@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:paddingBottom="@dimen/convert_36px"
+        android:focusable="true"
+        android:focusableInTouchMode="true">
+
+        <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/reset_password"
+            android:textColor="#6B6B6B"
+            android:textSize="@dimen/convert_54px"
+            android:layout_marginTop="@dimen/convert_110px"
+            android:layout_marginStart="@dimen/convert_75px"/>
+
+        <com.develop.food.base.widgets.YEditText
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:id="@+id/et_email_id"
+            android:layout_width="match_parent"
+            android:layout_marginStart="@dimen/convert_75px"
+            android:layout_marginEnd="@dimen/convert_75px"
+            android:layout_height="@dimen/convert_120px"
+            android:hint="@string/enter_email_id"
+            android:singleLine="true"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
+            android:textSize="@dimen/convert_45px"
+            android:inputType="textEmailAddress"
+            android:background="@drawable/bg_edit_input"
+            android:layout_marginTop="@dimen/convert_77px"
+            android:layout_gravity="center_horizontal"
+            android:paddingHorizontal="@dimen/convert_66px"/>
+
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:paddingHorizontal="@dimen/convert_75px"
+            android:layout_marginTop="@dimen/convert_45px">
+
+            <com.develop.food.base.widgets.YEditText
+                android:textCursorDrawable="@drawable/shape_edittext_cursor"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:id="@+id/et_captcha"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/convert_120px"
+                android:hint="@string/enter_captcha"
+                android:textSize="@dimen/convert_45px"
+                android:textColor="@color/register_edit_color"
+                android:textColorHint="@color/register_edit_color"
+                android:singleLine="true"
+                android:background="@drawable/bg_edit_input"
+                android:paddingHorizontal="@dimen/convert_66px"/>
+
+        </FrameLayout>
+
+        <TextView
+            android:id="@+id/tv_send_email"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="@color/launch_skip_for_now_color"
+            android:textSize="@dimen/convert_54px"
+            android:layout_marginTop="@dimen/convert_36px"
+            android:text="@string/send_email"
+            android:layout_gravity="center_horizontal"/>
+
+        <com.develop.food.base.widgets.YEditText
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:id="@+id/et_password"
+            android:layout_width="match_parent"
+            android:layout_marginStart="@dimen/convert_75px"
+            android:layout_marginEnd="@dimen/convert_75px"
+            android:layout_height="@dimen/convert_120px"
+            android:hint="@string/enter_password_again"
+            android:textSize="@dimen/convert_45px"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
+            android:inputType="textPassword"
+            android:singleLine="true"
+            android:background="@drawable/bg_edit_input"
+            android:layout_marginTop="@dimen/convert_45px"
+            android:layout_gravity="center_horizontal"
+            android:paddingHorizontal="@dimen/convert_66px"/>
+
+        <TextView
+            android:id="@+id/tv_hints"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="#E60012"
+            android:textSize="@dimen/convert_39px"
+            android:layout_marginTop="@dimen/convert_77px"
+            android:layout_marginStart="@dimen/convert_141px"
+            android:text="@string/enter_the_captcha_obtained_from_the_mail"/>
+
+        <TextView
+            android:id="@+id/tv_reset_password"
+            android:layout_width="@dimen/convert_930px"
+            android:layout_height="@dimen/convert_120px"
+            android:textColor="@color/register_color"
+            android:textSize="@dimen/convert_54px"
+            android:text="@string/reset_password"
+            android:gravity="center"
+            android:layout_gravity="center_horizontal"
+            android:background="@drawable/bg_orange_button"
+            android:layout_marginTop="@dimen/convert_171px"/>
+
+        <TextView
+            android:id="@+id/tv_login"
+            android:layout_width="@dimen/convert_930px"
+            android:layout_height="@dimen/convert_120px"
+            android:textColor="@color/launch_skip_for_now_color"
+            android:textSize="@dimen/convert_54px"
+            android:text="@string/login"
+            android:gravity="center"
+            android:layout_marginTop="10dp"
+            android:layout_gravity="center_horizontal"/>
+
+    </LinearLayout>
+
+</ScrollView>

+ 5 - 5
BusinessAuth/src/main/res/layout/activity_member_auth.xml

@@ -19,11 +19,11 @@
         android:layout_gravity="end|top"
         android:layout_margin="@dimen/convert_36px"
         android:background="@drawable/bg_skip_text"
-        android:text="HOME >>"
+        android:text="@string/member_home"
         android:paddingHorizontal="@dimen/convert_62px"
         android:gravity="center"
         android:textSize="@dimen/convert_42px"
-        android:textColor="#FFA627"/>
+        android:textColor="@color/home_color"/>
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/cl_user_icon"
@@ -31,7 +31,7 @@
         android:layout_height="@dimen/convert_672px"
         android:visibility="gone">
 
-        <com.google.android.material.imageview.ShapeableImageView
+        <ImageView
             android:id="@+id/iv_user_icon"
             android:layout_width="@dimen/convert_270px"
             android:layout_height="@dimen/convert_270px"
@@ -46,8 +46,8 @@
             android:layout_width="@dimen/convert_300px"
             android:layout_height="@dimen/convert_90px"
             android:layout_marginTop="@dimen/convert_60px"
-            android:text="Select"
-            android:textColor="#FFA627"
+            android:text="@string/avatar_select"
+            android:textColor="@color/login_color"
             android:textSize="@dimen/convert_45px"
             android:gravity="center"
             android:background="@drawable/bg_icon_select"

+ 22 - 7
BusinessAuth/src/main/res/layout/fragment_member_forgot.xml

@@ -17,19 +17,24 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/reset_password"
-            android:textColor="#6B6B6B"
+            android:textColor="@color/register_title_color"
             android:textSize="@dimen/convert_54px"
             android:layout_marginTop="@dimen/convert_110px"
             android:layout_marginStart="@dimen/convert_75px"/>
 
-        <EditText
+        <com.develop.food.base.widgets.YEditText
             android:id="@+id/et_email_id"
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
             android:layout_width="match_parent"
             android:layout_marginStart="@dimen/convert_75px"
             android:layout_marginEnd="@dimen/convert_75px"
             android:layout_height="@dimen/convert_120px"
             android:hint="@string/enter_email_id"
             android:singleLine="true"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
             android:textSize="@dimen/convert_45px"
             android:inputType="textEmailAddress"
             android:background="@drawable/bg_edit_input"
@@ -44,13 +49,18 @@
             android:paddingHorizontal="@dimen/convert_75px"
             android:layout_marginTop="@dimen/convert_45px">
 
-            <EditText
+            <com.develop.food.base.widgets.YEditText
+                android:textCursorDrawable="@drawable/shape_edittext_cursor"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
                 android:id="@+id/et_captcha"
                 android:layout_width="@dimen/convert_600px"
                 android:layout_height="@dimen/convert_120px"
                 android:hint="@string/enter_captcha"
                 android:textSize="@dimen/convert_45px"
                 android:singleLine="true"
+                android:textColor="@color/register_edit_color"
+                android:textColorHint="@color/register_edit_color"
                 android:background="@drawable/bg_edit_input"
                 android:paddingHorizontal="@dimen/convert_66px"/>
 
@@ -58,14 +68,16 @@
                 android:id="@+id/tv_send_email"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:textColor="#FFA627"
+                android:textColor="@color/launch_skip_for_now_color"
                 android:textSize="@dimen/convert_54px"
                 android:text="@string/send_email"
                 android:layout_gravity="center_vertical|end"/>
 
         </FrameLayout>
 
-        <EditText
+        <com.develop.food.base.widgets.YEditText
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
             android:id="@+id/et_password"
             android:layout_width="match_parent"
             android:layout_marginStart="@dimen/convert_75px"
@@ -75,6 +87,9 @@
             android:textSize="@dimen/convert_45px"
             android:inputType="textPassword"
             android:singleLine="true"
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
             android:background="@drawable/bg_edit_input"
             android:layout_marginTop="@dimen/convert_45px"
             android:layout_gravity="center_horizontal"
@@ -94,7 +109,7 @@
             android:id="@+id/tv_reset_password"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#fff"
+            android:textColor="@color/register_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/reset_password"
             android:gravity="center"
@@ -106,7 +121,7 @@
             android:id="@+id/tv_login"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#FFA627"
+            android:textColor="@color/launch_skip_for_now_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/login"
             android:gravity="center"

+ 6 - 7
BusinessAuth/src/main/res/layout/fragment_member_launch.xml

@@ -2,8 +2,7 @@
 <ScrollView
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="#fff">
+    android:layout_height="match_parent">
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -14,7 +13,7 @@
             android:id="@+id/tv_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textColor="#000"
+            android:textColor="@color/member_launch_color"
             android:textSize="@dimen/convert_72px"
             android:text="Not a member yet?"
             android:textStyle="bold"
@@ -25,8 +24,8 @@
             android:id="@+id/tv_subtitle"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textColor="#000"
-            android:textSize="20dp"
+            android:textColor="@color/member_launch_color"
+            android:textSize="@dimen/convert_52px"
             android:text="@string/launch_detail"
             android:lineSpacingExtra="8dp"
             android:layout_marginTop="40dp"
@@ -36,7 +35,7 @@
             android:id="@+id/tv_login_or_signup"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#fff"
+            android:textColor="@color/login_sign_up_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/login_sign_up"
             android:gravity="center"
@@ -48,7 +47,7 @@
             android:id="@+id/tv_skip_for_now"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#FFA627"
+            android:textColor="@color/launch_skip_for_now_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/skip_for_now"
             android:gravity="center"

+ 20 - 9
BusinessAuth/src/main/res/layout/fragment_member_login.xml

@@ -2,8 +2,7 @@
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:background="#fff">
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -17,7 +16,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/login"
-            android:textColor="#6B6B6B"
+            android:textColor="@color/login_title_color"
             android:textSize="@dimen/convert_54px"
             android:layout_marginTop="@dimen/convert_110px"
             android:layout_marginStart="@dimen/convert_75px"/>
@@ -30,6 +29,7 @@
             android:layout_gravity="center_vertical">
 
             <CheckBox
+                android:buttonTint="#6B6B6B"
                 android:id="@+id/cb_remember"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -42,9 +42,9 @@
                 android:id="@+id/tv_remember"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:textColor="#6B6B6B"
+                android:textColor="@color/remember_color"
                 android:textSize="@dimen/convert_39px"
-                android:text="Remember"
+                android:text="@string/remember"
                 app:layout_constraintStart_toEndOf="@+id/cb_remember"
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintBottom_toBottomOf="parent"/>
@@ -63,24 +63,35 @@
 
         </androidx.constraintlayout.widget.ConstraintLayout>
 
-        <EditText
+        <com.develop.food.base.widgets.YEditText
             android:id="@+id/et_email_id"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
             android:hint="@string/enter_email_id"
             android:textSize="@dimen/convert_45px"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
             android:singleLine="true"
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
             android:background="@drawable/bg_edit_input"
             android:layout_marginTop="@dimen/convert_129px"
             android:layout_gravity="center_horizontal"
             android:paddingHorizontal="@dimen/convert_66px"/>
 
-        <EditText
+        <com.develop.food.base.widgets.YEditText
             android:id="@+id/et_password"
             android:layout_width="@dimen/convert_930px"
+            android:cursorVisible="true"
             android:layout_height="@dimen/convert_120px"
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
             android:inputType="textPassword"
             android:hint="@string/enter_password"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
             android:textSize="@dimen/convert_45px"
             android:singleLine="true"
             android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -93,7 +104,7 @@
             android:id="@+id/tv_login"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#fff"
+            android:textColor="@color/register_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/login"
             android:gravity="center"
@@ -105,7 +116,7 @@
             android:id="@+id/tv_register"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#FFA627"
+            android:textColor="@color/launch_skip_for_now_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/register"
             android:gravity="center"

+ 14 - 9
BusinessAuth/src/main/res/layout/fragment_member_profile.xml

@@ -3,7 +3,7 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="#fff">
+    android:background="@color/bg_color">
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -17,17 +17,22 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/nickname"
-            android:textColor="#6B6B6B"
+            android:textColor="@color/register_title_color"
             android:textSize="@dimen/convert_54px"
             android:layout_marginTop="@dimen/convert_75px"
             android:layout_marginStart="@dimen/convert_101px"/>
 
-        <EditText
+        <com.develop.food.base.widgets.YEditText
             android:id="@+id/et_nickname"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
             android:hint="@string/enter_nickname"
             android:textSize="@dimen/convert_45px"
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
             android:background="@drawable/bg_edit_input"
             android:layout_marginTop="@dimen/convert_32px"
             android:layout_gravity="center_horizontal"
@@ -38,7 +43,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/sex"
-            android:textColor="#6B6B6B"
+            android:textColor="@color/register_title_color"
             android:textSize="@dimen/convert_54px"
             android:layout_marginTop="@dimen/convert_80px"
             android:layout_marginStart="@dimen/convert_101px"/>
@@ -49,7 +54,7 @@
             android:layout_height="@dimen/convert_120px"
             android:textSize="@dimen/convert_45px"
             android:text="@string/male"
-            android:textColor="#B1B2B2"
+            android:textColor="@color/register_edit_color"
             android:background="@drawable/bg_edit_input"
             android:layout_marginTop="@dimen/convert_32px"
             android:gravity="center_vertical"
@@ -61,7 +66,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/age"
-            android:textColor="#6B6B6B"
+            android:textColor="@color/register_title_color"
             android:textSize="@dimen/convert_54px"
             android:layout_marginTop="@dimen/convert_77px"
             android:layout_marginStart="@dimen/convert_101px"/>
@@ -72,7 +77,7 @@
             android:layout_height="@dimen/convert_120px"
             android:textSize="@dimen/convert_45px"
             android:text="20"
-            android:textColor="#B1B2B2"
+            android:textColor="@color/register_edit_color"
             android:background="@drawable/bg_edit_input"
             android:gravity="center_vertical"
             android:layout_marginTop="@dimen/convert_18px"
@@ -83,7 +88,7 @@
             android:id="@+id/tv_save"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#fff"
+            android:textColor="@color/register_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/save"
             android:gravity="center"
@@ -95,7 +100,7 @@
             android:id="@+id/tv_skip_for_now"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="wrap_content"
-            android:textColor="#FFA627"
+            android:textColor="@color/launch_skip_for_now_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/skip_for_now"
             android:gravity="center"

+ 22 - 7
BusinessAuth/src/main/res/layout/fragment_member_register.xml

@@ -3,7 +3,7 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="#fff">
+    >
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -17,29 +17,39 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/sign_up_it_s_free"
-            android:textColor="#6B6B6B"
+            android:textColor="@color/register_title_color"
             android:textSize="@dimen/convert_54px"
             android:layout_marginTop="@dimen/convert_110px"
             android:layout_marginStart="@dimen/convert_75px"/>
 
-        <EditText
+        <com.develop.food.base.widgets.YEditText
             android:id="@+id/et_email_id"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
             android:hint="@string/enter_email_id"
             android:textSize="@dimen/convert_45px"
             android:singleLine="true"
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
             android:background="@drawable/bg_edit_input"
             android:layout_marginTop="@dimen/convert_74px"
             android:layout_gravity="center_horizontal"
             android:paddingHorizontal="@dimen/convert_66px"/>
 
-        <EditText
+        <com.develop.food.base.widgets.YEditText
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
             android:id="@+id/et_password"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
             android:hint="@string/enter_password"
             android:textSize="@dimen/convert_45px"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
             android:singleLine="true"
             android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
             android:inputType="textPassword"
@@ -48,11 +58,16 @@
             android:layout_gravity="center_horizontal"
             android:paddingHorizontal="@dimen/convert_66px"/>
 
-        <EditText
+        <com.develop.food.base.widgets.YEditText
+            android:textCursorDrawable="@drawable/shape_edittext_cursor"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
             android:id="@+id/et_password_again"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
             android:inputType="textPassword"
+            android:textColor="@color/register_edit_color"
+            android:textColorHint="@color/register_edit_color"
             android:hint="@string/enter_password_again"
             android:textSize="@dimen/convert_45px"
             android:singleLine="true"
@@ -76,7 +91,7 @@
             android:id="@+id/tv_register"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#fff"
+            android:textColor="@color/register_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/register"
             android:gravity="center"
@@ -88,7 +103,7 @@
             android:id="@+id/tv_login"
             android:layout_width="@dimen/convert_930px"
             android:layout_height="@dimen/convert_120px"
-            android:textColor="#FFA627"
+            android:textColor="@color/launch_skip_for_now_color"
             android:textSize="@dimen/convert_54px"
             android:text="@string/login"
             android:gravity="center"

+ 29 - 4
BusinessMain/src/main/java/com/develop/main/init/ui/FoodListActivity.kt

@@ -6,10 +6,16 @@ import android.view.LayoutInflater
 import android.view.View
 import androidx.recyclerview.widget.RecyclerView
 import com.alibaba.android.arouter.facade.annotation.Route
-import com.develop.food.base.common.*
+import com.develop.food.base.common.Downloaded
+import com.develop.food.base.common.FOOD_LIST_TYPE
+import com.develop.food.base.common.FOOL_LIST_TITLE
+import com.develop.food.base.common.Favourite
+import com.develop.food.base.common.History
 import com.develop.food.base.data.DataFactory
 import com.develop.food.base.data.model.FoodContentModel
 import com.develop.food.base.event.RefreshDataEvent
+import com.develop.food.base.event.RefreshLikeDataEvent
+import com.develop.food.base.ext.safeGlobalScope
 import com.develop.food.base.repo.CURRENT_USER_ID
 import com.develop.food.base.repo.FoodDataProvider
 import com.develop.food.base.repo.entity.DevRecipe
@@ -18,10 +24,12 @@ import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.utils.ResDimension
 import com.develop.food.base.utils.ThreadUtils
+import com.develop.food.base.utils.setVisible
 import com.develop.main.R
 import com.develop.main.databinding.ActivityFoodListBinding
 import com.develop.main.init.ui.adapter.RecipesListAdapter
-import org.greenrobot.eventbus.EventBus
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
 import org.greenrobot.eventbus.Subscribe
 
 @Route(path = Screens.Main.FOOD_LIST)
@@ -44,6 +52,9 @@ class FoodListActivity : BaseActivity<ActivityFoodListBinding>() {
         binding.topBar.listenBackClick {
             finish()
         }
+        if (foodListType == History) {
+            binding.ivDelete.setVisible()
+        }
         recipesListAdapter.isHistory = foodListType == History
         binding.foodListRecycler.apply {
             adapter = recipesListAdapter
@@ -78,6 +89,14 @@ class FoodListActivity : BaseActivity<ActivityFoodListBinding>() {
             }
         }
 
+        binding.ivDelete.setOnClickListener {
+            safeGlobalScope.launch(Dispatchers.IO) {
+                FoodDataProvider.getUserDatabase().userInfoDao()
+                    .deleteAllHistoryRecipes(CURRENT_USER_ID)
+                refreshData()
+            }
+        }
+
     }
 
     override fun onResume() {
@@ -95,6 +114,12 @@ class FoodListActivity : BaseActivity<ActivityFoodListBinding>() {
         refreshData()
     }
 
+    @Subscribe
+    fun onLikeStateEvent(event: RefreshLikeDataEvent) {
+        refreshData()
+    }
+
+
     private fun refreshData() {
         if (foodListType == Downloaded) {
             getOnLineDownloadedFoodList()
@@ -109,7 +134,7 @@ class FoodListActivity : BaseActivity<ActivityFoodListBinding>() {
             val recipesDao = FoodDataProvider.getDatabase().recipeDao()
             val recipesIdList = mutableListOf<String>()
             val favoriteRecipesIds = mutableListOf<String>()
-            if(foodListType == Favourite){
+            if (foodListType == Favourite) {
                 userDao.queryFavoriteRecipes(CURRENT_USER_ID).forEach {
                     recipesIdList.add(it.favoriteRecipesId)
                     favoriteRecipesIds.add(it.favoriteRecipesId)
@@ -174,7 +199,7 @@ class FoodListActivity : BaseActivity<ActivityFoodListBinding>() {
                     FoodContentModel(
                         it.photoPath ?: "",
                         it.name ?: "",
-                        it.score?.toInt()?:5,
+                        it.score?.toInt() ?: 5,
                         DataFactory.getTime(it.makeHours ?: 0, it.makeMinutes ?: 0),
                         it.difficultyLevel ?: "",
                         isLike = favoriteRecipesIds.contains(it.number),

+ 23 - 10
BusinessMain/src/main/java/com/develop/main/init/ui/HomeActivity.kt

@@ -8,10 +8,20 @@ import android.widget.LinearLayout
 import androidx.databinding.ViewDataBinding
 import androidx.lifecycle.MutableLiveData
 import com.alibaba.android.arouter.facade.annotation.Route
-import com.develop.food.base.common.*
+import com.develop.food.base.common.CURRENT_USER_ID_TAG
+import com.develop.food.base.common.FOOD_LIST_TYPE
+import com.develop.food.base.common.FOOL_LIST_TITLE
+import com.develop.food.base.common.Favourite
+import com.develop.food.base.common.History
+import com.develop.food.base.common.MODE_ENTRANCE
+import com.develop.food.base.common.POLICY_FROM_MAIN_SETTING
+import com.develop.food.base.common.Recipes
+import com.develop.food.base.common.WIFI_FROM_MAIN_SETTING
 import com.develop.food.base.data.FunType
 import com.develop.food.base.data.model.NewsModel
+import com.develop.food.base.event.FinishAtyEvent
 import com.develop.food.base.event.TokenInvalidateEvent
+import com.develop.food.base.ext.src
 import com.develop.food.base.manager.wifi.WifiData
 import com.develop.food.base.manager.wifi.WifiHelp
 import com.develop.food.base.repo.FoodDataProvider
@@ -90,8 +100,6 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), NetWorkManager.OnSysCh
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         initFragment(intent)
-        binding.slideContainer.addSlideView(binding.rightSlide)
-        binding.slideContainer.isCanSlide(true)
         initCallbackAndListener()
         NetWorkManager.get().addTimeChangeListener(this)
         wifiHelp = WifiHelp.Build(this).build()
@@ -124,9 +132,9 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), NetWorkManager.OnSysCh
                         R.drawable.ic_icon6
                     }
                 }
-                binding.ivAvatar.setImageResource(icon)
+                binding.ivAvatar.src = icon
             } else {
-                binding.ivAvatar.setImageResource(R.drawable.ic_icon1)
+                binding.ivAvatar.src = R.drawable.ic_icon1
                 binding.functionTopBar.setUserName(getString(R.string.login))
                 binding.tvUserName.text = getString(R.string.login)
             }
@@ -207,7 +215,7 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), NetWorkManager.OnSysCh
                 }
 
                 override fun onTabClick() {
-                    binding.slideContainer.sliderShowWithAnim()
+                    binding.contentView.openDrawer(binding.rightContentLayout)
                 }
 
                 override fun onWifiClick() {
@@ -231,12 +239,12 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), NetWorkManager.OnSysCh
         }
 
         binding.settingLayout.setOnClickListener {
-            binding.slideContainer.sliderGoneWithAnim()
+            binding.contentView.closeDrawers()
             navigateTo(Screens.Setting.MAIN_SETTING)
         }
 
         binding.favouriteLayout.setOnClickListener {
-            binding.slideContainer.sliderGoneWithAnim()
+            binding.contentView.closeDrawers()
             val bundle = Bundle()
             bundle.putString(FOOL_LIST_TITLE, getString(R.string.favourite_recipes))
             bundle.putInt(FOOD_LIST_TYPE, Favourite)
@@ -246,7 +254,7 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), NetWorkManager.OnSysCh
         }
 
         binding.historyLayout.setOnClickListener {
-            binding.slideContainer.sliderGoneWithAnim()
+            binding.contentView.closeDrawers()
             val bundle = Bundle()
             bundle.putString(FOOL_LIST_TITLE, getString(R.string.cook_history))
             bundle.putInt(FOOD_LIST_TYPE, History)
@@ -256,7 +264,7 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), NetWorkManager.OnSysCh
         }
 
         binding.policyLayout.setOnClickListener {
-            binding.slideContainer.sliderGoneWithAnim()
+            binding.contentView.closeDrawers()
             val bundle = Bundle()
             bundle.putBoolean(POLICY_FROM_MAIN_SETTING, true)
             navigateTo(Screens.Setting.POLICY) {
@@ -300,4 +308,9 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), NetWorkManager.OnSysCh
         }
         finish()
     }
+
+    @Subscribe
+    fun  onFinishAtyEvent(event: FinishAtyEvent){
+        finish()
+    }
 }

+ 47 - 14
BusinessMain/src/main/java/com/develop/main/init/ui/ModeEntranceActivity.kt

@@ -3,6 +3,7 @@ package com.develop.main.init.ui
 import android.os.Bundle
 import android.util.Log
 import android.view.LayoutInflater
+import android.widget.RelativeLayout
 import com.alibaba.android.arouter.facade.annotation.Route
 import com.develop.food.base.common.MODE_ENTRANCE
 import com.develop.food.base.common.Mode
@@ -14,6 +15,9 @@ import com.develop.food.base.router.Screens
 import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.utils.MmkvUtils
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.utils.resId2Dimension
+import com.develop.main.R
 import com.develop.main.databinding.ActivityModeEntranceBinding
 import com.google.gson.Gson
 
@@ -21,7 +25,7 @@ import com.google.gson.Gson
 class ModeEntranceActivity : BaseActivity<ActivityModeEntranceBinding>() {
 
     private var loadingDialog: LoadingDialog = LoadingDialog()
-
+    private var isShowLoading = false
     private lateinit var wifiHelp: WifiHelp
     override fun createViewBinding(inflater: LayoutInflater): ActivityModeEntranceBinding {
         return ActivityModeEntranceBinding.inflate(layoutInflater)
@@ -37,39 +41,68 @@ class ModeEntranceActivity : BaseActivity<ActivityModeEntranceBinding>() {
             wifiHelp.connect(Gson().fromJson(wifiData, WifiData::class.java))
         }
         binding.modeLayout.setOnClickListener {
-            val bundle = Bundle()
-            bundle.putInt(MODE_ENTRANCE, Mode)
-            navigateTo(Screens.Main.HOME) {
-                with(bundle)
+            if (FoodDataProvider.checkDataExit()) {
+                val bundle = Bundle()
+                bundle.putInt(MODE_ENTRANCE, Mode)
+                navigateTo(Screens.Main.HOME) {
+                    with(bundle)
+                }
+                finish()
+            } else {
+                showLoading()
             }
-            finish()
+
         }
         binding.recipesLayout.setOnClickListener {
-            val bundle = Bundle()
-            bundle.putInt(MODE_ENTRANCE, Recipes)
-            navigateTo(Screens.Main.HOME) {
-                with(bundle)
+            if (FoodDataProvider.checkDataExit()) {
+                val bundle = Bundle()
+                bundle.putInt(MODE_ENTRANCE, Recipes)
+                navigateTo(Screens.Main.HOME) {
+                    with(bundle)
+                }
+                finish()
+            } else {
+                showLoading()
             }
-            finish()
         }
         if (FoodDataProvider.getPrepareLiveData().value != true) {
             showLoadingDialog()
         }
+        if (isNightTheme()){
+            val recipesParam = binding.ivRecipes.layoutParams as RelativeLayout.LayoutParams
+            recipesParam.width = dp88
+            recipesParam.height = dp75
+            binding.ivRecipes.layoutParams = recipesParam
+
+            val modeParam = binding.ivMode.layoutParams as RelativeLayout.LayoutParams
+            modeParam.width = dp87
+            modeParam.height = dp84
+            binding.ivMode.layoutParams = modeParam
+        }
     }
 
     private fun showLoadingDialog() {
         loadingDialog.showDialog(supportFragmentManager, "Loading")
         FoodDataProvider.getPrepareLiveData().observe(this) {
-            if (it) {
-                loadingDialog.removeSelf()
-            }
+            loadingDialog.removeSelf()
             Log.d("QQQQ", "dismiss!!!!!")
         }
     }
 
+    private fun showLoading() {
+        isShowLoading = true
+        loadingDialog.showDialog(supportFragmentManager, "Loading")
+    }
+
     override fun onDestroy() {
         super.onDestroy()
         loadingDialog.removeSelf()
         wifiHelp.destroy()
     }
+    companion object{
+        var dp88 = (R.dimen.convert_88px).resId2Dimension().toInt()
+        var dp87 = (R.dimen.convert_87px).resId2Dimension().toInt()
+        var dp84 = (R.dimen.convert_84px).resId2Dimension().toInt()
+        var dp75 = (R.dimen.convert_75px).resId2Dimension().toInt()
+    }
 }

+ 35 - 6
BusinessMain/src/main/java/com/develop/main/init/ui/ModesFragment.kt

@@ -11,11 +11,15 @@ import androidx.recyclerview.widget.RecyclerView
 import com.develop.food.base.common.MODE_TYPE
 import com.develop.food.base.data.DataFactory
 import com.develop.food.base.data.model.ModelsModel
+import com.develop.food.base.ext.background_drawable
 import com.develop.food.base.router.Screens
 import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.ViewBindingFragment
 import com.develop.food.base.utils.ResDimension
 import com.develop.food.base.utils.TopResumedActivityHolder
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.utils.setGone
+import com.develop.food.base.utils.setVisible
 import com.develop.food.base.widgets.CancelConfirmDialog
 import com.develop.main.R
 import com.develop.main.databinding.FragmentModesBinding
@@ -38,6 +42,10 @@ class ModesFragment : ViewBindingFragment<FragmentModesBinding>() {
     }
 
     override fun onPostCreateView() {
+        if (isNightTheme()) {
+            binding.listMode.setGone()
+            binding.modeLayout034.setVisible()
+        }
         binding.listMode.setOnClickListener {
             isGrid = !isGrid
             if (isGrid) {
@@ -50,6 +58,24 @@ class ModesFragment : ViewBindingFragment<FragmentModesBinding>() {
                 binding.galleryRecycle.visibility = View.VISIBLE
             }
         }
+
+        binding.modeLayout034.setOnClickListener {
+            isGrid = !isGrid
+            if (isGrid){
+                binding.ivIcon2.background_drawable = R.drawable.icon_v
+            } else {
+                binding.ivIcon2.background_drawable = R.drawable.ic_grid
+            }
+            if (isGrid) {
+                binding.listName2.text = getString(R.string.list_view)
+                binding.gridRecycle.visibility = View.VISIBLE
+                binding.galleryRecycle.visibility = View.GONE
+            } else {
+                binding.listName2.text = getString(R.string.grid_view)
+                binding.gridRecycle.visibility = View.GONE
+                binding.galleryRecycle.visibility = View.VISIBLE
+            }
+        }
         val manager = GridLayoutManager(context, 2)
         binding.gridRecycle.apply {
             adapter = modesGridAdapter
@@ -71,6 +97,7 @@ class ModesFragment : ViewBindingFragment<FragmentModesBinding>() {
                             outRect.left = ResDimension(R.dimen.convert_60px).toInt()
                             outRect.right = ResDimension(R.dimen.convert_30px).toInt()
                         }
+
                         1 -> {
                             outRect.left = ResDimension(R.dimen.convert_30px).toInt()
                             outRect.right = ResDimension(R.dimen.convert_60px).toInt()
@@ -132,7 +159,7 @@ class ModesFragment : ViewBindingFragment<FragmentModesBinding>() {
             run {
 
 
-                if(CofarSDK.devInfo().status != DevStatus.STOP.toInt()){
+                if (CofarSDK.devInfo().status != DevStatus.STOP.toInt()) {
                     runningWeightTips()
                     return@run
                 }
@@ -150,7 +177,7 @@ class ModesFragment : ViewBindingFragment<FragmentModesBinding>() {
                 val devInfo = CofarSDK.devInfo();
 
 
-                if( devInfo.status != DevStatus.STOP.toInt() && devInfo.runningInstId != dataList[position].modesType.name){
+                if (devInfo.status != DevStatus.STOP.toInt() && devInfo.runningInstId != dataList[position].modesType.name) {
                     runningWeightTips()
                     return@run
                 }
@@ -164,17 +191,19 @@ class ModesFragment : ViewBindingFragment<FragmentModesBinding>() {
         }
 
     }
-    private  val runningTipsDialog: CancelConfirmDialog = CancelConfirmDialog()
 
-    fun runningWeightTips(){
+    private val runningTipsDialog: CancelConfirmDialog = CancelConfirmDialog()
+
+    fun runningWeightTips() {
         runningTipsDialog.dialog?.hide()
         runningTipsDialog.showCancel = false
-        runningTipsDialog.title =  getString(R.string.running_block_tips)
+        runningTipsDialog.title = getString(R.string.running_block_tips)
         runningTipsDialog.confirmStr = getString(R.string.ok)
 
         TopResumedActivityHolder.getCurrentActivity()?.supportFragmentManager?.let {
             runningTipsDialog.showDialog(
-                it,"running_block_tips")
+                it, "running_block_tips"
+            )
         }
     }
 

+ 111 - 10
BusinessMain/src/main/java/com/develop/main/init/ui/RecipesFragment.kt

@@ -1,5 +1,6 @@
 package com.develop.main.init.ui
 
+import android.os.Bundle
 import android.util.Log
 import android.view.LayoutInflater
 import android.view.View
@@ -8,6 +9,7 @@ import android.widget.RelativeLayout
 import androidx.databinding.ViewDataBinding
 import androidx.fragment.app.activityViewModels
 import androidx.recyclerview.widget.RecyclerView
+import com.bumptech.glide.Glide
 import com.develop.base.databinding.FragmentCommeListBinding
 import com.develop.food.base.data.CategoryType
 import com.develop.food.base.data.DataFactory
@@ -15,11 +17,15 @@ import com.develop.food.base.data.SortedType
 import com.develop.food.base.data.model.FilterSortModel
 import com.develop.food.base.data.model.FoodContentModel
 import com.develop.food.base.data.model.HomeBannerModel
+import com.develop.food.base.event.RefreshDataEvent
+import com.develop.food.base.event.RefreshLikeDataEvent
+import com.develop.food.base.event.RefreshStarDataEvent
 import com.develop.food.base.repo.entity.DevRecipeCategory
 import com.develop.food.base.router.Screens
 import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.ViewBindingFragment
 import com.develop.food.base.utils.ResDimension
+import com.develop.food.base.utils.resId2Dimension
 import com.develop.food.base.widgets.CommonPopupWindow
 import com.develop.food.base.widgets.FilterSortViewLayout
 import com.develop.main.R
@@ -32,6 +38,8 @@ import com.develop.main.init.ui.provider.FunctionProvider
 import com.develop.main.init.ui.provider.HomeBannerProvider
 import com.develop.main.init.ui.provider.RecipesContentProvider
 import com.develop.main.init.ui.viewmodel.HomeViewModel
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
 
 
 class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
@@ -62,6 +70,10 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
             }
             .onShowBefore { popupWindow, view ->
                 val filterRecycler = view.findViewById<RecyclerView>(R.id.filter_recycle)
+                val triangle: View = view.findViewById(R.id.triangle)
+                val param = triangle.layoutParams as RelativeLayout.LayoutParams
+                param.marginStart = dp65
+                triangle.layoutParams = param
                 filterRecycler.adapter = categoryAdapter
             }
             .build<ViewDataBinding>(hostActivity)
@@ -81,6 +93,10 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
             }
             .onShowBefore { popupWindow, view ->
                 val filterRecycler = view.findViewById<RecyclerView>(R.id.filter_recycle)
+                val triangle: View = view.findViewById(R.id.triangle)
+                val param = triangle.layoutParams as RelativeLayout.LayoutParams
+                param.addRule(RelativeLayout.CENTER_HORIZONTAL)
+                triangle.layoutParams = param
                 filterRecycler.adapter = sortAdapter
             }
             .build<ViewDataBinding>(hostActivity)
@@ -89,6 +105,7 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
 
     private var currentHotWord = ""
 
+    private var loadMore = false
     override fun createViewBinding(
         inflater: LayoutInflater,
         container: ViewGroup?
@@ -96,36 +113,59 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
         return FragmentCommeListBinding.inflate(inflater, container, false)
     }
 
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        EventBus.getDefault().register(this)
+    }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        EventBus.getDefault().unregister(this)
+    }
+
     var scrollY = 0
 
     override fun onPostCreateView() {
         sortDataList.addAll(DataFactory.genSortNameList(resources))
-
+        categoryAdapter.homeViewModel = homeViewModel
         binding.recycleList.apply { adapter = recipesMainAdapter }
         binding.recycleList.addOnScrollListener(object : RecyclerView.OnScrollListener() {
 
 
             override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
-                Log.i("ZM","onScrollStateChanged: " + recyclerView.computeVerticalScrollOffset())
+                Log.i("ZM", "onScrollStateChanged: " + recyclerView.computeVerticalScrollOffset())
                 scrollY = recyclerView.computeVerticalScrollOffset();
                 super.onScrollStateChanged(recyclerView, newState)
+                if (newState == RecyclerView.SCROLL_STATE_IDLE) {
+                    if (!hostActivity.isDestroyed){
+                        Glide.with(hostActivity).resumeRequests();//恢复Glide加载图片
+                    }
+                }else {
+                    if (!hostActivity.isDestroyed){
+                        Glide.with(hostActivity).pauseRequests();//禁止Glide加载图片
+                    }
+                }
+
             }
         })
 
         recipesMainAdapter.apply {
             loadMoreModule.setOnLoadMoreListener {
                 if (homeViewModel.recipesType == HomeViewModel.RecipesType.ONLINE) {
-                    if (homeViewModel.currentPage < homeViewModel.totalPageSize) {
+                    if (homeViewModel.loadIndex < homeViewModel.totalPageSize) {
+                        loadMore = true
                         homeViewModel.getOnLineRecipeList(
                             categoryCode,
                             homeViewModel.currCategoryName,
                             isLoadMore = true
                         )
                     } else {
-                        loadMoreModule.loadMoreEnd()
+                        loadMore = false
+                        loadMoreModule.loadMoreEnd(true)
                     }
                 } else {
-                    loadMoreModule.loadMoreEnd()
+                    loadMore = false
+                    loadMoreModule.loadMoreEnd(true)
                 }
             }
             //banner的点击事件
@@ -134,6 +174,7 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
                     override fun onNetRecipesClick(bannerModel: HomeBannerModel) {
                         homeViewModel.recipesType = HomeViewModel.RecipesType.ONLINE
                         homeViewModel.netFoodLiveData.postValue(true)
+                        (hostActivity as HomeActivity).showDialog()
                         homeViewModel.getOnLineCategoryList()
                     }
                 }
@@ -182,8 +223,10 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
 
                 override fun onBackClick() {
                     if (homeViewModel.recipesType == HomeViewModel.RecipesType.ONLINE) {
+                        (hostActivity as HomeActivity).showDialog()
                         homeViewModel.getOnLineCategoryList()
                     } else {
+                        categoryAdapter.updateSelectedPosition(0)
                         homeViewModel.queryLocalRecipes(categoryCode)
                     }
                 }
@@ -271,8 +314,11 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
 
             //获取线上菜谱列表回调
             onLineRecipesLiveData.observe(viewLifecycleOwner) {
+                (hostActivity as HomeActivity).dismissDialog()
                 recipesMainAdapter.setList(it)
-                binding.recycleList.scrollToPosition(0)
+                if (!loadMore){
+                    binding.recycleList.scrollToPosition(0)
+                }
             }
 
             //获取线上分类回调
@@ -289,6 +335,9 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
                 categoryAdapter.setList(categoryDataList)
                 binding.recycleList.scrollToPosition(0)
             }
+            errorLiveData.observe(viewLifecycleOwner) {
+                (hostActivity as HomeActivity).dismissDialog()
+            }
             //获取线上热门标签回调
             onLineHotTagsLiveData.observe(viewLifecycleOwner) {
                 recipesMainAdapter.setList(DataFactory.genOnLineHotTags(it))
@@ -352,17 +401,24 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
             sortDataList[pos].name
         )
         homeViewModel.sortedType = when (pos) {
-            0 -> {
+            1 -> {
                 SortedType.Popular
             }
-            1 -> {
+
+            2 -> {
                 SortedType.Newest
             }
-            2 -> {
+
+            3 -> {
                 SortedType.Score
             }
+
+            0 -> {
+                SortedType.A2Z
+            }
+
             else -> {
-                SortedType.Popular
+                SortedType.A2Z
             }
         }
         if (needRefresh) {
@@ -375,4 +431,49 @@ class RecipesFragment : ViewBindingFragment<FragmentCommeListBinding>() {
     }
 
 
+    @Subscribe
+    fun refreshStarRecipes(event: RefreshStarDataEvent) {
+        val dataList = recipesMainAdapter.data
+        for (i in dataList.indices) {
+            val data = dataList[i]
+            if (data is FoodContentModel) {
+                if (data.foodId == event.recipeNumber) {
+                    data.starCount = event.starCount
+                    data.useNum = event.useNum.toInt()
+                    recipesMainAdapter.setList(dataList)
+                    recipesMainAdapter.notifyItemChanged(i)
+                }
+            }
+        }
+
+    }
+
+    @Subscribe
+    fun refreshLikeRecipes(event: RefreshLikeDataEvent) {
+        val dataList = recipesMainAdapter.data
+        for (i in dataList.indices) {
+            val data = dataList[i]
+            if (data is FoodContentModel) {
+                if (data.foodId == event.recipeNumber) {
+                    data.isLike = event.isLike
+                    recipesMainAdapter.setList(dataList)
+                    recipesMainAdapter.notifyItemChanged(i)
+                }
+            }
+        }
+
+    }
+
+    private var fromRefreshEvent = false
+
+    @Subscribe
+    fun refreshRecipes(event: RefreshDataEvent) {
+        fromRefreshEvent = true
+
+    }
+
+    companion object {
+        var dp65 = (R.dimen.convert_65px).resId2Dimension().toInt()
+    }
+
 }

+ 41 - 4
BusinessMain/src/main/java/com/develop/main/init/ui/adapter/CategoryAdapter.kt

@@ -1,25 +1,62 @@
 package com.develop.main.init.ui.adapter
 
+
 import android.widget.ImageView
 import androidx.appcompat.widget.AppCompatTextView
+import androidx.core.content.ContextCompat
+import androidx.core.graphics.drawable.DrawableCompat
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
 import com.develop.food.base.repo.entity.DevRecipeCategory
+import com.develop.food.base.utils.GlobalApp
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.utils.setGone
+import com.develop.food.base.utils.setVisible
 import com.develop.main.R
+import com.develop.main.init.ui.viewmodel.HomeViewModel
+
 
 class CategoryAdapter :
     BaseQuickAdapter<DevRecipeCategory, BaseViewHolder>(R.layout.item_filter_and_sort_view) {
     private var selectedPosition = 0
+
+    var homeViewModel: HomeViewModel? = null
     override fun convert(holder: BaseViewHolder, item: DevRecipeCategory) {
         val ivCheck = holder.getView<ImageView>(R.id.iv_check)
         val tvName = holder.getView<AppCompatTextView>(R.id.tv_name)
-        tvName.text = item.name
+        if (homeViewModel?.recipesType == HomeViewModel.RecipesType.ONLINE) {
+            tvName.text = item.name
+        } else {
+
+            var size = if (item.name == GlobalApp().getString(R.string.all)) {
+                homeViewModel?.categorySizeList?.get(item.name) ?: "null"
+            } else {
+                homeViewModel?.categorySizeList?.get(item.number) ?: "null"
+            }
+            if (size == "null") {
+                size = "0"
+            }
+            tvName.text = "${item.name}($size)"
+        }
+
         if (selectedPosition == holder.adapterPosition) {
-            tvName.setTextColor(context.resources.getColor(R.color.color_F4A12E))
-            ivCheck.setBackgroundResource(R.drawable.ic_check)
+            ivCheck.setVisible()
+            if (isNightTheme()) {
+                val up = ContextCompat.getDrawable(context, R.drawable.ic_check)
+                val drawableUp = DrawableCompat.wrap(up!!)
+                DrawableCompat.setTint(
+                    drawableUp,
+                    ContextCompat.getColor(context, R.color.color_000000)
+                )
+                tvName.setTextColor(context.resources.getColor(R.color.color_000000))
+                ivCheck.setImageDrawable(drawableUp)
+            } else {
+                tvName.setTextColor(context.resources.getColor(R.color.color_F4A12E))
+                ivCheck.setBackgroundResource(R.drawable.ic_check)
+            }
         } else {
             tvName.setTextColor(context.resources.getColor(R.color.color_6B6B6B))
-            ivCheck.setBackgroundResource(0)
+            ivCheck.setGone()
         }
     }
 

+ 9 - 3
BusinessMain/src/main/java/com/develop/main/init/ui/adapter/HomeBannerAdapter.kt

@@ -15,11 +15,13 @@ import com.develop.food.base.common.Downloaded
 import com.develop.food.base.common.FOOD_LIST_TYPE
 import com.develop.food.base.common.FOOL_LIST_TITLE
 import com.develop.food.base.data.model.HomeBannerModel
+import com.develop.food.base.ext.background_drawable
+import com.develop.food.base.router.Screens
+import com.develop.food.base.router.navigateTo
 import com.develop.food.base.utils.ResDimension
+import com.develop.food.base.utils.isNightTheme
 import com.develop.main.R
 import com.develop.main.init.ui.HomeActivity
-import com.develop.food.base.router.Screens
-import com.develop.food.base.router.navigateTo
 import com.youth.banner.adapter.BannerAdapter
 
 class HomeBannerAdapter(var bannerDataList: MutableList<HomeBannerModel>) :
@@ -47,7 +49,11 @@ class HomeBannerAdapter(var bannerDataList: MutableList<HomeBannerModel>) :
     }
 
     override fun onBindView(holder: ViewHolder, data: HomeBannerModel, position: Int, size: Int) {
-        Glide.with(context).load(data.cover).apply(options).into(holder.ivBanner)
+        if (isNightTheme()){
+            holder.ivBanner.background_drawable = data.cover as Int
+        } else {
+            Glide.with(context).load(data.cover).apply(options).into(holder.ivBanner)
+        }
         holder.downloadLayout.setOnClickListener {
             (context as HomeActivity).navigateTo(Screens.Main.FOOD_LIST) {
                 val bundle = Bundle()

+ 3 - 5
BusinessMain/src/main/java/com/develop/main/init/ui/adapter/ModesGalleryAdapter.kt

@@ -1,20 +1,18 @@
 package com.develop.main.init.ui.adapter
 
 
+import android.widget.ImageView
 import androidx.appcompat.widget.AppCompatTextView
-import com.bumptech.glide.Glide
-import com.bumptech.glide.load.resource.bitmap.RoundedCorners
-import com.bumptech.glide.request.RequestOptions
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
 import com.develop.food.base.data.model.ModelsModel
-import com.develop.food.base.utils.ResDimension
+import com.develop.food.base.ext.background_drawable
 import com.develop.main.R
 
 class ModesGalleryAdapter : BaseQuickAdapter<ModelsModel,BaseViewHolder>(R.layout.item_mode_card_view) {
     override fun convert(holder: BaseViewHolder, item: ModelsModel) {
         holder.getView<AppCompatTextView>(R.id.tv_mode_name).text =item.modeName
-        Glide.with(context).load(item.resId).into(holder.getView(R.id.ic_icon))
+        holder.getView<ImageView>(R.id.ic_icon).background_drawable = item.resId
     }
 
 

+ 4 - 3
BusinessMain/src/main/java/com/develop/main/init/ui/adapter/ModesGridAdapter.kt

@@ -1,15 +1,16 @@
 package com.develop.main.init.ui.adapter
 
 import android.widget.ImageView
-import androidx.appcompat.widget.AppCompatTextView
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
 import com.develop.food.base.data.model.ModelsModel
+import com.develop.food.base.ext.background_drawable
+import com.develop.food.base.widgets.MarqueeTextView
 import com.develop.main.R
 
 class ModesGridAdapter : BaseQuickAdapter<ModelsModel, BaseViewHolder>(R.layout.item_grid_view) {
     override fun convert(holder: BaseViewHolder, item: ModelsModel) {
-        holder.getView<ImageView>(R.id.iv_icon).setBackgroundResource(item.resId)
-        holder.getView<AppCompatTextView>(R.id.tv_mode_name).text = item.modeName
+        holder.getView<ImageView>(R.id.iv_icon).background_drawable = item.resId
+        holder.getView<MarqueeTextView>(R.id.tv_mode_name).text = item.modeName
     }
 }

+ 2 - 1
BusinessMain/src/main/java/com/develop/main/init/ui/adapter/RecipesListAdapter.kt

@@ -17,6 +17,7 @@ import com.develop.food.base.repo.entity.UserFavoriteRecipes
 import com.develop.food.base.utils.ResDimension
 import com.develop.food.base.utils.TopResumedActivityHolder
 import com.develop.food.base.widgets.CancelConfirmDialog
+import com.develop.food.base.widgets.MarqueeTextView
 import com.develop.food.base.widgets.StarView
 import com.develop.main.R
 import org.greenrobot.eventbus.EventBus
@@ -40,7 +41,7 @@ class RecipesListAdapter :
             FoodDataProvider.getResourcePath(item.cover.toString())
         }
         Glide.with(context).load(cover).apply(options).into(holder.getView(R.id.iv_cover))
-        holder.getView<AppCompatTextView>(R.id.tv_food_name).text = item.foodName
+        holder.getView<MarqueeTextView>(R.id.tv_food_name).text = item.foodName
         holder.getView<StarView>(R.id.star_view).setStarCount(item.starCount)
         val likeLayout = holder.getView<RelativeLayout>(R.id.like_layout)
         val ivLike = holder.getView<ImageView>(R.id.iv_like)

+ 16 - 3
BusinessMain/src/main/java/com/develop/main/init/ui/adapter/RecipesMainAdapter.kt

@@ -2,9 +2,17 @@ package com.develop.main.init.ui.adapter
 
 import com.chad.library.adapter.base.BaseProviderMultiAdapter
 import com.chad.library.adapter.base.module.LoadMoreModule
-import com.develop.food.base.data.model.*
-import com.develop.main.R
-import com.develop.main.init.ui.provider.*
+import com.develop.food.base.data.model.CategoryModel
+import com.develop.food.base.data.model.CommonSearchModel
+import com.develop.food.base.data.model.FilterSortModel
+import com.develop.food.base.data.model.FoodContentModel
+import com.develop.food.base.data.model.HomeBannerListModel
+import com.develop.main.init.ui.provider.CategoryTabProvider
+import com.develop.main.init.ui.provider.CategoryTitleProvider
+import com.develop.main.init.ui.provider.CommonSearchProvider
+import com.develop.main.init.ui.provider.FunctionProvider
+import com.develop.main.init.ui.provider.HomeBannerProvider
+import com.develop.main.init.ui.provider.RecipesContentProvider
 
 class RecipesMainAdapter : BaseProviderMultiAdapter<Any>(), LoadMoreModule {
 
@@ -29,12 +37,15 @@ class RecipesMainAdapter : BaseProviderMultiAdapter<Any>(), LoadMoreModule {
             is String -> {
                 CATEGORY_TITLE_TAG
             }
+
             is FoodContentModel -> {
                 CONTENT_TAG
             }
+
             is FilterSortModel -> {
                 FUNCTION_TAG
             }
+
             is HomeBannerListModel -> {
                 BANNER_TAG
             }
@@ -42,9 +53,11 @@ class RecipesMainAdapter : BaseProviderMultiAdapter<Any>(), LoadMoreModule {
             is CommonSearchModel -> {
                 SEARCH_TAG
             }
+
             is CategoryModel -> {
                 CATEGORY_TAB_TAG
             }
+
             else -> {
                 CONTENT_TAG
             }

+ 20 - 3
BusinessMain/src/main/java/com/develop/main/init/ui/adapter/SortAdapter.kt

@@ -2,9 +2,14 @@ package com.develop.main.init.ui.adapter
 
 import android.widget.ImageView
 import androidx.appcompat.widget.AppCompatTextView
+import androidx.core.content.ContextCompat
+import androidx.core.graphics.drawable.DrawableCompat
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
 import com.develop.food.base.data.model.FilterSortModel
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.utils.setGone
+import com.develop.food.base.utils.setVisible
 import com.develop.main.R
 
 class SortAdapter :
@@ -15,11 +20,23 @@ class SortAdapter :
         val tvName = holder.getView<AppCompatTextView>(R.id.tv_name)
         tvName.text = item.name
         if (selectedPosition == holder.adapterPosition) {
-            tvName.setTextColor(context.resources.getColor(R.color.color_F4A12E))
-            ivCheck.setBackgroundResource(R.drawable.ic_check)
+            ivCheck.setVisible()
+            if (isNightTheme()) {
+                val up = ContextCompat.getDrawable(context, R.drawable.ic_check)
+                val drawableUp = DrawableCompat.wrap(up!!)
+                DrawableCompat.setTint(
+                    drawableUp,
+                    ContextCompat.getColor(context, R.color.color_000000)
+                )
+                tvName.setTextColor(context.resources.getColor(R.color.color_000000))
+                ivCheck.setImageDrawable(drawableUp)
+            } else {
+                tvName.setTextColor(context.resources.getColor(R.color.color_F4A12E))
+                ivCheck.setBackgroundResource(R.drawable.ic_check)
+            }
         } else {
             tvName.setTextColor(context.resources.getColor(R.color.color_6B6B6B))
-            ivCheck.setBackgroundResource(0)
+            ivCheck.setGone()
         }
     }
 

+ 7 - 0
BusinessMain/src/main/java/com/develop/main/init/ui/provider/HomeBannerProvider.kt

@@ -1,10 +1,13 @@
 package com.develop.main.init.ui.provider
 
 
+import com.blankj.utilcode.util.NetworkUtils
 import com.chad.library.adapter.base.provider.BaseItemProvider
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
 import com.develop.food.base.data.model.HomeBannerListModel
 import com.develop.food.base.data.model.HomeBannerModel
+import com.develop.food.base.utils.GlobalApp
+import com.develop.food.base.utils.GlobalToast
 import com.develop.main.R
 import com.develop.main.init.ui.adapter.HomeBannerAdapter
 import com.develop.main.init.ui.adapter.RecipesMainAdapter
@@ -22,6 +25,10 @@ class HomeBannerProvider : BaseItemProvider<Any>() {
        val bannerAdapter = HomeBannerAdapter(item.data)
         bannerAdapter.onBannerItemClickListener = object :HomeBannerAdapter.OnBannerItemClickListener{
             override fun onNetRecipesClick(bannerModel: HomeBannerModel) {
+                if (!NetworkUtils.isConnected()){
+                    GlobalToast.showToast(GlobalApp().getString(R.string.network_wifi_status_disconnected))
+                    return
+                }
                 onBannerItemClickListener?.onNetRecipesClick(bannerModel)
             }
         }

+ 26 - 2
BusinessMain/src/main/java/com/develop/main/init/ui/provider/RecipesContentProvider.kt

@@ -11,13 +11,16 @@ import com.bumptech.glide.request.RequestOptions
 import com.chad.library.adapter.base.provider.BaseItemProvider
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
 import com.develop.food.base.data.model.FoodContentModel
+import com.develop.food.base.event.RefreshLikeDataEvent
 import com.develop.food.base.repo.CURRENT_USER_ID
 import com.develop.food.base.repo.FoodDataProvider
 import com.develop.food.base.repo.entity.UserFavoriteRecipes
 import com.develop.food.base.utils.ResDimension
+import com.develop.food.base.widgets.MarqueeTextView
 import com.develop.food.base.widgets.StarView
 import com.develop.main.R
 import com.develop.main.init.ui.adapter.RecipesMainAdapter
+import org.greenrobot.eventbus.EventBus
 
 class RecipesContentProvider : BaseItemProvider<Any>() {
     override val itemViewType: Int
@@ -28,6 +31,7 @@ class RecipesContentProvider : BaseItemProvider<Any>() {
         RoundedCorners(ResDimension(com.develop.base.R.dimen.convert_30px).toInt())
     private val options = RequestOptions.bitmapTransform(roundedCorners)
     var onRecipesContentClickListener: OnRecipesContentClickListener? = null
+    var mIsHistoryList = false
     override fun convert(helper: BaseViewHolder, item: Any) {
         item as FoodContentModel
         val cover = if (item.isNetRecipes) {
@@ -36,7 +40,7 @@ class RecipesContentProvider : BaseItemProvider<Any>() {
             FoodDataProvider.getResourcePath(item.cover.toString())
         }
         Glide.with(context).load(cover).apply(options).into(helper.getView(R.id.iv_cover))
-        helper.getView<AppCompatTextView>(R.id.tv_food_name).text = item.foodName
+        helper.getView<MarqueeTextView>(R.id.tv_food_name).text = item.foodName
         helper.getView<StarView>(R.id.star_view).apply {
             setStarCount(item.starCount)
             setCommentNumber(item.useNum.toString())
@@ -45,7 +49,7 @@ class RecipesContentProvider : BaseItemProvider<Any>() {
             onRecipesContentClickListener?.onRecipesContentClick(item, helper.adapterPosition)
         }
         helper.getView<AppCompatTextView>(R.id.tv_time_and_level).text =
-            "${item.time}・${item.level}"
+            "${item.time}・${getLevelStr(item.level)}"
         val likeLayout = helper.getView<RelativeLayout>(R.id.like_layout)
         val ivLike = helper.getView<ImageView>(R.id.iv_like)
         val ivNet = helper.getView<ImageView>(R.id.iv_net)
@@ -68,6 +72,9 @@ class RecipesContentProvider : BaseItemProvider<Any>() {
                         CURRENT_USER_ID, item.foodId
                     )
                 }
+                if (!mIsHistoryList) {
+                    EventBus.getDefault().post(RefreshLikeDataEvent(false, item.foodId))
+                }
                 ivLike.setBackgroundResource(R.drawable.ic_unlike)
             } else {
                 item.isLike = true
@@ -77,6 +84,23 @@ class RecipesContentProvider : BaseItemProvider<Any>() {
                         UserFavoriteRecipes(CURRENT_USER_ID, item.foodId)
                     )
                 }
+                if (!mIsHistoryList) {
+                    EventBus.getDefault().post(RefreshLikeDataEvent(true, item.foodId))
+                }
+            }
+        }
+    }
+
+    private fun getLevelStr(level: String): String {
+        return when (level) {
+            "easy" -> {
+                context.getString(R.string.easy)
+            }
+            "medium" -> {
+                context.getString(R.string.medium)
+            }
+            else -> {
+                context.getString(R.string.hard)
             }
         }
     }

+ 62 - 15
BusinessMain/src/main/java/com/develop/main/init/ui/viewmodel/HomeViewModel.kt

@@ -2,6 +2,7 @@ package com.develop.main.init.ui.viewmodel
 
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.ViewModel
+import com.blankj.utilcode.util.NetworkUtils
 import com.develop.food.base.api.FoodRepository
 import com.develop.food.base.data.CategoryType
 import com.develop.food.base.data.DataFactory
@@ -16,8 +17,11 @@ import com.develop.food.base.repo.CURRENT_USER_ID
 import com.develop.food.base.repo.FoodDataProvider
 import com.develop.food.base.repo.entity.DevRecipe
 import com.develop.food.base.repo.entity.DevRecipeCategory
+import com.develop.food.base.utils.GlobalApp
+import com.develop.food.base.utils.GlobalToast
 import com.develop.food.base.utils.MmkvUtils
 import com.develop.food.base.utils.ThreadUtils
+import com.develop.main.R
 import com.google.gson.Gson
 import com.google.gson.reflect.TypeToken
 import java.lang.reflect.Type
@@ -43,16 +47,33 @@ class HomeViewModel : ViewModel() {
     var currentPageSize = 10
     var totalPageSize = 1
 
-    var sortedType = SortedType.Popular
+    var sortedType = SortedType.A2Z
 
     var tempOnLineRecipes = mutableListOf<DevRecipe>()
     private var requestVersion = 0
+    var categorySizeList = HashMap<String, String>()
+    var errorLiveData = MutableLiveData<Boolean>()
 
     fun queryRecipesCategory() {
+        var allSize = 0
         FoodDataProvider.getDatabase().runInTransaction {
-            localCategoryLiveData.postValue(
-                FoodDataProvider.getDatabase().recipeDao().queryCategory().toMutableList()
-            )
+            val result = FoodDataProvider.getDatabase().recipeDao().queryCategory().toMutableList()
+            categorySizeList.clear()
+            result.forEach {
+                val size = FoodDataProvider.getDatabase().recipeDao()
+                    .queryRecipesByCategory(it.number ?: "").size
+                categorySizeList[it.number ?: ""] = if (size.toString() == "null") {
+                    "0"
+                } else {
+                    size.toString()
+                }
+            }
+            categorySizeList.forEach {
+                allSize += it.value.toInt()
+            }
+            categorySizeList[GlobalApp().getString(R.string.all)] =
+                allSize.toString()
+            localCategoryLiveData.postValue(result)
         }
     }
 
@@ -134,33 +155,44 @@ class HomeViewModel : ViewModel() {
                     allList.forEach {
                         result.add(
                             FoodContentModel(
-                                it.photoPath ?: "", it.name ?: "",
-                                3, DataFactory.getTime(it.makeHours ?: 0, it.makeMinutes ?: 0),
-                                it.difficultyLevel ?: "", foodId = it.number ?: "",
+                                it.photoPath ?: "",
+                                it.name ?: "",
+                                it.score?.toInt() ?: 0,
+                                DataFactory.getTime(it.makeHours ?: 0, it.makeMinutes ?: 0),
+                                it.difficultyLevel ?: "",
+                                foodId = it.number ?: "",
                                 useNum = it.useNum?.toInt() ?: 0
                             )
                         )
                     }
                 }
+
                 CategoryType.Recipes -> {
                     recipesList.forEach {
                         result.add(
                             FoodContentModel(
-                                it.photoPath ?: "", it.name ?: "",
-                                3, DataFactory.getTime(it.makeHours ?: 0, it.makeMinutes ?: 0),
-                                it.difficultyLevel ?: "", foodId = it.number ?: "",
+                                it.photoPath ?: "",
+                                it.name ?: "",
+                                it.score?.toInt() ?: 0,
+                                DataFactory.getTime(it.makeHours ?: 0, it.makeMinutes ?: 0),
+                                it.difficultyLevel ?: "",
+                                foodId = it.number ?: "",
                                 useNum = it.useNum?.toInt() ?: 0
                             )
                         )
                     }
                 }
+
                 CategoryType.Ingredients -> {
                     foodList.forEach {
                         result.add(
                             FoodContentModel(
-                                it.photoPath ?: "", it.name ?: "",
-                                3, DataFactory.getTime(it.makeHours ?: 0, it.makeMinutes ?: 0),
-                                it.difficultyLevel ?: "", foodId = it.number ?: "",
+                                it.photoPath ?: "",
+                                it.name ?: "",
+                                it.score?.toInt() ?: 0,
+                                DataFactory.getTime(it.makeHours ?: 0, it.makeMinutes ?: 0),
+                                it.difficultyLevel ?: "",
+                                foodId = it.number ?: "",
                                 useNum = it.useNum?.toInt() ?: 0
                             )
                         )
@@ -172,6 +204,7 @@ class HomeViewModel : ViewModel() {
     }
 
     fun getOnLineCategoryList() {
+        resetOnlineConfig()
         val version = ++requestVersion
         FoodRepository.getRecipesCategory().observeStatus(onSuccess = {
             if (version != requestVersion) {
@@ -186,6 +219,7 @@ class HomeViewModel : ViewModel() {
         })
     }
 
+    var loadIndex = 1
     fun getOnLineRecipeList(
         category: String,
         name: String,
@@ -193,10 +227,22 @@ class HomeViewModel : ViewModel() {
         pageSize: Int = 10,
         isLoadMore: Boolean = false
     ) {
+        if (!NetworkUtils.isConnected()){
+            GlobalToast.showToast(GlobalApp().getString(R.string.network_wifi_status_disconnected))
+            return
+        }
         if (!isLoadMore) resetOnlineConfig()
-        FoodRepository.recipesList(category, name, pageIndex, pageSize).observeStatus(
+        if (isLoadMore) {
+            loadIndex++
+        }
+       val searchName =  if (name== GlobalApp().getString(R.string.all)){
+            ""
+        } else {
+            name
+        }
+        FoodRepository.recipesList(category, searchName, loadIndex, pageSize).observeStatus(
             onFailed = {
-
+                errorLiveData.postValue(true)
             },
             onSuccess = {
                 val recipesList = it?.recipes?.toMutableList() ?: mutableListOf()
@@ -293,6 +339,7 @@ class HomeViewModel : ViewModel() {
 
     private fun resetOnlineConfig() {
         currentPage = 1
+        loadIndex = 1
         currentPageSize = 10
         totalPageSize = 1
         tempOnLineRecipes.clear()

+ 10 - 0
BusinessMain/src/main/res/layout/activity_food_list.xml

@@ -10,6 +10,16 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content" />
 
+    <ImageView
+        android:visibility="invisible"
+        android:background="@drawable/ic_delete_all"
+        android:layout_alignParentEnd="true"
+        android:layout_marginTop="@dimen/convert_20px"
+        android:id="@+id/iv_delete"
+        android:layout_marginEnd="@dimen/convert_20px"
+        android:layout_width="@dimen/convert_60px"
+        android:layout_height="@dimen/convert_60px"/>
+
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/food_list_recycler"
         android:layout_width="match_parent"

+ 137 - 141
BusinessMain/src/main/res/layout/activity_home.xml

@@ -1,13 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/content_view"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:background="@color/bg_color">
 
-    <com.develop.food.base.widgets.slide.SlideContainerLayout
+    <LinearLayout
         android:id="@+id/slide_container"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:orientation="vertical">
 
 
         <com.develop.food.base.widgets.HomeFunctionTopBar
@@ -21,151 +23,145 @@
             android:layout_height="match_parent"
             android:layout_below="@id/function_top_bar" />
 
-    </com.develop.food.base.widgets.slide.SlideContainerLayout>
+    </LinearLayout>
 
 
-    <com.develop.food.base.widgets.slide.RightSlideLayout
-        android:id="@+id/right_slide"
-        android:layout_width="match_parent"
+    <RelativeLayout
+        android:id="@+id/right_content_layout"
+        android:layout_width="@dimen/convert_675px"
         android:layout_height="match_parent"
-        android:visibility="gone">
+        android:layout_alignParentEnd="true"
+        android:layout_gravity="end"
+        android:background="@color/color_fff">
+
+        <ImageView
+            android:id="@+id/iv_avatar"
+            android:layout_width="@dimen/convert_294px"
+            android:layout_height="@dimen/convert_294px"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="@dimen/convert_183px"
+            android:background="@drawable/ic_icon1" />
+
+        <LinearLayout
+            android:id="@+id/history_layout"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/convert_120px"
+            android:layout_below="@id/tv_user_name"
+            android:layout_marginStart="@dimen/convert_77px"
+            android:layout_marginTop="@dimen/convert_140px"
+            android:background="@drawable/shape_60pxf4a12e_left_corners"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
 
-        <RelativeLayout
-            android:id="@+id/right_content_layout"
-            android:layout_width="@dimen/convert_675px"
-            android:layout_height="match_parent"
-            android:layout_alignParentEnd="true"
-            android:background="@color/color_fff">
+            <ImageView
+                android:layout_width="@dimen/convert_75px"
+                android:layout_height="@dimen/convert_75px"
+                android:layout_marginStart="@dimen/convert_60px"
+                android:background="@drawable/ic_history" />
+
+            <androidx.appcompat.widget.AppCompatTextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/convert_32px"
+                android:text="@string/cook_history"
+                android:textColor="@color/color_fff"
+                android:textSize="@dimen/convert_45px" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/favourite_layout"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/convert_120px"
+            android:layout_below="@id/history_layout"
+            android:layout_marginStart="@dimen/convert_77px"
+            android:layout_marginTop="@dimen/convert_89px"
+            android:background="@drawable/shape_60pxf4a12e_left_corners"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <ImageView
+                android:layout_width="@dimen/convert_75px"
+                android:layout_height="@dimen/convert_75px"
+                android:layout_marginStart="@dimen/convert_60px"
+                android:background="@drawable/ic_favourite" />
+
+            <androidx.appcompat.widget.AppCompatTextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/convert_32px"
+                android:text="@string/favourite_recipes"
+                android:textColor="@color/color_fff"
+                android:textSize="@dimen/convert_45px" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/setting_layout"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/convert_120px"
+            android:layout_below="@id/favourite_layout"
+            android:layout_marginStart="@dimen/convert_77px"
+            android:layout_marginTop="@dimen/convert_89px"
+            android:background="@drawable/shape_60pxf4a12e_left_corners"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <ImageView
+                android:layout_width="@dimen/convert_75px"
+                android:layout_height="@dimen/convert_75px"
+                android:layout_marginStart="@dimen/convert_60px"
+                android:background="@drawable/ic_setting" />
+
+            <androidx.appcompat.widget.AppCompatTextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/convert_32px"
+                android:text="@string/settings"
+                android:textColor="@color/color_fff"
+                android:textSize="@dimen/convert_45px" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/policy_layout"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/convert_120px"
+            android:layout_below="@id/setting_layout"
+            android:layout_marginStart="@dimen/convert_77px"
+            android:layout_marginTop="@dimen/convert_89px"
+            android:background="@drawable/shape_60pxf4a12e_left_corners"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
 
             <ImageView
-                android:id="@+id/iv_avatar"
-                android:layout_width="@dimen/convert_294px"
-                android:layout_height="@dimen/convert_294px"
-                android:layout_centerHorizontal="true"
-                android:layout_marginTop="@dimen/convert_183px"
-                android:background="@drawable/ic_icon1" />
-
-            <LinearLayout
-                android:id="@+id/history_layout"
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/convert_120px"
-                android:layout_below="@id/tv_user_name"
-                android:layout_marginStart="@dimen/convert_77px"
-                android:layout_marginTop="@dimen/convert_140px"
-                android:background="@drawable/shape_60pxf4a12e_left_corners"
-                android:gravity="center_vertical"
-                android:orientation="horizontal">
-
-                <ImageView
-                    android:layout_width="@dimen/convert_75px"
-                    android:layout_height="@dimen/convert_75px"
-                    android:layout_marginStart="@dimen/convert_60px"
-                    android:background="@drawable/ic_history" />
-
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/convert_32px"
-                    android:text="@string/cook_history"
-                    android:textColor="@color/color_fff"
-                    android:textSize="@dimen/convert_45px" />
-            </LinearLayout>
-
-            <LinearLayout
-                android:id="@+id/favourite_layout"
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/convert_120px"
-                android:layout_below="@id/history_layout"
-                android:layout_marginStart="@dimen/convert_77px"
-                android:layout_marginTop="@dimen/convert_89px"
-                android:background="@drawable/shape_60pxf4a12e_left_corners"
-                android:gravity="center_vertical"
-                android:orientation="horizontal">
-
-                <ImageView
-                    android:layout_width="@dimen/convert_75px"
-                    android:layout_height="@dimen/convert_75px"
-                    android:layout_marginStart="@dimen/convert_60px"
-                    android:background="@drawable/ic_favourite" />
-
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/convert_32px"
-                    android:text="@string/favourite_recipes"
-                    android:textColor="@color/color_fff"
-                    android:textSize="@dimen/convert_45px" />
-            </LinearLayout>
-
-            <LinearLayout
-                android:id="@+id/setting_layout"
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/convert_120px"
-                android:layout_below="@id/favourite_layout"
-                android:layout_marginStart="@dimen/convert_77px"
-                android:layout_marginTop="@dimen/convert_89px"
-                android:background="@drawable/shape_60pxf4a12e_left_corners"
-                android:gravity="center_vertical"
-                android:orientation="horizontal">
-
-                <ImageView
-                    android:layout_width="@dimen/convert_75px"
-                    android:layout_height="@dimen/convert_75px"
-                    android:layout_marginStart="@dimen/convert_60px"
-                    android:background="@drawable/ic_setting" />
-
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/convert_32px"
-                    android:text="@string/settings"
-                    android:textColor="@color/color_fff"
-                    android:textSize="@dimen/convert_45px" />
-            </LinearLayout>
-
-            <LinearLayout
-                android:id="@+id/policy_layout"
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/convert_120px"
-                android:layout_below="@id/setting_layout"
-                android:layout_marginStart="@dimen/convert_77px"
-                android:layout_marginTop="@dimen/convert_89px"
-                android:background="@drawable/shape_60pxf4a12e_left_corners"
-                android:gravity="center_vertical"
-                android:orientation="horizontal">
-
-                <ImageView
-                    android:layout_width="@dimen/convert_75px"
-                    android:layout_height="@dimen/convert_75px"
-                    android:layout_marginStart="@dimen/convert_60px"
-                    android:background="@drawable/ic_policy" />
-
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/convert_32px"
-                    android:text="@string/privacy_policy"
-                    android:textColor="@color/color_fff"
-                    android:textSize="@dimen/convert_45px" />
-            </LinearLayout>
+                android:layout_width="@dimen/convert_75px"
+                android:layout_height="@dimen/convert_75px"
+                android:layout_marginStart="@dimen/convert_60px"
+                android:background="@drawable/ic_policy" />
 
             <androidx.appcompat.widget.AppCompatTextView
-                android:id="@+id/tv_user_name"
-                android:layout_width="match_parent"
+                android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_below="@id/iv_avatar"
-                android:layout_centerHorizontal="true"
-                android:layout_marginStart="40dp"
-                android:layout_marginTop="@dimen/convert_35px"
-                android:layout_marginEnd="40dp"
-                android:ellipsize="end"
-                android:gravity="center"
-                android:includeFontPadding="false"
-                android:singleLine="true"
-                android:text="@string/login"
-                android:textColor="@color/color_F4A12E"
+                android:layout_marginStart="@dimen/convert_32px"
+                android:text="@string/privacy_policy"
+                android:textColor="@color/color_fff"
                 android:textSize="@dimen/convert_45px" />
-        </RelativeLayout>
-    </com.develop.food.base.widgets.slide.RightSlideLayout>
+        </LinearLayout>
 
-</RelativeLayout>
+        <androidx.appcompat.widget.AppCompatTextView
+            android:id="@+id/tv_user_name"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/iv_avatar"
+            android:layout_centerHorizontal="true"
+            android:layout_marginStart="40dp"
+            android:layout_marginTop="@dimen/convert_35px"
+            android:layout_marginEnd="40dp"
+            android:ellipsize="end"
+            android:gravity="center"
+            android:includeFontPadding="false"
+            android:singleLine="true"
+            android:text="@string/login"
+            android:textColor="@color/login_color"
+            android:textSize="@dimen/convert_45px" />
+    </RelativeLayout>
+
+</androidx.drawerlayout.widget.DrawerLayout>

+ 6 - 2
BusinessMain/src/main/res/layout/food_content_provider.xml

@@ -56,14 +56,18 @@
                 android:background="@drawable/ic_net"
                 android:visibility="gone" />
 
-            <androidx.appcompat.widget.AppCompatTextView
+            <com.develop.food.base.widgets.MarqueeTextView
                 android:id="@+id/tv_food_name"
-                android:layout_width="wrap_content"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/star_view"
                 android:layout_marginStart="@dimen/convert_42px"
                 android:layout_marginTop="@dimen/convert_24px"
+                android:layout_marginEnd="@dimen/convert_10px"
                 android:layout_toEndOf="@id/iv_net"
+                android:ellipsize="marquee"
+                android:focusable="true"
+                android:singleLine="true"
                 android:includeFontPadding="false"
                 android:textColor="@color/color_fff"
                 android:textSize="@dimen/convert_54px"

+ 49 - 13
BusinessMain/src/main/res/layout/fragment_modes.xml

@@ -27,39 +27,75 @@
                 android:background="@drawable/ic_grid" />
 
 
-            <androidx.appcompat.widget.AppCompatTextView
+            <com.develop.food.base.widgets.MarqueeTextView
                 android:id="@+id/list_name"
-                android:layout_width="wrap_content"
+                android:ellipsize="marquee"
+                android:focusable="true"
+                android:singleLine="true"
+                android:layout_width="match_parent"
+                android:layout_marginEnd="@dimen/convert_40px"
                 android:layout_height="wrap_content"
                 android:layout_centerVertical="true"
                 android:layout_marginStart="@dimen/convert_39px"
                 android:layout_toEndOf="@id/iv_icon"
                 android:text="@string/grid_view"
-                android:textColor="@color/color_F4A12E"
-                android:textSize="@dimen/convert_54px" />
+                android:textColor="@color/ic_modes_title"
+                android:textSize="@dimen/convert_44px" />
         </RelativeLayout>
 
     </androidx.cardview.widget.CardView>
 
+    <RelativeLayout
+        android:id="@+id/mode_layout_034"
+        android:layout_width="@dimen/convert_450px"
+        android:layout_height="@dimen/convert_120px"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="@dimen/convert_105px"
+        android:background="@drawable/shadow_60pxffffff_stoke"
+        android:visibility="gone">
+
+
+        <ImageView
+            android:id="@+id/iv_icon2"
+            android:layout_width="@dimen/convert_54px"
+            android:layout_height="@dimen/convert_54px"
+            android:layout_centerVertical="true"
+            android:layout_marginStart="@dimen/convert_66px"
+            android:background="@drawable/ic_grid" />
+
+
+        <com.develop.food.base.widgets.MarqueeTextView
+            android:id="@+id/list_name2"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:focusable="true"
+            android:singleLine="true"
+            android:layout_marginEnd="@dimen/convert_40px"
+            android:ellipsize="marquee"
+            android:layout_marginStart="@dimen/convert_39px"
+            android:layout_toEndOf="@id/iv_icon2"
+            android:text="@string/grid_view"
+            android:textColor="@color/ic_modes_title"
+            android:textSize="@dimen/convert_54px" />
+    </RelativeLayout>
 
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/grid_recycle"
-        android:visibility="gone"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_below="@id/list_mode"
-        android:layout_marginTop="@dimen/convert_20px" />
+        android:layout_marginTop="@dimen/convert_345px"
+        android:visibility="gone" />
 
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/gallery_recycle"
-        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/convert_345px"
         android:clipToPadding="false"
+        android:orientation="horizontal"
         android:paddingStart="@dimen/convert_234px"
         android:paddingEnd="@dimen/convert_234px"
-        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/list_mode"
-        android:layout_marginTop="@dimen/convert_225px" />
+        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
 
 </RelativeLayout>

+ 1 - 1
BusinessMain/src/main/res/layout/home_title_provider.xml

@@ -5,7 +5,7 @@
     android:layout_height="wrap_content"
     android:layout_marginStart="@dimen/convert_45px"
     android:layout_marginBottom="@dimen/convert_35px"
-    android:textColor="@color/color_6B6B6B"
+    android:textColor="@color/home_category_color"
     android:textSize="@dimen/convert_54px">
 
 </androidx.appcompat.widget.AppCompatTextView>

+ 4 - 2
BusinessMain/src/main/res/layout/item_grid_view.xml

@@ -14,14 +14,16 @@
         android:background="@drawable/ic_boil_water"
         app:layout_constraintTop_toTopOf="parent" />
 
-    <androidx.appcompat.widget.AppCompatTextView
+    <com.develop.food.base.widgets.MarqueeTextView
         android:id="@+id/tv_mode_name"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/convert_47px"
         android:gravity="center"
         android:singleLine="true"
-        android:textColor="@color/color_F4A12E"
+        android:ellipsize="marquee"
+        android:focusable="true"
+        android:textColor="@color/ic_modes_title"
         android:textSize="@dimen/convert_45px"
         app:layout_constraintTop_toBottomOf="@id/iv_icon" />
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 1
BusinessMain/src/main/res/layout/item_home_banner.xml

@@ -63,7 +63,7 @@
 
         <androidx.appcompat.widget.AppCompatTextView
             android:id="@+id/tv_title"
-            android:layout_width="wrap_content"
+            android:layout_width="@dimen/convert_400px"
             android:layout_height="wrap_content"
             android:layout_centerVertical="true"
             android:layout_marginStart="@dimen/convert_38px"

+ 1 - 1
BusinessMain/src/main/res/layout/item_mode_card_view.xml

@@ -30,7 +30,7 @@
         android:layout_height="wrap_content"
         android:layout_centerHorizontal="true"
         android:includeFontPadding="false"
-        android:textColor="@color/color_F4A12E"
+        android:textColor="@color/ic_modes_title"
         android:textSize="@dimen/convert_54px"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"

+ 40 - 0
BusinessSetting/src/main/java/com/develop/setting/init/adapter/LanguageAdapterV3.kt

@@ -0,0 +1,40 @@
+package com.develop.setting.init.adapter
+
+import android.widget.ImageView
+import android.widget.RelativeLayout
+import androidx.appcompat.widget.AppCompatTextView
+import com.bumptech.glide.Glide
+import com.chad.library.adapter.base.BaseQuickAdapter
+import com.chad.library.adapter.base.viewholder.BaseViewHolder
+import com.develop.common.utils.ConfigUtils
+import com.develop.setting.R
+
+
+class LanguageAdapterV3 :
+    BaseQuickAdapter<ConfigUtils.Lang, BaseViewHolder>(R.layout.item_language_view2) {
+    private var selectedPosition = 0
+    override fun convert(holder: BaseViewHolder, item: ConfigUtils.Lang) {
+        val ivIcon = holder.getView<ImageView>(R.id.ic_icon)
+        val tvTitle = holder.getView<AppCompatTextView>(R.id.tv_title)
+        val cardView = holder.getView<RelativeLayout>(R.id.content_layout)
+        if (selectedPosition == holder.adapterPosition) {
+            tvTitle.setTextColor(context.resources.getColor(R.color.color_fff))
+            cardView.setBackgroundResource(R.drawable.shape_60px000000_corners)
+        } else {
+            tvTitle.setTextColor(context.resources.getColor(R.color.color_000000))
+            cardView.setBackgroundResource(R.drawable.shape_60px000000_stroke)
+        }
+        Glide.with(context).load(context.resources.getIdentifier(item.icon,"drawable","com.develop.foodcooking")).into(ivIcon)
+
+        tvTitle.text = item.showName
+
+    }
+
+
+    fun updateSelectedPosition(adapterPosition: Int) {
+        val tempPosition = selectedPosition
+        selectedPosition = adapterPosition
+        notifyItemChanged(tempPosition)
+        notifyItemChanged(selectedPosition)
+    }
+}

+ 2 - 1
BusinessSetting/src/main/java/com/develop/setting/init/adapter/ScreenBannerAdapter.kt

@@ -5,6 +5,7 @@ import android.view.View
 import android.view.ViewGroup
 import android.widget.ImageView
 import androidx.recyclerview.widget.RecyclerView
+import com.develop.food.base.ext.background_drawable
 import com.develop.setting.R
 import com.youth.banner.adapter.BannerAdapter
 
@@ -28,6 +29,6 @@ class ScreenBannerAdapter(dataList: MutableList<Int>) :
         size: Int
     ) {
 
-        holder.ivBanner.setBackgroundResource(data)
+        holder.ivBanner.background_drawable = data
     }
 }

+ 2 - 1
BusinessSetting/src/main/java/com/develop/setting/init/adapter/SettingMainAdapter.kt

@@ -5,13 +5,14 @@ import androidx.appcompat.widget.AppCompatTextView
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
 import com.develop.food.base.data.model.SettingModel
+import com.develop.food.base.ext.background_drawable
 import com.develop.setting.R
 
 class SettingMainAdapter :
     BaseQuickAdapter<SettingModel, BaseViewHolder>(R.layout.item_setting_main_view) {
     override fun convert(holder: BaseViewHolder, item: SettingModel) {
         holder.getView<AppCompatTextView>(R.id.tv_name).text = item.name
-        holder.getView<ImageView>(R.id.iv_icon).setBackgroundResource(item.resId)
+        holder.getView<ImageView>(R.id.iv_icon).background_drawable = item.resId
     }
 
 }

+ 8 - 1
BusinessSetting/src/main/java/com/develop/setting/init/adapter/WifiListAdapter.kt

@@ -13,6 +13,7 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder
 import com.develop.food.base.manager.wifi.WiFiPwdType
 import com.develop.food.base.manager.wifi.WifiData
 import com.develop.food.base.utils.GlobalToast
+import com.develop.food.base.utils.resId2Dimension
 import com.develop.setting.R
 
 class WifiListAdapter : BaseQuickAdapter<WifiData, BaseViewHolder>
@@ -61,7 +62,7 @@ class WifiListAdapter : BaseQuickAdapter<WifiData, BaseViewHolder>
         wifiLevel.setImageLevel(item.rssi)
 
         ckbEye.setOnCheckedChangeListener { compoundButton, b ->
-            if (b) {
+            if (!b) {
                 etPwd.transformationMethod = PasswordTransformationMethod.getInstance()
             } else {
                 etPwd.transformationMethod = HideReturnsTransformationMethod.getInstance()
@@ -97,4 +98,10 @@ class WifiListAdapter : BaseQuickAdapter<WifiData, BaseViewHolder>
         fun onOkClick(accessPoint: WifiData)
     }
 
+    companion object {
+        var dp60 = (com.develop.base.R.dimen.convert_60px).resId2Dimension().toInt()
+
+    }
+
+
 }

+ 98 - 0
BusinessSetting/src/main/java/com/develop/setting/init/adapter/WifiListAdapter1.kt

@@ -0,0 +1,98 @@
+package com.develop.setting.init.adapter
+
+import android.text.method.HideReturnsTransformationMethod
+import android.text.method.PasswordTransformationMethod
+import android.view.View
+import android.widget.CheckBox
+import android.widget.EditText
+import android.widget.ImageView
+import android.widget.RelativeLayout
+import androidx.appcompat.widget.AppCompatTextView
+import com.chad.library.adapter.base.BaseQuickAdapter
+import com.chad.library.adapter.base.viewholder.BaseViewHolder
+import com.develop.food.base.ext.src
+import com.develop.food.base.manager.wifi.WiFiPwdType
+import com.develop.food.base.manager.wifi.WifiData
+import com.develop.food.base.utils.GlobalToast
+import com.develop.setting.R
+
+class WifiListAdapter1 : BaseQuickAdapter<WifiData, BaseViewHolder>
+    (R.layout.item_wifi_content1) {
+    var selectedPosition = -1
+    var onOkClickListener: OnOkClickListener? = null
+    override fun convert(holder: BaseViewHolder, item: WifiData) {
+        holder.getView<AppCompatTextView>(R.id.tv_wifi_name).text = item.ssid
+        val tvWifiState = holder.getView<AppCompatTextView>(R.id.tv_wifi_state)
+        val wifiLevel = holder.getView<ImageView>(R.id.iv_signal)
+        val lockView = holder.getView<ImageView>(R.id.iv_lock)
+        val inputLayout = holder.getView<RelativeLayout>(R.id.input_layout)
+        val ckbEye = holder.getView<CheckBox>(R.id.ckb_eye)
+        val etPwd = holder.getView<EditText>(R.id.et_pwd)
+        val tvOk = holder.getView<AppCompatTextView>(R.id.tv_ok)
+        if (item.capabilities == WiFiPwdType.ESS) {
+            lockView.visibility = View.GONE
+        } else {
+            lockView.visibility = View.VISIBLE
+        }
+
+        tvWifiState.text = if (item.isSavePwd && item.ipAddress.isNullOrEmpty()) {
+            context.getString(R.string.network_wifi_status_saved)
+        } else if (item.isConnected) {
+            context.getString(R.string.network_wifi_status_connected)
+        } else {
+            context.getString(R.string.off_line)
+        }
+        if (selectedPosition == holder.adapterPosition) {
+            if (item.isSelected) {
+                item.isSelected = false
+                inputLayout.visibility = View.GONE
+
+            } else {
+                item.isSelected = true
+                inputLayout.visibility = View.VISIBLE
+            }
+        } else {
+            item.isSelected = false
+            inputLayout.visibility = View.GONE
+        }
+        wifiLevel.src = R.drawable.icon_wifi_signal_level
+        wifiLevel.setImageLevel(item.rssi)
+
+        ckbEye.setOnCheckedChangeListener { compoundButton, b ->
+            if (!b) {
+                etPwd.transformationMethod = PasswordTransformationMethod.getInstance()
+            } else {
+                etPwd.transformationMethod = HideReturnsTransformationMethod.getInstance()
+            }
+        }
+        tvOk.setOnClickListener {
+            val pwd = etPwd.text.toString()
+            if (pwd.isEmpty()) {
+                GlobalToast.showToast(context.getString(R.string.pwd_can_not_be_empty))
+                return@setOnClickListener
+            }
+            item.password = pwd
+            onOkClickListener?.onOkClick(item)
+            inputLayout.visibility = View.GONE
+        }
+
+    }
+
+    fun updateSelectedPosition(adapterPosition: Int) {
+        val tempPosition = selectedPosition
+        selectedPosition = adapterPosition
+        notifyItemChanged(selectedPosition)
+        notifyItemChanged(tempPosition)
+    }
+
+    override fun getItemId(position: Int): Long {
+        return position.toLong()
+    }
+
+
+    interface OnOkClickListener {
+        fun onOkClick(accessPoint: WifiData)
+    }
+
+
+}

+ 264 - 64
BusinessSetting/src/main/java/com/develop/setting/init/ui/AboutActivity.kt

@@ -1,20 +1,34 @@
 package com.develop.setting.init.ui
 
+import android.content.ComponentName
+import android.content.Context
+import android.content.Intent
+import android.os.Build
 import android.os.Bundle
+import android.provider.Settings
 import android.util.Log
 import android.view.LayoutInflater
 import android.view.View
+import android.widget.LinearLayout
+import android.widget.Toast
 import com.alibaba.android.arouter.facade.annotation.Route
 import com.azhon.appupdate.listener.OnDownloadListener
 import com.blankj.utilcode.util.AppUtils
 import com.develop.food.base.api.FoodRepository
 import com.develop.food.base.http.observeStatus
 import com.develop.food.base.router.Screens
-import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.BaseActivity
-import com.develop.food.base.utils.*
+import com.develop.food.base.utils.AppVerUtils
+import com.develop.food.base.utils.GlobalToast
+import com.develop.food.base.utils.ResDimension
+import com.develop.food.base.utils.ThreadUtils
+import com.develop.food.base.utils.UpdateUtil
+import com.develop.food.base.utils.getSN
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.utils.toJson
 import com.develop.food.base.widgets.CancelConfirmDialog
 import com.develop.food.base.widgets.CommonDialog
+import com.develop.food.base.widgets.PwdDialog
 import com.develop.food.base.widgets.RecipeUpdateDialog
 import com.develop.setting.R
 import com.develop.setting.databinding.ActivityAboutBinding
@@ -24,6 +38,7 @@ import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
 import org.greenrobot.eventbus.Subscribe
 import java.io.File
 
+
 @Route(path = Screens.Setting.ABOUT)
 class AboutActivity : BaseActivity<ActivityAboutBinding>() {
     override fun createViewBinding(inflater: LayoutInflater): ActivityAboutBinding {
@@ -43,14 +58,20 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
     }
 
 
-    private val recipeUpdateDialog:RecipeUpdateDialog =   RecipeUpdateDialog();
+    private var adbCount = 0
+
+    private var testCount = 0
+
+    private var tpCount = 0
 
-    private  val weightAlignDialog:CancelConfirmDialog = CancelConfirmDialog()
+    private val recipeUpdateDialog: RecipeUpdateDialog = RecipeUpdateDialog();
+
+    private val weightAlignDialog: CancelConfirmDialog = CancelConfirmDialog()
 
     private var weight = false;
 
     //退出称重校准
-    fun exitWeightAlign(){
+    fun exitWeightAlign() {
         CofarSDK.stoptWeightAlign()
 //        CofarSDK.unregister(this)
         weight = false;
@@ -59,7 +80,7 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
     @Subscribe
     fun onDevStateEvent(event: DevStatusEvent) {
 
-        if(!weight){
+        if (!weight) {
             return;
         }
         ThreadUtils.runOnMainThread {
@@ -67,66 +88,71 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
 
 
 
-            if(event.devInfo.weightAlignStatus == (0).toByte()){ //正在标定不是
-                 weightAlignDialog.dialog?.hide()
-                 weightAlignDialog.showCancel = false;
-                 weightAlignDialog.confirmStr = getString(R.string.exit_weight_align)
+            if (event.devInfo.weightAlignStatus == (0).toByte()) { //正在标定不是
+                weightAlignDialog.dialog?.hide()
+                weightAlignDialog.showCancel = false;
+                weightAlignDialog.confirmStr = getString(R.string.exit_weight_align)
 
-                 if (!weightAlignDialog.isAdded){
-                         weightAlignDialog.title = getString(R.string.weight_aligning)
-                         weightAlignDialog.showDialog(supportFragmentManager,"weight_align_dialog")
-                 } else  {
-                     if(event.devInfo.weightPol == (1).toByte()){
-                         weightAlignDialog.binding.tvTitle.text = getString(R.string.weight_one_kg_tips)
-                     }
+                if (!weightAlignDialog.isAdded) {
+                    weightAlignDialog.title = getString(R.string.weight_aligning)
+                    weightAlignDialog.showDialog(supportFragmentManager, "weight_align_dialog")
+                } else {
+                    if (event.devInfo.weightPol == (1).toByte()) {
+                        weightAlignDialog.binding.tvTitle.text =
+                            getString(R.string.weight_one_kg_tips)
+                    }
 
-                     if(event.devInfo.weightPol == (2).toByte()){
-                         weightAlignDialog.binding.tvTitle.text = getString(R.string.weight_two_kg_tips)
-                     }
+                    if (event.devInfo.weightPol == (2).toByte()) {
+                        weightAlignDialog.binding.tvTitle.text =
+                            getString(R.string.weight_two_kg_tips)
+                    }
 
-                     weightAlignDialog.dialog?.show()
-                 }
+                    weightAlignDialog.dialog?.show()
+                }
 
-                 weightAlignDialog.onDialogClickListener = object :CancelConfirmDialog.OnDialogClickListener{
+                weightAlignDialog.onDialogClickListener =
+                    object : CancelConfirmDialog.OnDialogClickListener {
 
-                     override fun onConfirm() {
-                         exitWeightAlign()
-                         weight = false;
-                     }
+                        override fun onConfirm() {
+                            exitWeightAlign()
+                            weight = false;
+                        }
 
-                     override fun onCancel() {
-                         exitWeightAlign()
-                         weight = false
-                     }
+                        override fun onCancel() {
+                            exitWeightAlign()
+                            weight = false
+                        }
 
-                 }
+                    }
             }
 
-            if(event.devInfo.weightAlignStatus == (2).toByte()){ //正在标定不是
+            if (event.devInfo.weightAlignStatus == (2).toByte()) { //正在标定不是
 //                CofarSDK.unregister(this)
                 weightAlignDialog.dialog?.hide()
                 weightAlignDialog.showCancel = false;
                 weightAlignDialog.confirmStr = getString(R.string.exit_weight_align)
 
-                if (!weightAlignDialog.isAdded){
+                if (!weightAlignDialog.isAdded) {
                     weightAlignDialog.title = getString(R.string.weight_align_success)
-                    weightAlignDialog.showDialog(supportFragmentManager,"weight_align_dialog")
-                } else  {
-                    weightAlignDialog.binding.tvTitle.text =  getString(R.string.weight_align_success)
+                    weightAlignDialog.showDialog(supportFragmentManager, "weight_align_dialog")
+                } else {
+                    weightAlignDialog.binding.tvTitle.text =
+                        getString(R.string.weight_align_success)
                     weightAlignDialog.dialog?.show()
                 }
 
-                weightAlignDialog.onDialogClickListener = object :CancelConfirmDialog.OnDialogClickListener{
+                weightAlignDialog.onDialogClickListener =
+                    object : CancelConfirmDialog.OnDialogClickListener {
 
-                    override fun onConfirm() {
-                        exitWeightAlign()
-                    }
+                        override fun onConfirm() {
+                            exitWeightAlign()
+                        }
 
-                    override fun onCancel() {
-                        exitWeightAlign()
-                    }
+                        override fun onCancel() {
+                            exitWeightAlign()
+                        }
 
-                }
+                    }
 
                 exitWeightAlign()
             }
@@ -136,43 +162,141 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
+        if (isNightTheme()) {
+            binding.ivLogo.setBackgroundResource(R.drawable.ic_app_logo)
+            val param = binding.ivDownload.layoutParams as LinearLayout.LayoutParams
+            param.width = ResDimension(R.dimen.convert_98px).toInt()
+            param.height = ResDimension(R.dimen.convert_98px).toInt()
+            binding.ivDownload.layoutParams = param
+            binding.tvApk .text = "APK"
+            binding.tvMcu .text = "MCU"
+            binding.tvModel .text = "MODEL"
+            binding.tvTp .text = "TP"
+            binding.tvSn .text = "SN"
+        }
         binding.topBar.setTopBarTitle(getString(R.string.About))
         binding.topBar.listenBackClick {
             finish()
         }
 
+
         binding.devSn.text = getSN()
 
+        CofarSDK.devInfo().let {
+            binding.tvMcuVersion.text =
+                (it.manufacturer.toString() + "P" + it.haradware.toString() + "S" + it.software.toString())
+        }
 
+        recipeUpdateDialog.onDialogClickListener =
+            object : RecipeUpdateDialog.OnDialogClickListener {
+                override fun onConfirm() {
+                    print("onConfirm")
+                }
+
+                override fun onCancel() {
+                    print("onCancel")
+                }
 
-        recipeUpdateDialog.onDialogClickListener = object :RecipeUpdateDialog.OnDialogClickListener{
-            override fun onConfirm() {
-                print("onConfirm")
             }
 
-            override fun onCancel() {
-                print("onCancel")
+        binding.tvUpdateFirmware.setOnClickListener {
+            val packageName = "com.abupdate.fota_demo_iot"
+            val intent = packageManager.getLaunchIntentForPackage(packageName)
+
+            if (intent != null) {
+                // 存在可以处理的应用程序
+                // 启动应用程序
+                startActivity(intent)
+            } else {
+                // 未找到指定包名的应用程序
             }
 
         }
+        binding.devSn.setOnClickListener {
+            testCount++
+            if (testCount >= 7) {
+                testCount = 0
+
+                //2023年06月29日14:16:18 处理密码弹出
+                val pwdDialog = PwdDialog()
+                pwdDialog.title = getString(com.develop.base.R.string.enter_password)
+                pwdDialog.showDialog(supportFragmentManager, "pwdDialog")
+                pwdDialog.onDialogClickListener = object : PwdDialog.OnDialogClickListener {
+
+                    override fun onConfirm(pwd: String) {
+                        if ("12345678".equals(pwd)) {
+                            // 创建启动目标活动的Intent
+                            val intent = Intent()
+                            intent.component = ComponentName(
+                                "com.zavier.androidrk3326functiontest",
+                                "com.zavier.androidrk3326functiontest.MainFunctionActivity"
+                            )
+
+                            // 启动目标活动
+                            startActivity(intent)
+                        } else {
+                            GlobalToast.showToast(getString(com.develop.base.R.string.account_password_error))
+                        }
+                    }
+
+                    override fun onCancel() {
+
+                    }
+                }
+
+
+            }
+        }
+
+        binding.tvTpVersion.setOnClickListener {
+            tpCount++
+            if (tpCount >= 7) {
+                tpCount = 0
+
+
+                val ctx = this
+                //2023年06月29日14:16:18 处理密码弹出
+                val pwdDialog = PwdDialog()
+                pwdDialog.title = getString(com.develop.base.R.string.enter_password)
+                pwdDialog.showDialog(supportFragmentManager, "pwdDialog")
+                pwdDialog.onDialogClickListener = object : PwdDialog.OnDialogClickListener {
+
+                    override fun onConfirm(pwd: String) {
+                        if ("12345678".equals(pwd)) {
+                            togglePointerLocation(ctx)
+                        } else {
+                            GlobalToast.showToast(getString(com.develop.base.R.string.account_password_error))
+                        }
+                    }
+
+                    override fun onCancel() {
+
+                    }
+                }
+
+
+            }
+        }
+
+
 
         //点击食谱更新
-        binding.updateRecipes.setOnClickListener{
+        binding.updateRecipes.setOnClickListener {
             AppVerUtils.checkRecipeUpdate(true)
         }
 
-        binding.ivLogo.setOnClickListener{
+        binding.ivLogo.setOnClickListener {
 
             weightAlignCount++
-            if(weightAlignCount >= 7){
+            if (weightAlignCount >= 7) {
                 weight = true;
-                weightAlignCount =0
+                weightAlignCount = 0
 
-                var dailog =  CancelConfirmDialog()
+                var dailog = CancelConfirmDialog()
                 dailog.title = getString(R.string.change_lang_tips)
                 dailog.showCancel = false;
 
-                dailog.onDialogClickListener = object: CancelConfirmDialog.OnDialogClickListener {
+                dailog.onDialogClickListener = object : CancelConfirmDialog.OnDialogClickListener {
                     override fun onConfirm() {
 
                     }
@@ -181,10 +305,10 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
                     }
 
                 }
-                if(CofarSDK.devInfo().runningStatus == DevStatus.RUNNING){
-                    dailog.showDialog(supportFragmentManager,"confirm")
+                if (CofarSDK.devInfo().runningStatus == DevStatus.RUNNING) {
+                    dailog.showDialog(supportFragmentManager, "confirm")
                     return@setOnClickListener
-                }else{
+                } else {
 //                    CofarSDK.register(this)
 
                     //进入称重标定模式
@@ -192,8 +316,7 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
                 }
 
 
-
-            }else{
+            } else {
 //                CofarSDK.unregister(this)
             }
 
@@ -259,22 +382,99 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
             cancelConfirmDialog.showDialog(supportFragmentManager, "cancelConfirmDialog")
         }
 
+
+        binding.tvAppVersion.setOnClickListener {
+            adbCount++
+            if (adbCount >= 7) {
+                adbCount = 0
+
+                val ctx = this
+                //2023年06月29日14:16:18 处理密码弹出
+                val pwdDialog = PwdDialog()
+                pwdDialog.title = getString(com.develop.base.R.string.enter_password)
+                pwdDialog.showDialog(supportFragmentManager, "pwdDialog")
+                pwdDialog.onDialogClickListener = object : PwdDialog.OnDialogClickListener {
+
+                    override fun onConfirm(pwd: String) {
+                        if ("12345678".equals(pwd)) {
+                            if (isAdbDebuggingEnabled(ctx)) {
+                                Toast.makeText(ctx, "adb disable", Toast.LENGTH_SHORT).show()
+                                toggleAdbDebugging(ctx, false)
+                            } else {
+                                Toast.makeText(ctx, "adb enable", Toast.LENGTH_SHORT).show()
+                                toggleAdbDebugging(ctx, true)
+                            }
+                        } else {
+                            GlobalToast.showToast(getString(com.develop.base.R.string.account_password_error))
+                        }
+                    }
+
+                    override fun onCancel() {
+
+                    }
+                }
+
+
+            }
+        }
         binding.tvAppName.text = AppUtils.getAppName()
         binding.tvAppVersion.text = "v${AppUtils.getAppVersionName()}"
 
+        binding.tvTpVersion.text = Build.DISPLAY
+    }
+
+    fun isAdbDebuggingEnabled(context: Context): Boolean {
+        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+            Settings.Secure.getInt(
+                context.contentResolver,
+                Settings.Global.ADB_ENABLED,
+                0
+            ) != 0
+        } else {
+            Settings.Secure.getInt(
+                context.contentResolver,
+                Settings.Secure.ADB_ENABLED,
+                0
+            ) != 0
+        }
     }
 
+
+    fun toggleAdbDebugging(context: Context, enable: Boolean) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+            Settings.Secure.putInt(
+                context.contentResolver,
+                Settings.Global.ADB_ENABLED,
+                if (enable) 1 else 0
+            )
+        } else {
+            Settings.Secure.putInt(
+                context.contentResolver,
+                Settings.Secure.ADB_ENABLED,
+                if (enable) 1 else 0
+            )
+        }
+    }
+
+
     override fun onResume() {
         super.onResume()
         FoodRepository.devInfo().observeStatus(onSuccess = {
             updateApkUrl = it?.apkUrl ?: ""
             if (it?.apkUpdate == true) {
-                binding.tvUpdate.visibility = View.VISIBLE
-            } else {
-                binding.tvUpdate.visibility = View.INVISIBLE
+
+                binding.tvUpdate.performClick()
             }
+            binding.tvUpdate.visibility = View.VISIBLE
+            binding.tvUpdateFirmware.visibility = View.VISIBLE
         })
     }
+    fun togglePointerLocation(context: Context) {
+        val currentSetting = Settings.System.getInt(context.contentResolver, "pointer_location", 0)
+        val newSetting = if (currentSetting == 0) 1 else 0
+        Settings.System.putInt(context.contentResolver, "pointer_location", newSetting)
+    }
+
 
     override fun onDestroy() {
         super.onDestroy()

+ 8 - 7
BusinessSetting/src/main/java/com/develop/setting/init/ui/BrightnessActivity.kt

@@ -26,7 +26,7 @@ class BrightnessActivity : BaseActivity<ActivityBirghtnessBinding>() {
     @RequiresApi(Build.VERSION_CODES.O)
     override fun onCreate(savedInstanceState: Bundle?) {
 
-        Log.i("screen", Settings.System.getInt(contentResolver,SCREEN_OFF_TIMEOUT).toString())
+        Log.i("screen", Settings.System.getInt(contentResolver, SCREEN_OFF_TIMEOUT).toString())
 
         super.onCreate(savedInstanceState)
         binding.topBar.setTopBarTitle(getString(R.string.Brightness))
@@ -58,25 +58,26 @@ class BrightnessActivity : BaseActivity<ActivityBirghtnessBinding>() {
         //回显设置值
         val min = (Settings.System.getInt(contentResolver, SCREEN_OFF_TIMEOUT) / 1000 / 60)
         binding.rgLockTime.check(R.id.rb_3_min)
-        if (min == 10){
+        if (min == 10) {
             binding.rgLockTime.check(R.id.rb_10_min)
         }
-        if (min == 30){
+        if (min == 20) {
             binding.rgLockTime.check(R.id.rb_30_min)
         }
 
         binding.rgLockTime.setOnCheckedChangeListener { p0, p1 ->
-            var minute = 3
+            var minute = 5
             when (p1) {
                 R.id.rb_3_min -> {
-                    minute = 3
+                    minute = 5
                 }
+
                 R.id.rb_10_min -> {
-                    minute = 5
+                    minute = 10
                 }
 
                 R.id.rb_30_min -> {
-                    minute = 10
+                    minute = 20
                 }
             }
             setScreenSaverEnable(minute)

+ 67 - 30
BusinessSetting/src/main/java/com/develop/setting/init/ui/LanguageActivity.kt

@@ -9,7 +9,8 @@ import android.view.View
 import android.widget.RelativeLayout
 import com.alibaba.android.arouter.facade.annotation.Route
 import com.blankj.utilcode.util.LanguageUtils
-import com.develop.food.base.common.*
+import com.develop.food.base.common.CURRENT_LANGUAGE
+import com.develop.food.base.common.LANGUAGE_FROM_SETTING
 import com.develop.food.base.data.DataFactory
 import com.develop.food.base.event.FinishAtyEvent
 import com.develop.food.base.router.Screens
@@ -17,19 +18,21 @@ import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.utils.MmkvUtils
 import com.develop.food.base.utils.ResDimension
+import com.develop.food.base.utils.isNightTheme
 import com.develop.food.base.widgets.CancelConfirmDialog
 import com.develop.setting.R
 import com.develop.setting.databinding.ActivityLanguageBinding
-import com.develop.setting.init.adapter.LanguageAdapter
 import com.develop.setting.init.adapter.LanguageAdapterV2
+import com.develop.setting.init.adapter.LanguageAdapterV3
 import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevStatus
 import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
 import org.greenrobot.eventbus.Subscribe
-import java.util.*
+import java.util.Locale
 
 @Route(path = Screens.Setting.LANGUAGE)
 class LanguageActivity : BaseActivity<ActivityLanguageBinding>() {
     private var languageAdapter = LanguageAdapterV2()
+    private var languageAdapter1 = LanguageAdapterV3()
     private var selectPosition = -1
     override fun createViewBinding(inflater: LayoutInflater): ActivityLanguageBinding {
         return ActivityLanguageBinding.inflate(layoutInflater)
@@ -50,16 +53,32 @@ class LanguageActivity : BaseActivity<ActivityLanguageBinding>() {
                 finish()
             }
         }
-        languageAdapter.setList(DataFactory.createLanguageDataV2(resources))
-        binding.languageRecycle.apply {
-            adapter = languageAdapter
-            selectPosition = getSelectedPos()
-        }
+        if (isNightTheme()) {
+            languageAdapter1.setList(DataFactory.createLanguageDataV2(resources))
+            binding.languageRecycle.apply {
+                adapter = languageAdapter1
+                selectPosition = getSelectedPos()
+            }
+
+            languageAdapter1.setOnItemClickListener { adapter, view, position ->
+                languageAdapter1.updateSelectedPosition(position)
+                this.selectPosition = position
+//            updateLanguage()
+            }
+
+        } else {
+            languageAdapter.setList(DataFactory.createLanguageDataV2(resources))
+            binding.languageRecycle.apply {
+                adapter = languageAdapter
+                selectPosition = getSelectedPos()
+            }
 
-        languageAdapter.setOnItemClickListener { adapter, view, position ->
-            languageAdapter.updateSelectedPosition(position)
-            this.selectPosition = position
+            languageAdapter.setOnItemClickListener { adapter, view, position ->
+                languageAdapter.updateSelectedPosition(position)
+                this.selectPosition = position
 //            updateLanguage()
+            }
+
         }
 
 
@@ -68,8 +87,6 @@ class LanguageActivity : BaseActivity<ActivityLanguageBinding>() {
         }
 
         binding.tvNext.setOnClickListener {
-
-
             if (CofarSDK.devInfo().status == DevStatus.RUNNING.toInt()) {
                 var dailog = CancelConfirmDialog()
                 dailog.title = getString(R.string.change_lang_tips)
@@ -88,16 +105,18 @@ class LanguageActivity : BaseActivity<ActivityLanguageBinding>() {
                 return@setOnClickListener
             }
 
-
-
-
             if (isFromSetting) {
-
-                if(languageAdapter.itemCount <= 1){
-                    finish()
-                    return@setOnClickListener
+                if (isNightTheme()) {
+                    if (languageAdapter1.data[selectPosition].value == MmkvUtils.getString(CURRENT_LANGUAGE)) {
+                        finish()
+                        return@setOnClickListener
+                    }
+                } else {
+                    if (languageAdapter.data[selectPosition].value == MmkvUtils.getString(CURRENT_LANGUAGE)) {
+                        finish()
+                        return@setOnClickListener
+                    }
                 }
-
                 var dailog = CancelConfirmDialog()
                 dailog.title = getString(R.string.change_lang_tips2)
 
@@ -131,26 +150,44 @@ class LanguageActivity : BaseActivity<ActivityLanguageBinding>() {
     private fun updateLanguage() {
         var index = 0
         index = selectPosition
-        if(selectPosition == -1){
+        if (selectPosition == -1) {
             index = 0
         }
-        languageAdapter.data[selectPosition].apply {
-            MmkvUtils.save(CURRENT_LANGUAGE, this.value)
-            LanguageUtils.applyLanguage(Locale(this.value.lowercase(),this.value.uppercase()))
+        if (isNightTheme()) {
+            languageAdapter1.data[selectPosition].apply {
+                MmkvUtils.save(CURRENT_LANGUAGE, this.value)
+                LanguageUtils.applyLanguage(Locale(this.value.lowercase(), this.value.uppercase()))
+            }
+        } else {
+            languageAdapter.data[selectPosition].apply {
+                MmkvUtils.save(CURRENT_LANGUAGE, this.value)
+                LanguageUtils.applyLanguage(Locale(this.value.lowercase(), this.value.uppercase()))
+            }
         }
 
+
     }
 
     private fun getSelectedPos(): Int {
 
 
-        for ((index,item) in languageAdapter.data.withIndex()) {
-              if(MmkvUtils.getString(CURRENT_LANGUAGE) == item.value){
-                  languageAdapter.updateSelectedPosition(index)
-                  return index
-              }
+        if (isNightTheme()){
+            for ((index, item) in languageAdapter1.data.withIndex()) {
+                if (MmkvUtils.getString(CURRENT_LANGUAGE) == item.value) {
+                    languageAdapter1.updateSelectedPosition(index)
+                    return index
+                }
+            }
+        } else {
+            for ((index, item) in languageAdapter.data.withIndex()) {
+                if (MmkvUtils.getString(CURRENT_LANGUAGE) == item.value) {
+                    languageAdapter.updateSelectedPosition(index)
+                    return index
+                }
+            }
         }
 
+
         return 0
 
 

+ 8 - 2
BusinessSetting/src/main/java/com/develop/setting/init/ui/PowerAnimationActivity.kt

@@ -5,9 +5,10 @@ import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import com.alibaba.android.arouter.facade.annotation.Route
-import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.router.Screens
 import com.develop.food.base.router.navigateTo
+import com.develop.food.base.ui.BaseActivity
+import com.develop.food.base.utils.isNightTheme
 import com.develop.setting.R
 import com.develop.setting.databinding.ActivityPowerAnimationBinding
 
@@ -32,7 +33,12 @@ class PowerAnimationActivity : BaseActivity<ActivityPowerAnimationBinding>() {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         binding.fullVideoView.apply {
-            setVideoURI(Uri.parse("android.resource://" + packageName + "/" + R.raw.video))
+            if (isNightTheme()){
+                setVideoURI(Uri.parse("android.resource://" + packageName + "/" + R.raw.video_034))
+            }else{
+                setVideoURI(Uri.parse("android.resource://" + packageName + "/" + R.raw.video))
+            }
+
             start()
             mainHandler.post(runnable)
             setOnCompletionListener {

+ 12 - 1
BusinessSetting/src/main/java/com/develop/setting/init/ui/PrivacyPolicyActivity.kt

@@ -11,6 +11,9 @@ import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.utils.ThreadUtils
 import com.develop.food.base.utils.TimeDownUtil
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.utils.setGone
+import com.develop.food.base.utils.setVisible
 import com.develop.setting.R
 import com.develop.setting.databinding.ActivityPrivacePolicyBinding
 import org.greenrobot.eventbus.Subscribe
@@ -50,6 +53,10 @@ class PrivacyPolicyActivity : BaseActivity<ActivityPrivacePolicyBinding>() {
                 navigateTo(Screens.Setting.WIFI)
             }
         }
+        if (isNightTheme()) {
+            binding.cardLayout.setGone()
+            binding.scrollText.setVisible()
+        }
 
     }
 
@@ -67,7 +74,11 @@ class PrivacyPolicyActivity : BaseActivity<ActivityPrivacePolicyBinding>() {
             override fun onFinish() {
                 isFinish = true
                 ThreadUtils.runOnMainThread {
-                    binding.tvAgree.setBackgroundResource(R.drawable.shape_60pxf4a12e_corners)
+                    if (isNightTheme()) {
+                        binding.tvAgree.setBackgroundResource(R.drawable.shape_60px000000_corners)
+                    } else {
+                        binding.tvAgree.setBackgroundResource(R.drawable.shape_60pxf4a12e_corners)
+                    }
                     binding.tvAgree.text = getString(R.string.i_agree)
                 }
             }

+ 1 - 1
BusinessSetting/src/main/java/com/develop/setting/init/ui/RestoreActivity.kt

@@ -22,7 +22,7 @@ class RestoreActivity : BaseActivity<ActivityRestoreBinding>() {
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
-        binding.topBar.setTopBarTitle(getString(R.string.restore_factory_settings))
+        binding.topBar.setTopBarTitle(getString(R.string.reset))
         binding.topBar.listenBackClick {
             finish()
         }

+ 101 - 43
BusinessSetting/src/main/java/com/develop/setting/init/ui/WifiListActivity.kt

@@ -15,11 +15,12 @@ import com.develop.food.base.manager.wifi.WifiHelp
 import com.develop.food.base.router.Screens
 import com.develop.food.base.router.navigateTo
 import com.develop.food.base.ui.BaseActivity
-import com.develop.food.base.utils.GlobalToast
 import com.develop.food.base.utils.ResDimension
+import com.develop.food.base.utils.isNightTheme
 import com.develop.setting.R
 import com.develop.setting.databinding.ActivityWifiListBinding
 import com.develop.setting.init.adapter.WifiListAdapter
+import com.develop.setting.init.adapter.WifiListAdapter1
 import com.yanzhenjie.permission.AndPermission
 import com.yanzhenjie.permission.runtime.Permission
 import org.greenrobot.eventbus.EventBus
@@ -28,6 +29,7 @@ import org.greenrobot.eventbus.Subscribe
 @Route(path = Screens.Setting.WIFI)
 class WifiListActivity : BaseActivity<ActivityWifiListBinding>() {
     private var wifiListAdapter = WifiListAdapter()
+    private var wifiListAdapter1 = WifiListAdapter1()
     private var isFromMainSetting = false
     private var wifiDataList = mutableListOf<WifiData>()
     private lateinit var wifiHelp: WifiHelp
@@ -49,57 +51,109 @@ class WifiListActivity : BaseActivity<ActivityWifiListBinding>() {
         }
         binding.topBar.setTopBarTitle(getString(R.string.wifi))
 
+        if (isNightTheme()) {
+            wifiListAdapter1.apply {
+                onOkClickListener = object : WifiListAdapter1.OnOkClickListener {
+                    override fun onOkClick(accessPoint: WifiData) {
+                        showDialog()
+                        wifiHelp.connect(accessPoint, accessPoint.password)
+                    }
+                }
+                setOnItemClickListener { adapter, view, position ->
+                    val wifiData = wifiDataList[position]
+                    if (wifiData.isConnected) {
+//                    GlobalToast.showToast("已连接")
+                    } else if (wifiData.password.isNotEmpty()) {
+                        showDialog()
+                        wifiHelp.connect(wifiData, wifiData.password)
+                    } else if (wifiData.isSavePwd) {
+                        showDialog()
+                        wifiHelp.connect(wifiData)
+                    } else {
+                        updateSelectedPosition(position)
+                    }
+                }
 
-        wifiListAdapter.apply {
-            onOkClickListener = object : WifiListAdapter.OnOkClickListener {
-                override fun onOkClick(accessPoint: WifiData) {
-                    showDialog()
-                    wifiHelp.connect(accessPoint, accessPoint.password)
+                setOnItemLongClickListener { adapter, view, position ->
+                    wifiHelp.removeSaveWifi(wifiDataList[position])
+                    true
                 }
             }
-            setOnItemClickListener { adapter, view, position ->
-                val wifiData = wifiDataList[position]
-                if (wifiData.isConnected) {
+
+            binding.wifiRecycler.apply {
+                adapter = wifiListAdapter1
+                addItemDecoration(object : RecyclerView.ItemDecoration() {
+                    override fun getItemOffsets(
+                        outRect: Rect,
+                        view: View,
+                        parent: RecyclerView,
+                        state: RecyclerView.State
+                    ) {
+                        super.getItemOffsets(outRect, view, parent, state)
+                        val pos = parent.getChildAdapterPosition(view)
+                        if (pos == 0) {
+                            outRect.top = ResDimension(R.dimen.convert_30px).toInt()
+                        }
+                        outRect.left = ResDimension(R.dimen.convert_45px).toInt()
+                        outRect.right = ResDimension(R.dimen.convert_45px).toInt()
+                        outRect.bottom = ResDimension(R.dimen.convert_50px).toInt()
+                    }
+                })
+            }
+        } else {
+            wifiListAdapter.apply {
+                onOkClickListener = object : WifiListAdapter.OnOkClickListener {
+                    override fun onOkClick(accessPoint: WifiData) {
+                        showDialog()
+                        wifiHelp.connect(accessPoint, accessPoint.password)
+                    }
+                }
+                setOnItemClickListener { adapter, view, position ->
+                    val wifiData = wifiDataList[position]
+                    if (wifiData.isConnected) {
 //                    GlobalToast.showToast("已连接")
-                } else if (wifiData.password.isNotEmpty()) {
-                    showDialog()
-                    wifiHelp.connect(wifiData, wifiData.password)
-                } else if (wifiData.isSavePwd) {
-                    showDialog()
-                    wifiHelp.connect(wifiData)
-                } else {
-                    updateSelectedPosition(position)
+                    } else if (wifiData.password.isNotEmpty()) {
+                        showDialog()
+                        wifiHelp.connect(wifiData, wifiData.password)
+                    } else if (wifiData.isSavePwd) {
+                        showDialog()
+                        wifiHelp.connect(wifiData)
+                    } else {
+                        updateSelectedPosition(position)
+                    }
                 }
-            }
 
-            setOnItemLongClickListener { adapter, view, position ->
-                wifiHelp.removeSaveWifi(wifiDataList[position])
-                true
+                setOnItemLongClickListener { adapter, view, position ->
+                    wifiHelp.removeSaveWifi(wifiDataList[position])
+                    true
+                }
             }
-        }
 
-        binding.wifiRecycler.apply {
-            adapter = wifiListAdapter
-            addItemDecoration(object : RecyclerView.ItemDecoration() {
-                override fun getItemOffsets(
-                    outRect: Rect,
-                    view: View,
-                    parent: RecyclerView,
-                    state: RecyclerView.State
-                ) {
-                    super.getItemOffsets(outRect, view, parent, state)
-                    val pos = parent.getChildAdapterPosition(view)
-                    if (pos == 0) {
-                        outRect.top = ResDimension(R.dimen.convert_30px).toInt()
+            binding.wifiRecycler.apply {
+                adapter = wifiListAdapter
+                addItemDecoration(object : RecyclerView.ItemDecoration() {
+                    override fun getItemOffsets(
+                        outRect: Rect,
+                        view: View,
+                        parent: RecyclerView,
+                        state: RecyclerView.State
+                    ) {
+                        super.getItemOffsets(outRect, view, parent, state)
+                        val pos = parent.getChildAdapterPosition(view)
+                        if (pos == 0) {
+                            outRect.top = ResDimension(R.dimen.convert_30px).toInt()
+                        }
+                        outRect.left = ResDimension(R.dimen.convert_45px).toInt()
+                        outRect.right = ResDimension(R.dimen.convert_45px).toInt()
+                        outRect.bottom = ResDimension(R.dimen.convert_50px).toInt()
                     }
-                    outRect.left = ResDimension(R.dimen.convert_45px).toInt()
-                    outRect.right = ResDimension(R.dimen.convert_45px).toInt()
-                    outRect.bottom = ResDimension(R.dimen.convert_50px).toInt()
-                }
-            })
+                })
+            }
         }
 
 
+
+
         binding.tvSkin.setOnClickListener {
             if (NetworkUtils.isConnected()) {
                 navigateTo(Screens.Auth.MEMBER)
@@ -127,14 +181,18 @@ class WifiListActivity : BaseActivity<ActivityWifiListBinding>() {
         wifiHelp = WifiHelp.Build(this)
             .setErrorAuthenticating {
                 dismissDialog()
-                GlobalToast.showToast(it)
             }
             .setScanCallback {
                 it?.apply {
                     wifiDataList.clear()
                     wifiDataList.addAll(it)
-                    wifiListAdapter.selectedPosition = -1
-                    wifiListAdapter.setList(wifiDataList)
+                    if (isNightTheme()) {
+                        wifiListAdapter1.selectedPosition = -2
+                        wifiListAdapter1.setList(wifiDataList)
+                    } else {
+                        wifiListAdapter.selectedPosition = -2
+                        wifiListAdapter.setList(wifiDataList)
+                    }
                 }
                 dismissDialog()
             }

+ 35 - 13
BusinessSetting/src/main/res/layout/activity_about.xml

@@ -23,7 +23,7 @@
         android:id="@+id/tv_app_name"
         android:text="Product Name"
         android:textSize="@dimen/convert_54px"
-        android:textColor="@color/color_6B6B6B"
+         android:textColor="@color/title_color"
         android:layout_marginTop="@dimen/convert_135px"
         android:layout_centerHorizontal="true"
         android:layout_below="@id/iv_logo"
@@ -42,6 +42,7 @@
         android:orientation="horizontal">
 
         <ImageView
+            android:id="@+id/iv_download"
             android:layout_width="@dimen/convert_48px"
             android:layout_height="@dimen/convert_63px"
             android:layout_marginStart="@dimen/convert_70px"
@@ -52,7 +53,7 @@
             android:layout_height="wrap_content"
             android:layout_marginStart="@dimen/convert_50px"
             android:text="@string/update_the_recipes"
-            android:textColor="@color/color_92cf40"
+            android:textColor="@color/update_recipes_color"
             android:textSize="@dimen/convert_48px" />
     </LinearLayout>
 
@@ -73,12 +74,13 @@
            >
 
             <androidx.appcompat.widget.AppCompatTextView
+                android:id="@+id/tv_apk"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_centerVertical="true"
                 android:layout_marginStart="@dimen/convert_43px"
                 android:text="@string/apk"
-                android:textColor="@color/color_6B6B6B"
+                 android:textColor="@color/title_color"
                 android:textSize="@dimen/convert_45px" />
 
             <androidx.appcompat.widget.AppCompatTextView
@@ -89,7 +91,7 @@
                 android:layout_marginEnd="@dimen/convert_33px"
                 android:text="v2.1.2"
                 android:layout_centerVertical="true"
-                android:textColor="@color/color_B1B2B2"
+                android:textColor="@color/about_info_color"
                 android:textSize="@dimen/convert_39px" />
 
             <androidx.appcompat.widget.AppCompatTextView
@@ -117,22 +119,24 @@
             >
 
             <androidx.appcompat.widget.AppCompatTextView
+                android:id="@+id/tv_mcu"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/convert_43px"
                 android:text="@string/mcu"
                 android:layout_centerVertical="true"
-                android:textColor="@color/color_6B6B6B"
+                 android:textColor="@color/title_color"
                 android:textSize="@dimen/convert_45px" />
 
             <androidx.appcompat.widget.AppCompatTextView
+                android:id="@+id/tvMcuVersion"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentEnd="true"
                 android:layout_marginEnd="@dimen/convert_33px"
                 android:text="1.0.0"
                 android:layout_centerVertical="true"
-                android:textColor="@color/color_B1B2B2"
+                android:textColor="@color/about_info_color"
                 android:textSize="@dimen/convert_39px" />
         </RelativeLayout>
         <View
@@ -146,23 +150,39 @@
             >
 
             <androidx.appcompat.widget.AppCompatTextView
+                android:id="@+id/tv_tp"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/convert_43px"
                 android:text="@string/tp"
                 android:layout_centerVertical="true"
-                android:textColor="@color/color_6B6B6B"
+                 android:textColor="@color/title_color"
                 android:textSize="@dimen/convert_45px" />
 
             <androidx.appcompat.widget.AppCompatTextView
                 android:layout_width="wrap_content"
+                android:id="@+id/tv_tp_version"
                 android:layout_height="wrap_content"
                 android:layout_alignParentEnd="true"
                 android:layout_marginEnd="@dimen/convert_33px"
                 android:text="1.0.0"
                 android:layout_centerVertical="true"
-                android:textColor="@color/color_B1B2B2"
+                android:textColor="@color/about_info_color"
                 android:textSize="@dimen/convert_39px" />
+
+            <androidx.appcompat.widget.AppCompatTextView
+                android:textColor="@color/color_CCF4A12E"
+                android:gravity="center"
+                android:text="@string/update"
+                android:visibility="invisible"
+                android:id="@+id/tv_update_firmware"
+                android:background="@drawable/shape_60pxccff4a12e_stroke"
+                android:layout_marginEnd="@dimen/convert_30px"
+                android:layout_width="@dimen/convert_213px"
+                android:layout_height="@dimen/convert_78px"
+                android:layout_centerVertical="true"
+                android:layout_toStartOf="@id/tv_tp_version" />
+
         </RelativeLayout>
         <View
             android:background="@color/color_E5E5E5"
@@ -175,12 +195,13 @@
        >
 
             <androidx.appcompat.widget.AppCompatTextView
+                android:id="@+id/tv_sn"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_centerVertical="true"
                 android:layout_marginStart="@dimen/convert_43px"
                 android:text="@string/serial_number"
-                android:textColor="@color/color_6B6B6B"
+                 android:textColor="@color/title_color"
                 android:textSize="@dimen/convert_45px" />
 
             <androidx.appcompat.widget.AppCompatTextView
@@ -191,7 +212,7 @@
                 android:layout_centerVertical="true"
                 android:layout_marginEnd="@dimen/convert_33px"
                 android:text="00000000000000"
-                android:textColor="@color/color_B1B2B2"
+                android:textColor="@color/about_info_color"
                 android:textSize="@dimen/convert_39px" />
         </RelativeLayout>
         <View
@@ -205,11 +226,12 @@
             >
 
             <androidx.appcompat.widget.AppCompatTextView
+                android:id="@+id/tv_model"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/convert_43px"
                 android:text="@string/standby_time"
-                android:textColor="@color/color_6B6B6B"
+                 android:textColor="@color/title_color"
                 android:layout_centerVertical="true"
                 android:textSize="@dimen/convert_45px" />
 
@@ -219,8 +241,8 @@
                 android:layout_centerVertical="true"
                 android:layout_alignParentEnd="true"
                 android:layout_marginEnd="@dimen/convert_33px"
-                android:text="2022-5-20"
-                android:textColor="@color/color_B1B2B2"
+                android:text="3015"
+                android:textColor="@color/about_info_color"
                 android:textSize="@dimen/convert_39px" />
         </RelativeLayout>
 

+ 19 - 14
BusinessSetting/src/main/res/layout/activity_birghtness.xml

@@ -51,18 +51,21 @@
 
     <androidx.appcompat.widget.AppCompatTextView
         android:id="@+id/tv_screen_lock_time"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
+        android:gravity="center"
+        android:layout_marginStart="@dimen/convert_90px"
+        android:layout_marginEnd="@dimen/convert_90px"
         android:layout_height="wrap_content"
         android:layout_below="@id/top_bar"
         android:layout_centerHorizontal="true"
         android:layout_marginTop="@dimen/convert_207px"
         android:text="@string/screen_lock_time"
-        android:textColor="@color/color_6B6B6B"
+        android:textColor="@color/title_color"
         android:textSize="@dimen/convert_54px" />
 
     <RadioGroup
         android:layout_centerHorizontal="true"
-        android:orientation="horizontal"
+        android:orientation="vertical"
         android:id="@+id/rg_lock_time"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
@@ -72,37 +75,39 @@
         <RadioButton
             android:id="@+id/rb_3_min"
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
+            android:layout_height="wrap_content"
             android:button="@drawable/lock_time_selector"
             android:gravity="center_vertical"
-            android:text="@string/time_3min"
+            android:text="@string/time_5min"
             android:checked="true"
+            
             android:paddingStart="@dimen/convert_26px"
-            android:textColor="@color/color_6B6B6B"
+            android:textColor="@color/title_color"
             android:textSize="@dimen/convert_45px" />
 
         <RadioButton
             android:id="@+id/rb_10_min"
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginStart="@dimen/convert_102px"
+            android:layout_height="wrap_content"
             android:button="@drawable/lock_time_selector"
             android:gravity="center_vertical"
-            android:text="@string/time_5min"
+            android:text="@string/time_10min"
+            android:layout_marginTop="@dimen/convert_40px"
             android:paddingStart="@dimen/convert_26px"
-            android:textColor="@color/color_6B6B6B"
+            android:textColor="@color/title_color"
             android:textSize="@dimen/convert_45px" />
 
         <RadioButton
             android:id="@+id/rb_30_min"
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginStart="@dimen/convert_102px"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/convert_40px"
             android:button="@drawable/lock_time_selector"
             android:gravity="center_vertical"
             android:paddingStart="@dimen/convert_26px"
-            android:text="@string/time_10min"
-            android:textColor="@color/color_6B6B6B"
+            android:text="@string/time_20min"
+            
+            android:textColor="@color/title_color"
             android:textSize="@dimen/convert_45px" />
 
     </RadioGroup>

+ 3 - 1
BusinessSetting/src/main/res/layout/activity_language.xml

@@ -44,7 +44,9 @@
         app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
         android:id="@+id/language_recycle"
         android:layout_width="match_parent"
-        android:layout_height="@dimen/convert_730px"
+        android:layout_height="match_parent"
+        android:layout_above="@id/tv_next"
+        android:layout_marginBottom="@dimen/convert_65px"
         android:layout_below="@+id/tv_language"
         android:layout_marginTop="@dimen/convert_74px" />
 

+ 4 - 2
BusinessSetting/src/main/res/layout/activity_power_animation.xml

@@ -49,7 +49,7 @@
         android:background="@drawable/white_circle"
         android:gravity="center"
         android:text="@string/skip"
-        android:textColor="@color/color_F4A12E"
+        android:textColor="@color/cook_card_name_color"
         android:textSize="@dimen/convert_38px" />
 
 
@@ -58,7 +58,9 @@
         android:id="@+id/function_layout"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_centerInParent="true"
+        android:layout_centerHorizontal="true"
+        android:layout_alignParentBottom="true"
+        android:layout_marginBottom="@dimen/convert_300px"
         android:orientation="vertical">
 
         <RelativeLayout

+ 35 - 9
BusinessSetting/src/main/res/layout/activity_privace_policy.xml

@@ -12,16 +12,16 @@
 
     <androidx.appcompat.widget.AppCompatTextView
         android:id="@+id/tv_agree"
-        android:textSize="@dimen/convert_54px"
-        android:textColor="@color/color_fff"
-        android:gravity="center"
-        android:background="@drawable/shape_60pxe5e5e5_corners"
-        android:layout_marginBottom="@dimen/convert_95px"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/convert_120px"
         android:layout_alignParentBottom="true"
         android:layout_marginStart="@dimen/convert_75px"
         android:layout_marginEnd="@dimen/convert_75px"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/convert_120px"/>
+        android:layout_marginBottom="@dimen/convert_95px"
+        android:background="@drawable/shape_60pxe5e5e5_corners"
+        android:gravity="center"
+        android:textColor="@color/color_fff"
+        android:textSize="@dimen/convert_54px" />
 
     <LinearLayout
         android:id="@+id/agree_layout"
@@ -51,11 +51,12 @@
     <androidx.cardview.widget.CardView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:layout_above="@id/agree_layout"
+        android:id="@+id/card_layout"
         android:layout_below="@id/top_bar"
         android:layout_marginStart="@dimen/convert_45px"
         android:layout_marginTop="@dimen/convert_20px"
         android:layout_marginEnd="@dimen/convert_45px"
-        android:layout_above="@id/agree_layout"
         android:layout_marginBottom="@dimen/convert_60px"
         app:cardCornerRadius="@dimen/convert_30px">
 
@@ -72,11 +73,36 @@
                 android:layout_marginEnd="@dimen/convert_44px"
                 android:lineSpacingExtra="@dimen/convert_20px"
                 android:text="@string/privacy_policy_content"
-                android:textColor="@color/color_6B6B6B"
+                android:textColor="@color/title_color"
                 android:textSize="@dimen/convert_39px" />
 
         </androidx.core.widget.NestedScrollView>
     </androidx.cardview.widget.CardView>
 
+    <androidx.core.widget.NestedScrollView
+        android:id="@+id/scroll_text"
+        android:visibility="gone"
+        android:layout_marginStart="@dimen/convert_71px"
+        android:layout_marginTop="@dimen/convert_20px"
+        android:layout_marginEnd="@dimen/convert_71px"
+        android:layout_marginBottom="@dimen/convert_60px"
+        android:layout_below="@id/top_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:scrollbars="vertical">
+
+        <androidx.appcompat.widget.AppCompatTextView
+            android:layout_width="match_parent"
+            android:lineSpacingExtra="@dimen/convert_30px"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="@dimen/convert_44px"
+            android:layout_marginTop="@dimen/convert_30px"
+            android:layout_marginEnd="@dimen/convert_44px"
+            android:text="@string/privacy_policy_content"
+            android:textColor="#000"
+            android:textSize="@dimen/convert_39px" />
+
+    </androidx.core.widget.NestedScrollView>
+
 
 </RelativeLayout>

+ 5 - 3
BusinessSetting/src/main/res/layout/activity_restore.xml

@@ -12,13 +12,15 @@
 
     <androidx.appcompat.widget.AppCompatTextView
         android:id="@+id/tv_brightness"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
+        android:layout_marginStart="@dimen/convert_90px"
+        android:layout_marginEnd="@dimen/convert_90px"
         android:layout_height="wrap_content"
         android:layout_centerHorizontal="true"
         android:layout_marginTop="@dimen/convert_660px"
         android:includeFontPadding="false"
         android:text="@string/are_you_sure_to_restore_factory_settings"
-        android:textColor="@color/color_EE0000"
+        android:textColor="@color/restore_des_color"
         android:textSize="@dimen/convert_45px" />
 
     <androidx.appcompat.widget.AppCompatTextView
@@ -33,7 +35,7 @@
         android:gravity="center"
         android:text="@string/yes"
         android:textSize="@dimen/convert_52px"
-        android:textColor="@color/color_E5E5E5" />
+        android:textColor="@color/color_fff" />
 
 
 </RelativeLayout>

+ 1 - 1
BusinessSetting/src/main/res/layout/activity_wifi_list.xml

@@ -17,7 +17,7 @@
         android:layout_height="wrap_content"
         android:layout_marginBottom="@dimen/convert_80px"
         android:text="@string/skin_for_now"
-        android:textColor="@color/color_F4A12E"
+        android:textColor="@color/login_color"
         android:textSize="@dimen/convert_54px"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"

+ 26 - 0
BusinessSetting/src/main/res/layout/item_language_view2.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/content_layout"
+    android:layout_width="match_parent"
+    android:layout_height="@dimen/convert_120px"
+    android:layout_marginStart="@dimen/convert_75px"
+    android:layout_marginEnd="@dimen/convert_75px"
+    android:layout_marginBottom="@dimen/convert_30px">
+
+    <ImageView
+        android:id="@+id/ic_icon"
+        android:layout_width="@dimen/convert_60px"
+        android:layout_height="@dimen/convert_60px"
+        android:layout_centerVertical="true"
+        android:layout_marginStart="@dimen/convert_45px" />
+
+    <androidx.appcompat.widget.AppCompatTextView
+        android:id="@+id/tv_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:layout_marginStart="@dimen/convert_44px"
+        android:layout_toEndOf="@id/ic_icon"
+        android:textColor="@color/color_6B6B6B"
+        android:textSize="@dimen/convert_45px" />
+</RelativeLayout>

+ 1 - 1
BusinessSetting/src/main/res/layout/item_setting_main_view.xml

@@ -19,7 +19,7 @@
         android:layout_marginTop="@dimen/convert_45px"
         android:gravity="center"
         android:includeFontPadding="false"
-        android:textColor="@color/color_6B6B6B"
+        android:textColor="@color/title_color"
         android:textSize="@dimen/convert_45px"
         android:layout_below="@id/iv_icon" />
 </RelativeLayout>

+ 104 - 0
BusinessSetting/src/main/res/layout/item_wifi_content1.xml

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/content_layout"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/shape_30pxf4a12e_stoke">
+
+    <ImageView
+        android:id="@+id/iv_signal"
+        android:layout_width="@dimen/convert_70px"
+        android:layout_height="@dimen/convert_70px"
+        android:layout_marginStart="@dimen/convert_60px"
+        android:layout_marginTop="@dimen/convert_39px"
+        tools:src="@drawable/icon_wifi_signal_level" />
+
+    <ImageView
+        android:id="@+id/iv_lock"
+        android:layout_width="@dimen/convert_60px"
+        android:layout_height="@dimen/convert_60px"
+        android:layout_alignParentEnd="true"
+        android:layout_marginTop="@dimen/convert_65px"
+        android:layout_marginEnd="@dimen/convert_70px"
+        android:background="@drawable/ic_lock" />
+
+    <RelativeLayout
+        android:id="@+id/input_layout"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:visibility="gone">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/convert_120px"
+            android:layout_marginStart="@dimen/convert_90px"
+            android:layout_marginTop="@dimen/convert_267px"
+            android:layout_marginEnd="@dimen/convert_90px"
+            android:layout_marginBottom="@dimen/convert_116px"
+            android:orientation="horizontal">
+
+            <EditText
+                android:id="@+id/et_pwd"
+                android:layout_width="@dimen/convert_600px"
+                android:layout_height="match_parent"
+                android:background="@drawable/shape_60pxe5e5e5_left_stoke"
+                android:gravity="center_vertical"
+                android:inputType="textPassword"
+                android:maxLength="18"
+                android:paddingStart="@dimen/convert_54px"
+                android:paddingEnd="@dimen/convert_54px"
+                android:singleLine="true"
+                android:textColor="@color/color_6B6B6B"
+                android:textSize="@dimen/convert_39px" />
+
+            <androidx.appcompat.widget.AppCompatTextView
+                android:id="@+id/tv_ok"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@drawable/shape_60pxf4a12e_right_corners"
+                android:gravity="center"
+                android:text="@string/ok"
+                android:textColor="@color/color_fff"
+                android:textSize="@dimen/convert_54px" />
+        </LinearLayout>
+
+        <CheckBox
+            android:id="@+id/ckb_eye"
+            android:layout_width="@dimen/convert_57px"
+            android:layout_height="@dimen/convert_33px"
+            android:layout_marginStart="@dimen/convert_605px"
+            android:layout_marginTop="@dimen/convert_311px"
+            android:layout_marginEnd="@dimen/convert_327px"
+            android:background="@drawable/eye_selector"
+            android:button="@null" />
+
+    </RelativeLayout>
+
+    <androidx.appcompat.widget.AppCompatTextView
+        android:id="@+id/tv_wifi_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="@dimen/convert_40px"
+        android:layout_marginTop="@dimen/convert_49px"
+        android:layout_toEndOf="@id/iv_signal"
+        android:includeFontPadding="false"
+        android:text="WIFI-1001"
+        android:textColor="@color/wifi_color"
+        android:textSize="@dimen/convert_45px" />
+
+
+    <androidx.appcompat.widget.AppCompatTextView
+        android:id="@+id/tv_wifi_state"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/tv_wifi_name"
+        android:layout_marginStart="@dimen/convert_40px"
+        android:layout_marginTop="@dimen/convert_30px"
+        android:layout_marginBottom="@dimen/convert_42px"
+        android:layout_toEndOf="@id/iv_signal"
+        android:includeFontPadding="false"
+        android:text="@string/off_line"
+        android:textColor="@color/wifi_color"
+        android:textSize="@dimen/convert_39px" />
+</RelativeLayout>

BusinessStep/src/main/assets/config/lang_config.json → BusinessStep/src/main/assets/lang_config.json


+ 187 - 0
BusinessStep/src/main/assets/lang_config_034.json

@@ -0,0 +1,187 @@
+{
+  "langs": [
+    {
+      "name": "English(英语)",
+      "value": "EN",
+      "icon": "icon_lang_en",
+      "showName": "English",
+      "show": true
+    },
+    {
+      "name": "Polish(波兰语)",
+      "value": "PL",
+      "icon": "icon_lang_pl",
+      "showName": "Polski",
+      "show": true
+    },
+    {
+      "name": "German(德语)",
+      "value": "DE",
+      "icon": "icon_lang_de",
+      "showName": "Deutsch",
+      "show": true
+    },
+    {
+      "name": "French(法语)",
+      "value": "FR",
+      "icon": "icon_lang_fr",
+      "showName": "Français",
+      "show": false
+    },
+    {
+      "name": "Dutch(荷兰语)",
+      "value": "NL",
+      "icon": "icon_lang_nl",
+      "showName": "Nederlands",
+      "show": false
+    },
+    {
+      "name": "Portuguese(葡萄牙语)",
+      "value": "PT",
+      "icon": "icon_lang_pt",
+      "showName": "Português",
+      "show": false
+    },
+    {
+      "name": "Spanish(西班牙语)",
+      "value": "ES",
+      "icon": "icon_lang_es",
+      "showName": "Español",
+      "show": true
+    },
+    {
+      "name": "Italiano(意大利语)",
+      "value": "IT",
+      "icon": "icon_lang_it",
+      "showName": "Italiano",
+      "show": false
+    },
+
+    {
+      "name": "Greek(希腊语)",
+      "value": "GR",
+      "icon": "icon_lang_gr",
+      "showName": "Ελληνικά",
+      "show": false
+    },
+    {
+      "name": "Russian(俄语)",
+      "value": "RU",
+      "icon": "icon_lang_ru",
+      "showName": "Русский",
+      "show": true
+    },
+    {
+      "name": "Romanian(罗马尼亚语)",
+      "value": "RO",
+      "icon": "icon_lang_ro",
+      "showName": "Română",
+      "show": true
+    },
+    {
+      "name": "Finnish(芬兰语)",
+      "value": "FI",
+      "icon": "icon_lang_fi",
+      "showName": "Suomi",
+      "show": false
+    },
+    {
+      "name": "Norsk(挪威语)",
+      "value": "NO",
+      "icon": "icon_lang_no",
+      "showName": "Norsk",
+      "show": false
+    },
+    {
+      "name": "Swedish(瑞典语)",
+      "value": "SE",
+      "icon": "icon_lang_se",
+      "showName": "Svenska",
+      "show": false
+    },
+    {
+      "name": "Danish(丹麦语)",
+      "value": "DK",
+      "icon": "icon_lang_dk",
+      "showName": "Dansk",
+      "show": false
+    },
+    {
+      "name": "Czech(捷克语)",
+      "value": "CZ",
+      "icon": "icon_lang_cz",
+      "showName": "Čeština",
+      "show": false
+    },
+    {
+      "name": "Estonki(爱沙尼亚语)",
+      "value": "EE",
+      "icon": "icon_lang_ee",
+      "showName": "Eesti keel",
+      "show": false
+    },
+    {
+      "name": "Slovak(斯洛伐克语)",
+      "value": "SK",
+      "icon": "icon_lang_sk",
+      "showName": "Slovenčina",
+      "show": true
+    },
+    {
+      "name": "Ukrainian(乌克兰语)",
+      "value": "UK",
+      "icon": "icon_lang_uk",
+      "showName": "Українська",
+      "show": true
+    },
+    {
+      "name": "Arabic(阿拉伯语)",
+      "value": "AR",
+      "icon": "icon_lang_ar",
+      "showName": "العربية",
+      "show": false
+    },
+    {
+      "name": "Lithuanian(立陶宛语)",
+      "value": "LT",
+      "icon": "icon_lang_lt",
+      "showName": "Lietuvių kalba",
+      "show": false
+    },
+    {
+      "name": "Farsi(波斯语)",
+      "value": "IR",
+      "icon": "icon_lang_ir",
+      "showName": "فارسی",
+      "show": false
+    },
+    {
+      "name": "Kazakh(哈萨克语)",
+      "value": "KZ",
+      "icon": "icon_lang_kz",
+      "showName": "Қазақша",
+      "show": true
+    },
+    {
+      "name": "Chinese(中文)",
+      "value": "ZH",
+      "icon": "icon_lang_zh",
+      "showName": "中文",
+      "show": false
+    },
+    {
+      "name": "Bulgaria(保加利亚语)",
+      "value": "BG",
+      "icon": "icon_lang_bg",
+      "showName": "Български език",
+      "show": true
+    },
+    {
+      "name": "Hungarian(匈牙利语)",
+      "value": "HU",
+      "icon": "icon_lang_hu",
+      "showName": "Magyar nyelv",
+      "show": true
+    }
+  ]
+}

+ 73 - 23
BusinessStep/src/main/java/com/develop/step/CookEvaluateActivity.kt

@@ -7,9 +7,9 @@ import com.alibaba.android.arouter.facade.annotation.Autowired
 import com.alibaba.android.arouter.facade.annotation.Route
 import com.alibaba.android.arouter.launcher.ARouter
 import com.blankj.utilcode.util.KeyboardUtils
-import com.blankj.utilcode.util.ToastUtils
-import com.develop.food.base.api.FoodRepository
-import com.develop.food.base.http.observeStatus
+import com.develop.food.base.event.RefreshStarDataEvent
+import com.develop.food.base.ext.runOnMainThread
+import com.develop.food.base.ext.safeGlobalScope
 import com.develop.food.base.repo.CURRENT_USER_ID
 import com.develop.food.base.repo.FoodDataProvider
 import com.develop.food.base.repo.entity.UserTag
@@ -18,7 +18,9 @@ import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.utils.GlobalToast
 import com.develop.food.base.utils.ThreadUtils
 import com.develop.step.databinding.ActivityCookEvaluateBinding
-import com.develop.step.model.CookDetailInfo
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import org.greenrobot.eventbus.EventBus
 
 @Route(path = Screens.Cook.COOK_EVALUATE)
 class CookEvaluateActivity : BaseActivity<ActivityCookEvaluateBinding>() {
@@ -35,6 +37,7 @@ class CookEvaluateActivity : BaseActivity<ActivityCookEvaluateBinding>() {
 
     private var starCount = 0
     private var evaluateContent = ""
+    private var useNum = 0L
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         ARouter.getInstance().inject(this)
@@ -76,34 +79,83 @@ class CookEvaluateActivity : BaseActivity<ActivityCookEvaluateBinding>() {
             starCount = 5
             binding.tvGood.text = getString(R.string.perfect)
         }
-        binding.ivStar5.callOnClick()
         binding.viewClose.setOnClickListener {
             finish()
         }
+
+
+        safeGlobalScope.launch(Dispatchers.IO) {
+            val userTag = FoodDataProvider.getUserDatabase().userInfoDao().queryUserTag(
+                CURRENT_USER_ID, recipeNumber ?: ""
+            )
+            val recipes = FoodDataProvider.getDatabase().recipeDao().queryRecipe(recipeNumber)
+            val count1 = userTag?.starCount ?: 0
+            val count2 = recipes?.score?.toInt() ?: 0
+            starCount = if (count1 != 0) {
+                count1
+            } else if (count2 != 0) {
+                count2
+            } else {
+                0
+            }
+            runOnMainThread {
+                selectStar(starCount)
+                when (starCount) {
+                    1 -> {
+                        binding.tvGood.text = getString(R.string.bad)
+                    }
+
+                    2 -> {
+                        binding.tvGood.text = getString(R.string.imperfect)
+                    }
+
+                    3 -> {
+                        binding.tvGood.text = getString(R.string.ordinary)
+                    }
+
+                    4 -> {
+                        binding.tvGood.text = getString(R.string.good)
+                    }
+
+                    5 -> {
+                        binding.tvGood.text = getString(R.string.perfect)
+                    }
+                }
+                binding.etContent.setText(userTag?.daily)
+            }
+        }
+
         binding.tvOk.setOnClickListener {
             KeyboardUtils.hideSoftInput(this)
             evaluateContent = binding.etContent.text.toString()
             FoodDataProvider.getUserDatabase().runInTransaction {
                 val userTag = UserTag(CURRENT_USER_ID, recipeNumber, starCount, evaluateContent)
                 FoodDataProvider.getUserDatabase().userInfoDao().updateUserTag(userTag)
-            }
-
-            FoodRepository.score(recipeNumber,recipesEdition,starCount.toString(),evaluateContent).observeStatus(
-                onSuccess = {
-                    GlobalToast.showToast("Evaluate successfully")
-                    finish();
-                    return@observeStatus
-
-                },
-                onFailed = {
-                    it?.desc?.let { msg ->
-                        ToastUtils.showShort(msg)
-                    }
+                val result = FoodDataProvider.getDatabase().recipeDao().queryRecipe(recipeNumber)
+                result?.score = starCount.toDouble()
+                result?.useNum = result?.useNum?.plus(1)
+                useNum = result?.useNum ?: 0L
+                result?.apply {
+                    FoodDataProvider.getDatabase().recipeDao().updateRecipe(this)
                 }
-            )
+            }
 
+//            FoodRepository.score(recipeNumber,recipesEdition,starCount.toString(),evaluateContent).observeStatus(
+//                onSuccess = {
+//                    GlobalToast.showToast(getString(R.string.evaluate_successfully))
+//                    finish();
+//                    return@observeStatus
+//
+//                },
+//                onFailed = {
+//                    it?.desc?.let { msg ->
+//                        ToastUtils.showShort(msg)
+//                    }
+//                }
+//            )
+            EventBus.getDefault().post(RefreshStarDataEvent(starCount, recipeNumber, useNum))
 
-            GlobalToast.showToast("Evaluate successfully")
+            GlobalToast.showToast(getString(R.string.evaluate_successfully))
             finish()
         }
         ThreadUtils.runOnWorkThread(Runnable {
@@ -114,9 +166,7 @@ class CookEvaluateActivity : BaseActivity<ActivityCookEvaluateBinding>() {
                 ?: return@Runnable
             ThreadUtils.runOnMainThread {
                 val clickStart = starViews.getOrNull(userTag.starCount - 1)
-                if (clickStart != null) {
-                    clickStart.performClick()
-                }
+                clickStart?.performClick()
                 binding.etContent.setText(userTag.daily)
             }
         })

+ 128 - 59
BusinessStep/src/main/java/com/develop/step/CookStepActivity2.kt

@@ -2,14 +2,13 @@ package com.develop.step
 
 import android.annotation.SuppressLint
 import android.os.Bundle
-import android.text.Layout.Directions
 import android.util.Log
 import android.view.KeyEvent
-import android.view.View
+import androidx.constraintlayout.widget.ConstraintLayout
+import androidx.constraintlayout.widget.ConstraintSet
 import com.alibaba.android.arouter.facade.annotation.Route
 import com.bumptech.glide.Glide
 import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
-import com.develop.food.base.common.MODE_TYPE
 import com.develop.food.base.common.PRESS_DOWN_KEY_CODE
 import com.develop.food.base.common.TURN_DOWN_KEY_CODE
 import com.develop.food.base.common.TURN_UP_KEY_CODE
@@ -52,10 +51,22 @@ class CookStepActivity2 : CookStepToolActivity() {
     private var potCloverStatus = 1 //锅盖是否盖上 0 是 1 否
     private var coverPath: Any? = null
     private var isFromOverWrite = false
-
+    private var titleName = ""
+    private var currModes = ""
     override fun onCreate(savedInstanceState: Bundle?) {
         CofarSDK.updateScene(CookScenes.RECIPE)
         super.onCreate(savedInstanceState)
+        if (isNightTheme()) {
+            val param = binding.viewBack.layoutParams as ConstraintLayout.LayoutParams
+            param.width = dp83
+            param.height = dp83
+            param.marginStart = dp25
+            binding.viewBack.layoutParams = param
+            val set = ConstraintSet()
+            set.clone(binding.clStatusBar)
+            set.centerVertically(R.id.view_back, ConstraintSet.PARENT_ID)
+            set.applyTo(binding.clStatusBar)
+        }
         binding.controller.clSetTime.onTimePickerCallback =
             object : TimePickerView.OnTimePickerCallback {
                 override fun onTimePicker(
@@ -74,7 +85,8 @@ class CookStepActivity2 : CookStepToolActivity() {
                     }
                 }
 
-                override fun onTimePickerTouchFirst() {
+                override fun onTimePickerTouchFirst(where: Int) {
+                    whereIndex = where
                     viewModel.stepUiData.doingModify = true
                 }
             }
@@ -91,24 +103,28 @@ class CookStepActivity2 : CookStepToolActivity() {
         initData()
 
         binding.viewRemark.setOnClickListener {
-            Log.i("dd",CURRENT_USER_ID.toString() + recipeNumber.toString() + currentStepIndex.toString());
+            Log.i(
+                "dd",
+                CURRENT_USER_ID.toString() + recipeNumber.toString() + currentStepIndex.toString()
+            );
             var data = FoodDataProvider.getUserDatabase().userInfoDao().queryUserRecipeStepRemark(
-                CURRENT_USER_ID,recipeNumber.toString(),viewModel.stepIndex.toString());
+                CURRENT_USER_ID, recipeNumber.toString(), viewModel.stepIndex.toString()
+            );
             var dialog = NoteEditDialog();
             dialog.text = data?.remark
-            dialog.listener = object :NoteEditDialog.OnDialogClickListener{
-                override fun onComplete(remark:String) {
+            dialog.listener = object : NoteEditDialog.OnDialogClickListener {
+                override fun onComplete(remark: String) {
                     viewModel.recipe?.let {
 
 
-                        if(data == null){
-                             data = UserRecipeStepRemark(
+                        if (data == null) {
+                            data = UserRecipeStepRemark(
                                 recipeNumber = it.number.toString(),
                                 stepNumber = viewModel.stepIndex.toString(),
                                 userId = CURRENT_USER_ID,
                                 remark = remark
                             )
-                        }else{
+                        } else {
                             data!!.remark = remark;
                         }
 
@@ -129,10 +145,14 @@ class CookStepActivity2 : CookStepToolActivity() {
 
         }
 
-       ThreadUtils.runOnMainThread({
-           CofarSDK.resetLastPotStatus()
-       },1000)
+        ThreadUtils.runOnMainThread({
+            CofarSDK.resetLastPotStatus()
+        }, 1000)
+
+    }
 
+    override fun showDeviceStateDialog(): Boolean {
+        return false
     }
 
     private fun initData() {
@@ -140,17 +160,15 @@ class CookStepActivity2 : CookStepToolActivity() {
         viewModel.stepDisplay.observe(this) { it ->
 
 
-
-
             coverPath = FoodDataProvider.getImagePath(it.source.photoVideoFilePath)
-
-            if(it.workMode == "FINISH_DESC"){
+            currModes = it.workMode
+            if (it.workMode == "FINISH_DESC") {
 
                 val stepCount = viewModel.getStepCount()
                 val stepIndex = viewModel.allSteps.indexOf(it)
                 changeDescription()
                 cookProgressDrawable.setStepState(stepIndex, stepCount)
-                binding.tvStepName.text =getText(R.string.engjoy_your_meal)
+                binding.tvStepName.text = getText(R.string.engjoy_your_meal)
                 binding.tvTitleStep.text = getText(R.string.recipe_complete)
 
                 if (stepCount == 1) {
@@ -168,7 +186,7 @@ class CookStepActivity2 : CookStepToolActivity() {
                 }
 
                 var photoPath = it.source.photoVideoFilePath;
-                if(photoPath == null || photoPath == ""){
+                if (photoPath == null || photoPath == "") {
                     photoPath = viewModel.recipe?.photoPath;
                 }
 
@@ -177,7 +195,8 @@ class CookStepActivity2 : CookStepToolActivity() {
                     .transition(DrawableTransitionOptions.withCrossFade())
                     .error(R.drawable.bg_cook_session)
                     .into(binding.ivCookBg)
-            }else{
+            } else {
+                binding.tvTitleStep.text = titleName
                 if (CofarSDK.devInfo().status == DevStatus.STOP.toInt()) {
                     CofarSDK.changeModeWithoutCfg(
                         "$recipeNumber:${viewModel.stepIndex}",
@@ -210,33 +229,34 @@ class CookStepActivity2 : CookStepToolActivity() {
 //                    )
 //                )
                 cookProgressDrawable.setStepState(stepIndex, stepCount)
-                if(it.source.description == null || it.source.description == ""){
+                if (it.source.description == null || it.source.description == "") {
                     var minute = "0"
                     var second = "0"
                     var temperature = "0"
                     var rotateSpeed = "0"
                     var rotateDirection = MotorDirections.FORWARD.toString()
-                    if(it.source.minute != null){
+                    if (it.source.minute != null) {
                         minute = it.source.minute.toString();
                     }
-                    if(it.source.second != null){
+                    if (it.source.second != null) {
                         second = it.source.second.toString();
                     }
-                    if(it.source.temperature != null){
-                        temperature = CofarUtils.parseTemp(it.source.temperature!!.toShort()).toString();
+                    if (it.source.temperature != null) {
+                        temperature =
+                            CofarUtils.parseTemp(it.source.temperature!!.toShort()).toString();
                     }
-                    if(it.source.rotateSpeed != null ){
+                    if (it.source.rotateSpeed != null) {
                         rotateSpeed = it.source.rotateSpeed.toString();
                     }
-                    if(it.source.rotateDirection != null && it.source.rotateDirection != ""){
+                    if (it.source.rotateDirection != null && it.source.rotateDirection != "") {
                         rotateDirection = it.source.rotateDirection.toString();
                     }
-                    var description = "${temperature}°C/${minute}m${second}s/V${rotateSpeed}/${if(rotateDirection == MotorDirections.FORWARD.toString()) "R" else "L"}";
-                    binding.tvStepName.text = description
-                    binding.tvTitleStep.text = description
-                }else{
+                    //var description = "${temperature}°C/${minute}m${second}s/V${rotateSpeed}/${if(rotateDirection == MotorDirections.FORWARD.toString()) "R" else "L"}";
+                    binding.tvStepName.text = ""
+//                    binding.tvTitleStep.text = description
+                } else {
                     binding.tvStepName.text = it.source.description
-                    binding.tvTitleStep.text = it.source.description
+//                    binding.tvTitleStep.text = it.source.description
                 }
 
                 if (stepCount == 1) {
@@ -254,7 +274,7 @@ class CookStepActivity2 : CookStepToolActivity() {
                 }
 
                 var photoPath = it.source.photoVideoFilePath;
-                if(photoPath == null || photoPath == ""){
+                if (photoPath == null || photoPath == "") {
                     photoPath = viewModel.recipe?.photoPath;
                 }
 
@@ -277,7 +297,7 @@ class CookStepActivity2 : CookStepToolActivity() {
         }
 
         backRequestDialog.apply {
-            title = "Keep cooking in the background?"
+            title = GlobalApp().getString(R.string.keep_cooking_in_the_background)
             onDialogClickListener = object : CancelConfirmDialog.OnDialogClickListener {
                 override fun onConfirm() {
                     var info = CofarSDK.devInfo().runningInstId.split(":");
@@ -325,7 +345,10 @@ class CookStepActivity2 : CookStepToolActivity() {
                 }
             }
         }
-
+        viewModel.recipeLiveData.observe(this) {
+            titleName = it?.name.toString()
+            binding.tvTitleStep.text = it?.name
+        }
     }
 
     private fun playStepAudio(audioPath: String?) {
@@ -357,7 +380,11 @@ class CookStepActivity2 : CookStepToolActivity() {
                     CofarSDK.cfgHeat(it.uiData.targetTemp.toShort(), 0)
                     CofarSDK.cfgTime(it.uiData.targetTime)
 
-                    CofarSDK.cfgMotor(it.uiData.currentSpeed.toByte(),it.uiData.direction.toByte(),1);
+                    CofarSDK.cfgMotor(
+                        it.uiData.currentSpeed.toByte(),
+                        it.uiData.direction.toByte(),
+                        1
+                    );
 
                 }
                 ThreadUtils.runOnMainThread({
@@ -382,7 +409,8 @@ class CookStepActivity2 : CookStepToolActivity() {
         viewModel.nextStep()
 
         initStepData() //初始化步骤参数
-
+        whereIndex = -1
+        binding.controller.clSetTime.stopAlphaAnim()
 
     }
 
@@ -394,6 +422,8 @@ class CookStepActivity2 : CookStepToolActivity() {
             pendingCookStep = true
         }
         viewModel.prevStep()
+        whereIndex = -1
+        binding.controller.clSetTime.stopAlphaAnim()
         initStepData()
     }
 
@@ -431,6 +461,8 @@ class CookStepActivity2 : CookStepToolActivity() {
     }
 
     private fun handleButtonState(tag: String) {
+        whereIndex = -1
+        binding.controller.clSetTime.stopAlphaAnim()
         if (tag == BUTTON_TAG_START) {
 
 
@@ -467,7 +499,7 @@ class CookStepActivity2 : CookStepToolActivity() {
             initStepData();
             ThreadUtils.runOnMainThread({
                 configing = false
-            },1000);
+            }, 1000);
         } else if (tag == BUTTON_TAG_CANCEL) {
             CofarSDK.cancel()
             binding.controller.btnStart.setGone()
@@ -529,14 +561,19 @@ class CookStepActivity2 : CookStepToolActivity() {
                 mRunningInstId = devInfo.runningInstId
                 mSettingInstId = devInfo.settingInstId
                 it.uiData.runningStatus = devInfo.status
-                if(!viewModel.stepUiData.doingModify) it.uiData.targetTemp = CofarUtils.parseTemp(devInfo.targetTemp).toInt()
-                if(!viewModel.stepUiData.doingModify) it.uiData.targetTime = devInfo.targetTime.toInt()
-                if(!viewModel.stepUiData.doingModify) it.uiData.currentSpeed = devInfo.motorGear.toInt()
+                if (!viewModel.stepUiData.doingModify) it.uiData.targetTemp =
+                    CofarUtils.parseTemp(devInfo.targetTemp).toInt()
+                if (!viewModel.stepUiData.doingModify) it.uiData.targetTime =
+                    devInfo.targetTime.toInt()
+                if (!viewModel.stepUiData.doingModify) it.uiData.currentSpeed =
+                    devInfo.motorGear.toInt()
                 it.uiData.weightNum = devInfo.weight.toInt()
-                if(!viewModel.stepUiData.doingModify) it.uiData.direction = devInfo.motorDirection.toInt()
+                if (!viewModel.stepUiData.doingModify) it.uiData.direction =
+                    devInfo.motorDirection.toInt()
                 it.uiData.currentTemp = CofarUtils.parseTemp(devInfo.temp).toInt()
                 it.uiData.remainTime = devInfo.remainTime.toInt()
-                if(!viewModel.stepUiData.doingModify) it.uiData.targetTimeBuffer = devInfo.targetTimeBuffer.toInt()
+                if (!viewModel.stepUiData.doingModify) it.uiData.targetTimeBuffer =
+                    devInfo.targetTimeBuffer.toInt()
                 it.uiData.isTimeChange = devInfo.mode.isTimeChange
                 it.uiData.isTempChange = devInfo.mode.isTempChange
                 it.uiData.isMotorDirectionChange = devInfo.mode.isMotorDirectionChange
@@ -564,7 +601,7 @@ class CookStepActivity2 : CookStepToolActivity() {
             viewModel.cookingStep?.let {
                 updateUiSetting(it)
             }
-        }else{
+        } else {
             viewModel.displayStep()?.let {
                 it.uiData.currentTemp = CofarUtils.parseTemp(devInfo.temp).toInt() //回显实时温度
                 updateUiSetting(it);
@@ -625,6 +662,8 @@ class CookStepActivity2 : CookStepToolActivity() {
             CofarSDK.start("${recipeNumber}:${viewModel.stepIndex}")
         }
         //通知当前运行的菜谱的ID和当前步骤索引
+        whereIndex = -1
+        binding.controller.clSetTime.stopAlphaAnim()
         CofarSDK.startRecipe(recipeNumber, viewModel.stepIndex.toString())
     }
 
@@ -634,6 +673,7 @@ class CookStepActivity2 : CookStepToolActivity() {
                 TURN_UP_KEY_CODE -> {
                     operateByPhysical(true)
                 }
+
                 TURN_DOWN_KEY_CODE -> {
                     operateByPhysical(false)
                 }
@@ -716,16 +756,36 @@ class CookStepActivity2 : CookStepToolActivity() {
                 }
                 dealWithTimeByOperation(it, increase)
             }
+        } else if (tabType == CookSettingType.DIRECTION_SETTING) {
+            cookStep?.uiData?.let {
+                if (increase) {
+                    onSettingDirection(MotorDirections.FORWARD.toInt())
+                } else {
+                    onSettingDirection(MotorDirections.REVERSE.toInt())
+                }
+            }
         }
     }
 
     private fun dealWithTimeByOperation(uiData: CookStepUiData, increase: Boolean) {
         //当前调节时间
-        var targetTime = uiData.targetTime
+        var targetTime = if (uiData.runningStatus != DevStatus.RUNNING.toInt()) {
+            uiData.targetTime
+        } else if (uiData.targetTimeBuffer > 0) {
+            uiData.targetTimeBuffer
+        } else {
+            uiData.targetTime
+        }
+        var step = 0
+        if (whereIndex == 1) {
+            step += 60
+        } else {
+            step = rotateStep()
+        }
         if (increase) {
-            targetTime += rotateStep()
+            targetTime += step
         } else {
-            targetTime -= rotateStep()
+            targetTime -= step
         }
         if (targetTime > uiData.limitMaxTime) {
             targetTime = uiData.limitMaxTime
@@ -763,6 +823,7 @@ class CookStepActivity2 : CookStepToolActivity() {
             }
         }
         uiData.isTimeChange = true
+        Log.d("eeeeeee", "${uiData.targetTime} == ${targetTime} === $step")
         uiData.targetTime = targetTime
         binding.controller.clSetTime.isTimeCanChange(true)
         // 回调到上面那个地方来设置时间
@@ -798,9 +859,9 @@ class CookStepActivity2 : CookStepToolActivity() {
         if (keyCode == PRESS_DOWN_KEY_CODE) {
             Log.d("QQQQ", "catch key down")
 
-             if(!viewModel.isCurrentOnCookingStep()){
-                  return false
-             }
+            if (!viewModel.isCurrentOnCookingStep()) {
+                return false
+            }
 
             //当前是turbo模式下
             if (viewModel.cookingStep?.isTurboMode() != true && viewModel.cookingStep?.isWeightMode() != true && viewModel.cookingStep?.isDescription() != true) {
@@ -832,11 +893,14 @@ class CookStepActivity2 : CookStepToolActivity() {
                 }
 
 
-            } else if(viewModel.cookingStep?.isTurboMode() == true){
+            } else if (viewModel.cookingStep?.isTurboMode() == true) {
                 turboUpEvent();
-            } else if(viewModel.cookingStep?.isWeightMode() == true){
+            } else if (viewModel.cookingStep?.isWeightMode() == true) {
                 clickWeightTare();
             }
+            if (currModes == "FINISH_DESC") {
+                hideCommonDialog()
+            }
         }
         canStart = true
         return super.onKeyUp(keyCode, event)
@@ -920,8 +984,8 @@ class CookStepActivity2 : CookStepToolActivity() {
         }
 
 
-            //蒸汽模式特殊处理
-        if(viewModel.displayStep()?.workMode == ModesType.STEAM.name){
+        //蒸汽模式特殊处理
+        if (viewModel.displayStep()?.workMode == ModesType.STEAM.name) {
             binding.controller.steamFire.configNum(uiData.targetTemp);
             binding.controller.steamFireSmall.configNum(uiData.targetTemp);
         }
@@ -1009,17 +1073,17 @@ class CookStepActivity2 : CookStepToolActivity() {
             }
 
 
-            if(CommonEventTypes.CONFIRM_STOP == event.type){
+            if (CommonEventTypes.CONFIRM_STOP == event.type) {
                 clickNextStep();
             }
 
 
-            if (CommonEventTypes.MOTOR_REVERSE_CAN_NOT_RATHER_THEN_3 == event.type ) {
+            if (CommonEventTypes.MOTOR_REVERSE_CAN_NOT_RATHER_THEN_3 == event.type) {
                 CofarSDK.cfgMotorGear(3)
                 viewModel.cookingStep?.let { updateUiSetting(it, true) }
             }
 
-            if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_4_WITH_TEMP == event.type ) {
+            if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_4_WITH_TEMP == event.type) {
                 CofarSDK.cfgMotorGear(4)
                 viewModel.cookingStep?.let { updateUiSetting(it, true) }
             }
@@ -1049,4 +1113,9 @@ class CookStepActivity2 : CookStepToolActivity() {
             }
         }
     }
+
+    companion object {
+        var dp83 = (R.dimen.convert_83px).resId2Dimension().toInt()
+        var dp25 = (R.dimen.convert_25px).resId2Dimension().toInt()
+    }
 }

+ 21 - 1
BusinessStep/src/main/java/com/develop/step/CookStepToolActivity.kt

@@ -17,6 +17,7 @@ import com.develop.food.base.data.model.CookSettingType
 import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.utils.ThreadUtils
 import com.develop.food.base.utils.updateText
+import com.develop.food.base.widgets.BCustomerLinearLayout
 import com.develop.food.base.widgets.CancelConfirmDialog
 import com.develop.food.base.widgets.CookProgressDrawable
 import com.develop.step.databinding.ActivityFoodStep2Binding
@@ -26,7 +27,6 @@ import com.develop.step.widgets.RingControlView
 import com.kuyuntech.cofarcooking.device.sdk.eventbus.core.DevInfo
 import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevStatusEvent
 import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
-import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
 import java.util.*
 
@@ -53,6 +53,7 @@ abstract class CookStepToolActivity : BaseActivity<ActivityFoodStep2Binding>() {
     val overrideModeDialog by lazy {
         CancelConfirmDialog()
     }
+    protected var whereIndex = -1
 
     private var isCookDetailDialogShow = false
     private var rotateAnimator: ObjectAnimator? = null
@@ -105,15 +106,21 @@ abstract class CookStepToolActivity : BaseActivity<ActivityFoodStep2Binding>() {
             viewModel.stepUiData.doingModify = false
         }
         binding.controller.clCookTemp.setOnClickListener {
+            whereIndex = -1
+            binding.controller.clSetTime.stopAlphaAnim()
             changeTempSettingPanel()
         }
         binding.controller.clCookTime.setOnClickListener {
             changeTimeSettingPanel()
         }
         binding.controller.clCookSpeed.setOnClickListener {
+            whereIndex = -1
+            binding.controller.clSetTime.stopAlphaAnim()
             changeSpeedSettingStep()
         }
         binding.controller.clCookDirection.setOnClickListener {
+            whereIndex = -1
+            binding.controller.clSetTime.stopAlphaAnim()
             changeDirectionSettingStep()
         }
         binding.viewBack.setOnClickListener {
@@ -166,6 +173,19 @@ abstract class CookStepToolActivity : BaseActivity<ActivityFoodStep2Binding>() {
             true
         }
         configureDirection()
+        binding.scrollLayout.setOnGestureChangeListener(object :
+            BCustomerLinearLayout.OnGestureChangeListener {
+            override fun scrollLeft() {
+                //向左手势
+                clickNextStep()
+            }
+
+            override fun scrollRight() {
+                //向右手势
+                clickPrevStep()
+            }
+
+        })
     }
 
     private fun startTurbo() {

+ 190 - 59
BusinessStep/src/main/java/com/develop/step/details/CookDetailActivity.kt

@@ -5,12 +5,17 @@ import android.graphics.Color
 import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
+import android.widget.LinearLayout
 import androidx.activity.viewModels
+import androidx.constraintlayout.widget.ConstraintLayout
 import com.alibaba.android.arouter.facade.annotation.Autowired
 import com.alibaba.android.arouter.facade.annotation.Route
 import com.alibaba.android.arouter.launcher.ARouter
 import com.blankj.utilcode.util.ToastUtils
 import com.develop.food.base.data.DataFactory
+import com.develop.food.base.event.RefreshLikeDataEvent
+import com.develop.food.base.ext.background_drawable
+import com.develop.food.base.ext.src
 import com.develop.food.base.http.Resource
 import com.develop.food.base.repo.CURRENT_USER_ID
 import com.develop.food.base.repo.FoodDataProvider
@@ -26,6 +31,8 @@ import com.develop.step.ShareQRCodeDialog
 import com.develop.step.databinding.ActivityCookDetailBinding
 import com.develop.step.model.CookDetailInfo
 import com.develop.step.widgets.AmountSelectDialog
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
 import java.util.*
 
 @Route(path = Screens.Cook.COOK_DETAIL)
@@ -67,6 +74,7 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         super.onCreate(savedInstanceState)
 
         ARouter.getInstance().inject(this)
+
         binding.startLayout.let {
             starViews.add(it.ivStar1)
             starViews.add(it.ivStar2)
@@ -84,6 +92,16 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         binding.ivTab3.setOnClickListener {
             selectTab(TAB_TOOLS)
         }
+
+        binding.ivTab1Night.setOnClickListener {
+            selectTab(TAB_SOURCE)
+        }
+        binding.ivTab2Night.setOnClickListener {
+            selectTab(TAB_DESC)
+        }
+        binding.ivTab3Night.setOnClickListener {
+            selectTab(TAB_TOOLS)
+        }
         binding.ivTab4.setOnClickListener {
             selectTab(TAB_SERVE)
         }
@@ -104,9 +122,9 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
             }
         }
         if (isLike) {
-            binding.ivLike.setBackgroundResource(R.drawable.ic_like)
+            binding.ivLike.background_drawable = R.drawable.ic_like
         } else {
-            binding.ivLike.setBackgroundResource(R.drawable.ic_unlike)
+            binding.ivLike.background_drawable = R.drawable.ic_unlike
         }
         binding.likeLayout.setOnClickListener {
             //收藏/取消收藏
@@ -116,15 +134,17 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
                     FoodDataProvider.getUserDatabase().userInfoDao().removeFavoriteRecipe(
                         CURRENT_USER_ID, recipeNumber ?: ""
                     )
+                    EventBus.getDefault().post(RefreshLikeDataEvent(false, recipeNumber ?: ""))
                 }
-                binding.ivLike.setBackgroundResource(R.drawable.ic_unlike)
+                binding.ivLike.background_drawable = R.drawable.ic_unlike
             } else {
                 isLike = true
-                binding.ivLike.setBackgroundResource(R.drawable.ic_like)
+                binding.ivLike.background_drawable = R.drawable.ic_like
                 FoodDataProvider.getUserDatabase().runInTransaction {
                     FoodDataProvider.getUserDatabase().userInfoDao().insertFavoriteRecipe(
                         UserFavoriteRecipes(CURRENT_USER_ID, recipeNumber ?: "")
                     )
+                    EventBus.getDefault().post(RefreshLikeDataEvent(true, recipeNumber ?: ""))
                 }
             }
         }
@@ -159,32 +179,57 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         binding.viewBack.setOnClickListener {
             finish()
         }
+        if (isNightTheme()) {
+            binding.bgLayout.setBackgroundColor(resources.getColor(R.color.color_000000))
+            binding.flTabContent.setBackgroundColor(resources.getColor(R.color.color_000000))
+        }
         initViews()
         initData()
     }
 
     private fun initViews() {
+        if (isNightTheme()) {
+            val params = binding.viewIcon1.layoutParams as ConstraintLayout.LayoutParams
+            params.width = ResDimension(R.dimen.convert_55px).toInt()
+            params.height = ResDimension(R.dimen.convert_55px).toInt()
+            params.topMargin = ResDimension(R.dimen.convert_23px).toInt()
+            params.rightMargin = ResDimension(R.dimen.convert_12px).toInt()
+            binding.viewIcon1.layoutParams = params
+            binding.viewIcon3.setVisible()
+            val params1 = binding.viewIcon2.layoutParams as ConstraintLayout.LayoutParams
+            params1.width = ResDimension(R.dimen.convert_55px).toInt()
+            params1.height = ResDimension(R.dimen.convert_55px).toInt()
+            params1.topMargin = ResDimension(R.dimen.convert_75px).toInt()
+            params1.rightMargin = ResDimension(R.dimen.convert_12px).toInt()
+            binding.viewIcon2.layoutParams = params1
+            binding.tvMoreShare.setGone()
+        }
         if (cookSource == "local") {
             binding.tvDownload.setText(R.string.start_cooking)
-            binding.viewProgress.setButtonColor(Color.RED)
-            binding.viewIcon.setImageResource(R.drawable.ic_detail_cook_start)
+            if (isNightTheme()) {
+                binding.viewProgress.setButtonColor(Color.parseColor("#FFA627"))
+            } else {
+                binding.viewProgress.setButtonColor(Color.RED)
+            }
+
+            binding.viewIcon.src = R.drawable.ic_detail_cook_start
             binding.viewServing.setGone()
             binding.tvServingSize.setGone()
-            binding.tvMoreDelete.setVisible()
+            //binding.tvMoreDelete.setVisible()
         } else {
             binding.tvDownload.text = getString(R.string.download).uppercase(Locale.ROOT)
             binding.viewProgress.setButtonColor(Color.parseColor("#1296db"))
-            binding.viewIcon.setImageResource(R.drawable.ic_detail_cook_download)
+            binding.viewIcon.src = R.drawable.ic_detail_cook_download
             binding.viewServing.setGone()
             binding.tvServingSize.setGone()
-            binding.tvMoreDelete.setGone()
+            //binding.tvMoreDelete.setGone()
         }
         binding.viewHide.setOnClickListener {
             hideDetail = !hideDetail
             if (hideDetail) {
-                binding.viewHide.setBackgroundResource(R.drawable.ic_detail_hide)
+                binding.viewHide.background_drawable = R.drawable.ic_detail_hide
             } else {
-                binding.viewHide.setBackgroundResource(R.drawable.ic_detail_show)
+                binding.viewHide.background_drawable = R.drawable.ic_detail_show
             }
             for (view in hideViews) {
                 if (hideDetail) {
@@ -206,26 +251,38 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         hideViews.let {
             it.add(binding.viewIcon1)
             it.add(binding.viewIcon2)
+            if (isNightTheme()) {
+                it.add(binding.viewIcon3)
+            }
             it.add(binding.tvFoodTime)
             it.add(binding.tvEasy)
             it.add(binding.startLayout.root)
         }
-        allTabViews.add(binding.ivTab1)
-        allTabViews.add(binding.ivTab2)
-        allTabViews.add(binding.ivTab3)
-        allTabViews.add(binding.ivTab4)
+
+        if (isNightTheme()) {
+            binding.ivTab1.setGone()
+            binding.ivTab2.setGone()
+            binding.ivTab3.setGone()
+            binding.ivTab4.setGone()
+            allTabViews.add(binding.ivTab1Night)
+            allTabViews.add(binding.ivTab2Night)
+            allTabViews.add(binding.ivTab3Night)
+        } else {
+            binding.ivTab1Night.setGone()
+            binding.ivTab2Night.setGone()
+            binding.ivTab3Night.setGone()
+            allTabViews.add(binding.ivTab1)
+            allTabViews.add(binding.ivTab2)
+            allTabViews.add(binding.ivTab3)
+            allTabViews.add(binding.ivTab4)
+        }
+
         selectTab(TAB_SOURCE)
     }
 
     private fun initData() {
-        viewModel.queryRecipe(
-            recipeNumber ?: "",
-            cookSource == "remote",
-            recipesEdition ?: "1.0"
-        )
-        viewModel.getRecipeLiveData().observe(this) {
-            updateCookDetail(it)
-        }
+
+
         viewModel.getErrorCodeLiveData().observe(this) {
             if (it == CookDetailViewModel.ERR_NO_RECIPE_MATCH) {
                 ToastUtils.showShort("No match recipe found!")
@@ -234,14 +291,16 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         }
         viewModel.starCountLiveData.observe(this) {
             setStarCount(it)
-            binding.startLayout.tvStarNum.text = "(${it})"
+
         }
         viewModel.getDownloadState().observe(this) {
             updateDownloadButton(it)
         }
         viewModel.portionSizeLiveData.observe(this) {
-            val jarsCount = (it.portionSize ?: 1).toString() + " " + getString(R.string.jar)
-            binding.tvJarCount.text = jarsCount
+            if (it != null) {
+                val jarsCount = (it.portionSize ?: 1).toString() + " " + getString(R.string.jar)
+                binding.tvJarCount.text = jarsCount
+            }
         }
     }
 
@@ -251,6 +310,7 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         binding.ivTopBanner.loadCrossFade(bannerImg)
         binding.tvFoodName.text = detail.recipe.name
         val timeDescBuilder = StringBuilder()
+        binding.startLayout.tvStarNum.text = "(${detail.recipe.useNum})"
         timeDescBuilder.append(getString(R.string.preparation))
         timeDescBuilder.append(" ")
         if (detail.recipe.prepareHours.isPositive()) {
@@ -285,53 +345,104 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         if (starCount > 5 || starCount < 0) {
             starCount = 0
         }
+        if (isNightTheme()){
+            val star1P = binding.startLayout.ivStar1.layoutParams as LinearLayout.LayoutParams
+            star1P.height = ResDimension(R.dimen.convert_45px).toInt()
+            binding.startLayout.ivStar1.layoutParams = star1P
+
+            val star2P = binding.startLayout.ivStar2.layoutParams as LinearLayout.LayoutParams
+            star2P.height = ResDimension(R.dimen.convert_45px).toInt()
+            binding.startLayout.ivStar2.layoutParams = star2P
+
+            val star3P = binding.startLayout.ivStar3.layoutParams as LinearLayout.LayoutParams
+            star3P.height = ResDimension(R.dimen.convert_45px).toInt()
+            binding.startLayout.ivStar3.layoutParams = star3P
+
+            val star4P = binding.startLayout.ivStar4.layoutParams as LinearLayout.LayoutParams
+            star4P.height = ResDimension(R.dimen.convert_45px).toInt()
+            binding.startLayout.ivStar4.layoutParams = star4P
+
+            val star5P = binding.startLayout.ivStar5.layoutParams as LinearLayout.LayoutParams
+            star5P.height = ResDimension(R.dimen.convert_45px).toInt()
+            binding.startLayout.ivStar5.layoutParams = star5P
+        }
         when (starCount) {
             0 -> {
-                binding.startLayout.ivStar1.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar2.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar3.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar4.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar5.setBackgroundResource(com.develop.base.R.drawable.ic_star)
+                binding.startLayout.ivStar1.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar2.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar3.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar4.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar5.background_drawable =
+                    com.develop.base.R.drawable.ic_star
             }
 
             1 -> {
-                binding.startLayout.ivStar1.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar2.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar3.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar4.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar5.setBackgroundResource(com.develop.base.R.drawable.ic_star)
+                binding.startLayout.ivStar1.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar2.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar3.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar4.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar5.background_drawable =
+                    com.develop.base.R.drawable.ic_star
             }
 
             2 -> {
-                binding.startLayout.ivStar1.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar2.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar3.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar4.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar5.setBackgroundResource(com.develop.base.R.drawable.ic_star)
+                binding.startLayout.ivStar1.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar2.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar3.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar4.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar5.background_drawable =
+                    com.develop.base.R.drawable.ic_star
             }
 
             3 -> {
-                binding.startLayout.ivStar1.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar2.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar3.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar4.setBackgroundResource(com.develop.base.R.drawable.ic_star)
-                binding.startLayout.ivStar5.setBackgroundResource(com.develop.base.R.drawable.ic_star)
+                binding.startLayout.ivStar1.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar2.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar3.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar4.background_drawable =
+                    com.develop.base.R.drawable.ic_star
+                binding.startLayout.ivStar5.background_drawable =
+                    com.develop.base.R.drawable.ic_star
             }
 
             4 -> {
-                binding.startLayout.ivStar1.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar2.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar3.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar4.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar5.setBackgroundResource(com.develop.base.R.drawable.ic_star)
+                binding.startLayout.ivStar1.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar2.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar3.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar4.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar5.background_drawable =
+                    com.develop.base.R.drawable.ic_star
             }
 
             5 -> {
-                binding.startLayout.ivStar1.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar2.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar3.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar4.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
-                binding.startLayout.ivStar5.setBackgroundResource(com.develop.base.R.drawable.ic_star_selected)
+                binding.startLayout.ivStar1.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar2.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar3.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar4.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
+                binding.startLayout.ivStar5.background_drawable =
+                    com.develop.base.R.drawable.ic_star_selected
             }
         }
     }
@@ -343,16 +454,19 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         when (tab) {
             TAB_SOURCE -> {
                 binding.ivTab1.isSelected = true
+                binding.ivTab1Night.isSelected = true
                 replaceFragmentInstance(R.id.fl_tab_content, CookDetailSourceFragment())
             }
 
             TAB_DESC -> {
                 binding.ivTab2.isSelected = true
+                binding.ivTab2Night.isSelected = true
                 replaceFragmentInstance(R.id.fl_tab_content, CookDetailDescFragment())
             }
 
             TAB_TOOLS -> {
                 binding.ivTab3.isSelected = true
+                binding.ivTab3Night.isSelected = true
                 replaceFragmentInstance(R.id.fl_tab_content, CookDetailToolsFragment())
             }
 
@@ -374,7 +488,7 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
             binding.tvDownload.text = getString(R.string.download).uppercase(Locale.ROOT)
             binding.viewProgress.setProgress(1f)
             binding.viewProgress.setButtonColor(Color.parseColor("#1296db"))
-            binding.viewIcon.setImageResource(R.drawable.ic_detail_cook_download)
+            binding.viewIcon.src = R.drawable.ic_detail_cook_download
             dowloadFialDialog.showDialog(supportFragmentManager, "DownloadFailedDialog")
         } else if (resource.status == Resource.Status.LOADING) {
             val updateProgress = "${resource.data}%"
@@ -385,7 +499,7 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
             binding.tvProgress.updateText(updateProgress)
             binding.viewProgress.setProgress(resource.data!! / 100f)
             binding.viewProgress.setButtonColor(Color.parseColor("#79C414"))
-            binding.viewIcon.setImageResource(R.drawable.ic_detail_cook_download)
+            binding.viewIcon.src = R.drawable.ic_detail_cook_download
         } else {
             binding.tvDownload.setVisible()
             binding.viewIcon.setVisible()
@@ -394,13 +508,21 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
             binding.tvDownload.setText(R.string.start_cooking)
             binding.viewProgress.setProgress(1f)
             binding.viewProgress.setButtonColor(Color.RED)
-            binding.viewIcon.setImageResource(R.drawable.ic_detail_cook_start)
+            binding.viewIcon.src = R.drawable.ic_detail_cook_start
         }
     }
 
     override fun onResume() {
         super.onResume()
+        viewModel.queryRecipe(
+            recipeNumber ?: "",
+            cookSource == "remote",
+            recipesEdition ?: "1.0"
+        )
         viewModel.getStarCount(recipeNumber ?: "")
+        viewModel.getRecipeLiveData().observe(this) {
+            updateCookDetail(it)
+        }
         isLike = FoodDataProvider
             .getUserDatabase()
             .userInfoDao()
@@ -441,6 +563,15 @@ class CookDetailActivity : BaseActivity<ActivityCookDetailBinding>() {
         return ActivityCookDetailBinding.inflate(inflater)
     }
 
+    @Subscribe
+    fun refreshLikeRecipes(event: RefreshLikeDataEvent) {
+        if (event.isLike) {
+            binding.ivLike.background_drawable = R.drawable.ic_like
+        } else {
+            binding.ivLike.background_drawable = R.drawable.ic_unlike
+        }
+    }
+
     companion object {
         private const val TAB_SOURCE = 1
         private const val TAB_DESC = 2

+ 7 - 0
BusinessStep/src/main/java/com/develop/step/details/CookDetailSourceAdapter.kt

@@ -1,13 +1,20 @@
 package com.develop.step.details
 
+import android.widget.TextView
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.widgets.MarqueeTextView
 import com.develop.step.R
 
 class CookDetailSourceAdapter: BaseQuickAdapter<CookSourceItem, BaseViewHolder>(
     R.layout.item_cook_source
 ) {
     override fun convert(holder: BaseViewHolder, item: CookSourceItem) {
+        if (isNightTheme()){
+            holder.getView<MarqueeTextView>(R.id.tv_source_name).setTextColor(context.resources.getColor(R.color.color_fff))
+            holder.getView<TextView>(R.id.tv_source_amount).setTextColor(context.resources.getColor(R.color.color_fff))
+        }
         holder.setText(R.id.tv_source_name, item.name)
         holder.setText(R.id.tv_source_amount, item.amount)
     }

+ 16 - 1
BusinessStep/src/main/java/com/develop/step/details/CookDetailSourceFragment.kt

@@ -4,11 +4,14 @@ import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import android.widget.RelativeLayout
 import androidx.fragment.app.activityViewModels
 import com.develop.food.base.ui.BaseFragment
+import com.develop.food.base.utils.ResDimension
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.utils.setGone
 import com.develop.step.R
 import com.develop.step.databinding.FragmentDetailCookSourceBinding
-import com.develop.step.widgets.AmountSelectDialog
 import java.math.BigDecimal
 
 class CookDetailSourceFragment: BaseFragment() {
@@ -26,6 +29,12 @@ class CookDetailSourceFragment: BaseFragment() {
             inflater, container, false
         )
         binding.rvList.adapter = adapter
+        val params = binding.ivCollapse.layoutParams as RelativeLayout.LayoutParams
+        if (isNightTheme()){
+            params.width = ResDimension(R.dimen.convert_83px).toInt()
+            params.height = ResDimension(R.dimen.convert_83px).toInt()
+            binding.ivCollapse.layoutParams = params
+        }
         viewModel.getRecipeLiveData().observe(viewLifecycleOwner) {
             viewModel.portionSizeLiveData.observe(viewLifecycleOwner) { size ->
                 val sourceItems = mutableListOf<CookSourceItem>()
@@ -53,6 +62,12 @@ class CookDetailSourceFragment: BaseFragment() {
                 }
                 binding.tvStepTitle.text = string
             }
+        }
+        if (isNightTheme()){
+            binding.ivCollapse.setGone()
+        }
+        binding.ivCollapse.setOnClickListener {
+
         }
         return binding.root
     }

+ 2 - 2
BusinessStep/src/main/java/com/develop/step/details/CookDetailToolAdapter.kt

@@ -3,7 +3,7 @@ package com.develop.step.details
 import android.widget.ImageView
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
-import com.develop.food.base.utils.loadCrossFade
+import com.develop.food.base.utils.loadCrossFadeRound
 import com.develop.step.R
 
 class CookDetailToolAdapter: BaseQuickAdapter<CookToolItem, BaseViewHolder>(
@@ -12,6 +12,6 @@ class CookDetailToolAdapter: BaseQuickAdapter<CookToolItem, BaseViewHolder>(
     override fun convert(holder: BaseViewHolder, item: CookToolItem) {
         holder.setText(R.id.tv_tool_name, item.text)
         val ivImage = holder.getView<ImageView>(R.id.iv_tool_icon)
-        ivImage.loadCrossFade(item.icon)
+        ivImage.loadCrossFadeRound(item.icon)
     }
 }

+ 1 - 2
BusinessStep/src/main/java/com/develop/step/details/CookDetailViewModel.kt

@@ -18,7 +18,6 @@ import com.develop.food.base.repo.entity.DevRecipePortionSize
 import com.develop.food.base.repo.entity.UserOnLineRecipes
 import com.develop.food.base.utils.DownloadUtil
 import com.develop.food.base.utils.FileKit
-import com.develop.food.base.utils.MmkvUtils
 import com.develop.food.base.utils.ThreadUtils
 import com.develop.step.model.CookDetailInfo
 import com.google.gson.Gson
@@ -196,7 +195,7 @@ class CookDetailViewModel(application: Application) : AndroidViewModel(applicati
             }
             val jsonContent = FileKit.readFileToString(jsonFile)
             val contentData = Gson().fromJson(jsonContent, RecipeDataConfig::class.java)
-            contentData.resetAllCodes()
+            //contentData.resetAllCodes()
             FoodDataProvider.getDatabase().runInTransaction {
                 FoodDataProvider.getDatabase().recipeDao().apply {
                     insertDevAccessorys(contentData.devAccessorys)

+ 223 - 134
BusinessStep/src/main/java/com/develop/step/modes/ModesDetailActivity.kt

@@ -6,6 +6,7 @@ import android.os.Bundle
 import android.util.Log
 import android.view.*
 import android.view.animation.LinearInterpolator
+import android.widget.LinearLayout
 import androidx.activity.viewModels
 import com.alibaba.android.arouter.facade.annotation.Route
 import com.develop.food.base.common.MODE_TYPE
@@ -15,11 +16,15 @@ import com.develop.food.base.common.TURN_UP_KEY_CODE
 import com.develop.food.base.data.ModesType
 import com.develop.food.base.data.model.CookSettingType
 import com.develop.food.base.event.CookStepEvent
+import com.develop.food.base.ext.background_drawable
 import com.develop.food.base.manager.FloatWindowManager
 import com.develop.food.base.router.Screens
 import com.develop.food.base.ui.BaseActivity
 import com.develop.food.base.utils.CofarUtils
+import com.develop.food.base.utils.GlobalApp
 import com.develop.food.base.utils.ThreadUtils
+import com.develop.food.base.utils.isNightTheme
+import com.develop.food.base.utils.resId2Dimension
 import com.develop.food.base.widgets.CancelConfirmDialog
 import com.develop.food.base.widgets.DirectionView
 import com.develop.food.base.widgets.TimePickerView
@@ -41,7 +46,7 @@ import java.util.*
 
 @Route(path = Screens.Cook.COOK_MODES)
 class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
-    private var modeType = ModesType.CHOP.name
+    private var modeType = ModesType.FERMENT.name
     override fun createViewBinding(inflater: LayoutInflater): ActivityModeDetailBinding {
         return ActivityModeDetailBinding.inflate(layoutInflater)
     }
@@ -49,7 +54,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
     private val viewModel by viewModels<CookModesViewModel>()
     private var userChanging = false //当前是否用户在操作
     private var currDevInfo = DevInfo()
-    private var lastModeType = ModesType.CHOP.name
+    private var lastModeType = ModesType.FERMENT.name
     private var modeChange = false
     private var turboTimer: Timer? = null
     private var mSettingInstId = ""
@@ -80,19 +85,29 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
     }
     private var rotateAnimator: ObjectAnimator? = null
     private var rotateAnimDir = -1
+    private var whereIndex = -1
+    private var isMotorDirectionGearChange = false
 
     override fun onCreate(savedInstanceState: Bundle?) {
         configLock = true
         super.onCreate(savedInstanceState)
         hasShowScreenSaver = true
-        modeType = intent.extras?.getString(MODE_TYPE, ModesType.CHOP.name) ?: ""
+        modeType = intent.extras?.getString(MODE_TYPE, ModesType.FERMENT.name) ?: ""
         lastModeType = modeType
+        if (isNightTheme()) {
+            val param = binding.ivBack.layoutParams as LinearLayout.LayoutParams
+            param.width = dp83
+            param.height = dp83
+            param.gravity = Gravity.CENTER_VERTICAL
+            param.marginStart = dp25
+            binding.ivBack.layoutParams = param
+        }
         //初始化模式数据
         initModeData(modeType)
         initData()
         initListener()
         CofarSDK.resetLastPotStatus()
-        ThreadUtils.runOnMainThread({configLock = false},500)
+        ThreadUtils.runOnMainThread({ configLock = false }, 500)
     }
 
     @SuppressLint("ClickableViewAccessibility")
@@ -159,7 +174,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
         }
 
         backRequestDialog.apply {
-            title = "Keep cooking in the background?"
+            title = GlobalApp().getString(R.string.keep_cooking_in_the_background)
             onDialogClickListener = object : CancelConfirmDialog.OnDialogClickListener {
                 override fun onConfirm() {
                     val cookStepEvent = CookStepEvent(
@@ -195,9 +210,11 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                             CofarSDK.stop(false)
                             CofarSDK.startWeight()
                         }
+
                         ModesType.TURBO.name -> {
                             CofarSDK.stop(false)
                         }
+
                         else -> {
                             userChanging = false
                             CofarSDK.startRunning(modeType)
@@ -227,12 +244,13 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                 setByUser: Boolean
             ) {
                 if (setByUser) {
-                  //  currTime = time.toLong()
+                    //  currTime = time.toLong()
                 }
                 rollTimeEvent(hours, minute, second, time, setByUser)
             }
 
-            override fun onTimePickerTouchFirst() {
+            override fun onTimePickerTouchFirst(where: Int) {
+                whereIndex = where
                 userChanging = true
             }
         }
@@ -252,6 +270,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                 MotionEvent.ACTION_DOWN -> {
                     turboDownEvent()
                 }
+
                 MotionEvent.ACTION_CANCEL, MotionEvent.ACTION_UP -> {
                     turboUpEvent()
                 }
@@ -276,7 +295,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
     private fun initData() {
         binding.tvModeName.text = viewModel.getModeTitle(resources, modeType)
-        binding.ivBanner.setBackgroundResource(viewModel.getBanner(modeType))
+        binding.ivBanner.background_drawable = viewModel.getBanner(modeType)
         viewModel.currentStep.observe(this) {
             if (it == null) {
                 return@observe
@@ -288,15 +307,19 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                 CookSettingType.WEIGHT -> {
                     changeWeightStep()
                 }
+
                 CookSettingType.TEMP_SETTING -> {
                     changeTempSettingStep()
                 }
+
                 CookSettingType.TIME_SETTING -> {
                     changeTimeSettingStep()
                 }
+
                 CookSettingType.SPEED_SETTING -> {
                     changeSpeedSettingStep()
                 }
+
                 CookSettingType.DIRECTION_SETTING -> {
                     changeDirectionSettingStep()
                 }
@@ -305,6 +328,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
     }
 
     private fun changeWeightStep() {
+        whereIndex = -1
+        binding.clSetTime.stopAlphaAnim()
         binding.ivWeight.visibility = View.GONE
         binding.ivTurbo.visibility = View.GONE
         binding.functionLayout.visibility = View.GONE
@@ -314,6 +339,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
     }
 
     private fun changeCommonStep() {
+        whereIndex = -1
+        binding.clSetTime.stopAlphaAnim()
         binding.functionLayout.visibility = View.VISIBLE
         binding.llWeightView.visibility = View.GONE
         if (modeType == ModesType.WIGHT.name || modeType == ModesType.TURBO.name) {
@@ -343,11 +370,11 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
 
         //处理蒸汽模式
-        if(modeType == ModesType.STEAM.name){
+        if (modeType == ModesType.STEAM.name) {
             binding.tempRingText.visibility = View.GONE;
             binding.clCookTemp.turnSteamMode();
             binding.steamFire.visibility = View.VISIBLE
-        }else{
+        } else {
             binding.clCookTemp.turnCommonMode();
         }
 
@@ -369,6 +396,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
     }
 
     private fun changeSpeedSettingStep() {
+        whereIndex = -1
+        binding.clSetTime.stopAlphaAnim()
         binding.steamFire.visibility = View.GONE
         binding.llWeightView.visibility = View.GONE
         binding.functionLayout.visibility = View.VISIBLE
@@ -384,7 +413,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
     private fun changeDirectionSettingStep() {
         binding.steamFire.visibility = View.GONE
-
+        whereIndex = -1
+        binding.clSetTime.stopAlphaAnim()
         binding.llWeightView.visibility = View.GONE
         binding.functionLayout.visibility = View.VISIBLE
         binding.tempRingView.visibility = View.INVISIBLE
@@ -407,15 +437,19 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                 CookSettingType.TEMP_SETTING -> {
                     clCookTemp.upSelectedView(true)
                 }
+
                 CookSettingType.TIME_SETTING -> {
                     clCookTime.upSelectedView(true)
                 }
+
                 CookSettingType.SPEED_SETTING -> {
                     clCookSpeed.upSelectedView(true)
                 }
+
                 CookSettingType.DIRECTION_SETTING -> {
                     clCookDirection.upSelectedView(true)
                 }
+
                 CookSettingType.WEIGHT -> {
                     // do nothing
                 }
@@ -434,21 +468,21 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
 
     @Subscribe
-    fun onDevCommonEvent(event:DevCommonEvent){
+    fun onDevCommonEvent(event: DevCommonEvent) {
 
-        if(configLock){
+        if (configLock) {
             return;
         }
 
         ThreadUtils.runOnMainThread({
-            if(CommonEventTypes.MOTOR_GEAR_RATHER_THEN_7 == event.type){
+            if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_7 == event.type) {
                 CofarSDK.cfgTime((10 * 60).toInt())
                 currDevInfo.mode.apply {
                     updateTimeUI(
                         minTime,
                         maxTime,
-                        if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else   currDevInfo.targetTime.toInt(),
-                        if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else   currDevInfo.targetTime.toLong(),
+                        if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else currDevInfo.targetTime.toInt(),
+                        if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
                         true,
                         true
                     )
@@ -459,21 +493,21 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
 
 
-            if(CommonEventTypes.MOTOR_GEAR_RATHER_THEN_7 == event.type){
+            if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_7 == event.type) {
                 CofarSDK.cfgTime((10 * 60).toInt())
                 currDevInfo.mode.apply {
                     updateTimeUI(
                         minTime,
                         maxTime,
-                        if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else   currDevInfo.targetTime.toInt(),
-                        if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else   currDevInfo.targetTime.toLong(),
+                        if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else currDevInfo.targetTime.toInt(),
+                        if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
                         true,
                         true
                     )
                 }
             }
 
-            if(CommonEventTypes.MOTOR_GEAR_RATHER_THEN_3_WITH_TEMP == event.type || CommonEventTypes.MOTOR_REVERSE_CAN_NOT_RATHER_THEN_3 == event.type){
+            if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_3_WITH_TEMP == event.type || CommonEventTypes.MOTOR_REVERSE_CAN_NOT_RATHER_THEN_3 == event.type) {
                 CofarSDK.cfgMotorGear(3);
                 currDevInfo.mode.apply {
                     updateMotorGearUI(
@@ -485,15 +519,14 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                     )
                 }
             }
-        },500)
-
+        }, 500)
 
 
     }
 
     @Subscribe
     fun onDevStateEvent(event: DevStatusEvent) {
-        if(!initModeData || turboLock){
+        if (!initModeData || turboLock) {
             return
         }
         ThreadUtils.runOnMainThread {
@@ -512,21 +545,21 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                 updateTempUI(
                     minTemp.toFloat(),
                     maxTemp.toFloat(),
-                    if(currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTemp.toInt() else currDevInfo.temp.toInt(),
+                    if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTemp.toInt() else currDevInfo.temp.toInt(),
                     currDevInfo.targetTemp.toString(),
                     isTempChange
                 )
                 updateTimeUI(
-                    if(currDevInfo.status == DevStatus.STOP.toInt() || userChanging) minTime else 0,
+                    if (currDevInfo.status == DevStatus.STOP.toInt() || userChanging) minTime else 0,
                     maxTime,
-                    if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else (if(currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTime.toInt() else currDevInfo.remainTime.toInt()),
-                    if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else   currDevInfo.targetTime.toLong(),
+                    if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else (if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTime.toInt() else currDevInfo.remainTime.toInt()),
+                    if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
                     isTimeChange
                 )
 
                 var motorGear = currDevInfo.motorGear.toInt()
-                if(currDevInfo.motorGearBuffer.toInt() != -1){
-                     motorGear = currDevInfo.motorGearBuffer.toInt()
+                if (currDevInfo.motorGearBuffer.toInt() != -1) {
+                    motorGear = currDevInfo.motorGearBuffer.toInt()
                 }
 
                 updateMotorGearUI(
@@ -549,7 +582,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
     //初始化模式数据
     @SuppressLint("SetTextI18n")
-    private fun initModeData(type: String,keep:Boolean = false) {
+    private fun initModeData(type: String, keep: Boolean = false) {
 
         userChanging = false
         val baseMode = CofarSDK.devMode(type)
@@ -563,16 +596,16 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
         } else {
             this.window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
             //其他模式
-           changeCommonStep()
+            changeCommonStep()
 
-            if(CofarSDK.devInfo().status != DevStatus.PAUSE.toInt() && CofarSDK.devInfo().status != DevStatus.RUNNING.toInt()){
+            if (CofarSDK.devInfo().status != DevStatus.PAUSE.toInt() && CofarSDK.devInfo().status != DevStatus.RUNNING.toInt()) {
 
                 var targetTemp = baseMode.defaultTemp.toShort()
                 var motorDirection = baseMode.motorDirection.toByte()
                 var motorGear = baseMode.defaultMotorGear.toByte()
                 var targetTime = baseMode.defaultTime.toInt()
 
-                var restoreConfig:DevInfo ?= null
+                var restoreConfig: DevInfo? = null
 
                 if (modeType == ModesType.TURBO.name) {
 
@@ -581,27 +614,27 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                     changeSpeedSettingStep()
 
                 } else {
-                    turboLock=false;
+                    turboLock = false;
                     viewModel.changeStep(CookSettingType.TEMP_SETTING)
-                    if(keep){
+                    if (keep) {
                         configLock = true;
-                        restoreConfig = CofarSDK.changeMode(type, baseMode,true)
+                        restoreConfig = CofarSDK.changeMode(type, baseMode, true)
                         ThreadUtils.runOnMainThread({
-                             configLock = false;
-                        },500);
-                        if(restoreConfig != null){
+                            configLock = false;
+                        }, 500);
+                        if (restoreConfig != null) {
                             targetTemp = restoreConfig.targetTemp;
                             motorDirection = restoreConfig.motorDirection;
                             motorGear = restoreConfig.motorGear;
                             targetTime = restoreConfig.targetTime;
                         }
-                    }else{
+                    } else {
                         CofarSDK.changeMode(type, baseMode)
                     }
 
                 }
 
-                if(restoreConfig == null){
+                if (restoreConfig == null) {
                     currDevInfo.apply {
                         targetTemp = baseMode.defaultTemp.toShort()
                         motorDirection = baseMode.motorDirection.toByte()
@@ -637,6 +670,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                     )
 
                     currentMotorGer = defaultMotorGear
+                    this@ModesDetailActivity.isMotorDirectionGearChange =
+                        isMotorDirectionChange
                     updateMotorGearUI(
                         minMotorGear.toFloat(),
                         maxMotorGear.toFloat(),
@@ -664,16 +699,16 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
     private fun getTimeStr(time: Long): String {
 
-        if(time >= 91*60){
+        if (time >= 91 * 60) {
             var h = time / 3600;
             var m = time % 3600 / 60;
-            return "${if(h < 10) "0${h}" else h}:${if(m < 10) "0${m}" else m}";
-        }else{
+            return "${if (h < 10) "0${h}" else h}:${if (m < 10) "0${m}" else m}";
+        } else {
 
             var m = time / 60;
             var s = time % 60;
 
-            return "${if(m < 10) "0${m}" else m}:${if(s < 10) "0${s}" else s}";
+            return "${if (m < 10) "0${m}" else m}:${if (s < 10) "0${s}" else s}";
 
         }
 
@@ -725,12 +760,12 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
 
     private fun rotateStep(): Int {
-        if(currDevInfo.targetTime >= 60){
-            return  10;
+        if (currDevInfo.targetTime >= 60) {
+            return 10;
         }
 
-        if(currDevInfo.targetTime >= 10 * 60){
-            return  30;
+        if (currDevInfo.targetTime >= 10 * 60) {
+            return 30;
         }
 
         return 1
@@ -739,15 +774,16 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
     var lastKeyTime = 0L
     var lastKeyCode = 0;
+
     /**
      * 旋转物理键
      */
     override fun dispatchKeyEvent(event: KeyEvent): Boolean {
         var spend = (System.currentTimeMillis() - lastKeyTime);
-        if( spend < 10){
+        if (spend < 10) {
             return super.dispatchKeyEvent(event);
         }
-       lastKeyTime = System.currentTimeMillis();
+        lastKeyTime = System.currentTimeMillis();
         val currentStep = viewModel.currentStep.value
         Log.d("aaaaaa", "${event.keyCode}")
 
@@ -755,7 +791,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
         if (event.action != KeyEvent.ACTION_UP) {
 
-            when ( event.keyCode) {
+            when (event.keyCode) {
                 //旋转+
                 TURN_UP_KEY_CODE -> {
                     when (currentStep) {
@@ -772,6 +808,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                                 tempRingEvent(currentTemp)
                             }
                         }
+
                         CookSettingType.SPEED_SETTING -> {
                             if (isMotorGearChange) {
                                 //当前调节转速
@@ -783,14 +820,20 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                                 motorGearSpeedEvent(currentMotorGer)
                             }
                         }
+
                         CookSettingType.TIME_SETTING -> {
-                            if (isTimeChange){
+                            if (isTimeChange) {
                                 //当前调节时间
                                 //dealWithTimeByOperation(true)
-                                handleRotateTimeChange(rotateStep())
+                                handleRotateTimeChange(true)
                             }
                         }
 
+                        CookSettingType.DIRECTION_SETTING -> {
+                            motorGearDirectionClick(DirectionView.Direction.RIGHT)
+
+                        }
+
                         else -> {}
                     }
                 }
@@ -806,8 +849,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                                     currentTemp = minTemp
                                 }
 
-                                if(currentTemp < 37){ //小于37度置0
-                                    currentTemp=0
+                                if (currentTemp < 37) { //小于37度置0
+                                    currentTemp = 0
                                 }
 
                                 currentTemp = CofarUtils.parseTemp(currentTemp.toShort()).toInt();
@@ -817,8 +860,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                                 tempRingEvent(currentTemp)
                             }
                         }
+
                         CookSettingType.SPEED_SETTING -> {
-                            if (isMotorGearChange){
+                            if (isMotorGearChange) {
                                 //当前调节转速
                                 currentMotorGer -= 1
                                 if (currentMotorGer < minMotorGear) {
@@ -828,13 +872,18 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
                                 motorGearSpeedEvent(currentMotorGer)
                             }
                         }
+
                         CookSettingType.TIME_SETTING -> {
                             if (isTimeChange) {
                                 //当前调节时间
                                 //dealWithTimeByOperation(false)
-                                handleRotateTimeChange(-rotateStep())
+                                handleRotateTimeChange(false)
                             }
                         }
+                        CookSettingType.DIRECTION_SETTING -> {
+                            motorGearDirectionClick(DirectionView.Direction.LEFT)
+
+                        }
 
                         else -> {}
                     }
@@ -847,80 +896,95 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
     private var timeBuffer = 0;
 
 
-
     /**
      * 旋转按钮切换时间
      */
-    private fun handleRotateTimeChange(c:Int){
+    private fun handleRotateTimeChange(increase: Boolean) {
 
-        ThreadUtils.runOnMainThread({
+        ThreadUtils.runOnMainThread {
             //当前调节时间
-            var targetTime = currDevInfo.targetTime.toInt()
-            if(currDevInfo.remainTime.toInt() != 0){
-                targetTime = currDevInfo.remainTime.toInt()
+            var targetTime = currDevInfo.targetTime
+            if (currDevInfo.remainTime != 0) {
+                targetTime = currDevInfo.remainTime
             }
-            if(currDevInfo.targetTimeBuffer.toInt() != -1){
-                targetTime = currDevInfo.targetTimeBuffer.toInt()
+            if (currDevInfo.targetTimeBuffer != -1) {
+                targetTime = currDevInfo.targetTimeBuffer
+            }
+            var step = 0
+            if (whereIndex == 1) {
+                step += 60
+            } else {
+                step = rotateStep()
+            }
+            if (increase) {
+                targetTime += step
+            } else {
+                targetTime -= step
             }
-            targetTime+=c
 
 
-            if(targetTime < currDevInfo.mode.minTime){ //处理边界
-                targetTime = currDevInfo.mode.minTime
+            Log.d("kkkkkkk", "$whereIndex===$step===$targetTime")
+            if (targetTime < 0) {
+                targetTime = 0;
             }
-
-            if( targetTime > currDevInfo.mode.maxTime){ //处理边界
+            if (targetTime > currDevInfo.mode.maxTime) {
                 targetTime = currDevInfo.mode.maxTime
             }
-
-            if(targetTime < 0){
-                targetTime = 0;
+            if (targetTime < currDevInfo.mode.minTime) {
+                targetTime = currDevInfo.mode.minTime
             }
             val sec = targetTime % 60
-            val min = ((targetTime / 60) % 60 )
+            val min = ((targetTime / 60) % 60)
             val hour = (targetTime / 3600)
             var time = ""
-            if(hour > 0){
-                time += if(hour < 10){
+            if (hour > 0) {
+                time += if (hour < 10) {
                     "0${hour}"
-                }else{
-                    "${hour}"
+                } else {
+                    "$hour"
                 }
 
-                time += if(min < 10){
+                time += if (min < 10) {
                     ":0${min}"
-                }else{
+                } else {
                     ":${min}"
                 }
-            }else{
-                time += if(min < 10){
+            } else {
+                time += if (min < 10) {
                     "0${min}"
-                }else{
-                    "${min}"
+                } else {
+                    "$min"
                 }
 
-                time += if(sec < 10){
+                time += if (sec < 10) {
                     ":0${sec}"
-                }else{
+                } else {
                     ":${sec}"
                 }
             }
-            rollTimeEvent(hour,min,sec,time, setByUser = true)
-
+            rollTimeEvent(hour, min, sec, time, setByUser = true)
             currDevInfo.apply {
-                updateTimeUI(mode.minTime, mode.maxTime,remainTime.toInt(),targetTime.toLong(),true)
-                binding.apply {
-                    clSetTime.setTimeInternal(hour,min,sec,true,true)
-                }
-
+                updateTimeUI(
+                    mode.minTime,
+                    mode.maxTime,
+                    remainTime,
+                    targetTime.toLong(),
+                    true
+                )
             }
-        })
+            binding.clSetTime.setTimeInternal(
+                hour,
+                min,
+                sec,
+                changeSetting = true,
+                setByUser = true
+            )
+        }
 
 
     }
 
 
-
     private var pressStartTime = -1L;
 
 
@@ -932,21 +996,22 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
     override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
         if (keyCode == PRESS_DOWN_KEY_CODE) {
 
+            Log.d("======","down")
 
             //当前是turbo模式下
             if (modeType == ModesType.TURBO.name) {
                 turboDownEvent()
-            }else{
-                if(pressStartTime == -1L){
+            } else {
+                if (pressStartTime == -1L) {
                     pressStartTime = System.currentTimeMillis()
                 }
 
 
-                if(pressStartTime != -1L && (System.currentTimeMillis() - pressStartTime ) > 1000 && event.keyCode == PRESS_DOWN_KEY_CODE){
-                    this.onKeyLongPress(keyCode,event);
+                if (pressStartTime != -1L && (System.currentTimeMillis() - pressStartTime) > 1000 && event.keyCode == PRESS_DOWN_KEY_CODE) {
+                    this.onKeyLongPress(keyCode, event);
                     event.startTracking()
                     pressStartTime = -1L
-                    canStart=false;
+                    canStart = false;
                     return false
                 }
             }
@@ -957,9 +1022,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
     override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean {
 
-        if( modeType == ModesType.WIGHT.name){
+        if (modeType == ModesType.WIGHT.name) {
             backClick()
-        }else{
+        } else {
             if (mRunningState == DevStatus.RUNNING.toInt() || currDevInfo.status == DevStatus.PAUSE.toInt()) {
                 stopClick()
             } else if (mRunningState == DevStatus.STOP.toInt()) {
@@ -976,7 +1041,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
      * 物理键离开事件
      */
     override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
-
+        Log.d("======","up")
         if (modeType == ModesType.TURBO.name && event.keyCode == PRESS_DOWN_KEY_CODE) {
             //当前是turbo模式下,并且是物理键按下
             turboUpEvent()
@@ -987,7 +1052,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
 
 
-        if (modeType != ModesType.WIGHT.name && modeType != ModesType.TURBO.name  && event.keyCode == PRESS_DOWN_KEY_CODE && canStart) {
+        if (modeType != ModesType.WIGHT.name && modeType != ModesType.TURBO.name && event.keyCode == PRESS_DOWN_KEY_CODE && canStart) {
             //非turbo模式
             if (userChanging && currDevInfo.status.toByte() != DevStatus.STOP) {
                 //用户调节中
@@ -995,21 +1060,20 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
             } else {
                 if (mRunningState == DevStatus.RUNNING.toInt()) {
                     pauseClick()
-                } else if(currDevInfo.status == DevStatus.PAUSE.toInt()){
+                } else if (currDevInfo.status == DevStatus.PAUSE.toInt()) {
                     resumeClick();
-                }
-                else if (mRunningState == DevStatus.STOP.toInt()) {
+                } else if (mRunningState == DevStatus.STOP.toInt()) {
                     startClick()
                 }
             }
         }
 
 
-        if(modeType == ModesType.WIGHT.name){
+        if (modeType == ModesType.WIGHT.name) {
             weightClearClick();
         }
 
-        canStart=true;
+        canStart = true;
         return super.onKeyUp(keyCode, event)
     }
 
@@ -1039,8 +1103,14 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
             tempRingView.setRange(minTemp, maxTemp)
             tempRingView.setCanTouch(isTempChange)
             var tempBuffer = CofarSDK.devInfo().targetTempBuffer;
-            steamFire.configNum(CofarUtils.parseTemp( if(tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort()).toInt())
-            clCookTemp.configSteamFire(CofarUtils.parseTemp(if(tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort()).toInt())
+            steamFire.configNum(
+                CofarUtils.parseTemp(if (tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort())
+                    .toInt()
+            )
+            clCookTemp.configSteamFire(
+                CofarUtils.parseTemp(if (tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort())
+                    .toInt()
+            )
 
             if (!userChanging || focusUpdate) {
                 clCookTemp.setConfigValue("--${CofarUtils.parseTemp(targetTemp.toShort())}°C--")
@@ -1075,9 +1145,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
             var hours = 0
             var minute = 0
             var sec = 0
-            if (remainTime > ( 91 * 60)) {
+            if (remainTime > (91 * 60)) {
                 hours = remainTime / 3600
-                minute = remainTime % 3600  / 60
+                minute = remainTime % 3600 / 60
             } else {
                 minute = remainTime / 60
                 sec = remainTime % 60
@@ -1160,7 +1230,6 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
     private fun updateStatusBtn(status: Byte) {
 
 
-
         //当前用户正在修改不更新按钮状态
         if (userChanging) return
         //切碎功能隐藏按钮
@@ -1234,7 +1303,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
      * 显示/隐藏 确认取消按钮
      */
     private fun showConfirmAndCancelBtn() {
-        if (currDevInfo.status.toByte() != DevStatus.STOP ) {
+        if (currDevInfo.status.toByte() != DevStatus.STOP) {
             binding.btnCancel.visibility = View.VISIBLE
             binding.btnConfirm.visibility = View.VISIBLE
         }
@@ -1253,6 +1322,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
             CofarSDK.cancel()
             CofarSDK.devInfo().runningRecipeId = null
             CofarSDK.start(modeType)
+            whereIndex = -1
+            binding.clSetTime.stopAlphaAnim()
         }
     }
 
@@ -1279,6 +1350,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
      * 点击确认操作
      */
     private fun confirmClick() {
+        whereIndex = -1
+        binding.clSetTime.stopAlphaAnim()
         //确认
         userChanging = false
         //配置
@@ -1297,7 +1370,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
         //TODO 崩溃?
         try {
             FloatWindowManager.hideStepFlowWindow()
-        }catch (e:Exception) {
+        } catch (e: Exception) {
             print(e)
         }
     }
@@ -1315,6 +1388,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
      */
     private fun weightClick() {
 //        CofarSDK.stop(false)
+        whereIndex = -1
+        binding.clSetTime.stopAlphaAnim()
         modeChange = true
         modeType = ModesType.WIGHT.name
         initModeData(modeType)
@@ -1322,7 +1397,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
         binding.ivTurbo.visibility = View.GONE
         binding.ivWeight.visibility = View.GONE
         binding.tvModeName.text = viewModel.getModeTitle(resources, modeType)
-        binding.ivBanner.setBackgroundResource(viewModel.getBanner(modeType))
+        binding.ivBanner.background_drawable = viewModel.getBanner(modeType)
     }
 
     /**
@@ -1330,6 +1405,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
      */
     private fun turboClick() {
         CofarSDK.stop(false)
+        whereIndex = -1
+        binding.clSetTime.stopAlphaAnim()
         modeChange = true
         modeType = ModesType.TURBO.name
         viewModel.changeStep(CookSettingType.TEMP_SETTING)
@@ -1338,7 +1415,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
         binding.ivTurbo.visibility = View.GONE
         binding.ivWeight.visibility = View.GONE
         binding.ivTurboView.visibility = View.VISIBLE
-        binding.ivBanner.setBackgroundResource(viewModel.getBanner(modeType))
+        binding.ivBanner.background_drawable = viewModel.getBanner(modeType)
     }
 
     /**
@@ -1362,9 +1439,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
         if (modeChange) {
 
-            if(modeType == ModesType.TURBO.name){ //TURBO未停止之前不能退出
-                 CofarSDK.stop(false)
-                if(DevStatus.STOP != devInfo.status.toByte()){
+            if (modeType == ModesType.TURBO.name) { //TURBO未停止之前不能退出
+                CofarSDK.stop(false)
+                if (DevStatus.STOP != devInfo.status.toByte()) {
                     return
                 }
 
@@ -1375,15 +1452,18 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
             var cm = modeType;
             modeType = lastModeType
             binding.tvModeName.text = viewModel.getModeTitle(resources, modeType)
-            binding.ivBanner.setBackgroundResource(viewModel.getBanner(modeType))
+            binding.ivBanner.background_drawable = viewModel.getBanner(modeType)
             modeChange = false
             binding.ivTurboView.visibility = View.GONE
-            initModeData(modeType,cm == ModesType.WIGHT.name || cm == ModesType.TURBO.name)
+            initModeData(modeType, cm == ModesType.WIGHT.name || cm == ModesType.TURBO.name)
             changeCommonStep()
         } else if (devInfo.status != DevStatus.STOP.toInt() && modeType != ModesType.WIGHT.name
             && modeType != ModesType.TURBO.name
         ) {
-           if(CofarSDK.devInfo().runningInstId == modeType) backRequestDialog.showDialog(supportFragmentManager, "backRequestDialog")
+            if (CofarSDK.devInfo().runningInstId == modeType) backRequestDialog.showDialog(
+                supportFragmentManager,
+                "backRequestDialog"
+            )
             else finish()
         } else {
             finish()
@@ -1416,17 +1496,21 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
      * 点击电机方向事件
      */
     private fun motorGearDirectionClick(direction: DirectionView.Direction) {
-        userChanging = true
-        binding.clCookDirection.updateChangeValue(
-            getDirectionStr(direction == DirectionView.Direction.LEFT)
-        )
-        if (direction != DirectionView.Direction.RIGHT) {
-            CofarSDK.cfgMotorDirection(MotorDirections.REVERSE);
+        if (isMotorDirectionGearChange){
+            userChanging = true
+            binding.clCookDirection.updateChangeValue(
+                getDirectionStr(direction == DirectionView.Direction.LEFT)
+            )
 
-        } else {
-            CofarSDK.cfgMotorDirection(MotorDirections.FORWARD);
+            if (direction != DirectionView.Direction.RIGHT) {
+                CofarSDK.cfgMotorDirection(MotorDirections.REVERSE);
+                updateMotorDirectionUI(MotorDirections.REVERSE.toInt(), true);
+            } else {
+                CofarSDK.cfgMotorDirection(MotorDirections.FORWARD);
+                updateMotorDirectionUI(MotorDirections.FORWARD.toInt(), true);
+            }
+            showConfirmAndCancelBtn()
         }
-        showConfirmAndCancelBtn()
     }
 
     /**
@@ -1467,4 +1551,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
 
 
     }
+
+    companion object {
+        var dp83 = (R.dimen.convert_83px).resId2Dimension().toInt()
+        var dp25 = (R.dimen.convert_25px).resId2Dimension().toInt()
+    }
 }

+ 8 - 0
BusinessStep/src/main/java/com/develop/step/viewmodel/CookModesViewModel.kt

@@ -23,9 +23,14 @@ class CookModesViewModel(application: Application) : AndroidViewModel(applicatio
 
     fun getBanner(modeType: String): Int {
         return when (modeType) {
+            ModesType.FERMENT.name -> {
+                R.drawable.ic_mode_ferment
+            }
+
             ModesType.CHOP.name -> {
                 R.drawable.ic_mode_chop
             }
+
             ModesType.STEAM.name -> {
                 R.drawable.ic_mode_steam
             }
@@ -61,6 +66,9 @@ class CookModesViewModel(application: Application) : AndroidViewModel(applicatio
             ModesType.CHOP.name -> {
                 resources.getString(R.string.chop)
             }
+            ModesType.FERMENT.name -> {
+                resources.getString(R.string.ferment)
+            }
             ModesType.STEAM.name -> {
                 resources.getString(R.string.steam)
             }

+ 2 - 1
BusinessStep/src/main/java/com/develop/step/viewmodel/CookStepViewModel.kt

@@ -32,6 +32,7 @@ class CookStepViewModel(application: Application) : AndroidViewModel(application
     val dataCopy = mutableListOf<CookStepUiData>()
     val allSteps = CopyOnWriteArrayList<CookStepStatus>()
     val stepDisplay = MutableLiveData<CookStepStatus>()
+    val recipeLiveData = MutableLiveData<DevRecipe>()
     var cookingStep: CookStepStatus? = null
 
     var recipe: DevRecipe? = null;
@@ -41,7 +42,7 @@ class CookStepViewModel(application: Application) : AndroidViewModel(application
             allSteps.clear()
 
             recipe = FoodDataProvider.getDatabase().recipeDao().queryRecipe(number);
-
+            recipeLiveData.postValue(recipe)
             val cookSteps = FoodDataProvider
                 .getDatabase()
                 .recipeDao()

+ 4 - 0
BusinessStep/src/main/java/com/develop/step/widgets/NoteEditDialog.kt

@@ -27,6 +27,10 @@ class NoteEditDialog: FullScreenTransparentDialog() {
 
            // removeSelf()
         }
+        binding.ivClose.setOnClickListener {
+            removeSelf()
+        }
+
         binding.viewComplete.setOnClickListener {
 
               listener?.onComplete(binding.etNote.text.toString());

+ 23 - 4
BusinessStep/src/main/java/com/develop/step/widgets/RingControlView.kt

@@ -8,6 +8,7 @@ import android.util.AttributeSet
 import android.util.TypedValue
 import android.view.MotionEvent
 import android.view.View
+import com.develop.food.base.utils.isNightTheme
 import kotlin.math.abs
 import kotlin.math.cos
 import kotlin.math.sin
@@ -59,14 +60,32 @@ class RingControlView @JvmOverloads constructor(
 
     override fun onDraw(canvas: Canvas) {
         super.onDraw(canvas)
-        extraPaint.color = 0x60ffffff
+        extraPaint.color = if (isNightTheme()){
+            0xff262626.toInt()
+        } else {
+            0x60ffffff
+        }
         val radius = width / 2f - ringStrokeWidth - ringPadding
         canvas.drawCircle(width / 2f, height / 2f, radius, extraPaint)
-        ringPaint.color = 0xffffffff.toInt()
+        ringPaint.color = if (isNightTheme()){
+            0x604d4d4d
+        } else {
+            0xffffffff.toInt()
+        }
         canvas.drawPath(stubPath, ringPaint)
-        ringPaint.color = 0xffE60012.toInt()
+        ringPaint.color = if (isNightTheme()){
+            0xffFF192B.toInt()
+        } else {
+            0xffE60012.toInt()
+        }
+
         canvas.drawPath(fillPath, ringPaint)
-        extraPaint.color = 0xffFFA627.toInt()
+        extraPaint.color = if (isNightTheme()){
+            0xffFFFFFF.toInt()
+        } else {
+            0xffFFA627.toInt()
+
+        }
 
         // -150 ~ 150
         val angle = 300.0 * progress - 150.0

+ 60 - 8
BusinessStep/src/main/res/layout/activity_cook_detail.xml

@@ -5,6 +5,7 @@
     android:layout_height="match_parent"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:background="#ffffff"
+    android:id="@+id/bg_layout"
     xmlns:tools="http://schemas.android.com/tools"
     tools:background="#555">
     
@@ -76,7 +77,7 @@
         layout="@layout/item_star_layout"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/convert_70px"
+        android:layout_marginTop="@dimen/convert_60px"
         android:layout_marginStart="@dimen/convert_45px"
         app:layout_constraintTop_toBottomOf="@+id/view_back"
         app:layout_constraintStart_toStartOf="parent"/>
@@ -89,7 +90,7 @@
         android:textColor="#ffffff"
         android:textSize="@dimen/convert_54px"
         android:textStyle="bold"
-        android:layout_marginTop="@dimen/convert_160px"
+        android:layout_marginTop="@dimen/convert_150px"
         android:layout_marginStart="@dimen/convert_47px"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/view_back"/>
@@ -127,6 +128,17 @@
         app:layout_constraintTop_toBottomOf="@+id/tv_food_name"
         app:layout_constraintEnd_toStartOf="@+id/tv_food_time"/>
 
+    <View
+        android:layout_marginTop="@dimen/convert_7px"
+        android:id="@+id/view_icon3"
+        android:layout_width="@dimen/convert_55px"
+        android:layout_height="@dimen/convert_55px"
+        android:background="@drawable/ic_ready"
+        android:visibility="invisible"
+        android:layout_marginEnd="@dimen/convert_12px"
+        app:layout_constraintStart_toStartOf="@+id/view_icon1"
+        app:layout_constraintTop_toBottomOf="@+id/view_icon1"/>
+
     <View
         android:id="@+id/view_icon2"
         android:layout_width="@dimen/convert_69px"
@@ -144,7 +156,7 @@
         android:textColor="#fff"
         android:textSize="@dimen/convert_54px"
         android:layout_marginStart="@dimen/convert_47px"
-        android:layout_marginTop="@dimen/convert_50px"
+        android:layout_marginTop="@dimen/convert_30px"
         app:layout_constraintTop_toBottomOf="@+id/view_icon2"
         app:layout_constraintStart_toStartOf="parent" />
 
@@ -194,7 +206,7 @@
             android:layout_width="@dimen/convert_87px"
             android:layout_height="@dimen/convert_87px"
             android:src="@drawable/ic_detail_cook_start"
-            android:layout_marginStart="@dimen/convert_66px"
+            android:layout_marginStart="@dimen/convert_50px"
             app:layout_constraintHorizontal_chainStyle="packed"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"
@@ -204,11 +216,11 @@
             android:id="@+id/tv_download"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textSize="@dimen/convert_54px"
+            android:textSize="@dimen/convert_48px"
             android:textColor="#ffffff"
             android:layout_gravity="center_vertical"
             android:text="@string/start_cooking"
-            android:layout_marginEnd="@dimen/convert_26px"
+            android:layout_marginEnd="@dimen/convert_22px"
             app:layout_constraintTop_toTopOf="parent"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintStart_toEndOf="@+id/view_icon"
@@ -298,11 +310,51 @@
         app:layout_constraintEnd_toEndOf="parent"
         app:tint="@color/color_cook_tab_tint" />
 
+    <ImageView
+        android:id="@+id/iv_tab1_night"
+        android:layout_width="@dimen/convert_322px"
+        android:layout_height="@dimen/convert_182px"
+        android:layout_marginTop="@dimen/convert_171px"
+        android:src="@drawable/ic_tab1_selector"
+        android:padding="@dimen/convert_28px"
+        android:background="@drawable/shape_detail_tab_night_selector"
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintTop_toBottomOf="@+id/iv_top_banner"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toStartOf="@+id/iv_tab2_night" />
+
+    <ImageView
+        android:layout_marginStart="@dimen/convert_13px"
+        android:id="@+id/iv_tab2_night"
+        android:layout_width="@dimen/convert_322px"
+        android:layout_height="@dimen/convert_182px"
+        android:layout_marginTop="@dimen/convert_171px"
+        android:src="@drawable/ic_tab2_selector"
+        android:padding="@dimen/convert_28px"
+        android:background="@drawable/shape_detail_tab_night_selector"
+        app:layout_constraintTop_toBottomOf="@+id/iv_top_banner"
+        app:layout_constraintStart_toEndOf="@+id/iv_tab1_night"
+        app:layout_constraintEnd_toStartOf="@+id/iv_tab3_night" />
+
+    <ImageView
+        android:layout_marginStart="@dimen/convert_13px"
+        android:id="@+id/iv_tab3_night"
+        android:layout_width="@dimen/convert_322px"
+        android:layout_height="@dimen/convert_182px"
+        android:layout_marginTop="@dimen/convert_171px"
+        android:src="@drawable/ic_tab3_selector"
+        android:padding="@dimen/convert_28px"
+        android:background="@drawable/shape_detail_tab_night_selector"
+        app:layout_constraintTop_toBottomOf="@+id/iv_top_banner"
+        app:layout_constraintStart_toEndOf="@+id/iv_tab2_night"
+        app:layout_constraintEnd_toEndOf="parent" />
+
     <FrameLayout
         android:id="@+id/fl_tab_content"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        app:layout_constraintTop_toBottomOf="@+id/iv_tab1"
+        android:layout_marginTop="@dimen/convert_353px"
+        app:layout_constraintTop_toBottomOf="@+id/iv_top_banner"
         app:layout_constraintBottom_toBottomOf="parent"/>
 
     <androidx.constraintlayout.widget.ConstraintLayout
@@ -347,7 +399,6 @@
                 android:drawablePadding="@dimen/convert_29px"/>
 
             <TextView
-                android:visibility="gone"
                 android:id="@+id/tv_more_share"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -360,6 +411,7 @@
                 android:layout_marginTop="@dimen/convert_60px"/>
 
             <TextView
+                android:visibility="gone"
                 android:id="@+id/tv_more_delete"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"

+ 3 - 3
BusinessStep/src/main/res/layout/activity_cook_evaluate.xml

@@ -10,7 +10,7 @@
         android:id="@+id/tv_good"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:textColor="#FFA627"
+        android:textColor="@color/cook_card_name_color"
         android:textSize="@dimen/convert_108px"
         android:text="@string/bad"
         android:layout_marginTop="@dimen/convert_248px"
@@ -96,8 +96,8 @@
         android:id="@+id/view_close"
         android:layout_width="@dimen/convert_90px"
         android:layout_height="@dimen/convert_90px"
-        android:src="@drawable/ic_cancel"
-        app:tint="#FFA627"
+        android:src="@drawable/ic_close"
+        app:tint="@color/cook_card_name_color"
         android:padding="@dimen/convert_16px"
         android:layout_marginStart="@dimen/convert_45px"
         android:layout_marginTop="@dimen/convert_45px"

+ 158 - 144
BusinessStep/src/main/res/layout/activity_food_step2.xml

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    android:background="@color/mode_bg_color"
+    android:layout_height="match_parent">
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/cl_status_bar"
         android:layout_width="match_parent"
         android:layout_height="@dimen/convert_132px"
-        android:background="#FFA627"
+        android:background="@color/mode_detail_title_bg_color"
         app:layout_constraintTop_toTopOf="parent">
 
         <View
@@ -18,176 +18,190 @@
             android:layout_height="@dimen/convert_132px"
             android:background="@drawable/ic_cook_back"
             app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent"/>
+            app:layout_constraintTop_toTopOf="parent" />
 
         <View
             android:id="@+id/view_progress"
             android:layout_width="0dp"
             android:layout_height="@dimen/convert_15px"
-            app:layout_constraintStart_toEndOf="@+id/view_back"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"/>
+            app:layout_constraintStart_toEndOf="@+id/view_back" />
 
         <TextView
             android:id="@+id/tv_title_step"
             android:layout_width="0dp"
             android:layout_height="match_parent"
-            android:text="Step1:Peel 3 onions(180g)and2..."
+            android:layout_marginStart="@dimen/convert_51px"
+            android:layout_marginEnd="@dimen/convert_70px"
+            android:ellipsize="end"
             android:gravity="center_vertical"
+            android:maxLines="1"
+            android:text="Step1:Peel 3 onions(180g)and2..."
             android:textColor="#ffffff"
             android:textSize="@dimen/convert_45px"
-            android:maxLines="1"
-            android:ellipsize="end"
-            android:layout_marginStart="@dimen/convert_51px"
-            android:layout_marginEnd="@dimen/convert_70px"
-            app:layout_constraintStart_toEndOf="@+id/view_back"
-            app:layout_constraintEnd_toStartOf="@+id/view_alarm"/>
+            app:layout_constraintEnd_toStartOf="@+id/view_alarm"
+            app:layout_constraintStart_toEndOf="@+id/view_back" />
 
         <View
-            android:visibility="gone"
             android:id="@+id/view_alarm"
             android:layout_width="@dimen/convert_75px"
             android:layout_height="@dimen/convert_59px"
-            android:background="@drawable/ic_alarm"
             android:layout_marginEnd="@dimen/convert_45px"
+            android:background="@drawable/ic_alarm"
+            android:visibility="gone"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"/>
+            app:layout_constraintTop_toTopOf="parent" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
 
-    <ImageView
-        android:id="@+id/iv_cook_bg"
+    <com.develop.food.base.widgets.BCustomerLinearLayout
         android:layout_width="match_parent"
+        android:id="@+id/scroll_layout"
         android:layout_height="0dp"
-        android:scaleType="centerCrop"
-        app:layout_constraintTop_toBottomOf="@+id/cl_status_bar"
-        app:layout_constraintBottom_toBottomOf="parent"/>
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/cl_status_bar">
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <ImageView
+                android:id="@+id/iv_cook_bg"
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:scaleType="centerCrop"
+                app:layout_constraintBottom_toBottomOf="parent" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:background="@drawable/bg_cook_mask"
+                app:layout_constraintBottom_toBottomOf="parent" />
+
+            <TextView
+                app:layout_constraintTop_toTopOf="parent"
+                android:id="@+id/tv_step_name"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/convert_77px"
+                android:layout_marginTop="@dimen/convert_77px"
+                android:layout_marginEnd="@dimen/convert_99px"
+                android:lineSpacingExtra="10dp"
+                android:text="Step1:Peel 3 onions(180g)and2garlic cloves,halve the onions andput both in the blender jug."
+                android:textColor="#fff"
+                android:textSize="@dimen/convert_39px"
+                app:layout_constraintEnd_toStartOf="@+id/view_remark"
+                app:layout_constraintStart_toStartOf="parent" />
+
+            <View
+                app:layout_constraintTop_toTopOf="parent"
+                android:id="@+id/view_remark"
+                android:layout_width="@dimen/convert_122px"
+                android:layout_height="@dimen/convert_120px"
+                android:layout_marginTop="@dimen/convert_47px"
+                android:layout_marginEnd="@dimen/convert_45px"
+                android:background="@drawable/ic_remark"
+                app:layout_constraintEnd_toEndOf="parent" />
+
+            <ImageView
+                android:id="@+id/iv_prev_step"
+                android:layout_width="@dimen/convert_120px"
+                android:layout_height="@dimen/convert_120px"
+                android:layout_marginStart="@dimen/convert_48px"
+                android:src="@drawable/ic_cook_prev_step"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.4" />
+
+            <ImageView
+                android:id="@+id/iv_next_step"
+                android:layout_width="@dimen/convert_120px"
+                android:layout_height="@dimen/convert_120px"
+                android:layout_marginEnd="@dimen/convert_48px"
+                android:src="@drawable/ic_cook_next_step"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.4" />
+
+            <include
+                android:id="@+id/controller"
+                layout="@layout/item_cook_controller2"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginBottom="@dimen/convert_64px"
+                app:layout_constraintBottom_toBottomOf="parent" />
+
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/ll_weight_view"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                app:layout_constraintBottom_toBottomOf="parent">
+
+                <TextView
+                    android:id="@+id/tv_weight_num"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:layout_marginBottom="@dimen/convert_80px"
+                    android:includeFontPadding="false"
+                    android:text="50g"
+                    android:textColor="#ffffff"
+                    android:textSize="@dimen/convert_180px"
+                    app:layout_constraintBottom_toTopOf="@+id/weight_view"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent" />
+
+                <com.develop.step.widgets.WeightView
+                    android:id="@+id/weight_view"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/convert_83px"
+                    app:layout_constraintBottom_toBottomOf="parent" />
+
+                <TextView
+                    android:id="@+id/tv_weight_tare"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="@dimen/convert_66px"
+                    android:background="@drawable/bg_tare_button"
+                    android:includeFontPadding="false"
+                    android:paddingHorizontal="@dimen/convert_80px"
+                    android:paddingVertical="@dimen/convert_20px"
+                    android:text="@string/tare"
+                    android:textColor="#ffffff"
+                    android:textSize="@dimen/convert_56px"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent" />
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+            <ImageView
+                android:id="@+id/iv_turbo_view"
+                android:layout_width="@dimen/convert_200px"
+                android:layout_height="@dimen/convert_200px"
+                android:layout_marginBottom="@dimen/convert_64px"
+                android:background="@drawable/ic_turbo_unselected"
+                android:visibility="visible"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent" />
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </com.develop.food.base.widgets.BCustomerLinearLayout>
 
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="0dp"
-        android:background="@drawable/bg_cook_mask"
-        app:layout_constraintTop_toBottomOf="@+id/cl_status_bar"
-        app:layout_constraintBottom_toBottomOf="parent"/>
-
-    <TextView
-        android:id="@+id/tv_step_name"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:text="Step1:Peel 3 onions(180g)and2garlic cloves,halve the onions andput both in the blender jug."
-        android:textColor="#fff"
-        android:layout_marginStart="@dimen/convert_77px"
-        android:layout_marginTop="@dimen/convert_77px"
-        android:layout_marginEnd="@dimen/convert_99px"
-        android:textSize="@dimen/convert_39px"
-        android:lineSpacingExtra="10dp"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintEnd_toStartOf="@+id/view_remark"
-        app:layout_constraintTop_toBottomOf="@+id/cl_status_bar"/>
-
-    <View
-        android:id="@+id/view_remark"
-        android:layout_width="@dimen/convert_122px"
-        android:layout_height="@dimen/convert_120px"
-        android:layout_marginTop="@dimen/convert_47px"
-        android:layout_marginEnd="@dimen/convert_45px"
-        android:background="@drawable/ic_remark"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/cl_status_bar"/>
-
-    <ImageView
-        android:id="@+id/iv_prev_step"
-        android:layout_width="@dimen/convert_120px"
-        android:layout_height="@dimen/convert_120px"
-        android:src="@drawable/ic_cook_prev_step"
-        android:layout_marginStart="@dimen/convert_48px"
-        app:layout_constraintVertical_bias="0.4"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"/>
-
-    <ImageView
-        android:id="@+id/iv_next_step"
-        android:layout_width="@dimen/convert_120px"
-        android:layout_height="@dimen/convert_120px"
-        android:src="@drawable/ic_cook_next_step"
-        android:layout_marginEnd="@dimen/convert_48px"
-        app:layout_constraintVertical_bias="0.4"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"/>
-
-    <include
-        android:id="@+id/controller"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        layout="@layout/item_cook_controller2"
-        android:layout_marginBottom="@dimen/convert_64px"
-        app:layout_constraintBottom_toBottomOf="parent"/>
 
     <FrameLayout
         android:id="@+id/fl_cook_details"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        app:layout_constraintTop_toBottomOf="@+id/cl_status_bar"
-        app:layout_constraintBottom_toBottomOf="parent"/>
-
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/ll_weight_view"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical"
-        app:layout_constraintBottom_toBottomOf="parent">
-
-        <TextView
-            android:id="@+id/tv_weight_num"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textColor="#ffffff"
-            android:textSize="@dimen/convert_180px"
-            android:text="50g"
-            android:layout_marginBottom="@dimen/convert_80px"
-            android:includeFontPadding="false"
-            android:layout_gravity="center_horizontal"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintBottom_toTopOf="@+id/weight_view"/>
-
-        <com.develop.step.widgets.WeightView
-            android:id="@+id/weight_view"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/convert_83px"
-            app:layout_constraintBottom_toBottomOf="parent"/>
-
-        <TextView
-            android:id="@+id/tv_weight_tare"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:paddingHorizontal="@dimen/convert_80px"
-            android:paddingVertical="@dimen/convert_20px"
-            android:textColor="#ffffff"
-            android:textSize="@dimen/convert_56px"
-            android:text="@string/tare"
-            android:includeFontPadding="false"
-            android:layout_marginBottom="@dimen/convert_66px"
-            android:background="@drawable/bg_tare_button"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"/>
-
-    </androidx.constraintlayout.widget.ConstraintLayout>
-
-    <ImageView
-        android:visibility="visible"
-        android:id="@+id/iv_turbo_view"
-        android:layout_width="@dimen/convert_200px"
-        android:layout_height="@dimen/convert_200px"
-        android:layout_marginBottom="@dimen/convert_64px"
-        android:background="@drawable/ic_turbo_unselected"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"/>
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/cl_status_bar" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 12 - 12
BusinessStep/src/main/res/layout/activity_mode_detail.xml

@@ -3,7 +3,7 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/color_E5E5E5">
+    android:background="@color/mode_bg_color">
 
     <LinearLayout
         android:id="@+id/title_layout"
@@ -21,7 +21,7 @@
             android:id="@+id/tv_mode_name"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:background="@color/color_FFA627"
+            android:background="@color/mode_detail_title_bg_color"
             android:gravity="center"
             android:textColor="@color/color_fff"
             android:textSize="@dimen/convert_54px" />
@@ -94,7 +94,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="80°C"
-            android:textColor="#E60012"
+            android:textColor="@color/ring_text_color"
             android:textSize="@dimen/convert_90px"
             app:layout_constraintBottom_toBottomOf="@+id/temp_ring_view"
             app:layout_constraintEnd_toEndOf="@+id/temp_ring_view"
@@ -212,8 +212,8 @@
             android:layout_marginBottom="@dimen/convert_42px"
             android:background="@drawable/bg_orange_button"
             android:gravity="center"
-            android:text="START"
-            android:textColor="#ffffff"
+            android:text="@string/start"
+            android:textColor="@color/home_menu_title_color"
             android:textSize="@dimen/convert_54px"
             app:layout_constraintTop_toBottomOf="@id/cl_cook_speed" />
 
@@ -227,7 +227,7 @@
             android:gravity="center"
             android:text="@string/resume"
             android:visibility="invisible"
-            android:textColor="#ffffff"
+            android:textColor="@color/home_menu_title_color"
             android:textSize="@dimen/convert_54px"
             app:layout_constraintTop_toBottomOf="@id/cl_cook_speed" />
 
@@ -241,7 +241,7 @@
             android:gravity="center"
             android:text="@string/pause"
             android:visibility="invisible"
-            android:textColor="#ffffff"
+            android:textColor="@color/home_menu_title_color"
             android:textSize="@dimen/convert_54px"
             app:layout_constraintTop_toBottomOf="@id/cl_cook_speed" />
 
@@ -254,7 +254,7 @@
             android:background="@drawable/bg_white_button"
             android:gravity="center"
             android:text="@string/stop"
-            android:textColor="@color/color_FFA627"
+            android:textColor="@color/mode_detail_title_bg_color"
             android:textSize="@dimen/convert_54px"
             app:layout_constraintTop_toBottomOf="@id/btn_start" />
 
@@ -267,7 +267,7 @@
             android:background="@drawable/bg_orange_button"
             android:gravity="center"
             android:text="@string/confirm"
-            android:textColor="#ffffff"
+            android:textColor="@color/home_menu_title_color"
             android:textSize="@dimen/convert_54px"
             app:layout_constraintTop_toBottomOf="@id/cl_cook_speed" />
 
@@ -280,7 +280,7 @@
             android:background="@drawable/bg_white_button"
             android:gravity="center"
             android:text="@string/cancel"
-            android:textColor="@color/color_FFA627"
+            android:textColor="@color/mode_detail_title_bg_color"
             android:textSize="@dimen/convert_54px"
             app:layout_constraintTop_toBottomOf="@id/btn_confirm" />
 
@@ -308,7 +308,7 @@
             android:id="@+id/tv_weight_num"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textColor="#ffffff"
+            android:textColor="#fff"
             android:textSize="@dimen/convert_180px"
             android:text="50g"
             android:layout_marginBottom="@dimen/convert_80px"
@@ -331,7 +331,7 @@
             android:layout_height="wrap_content"
             android:paddingHorizontal="@dimen/convert_80px"
             android:paddingVertical="@dimen/convert_20px"
-            android:textColor="#ffffff"
+            android:textColor="#fff"
             android:textSize="@dimen/convert_56px"
             android:text="@string/tare"
             android:includeFontPadding="false"

+ 3 - 3
BusinessStep/src/main/res/layout/dialog_recipe_delete_confirm.xml

@@ -17,7 +17,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textSize="@dimen/convert_45px"
-            android:textColor="#F30101"
+            android:textColor="@color/dialog_title_color"
             android:text="@string/are_you_sure_to_delete"
             android:layout_marginTop="@dimen/convert_150px"
             app:layout_constraintTop_toTopOf="parent"
@@ -42,11 +42,11 @@
             android:id="@+id/tv_cancel"
             android:layout_width="@dimen/convert_270px"
             android:layout_height="@dimen/convert_120px"
-            android:background="@drawable/bg_white_button"
+            android:background="@drawable/bg_no_button"
             android:elevation="@dimen/convert_15px"
             android:text="@string/no"
             android:gravity="center"
-            android:textColor="#FB900C"
+            android:textColor="@color/no_color"
             android:textSize="@dimen/convert_54px"
             android:layout_marginEnd="@dimen/convert_65px"
             android:layout_marginBottom="@dimen/convert_71px"

+ 25 - 22
BusinessStep/src/main/res/layout/dialog_share_qr_code.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:tools="http://schemas.android.com/tools"
     tools:background="#444">
 
     <RelativeLayout
@@ -15,51 +15,54 @@
             android:layout_width="@dimen/convert_780px"
             android:layout_height="wrap_content"
             android:background="@drawable/bg_icon_page"
-            android:paddingBottom="@dimen/convert_164px"
+            android:gravity="center_horizontal"
             android:orientation="vertical"
-            android:gravity="center_horizontal">
+            android:paddingBottom="@dimen/convert_164px">
 
             <TextView
                 android:id="@+id/tv_title"
-                android:layout_width="wrap_content"
+                android:layout_width="match_parent"
+                android:gravity="center"
+                android:layout_marginStart="@dimen/convert_30px"
+                android:layout_marginEnd="@dimen/convert_30px"
                 android:layout_height="wrap_content"
-                android:text="@string/share_with_more_people"
-                android:textSize="@dimen/convert_45px"
-                android:textColor="#F30101"
-                android:includeFontPadding="false"
+                android:layout_centerHorizontal="true"
                 android:layout_marginTop="@dimen/convert_89px"
-                android:layout_centerHorizontal="true"/>
+                android:includeFontPadding="false"
+                android:text="@string/share_with_more_people"
+                android:textColor="@color/dialog_title_color"
+                android:textSize="@dimen/convert_45px" />
 
             <TextView
                 android:id="@+id/tv_subtitle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_below="@+id/tv_title"
+                android:layout_centerHorizontal="true"
+                android:layout_marginTop="@dimen/convert_48px"
+                android:includeFontPadding="false"
                 android:text="@string/scan_qr_code_with_camera"
-                android:textSize="@dimen/convert_36px"
                 android:textColor="#6B6B6B"
-                android:includeFontPadding="false"
-                android:layout_marginTop="@dimen/convert_48px"
-                android:layout_below="@+id/tv_title"
-                android:layout_centerHorizontal="true"/>
+                android:textSize="@dimen/convert_36px" />
 
             <ImageView
                 android:id="@+id/iv_qr_code"
                 android:layout_width="@dimen/convert_300px"
                 android:layout_height="@dimen/convert_300px"
+                android:layout_below="@+id/tv_subtitle"
                 android:layout_centerHorizontal="true"
-                tools:src="#aaa"
+                android:layout_marginTop="@dimen/convert_113px"
                 android:scaleType="fitCenter"
-                android:layout_below="@+id/tv_subtitle"
-                android:layout_marginTop="@dimen/convert_113px"/>
+                tools:src="#aaa" />
 
             <ProgressBar
                 android:id="@+id/loading"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_below="@+id/tv_subtitle"
                 android:layout_centerHorizontal="true"
-                android:indeterminateTint="#000"
                 android:layout_marginTop="@dimen/convert_200px"
-                android:layout_below="@+id/tv_subtitle"/>
+                android:indeterminateTint="#000" />
 
         </RelativeLayout>
 
@@ -69,10 +72,10 @@
             android:layout_height="40dp"
             android:layout_below="@+id/cl_layer"
             android:layout_centerHorizontal="true"
-            android:src="@drawable/ic_cancel"
-            android:padding="12dp"
+            android:layout_marginTop="-20dp"
             android:background="@drawable/bg_icon_cancel"
-            android:layout_marginTop="-20dp"/>
+            android:padding="12dp"
+            android:src="@drawable/ic_cancel" />
 
     </RelativeLayout>
 

+ 3 - 1
BusinessStep/src/main/res/layout/fragment_detail_cook_desc.xml

@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ScrollView
+    android:scrollbars="none"
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:overScrollMode="never"
     xmlns:app="http://schemas.android.com/apk/res-auto"
 >
 
@@ -12,7 +14,7 @@
         android:layout_height="wrap_content"
         android:text="MAKES 2 JARS (300 ML EACH)"
         android:textSize="@dimen/convert_39px"
-        android:textColor="#6B6B6B"
+        android:textColor="@color/home_category_color"
         android:lineSpacingExtra="@dimen/convert_10px"
         android:paddingTop="@dimen/convert_24px"
         android:paddingBottom="@dimen/convert_24px"

+ 2 - 0
BusinessStep/src/main/res/layout/fragment_detail_cook_method.xml

@@ -5,7 +5,9 @@
     android:layout_height="match_parent">
 
     <androidx.recyclerview.widget.RecyclerView
+        android:scrollbars="none"
         android:id="@+id/rv_tools"
+        android:overScrollMode="never"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:paddingBottom="36dp"

+ 2 - 0
BusinessStep/src/main/res/layout/fragment_detail_cook_serving.xml

@@ -27,6 +27,8 @@
         app:layout_constraintEnd_toEndOf="parent"/>
 
     <androidx.recyclerview.widget.RecyclerView
+        android:scrollbars="none"
+        android:overScrollMode="never"
         android:id="@+id/rv_list"
         android:layout_width="match_parent"
         android:layout_height="0dp"

+ 16 - 19
BusinessStep/src/main/res/layout/fragment_detail_cook_source.xml

@@ -1,38 +1,35 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:paddingHorizontal="@dimen/convert_47px">
 
     <TextView
         android:id="@+id/tv_step_title"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="MAKES 2 JARS (300 ML EACH)"
-        android:textSize="@dimen/convert_45px"
-        android:textColor="#FFA627"
         android:layout_marginTop="@dimen/convert_83px"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent"/>
+        android:text="MAKES 2 JARS (300 ML EACH)"
+        android:textColor="@color/ic_modes_title"
+        android:textSize="@dimen/convert_45px" />
 
     <ImageView
+        android:layout_alignParentEnd="true"
         android:id="@+id/iv_collapse"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:src="@drawable/ic_detail_collapse"
-        app:layout_constraintTop_toTopOf="@+id/tv_step_title"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_step_title"
-        app:layout_constraintEnd_toEndOf="parent"/>
+        android:layout_width="@dimen/convert_48px"
+        android:layout_height="@dimen/convert_27px"
+        android:layout_marginTop="@dimen/convert_83px"
+        android:src="@drawable/ic_detail_collapse" />
 
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/rv_list"
+        android:overScrollMode="never"
         android:layout_width="match_parent"
-        android:layout_height="0dp"
+        android:layout_height="match_parent"
+        android:layout_below="@id/tv_step_title"
         android:layout_marginTop="@dimen/convert_59px"
-        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
-        app:layout_constraintTop_toBottomOf="@+id/tv_step_title"
-        app:layout_constraintBottom_toBottomOf="parent"/>
+        android:scrollbars="none"
+        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
 
-</androidx.constraintlayout.widget.ConstraintLayout>
+</RelativeLayout>

+ 6 - 6
BusinessStep/src/main/res/layout/item_cook_controller2.xml

@@ -120,7 +120,7 @@
                 android:layout_weight="1"
                 android:text="@string/turn_left"
                 android:textColor="@color/color_E60012"
-                android:textSize="@dimen/convert_39px" />
+                android:textSize="@dimen/convert_28px" />
 
             <TextView
                 android:id="@+id/tv_turn_left"
@@ -131,7 +131,7 @@
                 android:paddingEnd= "@dimen/convert_60px"
                 android:text="@string/turn_right"
                 android:textColor="@color/color_E5E5E5"
-                android:textSize="@dimen/convert_39px" />
+                android:textSize="@dimen/convert_28px" />
         </LinearLayout>
 
     </FrameLayout>
@@ -208,7 +208,7 @@
             android:id="@+id/tv_cooking_temp_target"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textColor="#FFA627"
+            android:textColor="@color/cook_card_name_color"
             android:text="--80°C--"
             android:textSize="@dimen/convert_36px"
             android:visibility="visible"
@@ -294,7 +294,7 @@
             android:id="@+id/tv_cooking_time_target"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textColor="#FFA627"
+            android:textColor="@color/cook_card_name_color"
             android:text="--05:00--"
             android:textSize="@dimen/convert_36px"
             android:layout_marginTop="@dimen/convert_16px"
@@ -434,7 +434,7 @@
         android:layout_height="@dimen/convert_120px"
         android:background="@drawable/bg_orange_button"
         android:text="@string/start"
-        android:textColor="#ffffff"
+        android:textColor="@color/home_menu_title_color"
         android:textSize="@dimen/convert_54px"
         android:gravity="center"
         android:layout_marginBottom="@dimen/convert_42px"
@@ -446,7 +446,7 @@
         android:layout_height="@dimen/convert_120px"
         android:background="@drawable/bg_white_button"
         android:text="@string/reset_button"
-        android:textColor="#FFA627"
+        android:textColor="@color/login_color"
         android:textSize="@dimen/convert_54px"
         android:gravity="center"
         android:layout_marginBottom="@dimen/convert_71px"

+ 12 - 6
BusinessStep/src/main/res/layout/item_cook_source.xml

@@ -1,16 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout
+<RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="@dimen/convert_122px"
     xmlns:tools="http://schemas.android.com/tools">
 
-    <TextView
+    <com.develop.food.base.widgets.MarqueeTextView
         android:id="@+id/tv_source_name"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
+        android:layout_centerVertical="true"
         android:layout_height="wrap_content"
         android:textSize="@dimen/convert_45px"
+        android:ellipsize="marquee"
+        android:focusable="true"
+        android:singleLine="true"
         android:textColor="#6B6B6B"
+        android:layout_marginEnd="@dimen/convert_80px"
+        android:layout_toStartOf="@+id/tv_source_amount"
         android:layout_marginTop="@dimen/convert_28px"
         tools:text="AAAAAAA"/>
 
@@ -21,13 +27,13 @@
         android:textSize="@dimen/convert_45px"
         android:textColor="#6B6B6B"
         android:layout_marginTop="@dimen/convert_28px"
-        android:layout_gravity="end"
+        android:layout_alignParentEnd="true"
         tools:text="AAAAAAA"/>
 
     <View
         android:layout_width="match_parent"
         android:layout_height="1px"
         android:background="#E5E5E5"
-        android:layout_gravity="bottom"/>
+        android:layout_alignParentBottom="true"/>
 
-</FrameLayout>
+</RelativeLayout>

+ 4 - 4
BusinessStep/src/main/res/layout/item_cook_tool.xml

@@ -17,16 +17,16 @@
         tools:src="@drawable/ic_cook_tool1"
         android:elevation="@dimen/convert_15px"/>
 
-    <TextView
+    <com.develop.food.base.widgets.MarqueeTextView
         android:id="@+id/tv_tool_name"
         android:layout_width="@dimen/convert_340px"
         android:layout_height="wrap_content"
-        android:maxWidth="@dimen/convert_200px"
         android:layout_gravity="center_horizontal"
         android:layout_marginTop="@dimen/convert_35px"
         android:textColor="#6B6B6B"
-        android:maxLines="1"
-        android:ellipsize="end"
+        android:singleLine="true"
+        android:ellipsize="marquee"
+        android:focusable="true"
         android:textSize="@dimen/convert_39px"
         android:gravity="center"
         tools:text="AAAAAA"/>

+ 11 - 0
BusinessStep/src/main/res/layout/item_note_dialog.xml

@@ -12,6 +12,17 @@
         android:layout_marginTop="@dimen/convert_300px"
         android:background="@drawable/bg_cook_note">
 
+        <ImageView
+            android:id="@+id/iv_close"
+            android:layout_width="@dimen/convert_60px"
+            android:layout_height="@dimen/convert_60px"
+            android:layout_marginTop="@dimen/convert_10px"
+            android:layout_marginEnd="@dimen/convert_20px"
+            android:padding="@dimen/convert_15px"
+            android:src="@drawable/ic_close"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
         <TextView
             android:id="@+id/tv_note_title"
             android:layout_width="wrap_content"

+ 1 - 0
LocalTools/.gitignore

@@ -0,0 +1 @@
+/build

+ 15 - 0
LocalTools/build.gradle

@@ -0,0 +1,15 @@
+plugins {
+    id 'java-library'
+    id 'org.jetbrains.kotlin.jvm'
+}
+
+java {
+    sourceCompatibility = JavaVersion.VERSION_17
+    targetCompatibility = JavaVersion.VERSION_17
+}
+
+dependencies {
+    implementation files('libs/okhttp-4.9.0.jar')
+    implementation files('libs/okio-2.10.0.jar')
+    implementation files('libs/gson-2.10.1.jar')
+}

BIN
LocalTools/libs/gson-2.10.1.jar


BIN
LocalTools/libs/okhttp-4.9.0.jar


BIN
LocalTools/libs/okio-2.10.0.jar


+ 29 - 0
LocalTools/src/main/java/com/twm/tools/local/AndroidLanguage.kt

@@ -0,0 +1,29 @@
+package com.twm.tools.local
+
+enum class AndroidLanguage(
+    val valuesLang: String,
+    val baiduLang: String
+) {
+    TW("zh-rTW", BaiduLanguage.TW),
+    HK("zh-rHK", BaiduLanguage.TW),
+    EN("en", BaiduLanguage.EN),
+    JP("ja", BaiduLanguage.JP),
+    KO("ko", BaiduLanguage.KO),
+    FR("fr", BaiduLanguage.FR),
+    SP("es", BaiduLanguage.SP),
+    RU("ru", BaiduLanguage.RU),
+    PT("pt", BaiduLanguage.PT),
+    DE("de", BaiduLanguage.DE),
+    IT("it", BaiduLanguage.IT),
+    NL("nl", BaiduLanguage.NL),
+    PL("pl", BaiduLanguage.PL),
+    SW("sw", BaiduLanguage.SW),
+    VI("vi", BaiduLanguage.VI),
+    TH("th", BaiduLanguage.TH),
+    BG("bg", BaiduLanguage.BG),
+    HU("hu", BaiduLanguage.HU),
+    SK("sk", BaiduLanguage.SK),
+    UK("uk", BaiduLanguage.UK),
+    RO("ro", BaiduLanguage.RO),
+    KZ("kz", BaiduLanguage.KZ)
+}

+ 25 - 0
LocalTools/src/main/java/com/twm/tools/local/BaiduLanguage.kt

@@ -0,0 +1,25 @@
+package com.twm.tools.local
+
+object BaiduLanguage {
+    const val TW = "cht" // 繁中
+    const val EN = "en" // 英语
+    const val JP = "jp" // 日语
+    const val KO = "kor" // 韩语
+    const val FR = "fra" // 法语
+    const val SP = "spa" // 西班牙
+    const val RU = "ru" // 俄语
+    const val PT = "pt" // 葡萄牙语
+    const val DE = "de" // 德语
+    const val IT = "it" // 意大利语
+    const val NL = "nl" // 荷兰语
+    const val PL = "pl" // 波兰语
+    const val SW = "swe" // 瑞典语
+    const val VI = "vie" // 越南语
+    const val TH = "th" // 泰语
+    const val BG = "bg" // 保加利亚语
+    const val HU = "hu" //匈牙利语
+    const val SK = "sk" //斯洛伐克语
+    const val UK = "uk" //乌克兰语
+    const val RO = "ro"//罗马尼亚语
+    const val KZ = "kz"//哈萨克语
+}

+ 12 - 0
LocalTools/src/main/java/com/twm/tools/local/BaiduTranslateResponse.kt

@@ -0,0 +1,12 @@
+package com.twm.tools.local
+
+class BaiduTranslateResponse(
+    val from: String,
+    val to: String,
+    val trans_result: List<BaiduTranslateResult>?
+)
+
+class BaiduTranslateResult(
+    val src: String,
+    val dst: String?
+)

+ 49 - 0
LocalTools/src/main/java/com/twm/tools/local/BaiduTranslateService.kt

@@ -0,0 +1,49 @@
+package com.twm.tools.local
+
+import com.google.gson.Gson
+import okhttp3.FormBody
+import okhttp3.OkHttpClient
+import okhttp3.Request
+import java.math.BigInteger
+import java.security.MessageDigest
+
+object BaiduTranslateService: TranslateApi {
+    private const val TRANSLATE_URL = "https://fanyi-api.baidu.com/api/trans/vip/translate"
+    private const val BAIDU_APPID = "20230809001774667"
+    private const val BAIDU_SECRET = ""
+    private val client = OkHttpClient.Builder().build()
+
+    override fun translate(source: String, lang: String): String? {
+        val salt = System.nanoTime().toString()
+        val sign = (BAIDU_APPID + source + salt + BAIDU_SECRET).getMd5()
+        val body = FormBody.Builder()
+            .add("q", source)
+            .add("from", "auto")
+            .add("to", lang)
+            .add("appid", BAIDU_APPID)
+            .add("salt", salt)
+            .add("sign", sign)
+            .build()
+        val request = Request.Builder()
+            .post(body)
+            .url(TRANSLATE_URL)
+            .header("Content-Type", "application/x-www-form-urlencoded")
+            .build()
+        val response = runCatching {
+            client.newCall(request).execute()
+        }
+        if (response.isFailure) {
+            return null
+        }
+        val result = response.getOrThrow().body?.string() ?: return null
+        val translate = Gson().fromJson(
+            result, BaiduTranslateResponse::class.java
+        )
+        return translate.trans_result?.firstOrNull()?.dst
+    }
+
+    private fun String.getMd5(): String {
+        val md = MessageDigest.getInstance("MD5")
+        return BigInteger(1, md.digest(this.toByteArray())).toString(16).padStart(32, '0')
+    }
+}

+ 0 - 0
LocalTools/src/main/java/com/twm/tools/local/MainClass.kt


Деякі файли не було показано, через те що забагато файлів було змінено