|
@@ -2,12 +2,14 @@ package com.develop.common.data_repo.db
|
|
|
|
|
|
import android.content.res.Resources
|
|
|
import com.develop.base.app.BaseApp
|
|
|
+import com.develop.base.ext.getSN
|
|
|
import com.develop.base.ext.isBrand036I
|
|
|
import com.develop.base.ext.isNightTheme
|
|
|
import com.develop.base.util.MMkvUtils
|
|
|
import com.develop.common.R
|
|
|
import com.develop.common.data_repo.db.entity.DevRecipe
|
|
|
import com.develop.common.data_repo.db.entity.UserFavoriteRecipes
|
|
|
+import com.develop.common.tag.CURRENT_LANGUAGE
|
|
|
import com.develop.common.tag.ISTUYA
|
|
|
import com.develop.common.utils.ConfigUtils
|
|
|
import com.develop.common.utils.TuyaUtils
|
|
@@ -363,6 +365,53 @@ object DataFactory {
|
|
|
return result
|
|
|
}
|
|
|
|
|
|
+ fun genSetting033FModesList(resource: Resources): MutableList<SettingModel> {
|
|
|
+ val result = mutableListOf<SettingModel>()
|
|
|
+ val resIdList = mutableListOf(
|
|
|
+ R.drawable.ic_setting_language,
|
|
|
+ R.drawable.ic_setting_wifi,
|
|
|
+// R.drawable.ic_setting_voice,
|
|
|
+ R.drawable.ic_setting_brightness,
|
|
|
+ R.drawable.ic_setting_user,
|
|
|
+// R.drawable.ic_setting_folder,
|
|
|
+ R.drawable.ic_setting_reset,
|
|
|
+ R.drawable.ic_setting_about,
|
|
|
+ )
|
|
|
+
|
|
|
+ val nameList = mutableListOf(
|
|
|
+ resource.getString(R.string.language), resource.getString(R.string.wifi),
|
|
|
+// resource.getString(R.string.sound),
|
|
|
+ resource.getString(R.string.brightness),
|
|
|
+ resource.getString(R.string.user_account),
|
|
|
+// resource.getString(R.string.storage),
|
|
|
+ resource.getString(R.string.reset), resource.getString(R.string.about)
|
|
|
+
|
|
|
+ )
|
|
|
+ val settingTypeList = mutableListOf(
|
|
|
+ SettingType.LANGUAGE, SettingType.WIFI,
|
|
|
+// SettingType.SOUND,
|
|
|
+ SettingType.BRIGHTNESS,
|
|
|
+ SettingType.USER_ACCOUNT,
|
|
|
+// SettingType.STORAGE,
|
|
|
+ SettingType.RESTORE_FACTORY_SETTINGS, SettingType.ABOUT
|
|
|
+ )
|
|
|
+ // 2024.3.20 鸦图标隐藏(只针对010Dak、010Fapk、032Dapk)
|
|
|
+// settingTypeList.add(SettingType.TUYA)
|
|
|
+// nameList.add(resource.getString(R.string.tuya))
|
|
|
+// resIdList.add(R.drawable.ic_setting_tuya)
|
|
|
+
|
|
|
+// var tuyaConfig = ConfigUtils.loadTuyaConfig()
|
|
|
+// if(tuyaConfig != null){
|
|
|
+// settingTypeList.add(SettingType.TUYA)
|
|
|
+// nameList.add(resource.getString(R.string.tuya))
|
|
|
+// resIdList.add(R.drawable.ic_setting_tuya)
|
|
|
+// }
|
|
|
+
|
|
|
+ for (i in resIdList.indices) {
|
|
|
+ result.add(SettingModel(resIdList[i], nameList[i], settingTypeList[i]))
|
|
|
+ }
|
|
|
+ return result
|
|
|
+ }
|
|
|
fun genLocalRecipes(
|
|
|
categoryName: String,
|
|
|
recipesList: MutableList<DevRecipe>,
|
|
@@ -404,12 +453,16 @@ object DataFactory {
|
|
|
|
|
|
fun genSortNameList(resource: Resources): MutableList<FilterSortModel> {
|
|
|
val result = mutableListOf<FilterSortModel>()
|
|
|
+ val sn = getSN()
|
|
|
val sortNameList = mutableListOf(
|
|
|
"A-Z",
|
|
|
resource.getString(R.string.most_popular),
|
|
|
resource.getString(R.string.newest),
|
|
|
- resource.getString(R.string.rating)
|
|
|
)
|
|
|
+ //033需求,评价等级功能隐藏,标签也要隐藏
|
|
|
+ if (!sn.startsWith("033")){
|
|
|
+ sortNameList.add(resource.getString(R.string.rating))
|
|
|
+ }
|
|
|
|
|
|
for (name in sortNameList) {
|
|
|
result.add(FilterSortModel(name))
|
|
@@ -417,12 +470,16 @@ object DataFactory {
|
|
|
return result
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 本地搜索
|
|
|
+ * */
|
|
|
fun genTestSearchDataList(): MutableList<Any> {
|
|
|
val result = mutableListOf<Any>()
|
|
|
val homeHeader = HomeHeader()
|
|
|
homeHeader.filterSortModel = FilterSortModel("")
|
|
|
+ var lang = MMkvUtils.getString(CURRENT_LANGUAGE) ?:"EN"
|
|
|
var historyDataList: MutableList<CommonSearchItem> = mutableListOf()
|
|
|
- val hotWordJson = MMkvUtils.getString("CommonWords") ?: ""
|
|
|
+ val hotWordJson = MMkvUtils.getString("CommonWords-$lang") ?: ""
|
|
|
if (hotWordJson.isNotEmpty()) {
|
|
|
val type: Type = object : TypeToken<List<CommonSearchItem>>() {}.type
|
|
|
historyDataList = Gson().fromJson(hotWordJson, type)
|
|
@@ -448,9 +505,10 @@ object DataFactory {
|
|
|
fun genOnLineHotTags(hotTags: MutableList<String>): MutableList<Any> {
|
|
|
val result = mutableListOf<Any>()
|
|
|
val homeHeader = HomeHeader()
|
|
|
+ var lang = MMkvUtils.getString(CURRENT_LANGUAGE) ?:"EN"
|
|
|
homeHeader.filterSortModel = FilterSortModel("")
|
|
|
var historyDataList: MutableList<CommonSearchItem> = mutableListOf()
|
|
|
- val hotWordJson = MMkvUtils.getString("CommonWords") ?: ""
|
|
|
+ val hotWordJson = MMkvUtils.getString("CommonWords-$lang") ?: ""
|
|
|
if (hotWordJson.isNotEmpty()) {
|
|
|
val type: Type = object : TypeToken<List<CommonSearchItem>>() {}.type
|
|
|
historyDataList = Gson().fromJson(hotWordJson, type)
|
|
@@ -685,8 +743,8 @@ object DataFactory {
|
|
|
|
|
|
private var titleStrIds011 = mutableListOf<Int>(
|
|
|
R.string.automatic_recipes_011,
|
|
|
- R.string.manual_cooking_011,
|
|
|
R.string.automatic_programmes_011,
|
|
|
+ R.string.manual_cooking_011,
|
|
|
R.string.download_new_recipes_011
|
|
|
)
|
|
|
private var title2StrIds1 = mutableListOf<Int>(
|