package com.dano.test1 import android.view.View import android.widget.* import android.text.Html import kotlinx.coroutines.* import android.util.TypedValue import android.widget.TextView import androidx.core.widget.TextViewCompat class HandlerLastPage( private val answers: Map, private val languageID: String, private val goToNextQuestion: () -> Unit, private val goToPreviousQuestion: () -> Unit, private val saveAnswersToDatabase: suspend (Map) -> Unit ) : QuestionHandler { private lateinit var currentQuestion: QuestionItem.LastPage private lateinit var layout: View private val minLoadingTimeMs = 2000L // Minimum loading time in milliseconds (2 seconds) override fun bind(layout: View, question: QuestionItem) { this.layout = layout currentQuestion = question as QuestionItem.LastPage val titleTv = layout.findViewById(R.id.textView) val questionTv = layout.findViewById(R.id.question) // Texte setzen titleTv.text = LanguageManager.getText(languageID, currentQuestion.textKey) questionTv.text = Html.fromHtml( LanguageManager.getText(languageID, currentQuestion.question), Html.FROM_HTML_MODE_LEGACY ) // ==== Schriftgrößen prozentual zur Bildschirmhöhe ==== // Passe die Faktoren bei Bedarf an (z. B. 0.032f für etwas größer) setTextSizePercentOfScreenHeight(titleTv, 0.03f) setTextSizePercentOfScreenHeight(questionTv, 0.03f) // ===================================================== // Buttons layout.findViewById