ProjectLaogai/app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/LessonTextView.kt

26 lines
787 B
Kotlin

package org.mosad.seil0.projectlaogai.uicomponents
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.widget.TextView
import org.mosad.seil0.projectlaogai.hsoparser.Lesson
class LessonTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : TextView(context, attrs) {
init {
this.setTextColor(Color.BLACK)
this.textSize = 16F
this.setPadding(0,6,0,0)
}
fun setLesson(lesson: Lesson) {
this.text = resources.getString(org.mosad.seil0.projectlaogai.R.string.string_new_line, lesson.lessonSubject)
this.append(lesson.lessonTeacher + "\n")
this.append(lesson.lessonRoom)
}
fun setText(text: String) {
this.text = text
}
}