|
@@ -24,6 +24,7 @@ import com.develop.common.utils.Resource
|
|
|
import com.develop.common.dialog.DownloadFailedDialog
|
|
|
import com.develop.common.dialog.ShareQRCodeDialog
|
|
|
import com.develop.common.event.RefreshDataEvent
|
|
|
+import com.develop.common.utils.setLeftDrawable
|
|
|
import com.develop.step.databinding.ActivityCookDetailBinding
|
|
|
import com.develop.step.viewmodel.CookDetailViewModel
|
|
|
import java.util.*
|
|
@@ -76,8 +77,6 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
ARouter.getInstance().inject(this)
|
|
@@ -118,22 +117,22 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
|
|
|
}
|
|
|
|
|
|
private fun initView() {
|
|
|
- val tintList = if (!isNightTheme()){
|
|
|
+ val tintList = if (!isNightTheme()) {
|
|
|
resources.getColorStateList(com.develop.common.R.color.color_cook_tab_tint)
|
|
|
} else {
|
|
|
resources.getColorStateList(com.develop.common.R.color.color_night_cook_tab_tint)
|
|
|
}
|
|
|
binding.ivTab1.drawable?.apply {
|
|
|
- DrawableCompat.setTintList(this,tintList)
|
|
|
+ DrawableCompat.setTintList(this, tintList)
|
|
|
}
|
|
|
binding.ivTab2.drawable?.apply {
|
|
|
- DrawableCompat.setTintList(this,tintList)
|
|
|
+ DrawableCompat.setTintList(this, tintList)
|
|
|
}
|
|
|
binding.ivTab3.drawable?.apply {
|
|
|
- DrawableCompat.setTintList(this,tintList)
|
|
|
+ DrawableCompat.setTintList(this, tintList)
|
|
|
}
|
|
|
binding.ivTab4.drawable?.apply {
|
|
|
- DrawableCompat.setTintList(this,tintList)
|
|
|
+ DrawableCompat.setTintList(this, tintList)
|
|
|
}
|
|
|
|
|
|
if (isLike) {
|
|
@@ -145,7 +144,7 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
|
|
|
binding.viewHide.background_drawable = com.develop.common.R.drawable.hide_bg_conner
|
|
|
if (cookSource == "local") {
|
|
|
binding.tvDownload.setText(com.develop.common.R.string.start_cooking)
|
|
|
- if (isNightTheme()){
|
|
|
+ if (isNightTheme()) {
|
|
|
binding.viewProgress.setButtonColor(Color.parseColor("#E03E52"))
|
|
|
} else {
|
|
|
binding.viewProgress.setButtonColor(Color.parseColor("#CCEE8F08"))
|
|
@@ -224,6 +223,21 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ binding.tvMoreScore.setLeftDrawable(
|
|
|
+ com.develop.common.R.drawable.ic_more_star,
|
|
|
+ com.develop.common.R.dimen.convert_60px
|
|
|
+ )
|
|
|
+
|
|
|
+ binding.tvMoreDelete.setLeftDrawable(
|
|
|
+ com.develop.common.R.drawable.ic_more_delete,
|
|
|
+ com.develop.common.R.dimen.convert_60px
|
|
|
+ )
|
|
|
+
|
|
|
+ binding.tvMoreShare.setLeftDrawable(
|
|
|
+ com.develop.common.R.drawable.ic_more_share,
|
|
|
+ com.develop.common.R.dimen.convert_60px
|
|
|
+ )
|
|
|
+
|
|
|
binding.tvMoreScore.setOnClickListener {
|
|
|
navigateTo(Screens.Cook.COOK_EVALUATE) {
|
|
|
withString("recipeId", recipeNumber)
|
|
@@ -342,13 +356,13 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
|
|
|
binding.tvEasy.text = detail.recipe.difficultyLevel
|
|
|
binding.startLayout.setCommentNumber(detail.recipe.useNum.toString())
|
|
|
FoodDataProvider.getUserDatabase().runInTransaction {
|
|
|
- val result = FoodDataProvider.getUserDatabase().userInfoDao()
|
|
|
+ val result = FoodDataProvider.getUserDatabase().userInfoDao()
|
|
|
.queryUserTag(CURRENT_USER_ID, detail.recipe.number ?: "")
|
|
|
- runOnUiThread {
|
|
|
- result?.starCount?.apply {
|
|
|
- binding.startLayout.setStarCount(this)
|
|
|
- }
|
|
|
- }
|
|
|
+ runOnUiThread {
|
|
|
+ result?.starCount?.apply {
|
|
|
+ binding.startLayout.setStarCount(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
// detail.recipe.score?.let { binding.startLayout.setStarCount(it.toInt()) }
|
|
|
}
|
|
@@ -389,7 +403,7 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
|
|
|
binding.tvDownloadState.setGone()
|
|
|
binding.tvDownload.setText(com.develop.common.R.string.start_cooking)
|
|
|
binding.viewProgress.setProgress(1f)
|
|
|
- if (isNightTheme()){
|
|
|
+ if (isNightTheme()) {
|
|
|
binding.viewProgress.setButtonColor(Color.parseColor("#E03E52"))
|
|
|
} else {
|
|
|
binding.viewProgress.setButtonColor(Color.parseColor("#CCEE8F08"))
|