Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ class NumberDialog : AppCompatDialogFragment() {
val appComponent = (requireActivity().application as HabitsApplication).component
val prefs = appComponent.preferences
view = CheckmarkPopupBinding.inflate(LayoutInflater.from(context))
arrayOf(view.yesBtn, view.skipBtn).forEach {
arrayOf(view.yesBtn).forEach {
Copy link

@oshhh oshhh Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a yes button for number dialog right? Do we need this line at all?

I'm sorry if I am missing something basi - I am unfamiliar with this codebase - just looked up the git repo to fix this issue and saw this cl already raised. Thanks!

it.setTextColor(requireArguments().getInt("color"))
}
arrayOf(view.noBtn, view.unknownBtn).forEach {
arrayOf(view.noBtn, view.unknownBtnNumber).forEach {
it.setTextColor(view.root.sres.getColor(R.attr.contrast60))
}
arrayOf(view.yesBtn, view.noBtn, view.skipBtn, view.unknownBtn).forEach {
arrayOf(view.yesBtn, view.noBtn, view.unknownBtnNumber).forEach {
it.typeface = InterfaceUtils.getFontAwesome(requireContext())
}
if (!prefs.isSkipEnabled) view.skipBtnNumber.visibility = View.GONE
if (!prefs.areQuestionMarksEnabled) view.unknownBtnNumber.visibility = View.GONE
view.numberButtons.visibility = View.VISIBLE
fixDecimalSeparator(view)
originalNotes = requireArguments().getString("notes")!!
Expand All @@ -71,6 +72,12 @@ class NumberDialog : AppCompatDialogFragment() {
view.value.setText(DecimalFormat("#.###").format((Entry.SKIP.toDouble() / 1000)))
save()
}

view.unknownBtnNumber.setOnClickListener {
view.value.setText(DecimalFormat("#.###").format((Entry.UNKNOWN.toDouble() / 1000)))
save()
}

view.notes.setOnEditorActionListener { v, actionId, event ->
save()
true
Expand Down
27 changes: 16 additions & 11 deletions uhabits-android/src/main/res/layout/checkmark_popup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="128dp"
android:background="@drawable/checkmark_dialog_bg"
android:minWidth="208dp"
app:divider="@drawable/checkmark_dialog_divider"
app:showDividers="middle"
android:minHeight="128dp"
android:orientation="vertical"
android:background="@drawable/checkmark_dialog_bg">
app:divider="@drawable/checkmark_dialog_divider"
app:showDividers="middle">

<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/notes"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/transparent"
android:gravity="center"
android:hint="@string/notes"
android:inputType="textCapSentences|textMultiLine"
android:textSize="@dimen/smallTextSize"
android:padding="4dp"
android:background="@color/transparent"
android:hint="@string/notes"
android:text="" />
android:text=""
android:textSize="@dimen/smallTextSize" />

<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/booleanButtons"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:visibility="gone"
app:divider="@drawable/checkmark_dialog_divider"
app:showDividers="middle">

Expand All @@ -75,10 +75,10 @@

<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/numberButtons"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:visibility="gone"
app:divider="@drawable/checkmark_dialog_divider"
app:showDividers="middle">

Expand All @@ -88,16 +88,21 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/transparent"
android:textAlignment="center"
android:inputType="numberDecimal"
android:selectAllOnFocus="true"
android:textAlignment="center"
android:textSize="@dimen/smallTextSize" />

<TextView
android:id="@+id/skipBtnNumber"
style="@style/NumericalPopupBtn"
android:text="@string/skip_day" />

<TextView
android:id="@+id/unknownBtnNumber"
style="@style/CheckmarkPopupBtn"
android:text="@string/fa_question" />

<TextView
android:id="@+id/saveBtn"
style="@style/NumericalPopupBtn"
Expand Down