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

54 lines
1.7 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-29 13:04:20 +01:00
package org.mosad.seil0.projectlaogai.uicomponents
2018-10-24 18:22:05 +02:00
import android.content.Context
import android.util.AttributeSet
2018-10-29 13:04:20 +01:00
import android.widget.LinearLayout
2018-10-25 16:44:36 +02:00
import android.widget.TextView
import org.mosad.seil0.projectlaogai.R
2018-10-25 16:44:36 +02:00
2018-10-29 13:04:20 +01:00
class MensaDayCardView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : androidx.cardview.widget.CardView(context, attrs){
2018-10-25 16:44:36 +02:00
2018-10-29 13:04:20 +01:00
private var linLayoutMensaDay: LinearLayout
private var txtViewDayHeading: TextView
2018-10-24 18:22:05 +02:00
init {
2018-10-29 13:04:20 +01:00
inflate(context, R.layout.mensaday_cardview,this)
2018-10-25 16:44:36 +02:00
2018-10-29 13:04:20 +01:00
linLayoutMensaDay = findViewById(R.id.linLayout_MensaDay)
txtViewDayHeading = findViewById(R.id.txtView_DayHeading)
2018-10-25 16:44:36 +02:00
// workaround to prevent a white border
2018-10-29 13:04:20 +01:00
//this.setBackgroundColor(Color.TRANSPARENT)
2018-10-25 16:44:36 +02:00
}
2018-10-29 13:04:20 +01:00
fun getLinLayoutMensaDay(): LinearLayout {
return linLayoutMensaDay
2018-10-25 16:44:36 +02:00
}
2018-10-24 18:22:05 +02:00
2018-10-29 13:04:20 +01:00
fun setDayHeading(heading: String) {
txtViewDayHeading.text = heading
2018-10-24 18:22:05 +02:00
}
2018-10-29 13:04:20 +01:00
2018-10-24 18:22:05 +02:00
}