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 emojiTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_emoji)
|
||||||
val descriptionTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_description)
|
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 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 quantityTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_quantity)
|
||||||
val notesTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_notes)
|
val notesTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_notes)
|
||||||
|
|
||||||
emojiTextView.text = event.getTypeEmoji(this)
|
emojiTextView.text = event.getTypeEmoji(this)
|
||||||
descriptionTextView.text = event.getTypeDescription(this)
|
descriptionTextView.text = event.getTypeDescription(this)
|
||||||
|
|
||||||
|
val pickedTime = datePickerHelper(event.time, dateTextView)
|
||||||
val updateValues = {
|
val updateValues = {
|
||||||
quantityTextView.text = NumericUtils(this).formatEventQuantity(event)
|
quantityTextView.text = NumericUtils(this).formatEventQuantity(event)
|
||||||
notesTextView.text = event.notes
|
notesTextView.text = event.notes
|
||||||
if (event.type == LunaEvent.TYPE_SLEEP) {
|
|
||||||
dateEndTextView.text = DateUtils.formatDateTime(event.time + event.quantity)
|
|
||||||
dateEndTextView.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
updateValues()
|
updateValues()
|
||||||
|
|
||||||
val pickedTime = datePickerHelper(event.time, dateTextView, { newTime: Long ->
|
|
||||||
event.time = newTime
|
|
||||||
updateValues()
|
|
||||||
})
|
|
||||||
|
|
||||||
quantityTextView.setOnClickListener {
|
quantityTextView.setOnClickListener {
|
||||||
when (event.type) {
|
when (event.type) {
|
||||||
LunaEvent.TYPE_BABY_BOTTLE -> askBabyBottleContent(event, false, updateValues)
|
LunaEvent.TYPE_BABY_BOTTLE -> askBabyBottleContent(event, false, updateValues)
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
android:id="@+id/dialog_amount_value"
|
android:id="@+id/dialog_amount_value"
|
||||||
android:layout_width="250dp"
|
android:layout_width="250dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingHorizontal="16dp"/>
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="8dp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/dialog_date_picker"
|
android:id="@+id/dialog_date_picker"
|
||||||
|
|||||||
@@ -52,6 +52,6 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginTop="15dp"/>
|
android:layout_marginTop="20dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -46,18 +46,6 @@
|
|||||||
android:textSize="28sp"
|
android:textSize="28sp"
|
||||||
android:text="@string/dialog_event_detail_quantity"/>
|
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
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="200dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user