Archived
Added German translation
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
package com.denizk0461.studip.adapter
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.denizk0461.studip.R
|
||||
@@ -49,20 +45,14 @@ class StudIPEventAdapter(
|
||||
theme.resolveAttribute(R.attr.colorPrimary, colorPrimary, true)
|
||||
theme.resolveAttribute(R.attr.colorTextHintLighter, colorTextHint, true)
|
||||
|
||||
// Log.d("eek!", holder.binding.cardBackground.strokeWidth.toString())
|
||||
|
||||
if (!isAnyCourseHighlighted && currentItem.isCurrentCourse(currentCalendar)) { // highlight
|
||||
isAnyCourseHighlighted = true
|
||||
// holder.binding.textTitle.setTextColor(colorHighlight.data)
|
||||
holder.binding.cardBackground.strokeColor = colorPrimary.data
|
||||
holder.binding.cardBackground.strokeWidth = 6
|
||||
// holder.binding.cardBackground.cardForegroundColor = holder.binding.root.context.getColorStateList(
|
||||
// R.color.list_card_selected)
|
||||
} else { // un-highlight
|
||||
// holder.binding.textTitle.setTextColor(colorUnhighlight.data)
|
||||
holder.binding.cardBackground.strokeColor = colorTextHint.data
|
||||
holder.binding.cardBackground.strokeWidth = 3
|
||||
// holder.binding.cardBackground.cardForegroundColor = Color.TRANSPARENT
|
||||
}
|
||||
|
||||
holder.binding.cardBackground.setOnClickListener {
|
||||
@@ -77,15 +67,9 @@ class StudIPEventAdapter(
|
||||
|
||||
}
|
||||
|
||||
private fun StudIPEvent.isCurrentCourse(calendar: Calendar): Boolean {
|
||||
// if (calendar.get(Calendar.DAY_OF_WEEK) == this.day.toCalendarDay()) {
|
||||
if (Calendar.THURSDAY == this.day.toCalendarDay()) {
|
||||
if ((calendar.get(Calendar.MINUTE) + calendar.get(Calendar.HOUR_OF_DAY) * 60) < this.timeslotEnd.parseToMinutes()) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
private fun StudIPEvent.isCurrentCourse(calendar: Calendar): Boolean =
|
||||
(calendar.get(Calendar.DAY_OF_WEEK) == this.day.toCalendarDay()) &&
|
||||
((calendar.get(Calendar.MINUTE) + calendar.get(Calendar.HOUR_OF_DAY) * 60) < this.timeslotEnd.parseToMinutes())
|
||||
|
||||
// Converts day as defined in StudIPEvent.kt to day from Calendar
|
||||
private fun Int.toCalendarDay(): Int = when (this) {
|
||||
|
||||
Reference in New Issue
Block a user