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

53 lines
1.6 KiB
Kotlin
Raw Normal View History

2018-10-25 16:44:36 +02:00
/**
* ProjectLaogai
*
* Copyright 2018 <seil0@mosad.xyz>
*
* 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-24 18:22:05 +02:00
package org.mosad.seil0.projectlaogai
import android.content.Context
2018-10-25 16:44:36 +02:00
import android.graphics.Color
2018-10-26 00:50:37 +02:00
import androidx.cardview.widget.CardView
2018-10-24 18:22:05 +02:00
import android.util.AttributeSet
2018-10-25 16:44:36 +02:00
import android.widget.TextView
2018-10-26 00:50:37 +02:00
class LessonCardView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : androidx.cardview.widget.CardView(context, attrs){
2018-10-25 16:44:36 +02:00
private var txtViewLesson: TextView
private var txtViewTime: TextView
2018-10-24 18:22:05 +02:00
init {
2018-10-25 16:44:36 +02:00
inflate(context, R.layout.lesson_cardview,this)
txtViewLesson = findViewById(R.id.txtView_Lesson)
txtViewTime = findViewById(R.id.txtView_Time)
// workaround to prevent a white border
this.setBackgroundColor(Color.parseColor("#3F51B5"))
}
fun getTxtViewLesson(): TextView {
return txtViewLesson
}
2018-10-24 18:22:05 +02:00
2018-10-25 16:44:36 +02:00
fun getTxtViewTime(): TextView {
return txtViewTime
2018-10-24 18:22:05 +02:00
}
}