宝箱act 顶部UI刷新 +1
This commit is contained in:
parent
82ff8c5c51
commit
ff0ee2d612
|
|
@ -5,6 +5,7 @@ import android.content.Intent
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import com.ama.core.architecture.appBase.AppViewsActivity
|
import com.ama.core.architecture.appBase.AppViewsActivity
|
||||||
|
import com.ama.core.architecture.util.ResUtil
|
||||||
import com.gamedog.vididin.R
|
import com.gamedog.vididin.R
|
||||||
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
|
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
|
||||||
import com.gamedog.vididin.manager.TaskManager
|
import com.gamedog.vididin.manager.TaskManager
|
||||||
|
|
@ -78,18 +79,42 @@ class BenefitActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
|
||||||
ivSubtask1.setImageResource(getIconResByState(stateEnum))
|
ivSubtask1.setImageResource(getIconResByState(stateEnum))
|
||||||
tvSubtask1State.setText(getStrResByState(stateEnum))
|
tvSubtask1State.setText(getStrResByState(stateEnum))
|
||||||
tvSubtask1State.setTextColor(getStrColorByState(stateEnum))
|
tvSubtask1State.setTextColor(getStrColorByState(stateEnum))
|
||||||
|
|
||||||
|
with (tvSubtask1Reward) {
|
||||||
|
compoundDrawablePadding = if (stateEnum == STATE_FINISH || stateEnum == STATE_CLAIMED) 0 else ResUtil.getPixelSize(R.dimen.dp3)
|
||||||
|
val tvRewardIcon = getRewardTvDrawableRes(stateEnum)
|
||||||
|
setCompoundDrawables(ResUtil.getDrawable(tvRewardIcon), null, null, null)
|
||||||
|
val needShowNum = R.mipmap.icon_check_mark != tvRewardIcon
|
||||||
|
setText(if (needShowNum) { ResUtil.getString(R.string.cash) + " " + curBoxState.reward_value} else "")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
ivSubtask2.setImageResource(getIconResByState(stateEnum))
|
ivSubtask2.setImageResource(getIconResByState(stateEnum))
|
||||||
tvSubtask2State.setText(getStrResByState(stateEnum))
|
tvSubtask2State.setText(getStrResByState(stateEnum))
|
||||||
tvSubtask2State.setTextColor(getStrColorByState(stateEnum))
|
tvSubtask2State.setTextColor(getStrColorByState(stateEnum))
|
||||||
|
|
||||||
|
with (tvSubtask2Reward) {
|
||||||
|
compoundDrawablePadding = if (stateEnum == STATE_FINISH || stateEnum == STATE_CLAIMED) 0 else ResUtil.getPixelSize(R.dimen.dp3)
|
||||||
|
val tvRewardIcon = getRewardTvDrawableRes(stateEnum)
|
||||||
|
setCompoundDrawables(ResUtil.getDrawable(tvRewardIcon), null, null, null)
|
||||||
|
val needShowNum = R.mipmap.icon_check_mark != tvRewardIcon
|
||||||
|
setText(if (needShowNum) { ResUtil.getString(R.string.cash) + " " + curBoxState.reward_value} else "")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == 2) {
|
if (index == 2) {
|
||||||
ivSubtask3.setImageResource(getIconResByState(stateEnum))
|
ivSubtask3.setImageResource(getIconResByState(stateEnum))
|
||||||
tvSubtask3State.setText(getStrResByState(stateEnum))
|
tvSubtask3State.setText(getStrResByState(stateEnum))
|
||||||
tvSubtask3State.setTextColor(getStrColorByState(stateEnum))
|
tvSubtask3State.setTextColor(getStrColorByState(stateEnum))
|
||||||
|
|
||||||
|
with (tvSubtask3Reward) {
|
||||||
|
compoundDrawablePadding = if (stateEnum == STATE_FINISH || stateEnum == STATE_CLAIMED) 0 else ResUtil.getPixelSize(R.dimen.dp3)
|
||||||
|
val tvRewardIcon = getRewardTvDrawableRes(stateEnum)
|
||||||
|
setCompoundDrawables(ResUtil.getDrawable(tvRewardIcon), null, null, null)
|
||||||
|
val needShowNum = R.mipmap.icon_check_mark != tvRewardIcon
|
||||||
|
setText(if (needShowNum) { ResUtil.getString(R.string.cash) + " " + curBoxState.reward_value} else "")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,6 +155,14 @@ class BenefitActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getRewardTvDrawableRes(state: Int): Int {
|
||||||
|
when (state) {
|
||||||
|
STATE_EXPIRED -> return R.mipmap.icon_cash_s_disable
|
||||||
|
STATE_FINISH, STATE_CLAIMED -> return R.mipmap.icon_check_mark
|
||||||
|
else -> return R.mipmap.icon_cash_s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
internal fun startActivity(activity: Activity) {
|
internal fun startActivity(activity: Activity) {
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@
|
||||||
android:layout_marginTop="6dp"
|
android:layout_marginTop="6dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textColor="@color/gray_60"
|
android:textColor="@color/gray_60"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="@string/expired"/>
|
android:text="@string/expired"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -167,6 +168,7 @@
|
||||||
android:layout_marginTop="6dp"
|
android:layout_marginTop="6dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textColor="@color/green_39"
|
android:textColor="@color/green_39"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="@string/finished"/>
|
android:text="@string/finished"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -208,6 +210,7 @@
|
||||||
android:layout_marginTop="6dp"
|
android:layout_marginTop="6dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textColor="@color/red_5c"
|
android:textColor="@color/red_5c"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="@string/ongoing"/>
|
android:text="@string/ongoing"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,5 @@
|
||||||
<dimen name="main_tab_item_padding_vertical">14dp</dimen>
|
<dimen name="main_tab_item_padding_vertical">14dp</dimen>
|
||||||
<dimen name="main_tab_item_title_test_size">16sp</dimen>
|
<dimen name="main_tab_item_title_test_size">16sp</dimen>
|
||||||
<dimen name="dp1">1dp</dimen>
|
<dimen name="dp1">1dp</dimen>
|
||||||
|
<dimen name="dp3">3dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue