mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-21 14:10:51 +01:00
properly show all-day tasks at the weekly view
This commit is contained in:
parent
26c0a55d19
commit
e558342cc9
@ -159,6 +159,8 @@ class TaskActivity : SimpleActivity() {
|
|||||||
mEventTypeId = mTask.eventType
|
mEventTypeId = mTask.eventType
|
||||||
task_title.setText(mTask.title)
|
task_title.setText(mTask.title)
|
||||||
task_description.setText(mTask.description)
|
task_description.setText(mTask.description)
|
||||||
|
task_all_day.isChecked = mTask.getIsAllDay()
|
||||||
|
toggleAllDay(mTask.getIsAllDay())
|
||||||
setupMarkCompleteButton()
|
setupMarkCompleteButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -666,7 +666,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
private fun addAllDayEvent(event: Event) {
|
private fun addAllDayEvent(event: Event) {
|
||||||
(inflater.inflate(R.layout.week_all_day_event_marker, null, false) as TextView).apply {
|
(inflater.inflate(R.layout.week_all_day_event_marker, null, false) as ConstraintLayout).apply {
|
||||||
var backgroundColor = eventTypeColors.get(event.eventType, primaryColor)
|
var backgroundColor = eventTypeColors.get(event.eventType, primaryColor)
|
||||||
var textColor = backgroundColor.getContrastColor()
|
var textColor = backgroundColor.getContrastColor()
|
||||||
if (dimPastEvents && event.isPastEvent && !isPrintVersion) {
|
if (dimPastEvents && event.isPastEvent && !isPrintVersion) {
|
||||||
@ -675,9 +675,18 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
}
|
}
|
||||||
background = ColorDrawable(backgroundColor)
|
background = ColorDrawable(backgroundColor)
|
||||||
|
|
||||||
|
week_event_label.apply {
|
||||||
setTextColor(textColor)
|
setTextColor(textColor)
|
||||||
|
maxLines = if (event.isTask()) 1 else 2
|
||||||
text = event.title
|
text = event.title
|
||||||
|
checkViewStrikeThrough(event.isTaskCompleted())
|
||||||
contentDescription = text
|
contentDescription = text
|
||||||
|
}
|
||||||
|
|
||||||
|
week_event_task_image.beVisibleIf(event.isTask())
|
||||||
|
if (event.isTask()) {
|
||||||
|
week_event_task_image.applyColorFilter(textColor)
|
||||||
|
}
|
||||||
|
|
||||||
val startDateTime = Formatter.getDateTimeFromTS(event.startTS)
|
val startDateTime = Formatter.getDateTimeFromTS(event.startTS)
|
||||||
val endDateTime = Formatter.getDateTimeFromTS(event.endTS)
|
val endDateTime = Formatter.getDateTimeFromTS(event.endTS)
|
||||||
|
@ -1,9 +1,37 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/week_event_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/week_event_task_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:paddingStart="@dimen/one_dp"
|
||||||
|
android:paddingTop="@dimen/one_dp"
|
||||||
|
android:paddingBottom="@dimen/one_dp"
|
||||||
|
android:scaleType="fitStart"
|
||||||
|
android:src="@drawable/ic_task_vector"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/week_event_label"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/week_event_label" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/week_event_label"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:padding="@dimen/tiny_margin"
|
android:paddingStart="@dimen/tiny_margin"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="@dimen/small_text_size" />
|
android:textSize="@dimen/small_text_size"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/week_event_task_image"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="My event" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user