the no lesson card now has the correct text color

* updated material-dialogs to version 3.1.0
This commit is contained in:
2019-07-18 00:32:31 +02:00
parent e8cae7e807
commit f52151fbf1
2 changed files with 5 additions and 9 deletions

View File

@ -28,7 +28,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.afollestad.materialdialogs.MaterialDialog
import kotlinx.android.synthetic.main.fragment_home.*
@ -75,8 +74,6 @@ class HomeFragment : Fragment() {
val cal = Calendar.getInstance()
val mensaCardView = DayCardView(context!!)
uiThread {
if (isAdded) {
@ -116,7 +113,6 @@ class HomeFragment : Fragment() {
}
}
/**
@ -194,12 +190,13 @@ class HomeFragment : Fragment() {
* @param startDayIndex the day index you want to start searching
* @return a DayCardView with all lessons added
*/
private fun findNextDay(startWeekIndex: Int, startDayIndex: Int) : DayCardView{
private fun findNextDay(startWeekIndex: Int, startDayIndex: Int) : DayCardView {
val cal = Calendar.getInstance()
var dayCardView = DayCardView(context!!)
var dayTimetable: TimetableDay? = null
var dayIndexSearch = startDayIndex
var weekIndexSearch = startWeekIndex
loop@ while (dayTimetable == null && weekIndexSearch <= timetables.size) {
for (i in (dayIndexSearch) ..5) {
dayTimetable = timetables[weekIndexSearch].timetable.days[i]
@ -229,7 +226,6 @@ class HomeFragment : Fragment() {
private fun getNoCard(text: String): TextView {
val noLesson = TextView(context)
noLesson.text = text
noLesson.setTextColor(ContextCompat.getColor(context!!, R.color.textPrimary))
noLesson.textSize = 18.0F
noLesson.setTypeface(null, Typeface.BOLD)
noLesson.textAlignment = View.TEXT_ALIGNMENT_CENTER