mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
SubtitleCard: Show at-most icon
This commit is contained in:
@@ -53,8 +53,6 @@ class SubtitleCardViewTest : BaseViewTest() {
|
||||
isNumerical = false,
|
||||
question = "Did you meditate this morning?",
|
||||
reminder = Reminder(8, 30, EVERY_DAY),
|
||||
unit = "",
|
||||
targetValue = 0.0,
|
||||
theme = LightTheme(),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.isoron.platform.gui.toInt
|
||||
import org.isoron.uhabits.R
|
||||
import org.isoron.uhabits.activities.habits.edit.formatFrequency
|
||||
import org.isoron.uhabits.activities.habits.list.views.toShortString
|
||||
import org.isoron.uhabits.core.models.NumericalHabitType
|
||||
import org.isoron.uhabits.core.ui.screens.habits.show.views.SubtitleCardState
|
||||
import org.isoron.uhabits.databinding.ShowHabitSubtitleBinding
|
||||
import org.isoron.uhabits.utils.InterfaceUtils
|
||||
@@ -65,7 +66,12 @@ class SubtitleCardView(context: Context, attrs: AttributeSet) : LinearLayout(con
|
||||
binding.questionLabel.visibility = View.VISIBLE
|
||||
binding.targetIcon.visibility = View.VISIBLE
|
||||
binding.targetText.visibility = View.VISIBLE
|
||||
if (!state.isNumerical) {
|
||||
if (state.isNumerical) {
|
||||
binding.targetIcon.text = when (state.targetType) {
|
||||
NumericalHabitType.AT_LEAST -> resources.getString(R.string.fa_arrow_circle_up)
|
||||
else -> resources.getString(R.string.fa_arrow_circle_down)
|
||||
}
|
||||
} else {
|
||||
binding.targetIcon.visibility = View.GONE
|
||||
binding.targetText.visibility = View.GONE
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
android:id="@+id/targetIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fa_arrow_circle_up"
|
||||
android:textColor="?attr/contrast60"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<resources>
|
||||
<string translatable="false" name="fa_star_half_o"></string>
|
||||
<string translatable="false" name="fa_arrow_circle_up"></string>
|
||||
<string translatable="false" name="fa_arrow_circle_down"></string>
|
||||
<string translatable="false" name="fa_check"></string>
|
||||
<string translatable="false" name="fa_times"></string>
|
||||
<string translatable="false" name="fa_skipped"></string>
|
||||
@@ -181,7 +182,6 @@
|
||||
<!--<string translatable="false" name="fa_hand_o_down"></string>-->
|
||||
<!--<string translatable="false" name="fa_arrow_circle_left"></string>-->
|
||||
<!--<string translatable="false" name="fa_arrow_circle_right"></string>-->
|
||||
<!--<string translatable="false" name="fa_arrow_circle_down"></string>-->
|
||||
<!--<string translatable="false" name="fa_globe"></string>-->
|
||||
<!--<string translatable="false" name="fa_wrench"></string>-->
|
||||
<!--<string translatable="false" name="fa_tasks"></string>-->
|
||||
|
||||
Reference in New Issue
Block a user