This is the home of the new hsoApp!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.2 KiB

4 years ago
* ProjectLaogai
* Copyright 2018 <>
* 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
* 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.
package org.mosad.seil0.projectlaogai
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.TextView
* The "home" controller class
* contains all needed parts to display the apps home screen
class HomeFragment : Fragment() {
private lateinit var txtViewMenu1: TextView
private lateinit var txtViewMenu2: TextView
private lateinit var scrollViewTimeTable: ScrollView
private lateinit var linLayoutTimeTable: LinearLayout
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view: View = inflater.inflate(R.layout.fragment_home, container, false)
// init UI elements
txtViewMenu1 = view.findViewById(
txtViewMenu2 = view.findViewById(
scrollViewTimeTable = view.findViewById(
linLayoutTimeTable = view.findViewById(
// Inflate the layout for this fragment
return view
private fun setText() {
txtViewMenu1.text = "Buntes Pfannengemüse\nCouscous\nBlattsalat"
txtViewMenu2.text = "Riesen Currywurst\nCurryketchup\nGitterkartoffeln\nBlattsalat"
private fun addLessons() {
// for each lesson to display on homescreen create a cardview
val cardView = CardView(context!!)
val linLayout = LinearLayout(context)
val tv = TextView(context)
cardView.radius = 20F
cardView.cardElevation = 10F
cardView.preventCornerOverlap = true
cardView.useCompatPadding = true
linLayout.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 160)
linLayout.orientation = LinearLayout.HORIZONTAL
tv.text = "test\nRaum abc"
// TODO make lesson card an seperate oject
//var lessonCardView = LessonCardView(context!!, null)

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close