Initialer Upload neues Unity-Projekt

This commit is contained in:
Daniel Ocks
2025-07-25 11:17:02 +02:00
commit f7a629ccde
91 changed files with 8743 additions and 0 deletions

View File

@ -0,0 +1,52 @@
package com.dano.test1
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
private lateinit var openingScreenHandler: HandlerOpeningScreen
var isInQuestionnaire: Boolean = false
var isFirstQuestionnairePage: Boolean = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Initialize the opening screen handler and show the opening screen
openingScreenHandler = HandlerOpeningScreen(this)
openingScreenHandler.init()
}
/**
* Starts the given questionnaire and attaches it to this activity.
* @param questionnaire The questionnaire instance to start.
* @param languageID The language identifier for localization.
*/
fun startQuestionnaire(questionnaire: QuestionnaireBase<*>, languageID: String) {
isInQuestionnaire = true
isFirstQuestionnairePage = true
questionnaire.attach(this, languageID)
questionnaire.startQuestionnaire()
}
/**
* Handle the back button press.
* If the openingScreenHandler can handle it, do not call super.
* Otherwise, call the default back press behavior.
*/
override fun onBackPressed() {
if (!openingScreenHandler.onBackPressed()) {
super.onBackPressed()
}
}
/**
* Finish the questionnaire and return to the opening screen.
*/
fun finishQuestionnaire() {
// For example, switch back to the opening screen:
isInQuestionnaire = false
isFirstQuestionnairePage = false
openingScreenHandler.init()
}
}