forked from penguin86/luna-tracker
Compare commits
8 Commits
9cce54c05e
...
d4df3cfc18
| Author | SHA1 | Date | |
|---|---|---|---|
| d4df3cfc18 | |||
| fc3b67638d | |||
| f85094b0ff | |||
| 9237d329e8 | |||
| f1f6af14ad | |||
| 1106c7d42a | |||
| 6f7faa97d3 | |||
| 001fa68de5 |
@@ -714,28 +714,19 @@ class MainActivity : AppCompatActivity() {
|
||||
val emojiTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_emoji)
|
||||
val descriptionTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_description)
|
||||
val dateTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_date)
|
||||
val dateEndTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_date_end)
|
||||
val quantityTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_quantity)
|
||||
val notesTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_notes)
|
||||
|
||||
emojiTextView.text = event.getTypeEmoji(this)
|
||||
descriptionTextView.text = event.getTypeDescription(this)
|
||||
|
||||
val pickedTime = datePickerHelper(event.time, dateTextView)
|
||||
val updateValues = {
|
||||
quantityTextView.text = NumericUtils(this).formatEventQuantity(event)
|
||||
notesTextView.text = event.notes
|
||||
if (event.type == LunaEvent.TYPE_SLEEP) {
|
||||
dateEndTextView.text = DateUtils.formatDateTime(event.time + event.quantity)
|
||||
dateEndTextView.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
updateValues()
|
||||
|
||||
val pickedTime = datePickerHelper(event.time, dateTextView, { newTime: Long ->
|
||||
event.time = newTime
|
||||
updateValues()
|
||||
})
|
||||
|
||||
quantityTextView.setOnClickListener {
|
||||
when (event.type) {
|
||||
LunaEvent.TYPE_BABY_BOTTLE -> askBabyBottleContent(event, false, updateValues)
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
android:id="@+id/dialog_amount_value"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"/>
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_date_picker"
|
||||
|
||||
@@ -52,6 +52,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="15dp"/>
|
||||
android:layout_marginTop="20dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -46,18 +46,6 @@
|
||||
android:textSize="28sp"
|
||||
android:text="@string/dialog_event_detail_quantity"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_event_detail_type_date_end"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:drawablePadding="10dp"
|
||||
android:drawableTint="@color/accent"
|
||||
android:visibility="gone"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
|
||||
Reference in New Issue
Block a user