2018-10-25 16:44:36 +02:00
/ * *
* ProjectLaogai
*
2020-01-15 15:00:05 +01:00
* Copyright 2019 - 2020 < seil0 @mosad . xyz >
2018-10-25 16:44:36 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston ,
* MA 02110 - 1301 , USA .
*
* /
2018-10-29 13:04:20 +01:00
package org.mosad.seil0.projectlaogai.uicomponents
2018-10-24 18:22:05 +02:00
import android.content.Context
2019-03-20 21:33:55 +01:00
import android.view.View
2019-03-03 20:46:51 +01:00
import android.widget.LinearLayout
2019-03-20 21:33:55 +01:00
import kotlinx.android.synthetic.main.linearlayout_lesson.view.*
2018-10-27 14:11:47 +02:00
import org.mosad.seil0.projectlaogai.R
2020-06-07 23:41:49 +02:00
import org.mosad.seil0.projectlaogai.util.Lesson
2018-10-25 16:44:36 +02:00
2019-03-20 21:33:55 +01:00
class LessonLinearLayout ( context : Context ? ) : LinearLayout ( context ) {
2018-10-24 18:22:05 +02:00
init {
2020-08-17 22:30:12 +02:00
inflate ( context , R . layout . linearlayout _lesson , this )
2018-10-25 16:44:36 +02:00
}
2019-03-20 21:33:55 +01:00
fun setLesson ( lesson : Lesson , time : String ) {
txtView _lessonTime . text = time
txtView _lessonSubject . text = lesson . lessonSubject
txtView _lessonTeacher . text = lesson . lessonTeacher
txtView _lessonRoom . text = lesson . lessonRoom
2018-10-25 16:44:36 +02:00
}
2018-10-24 18:22:05 +02:00
2019-03-20 21:33:55 +01:00
fun disableDivider ( ) {
divider _lesson . visibility = View . GONE
2018-10-24 18:22:05 +02:00
}
2019-03-20 21:33:55 +01:00
2018-10-24 18:22:05 +02:00
}