Layout fixes
This commit is contained in:
2
.idea/deploymentTargetSelector.xml
generated
2
.idea/deploymentTargetSelector.xml
generated
@ -4,7 +4,7 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2025-07-24T13:14:09.057647300Z">
|
||||
<DropdownSelection timestamp="2025-07-28T06:25:21.461295300Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=HA218GZY" />
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.dano.test1
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Color
|
||||
@ -10,7 +9,6 @@ import android.widget.*
|
||||
import kotlinx.coroutines.*
|
||||
import org.json.JSONArray
|
||||
import android.util.Log
|
||||
import java.util.Calendar
|
||||
|
||||
// Global constants and values
|
||||
var INTEGRATION_INDEX_POINTS: Int? = null
|
||||
@ -27,7 +25,6 @@ class HandlerOpeningScreen(private val activity: MainActivity) {
|
||||
private val dynamicButtons = mutableListOf<Button>()
|
||||
private val questionnaireFiles = mutableMapOf<Button, String>()
|
||||
private val buttonPoints: MutableMap<String, Int> = mutableMapOf()
|
||||
private var questionnaireOrder: List<String> = emptyList()
|
||||
private var questionnaireEntries: List<QuestionItem.QuestionnaireEntry> = emptyList()
|
||||
|
||||
fun init() {
|
||||
@ -245,7 +242,6 @@ class HandlerOpeningScreen(private val activity: MainActivity) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (nextIndex >= questionnaireEntries.size) {
|
||||
setButtonsEnabled(emptyList())
|
||||
val message = LanguageManager.getText(languageID, "questionnaires_finished")
|
||||
@ -257,13 +253,6 @@ class HandlerOpeningScreen(private val activity: MainActivity) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun resetToStartState() {
|
||||
GlobalValues.LAST_CLIENT_CODE = null
|
||||
editText.setText("")
|
||||
setButtonsEnabled(listOf(dynamicButtons.firstOrNull()).filterNotNull())
|
||||
}
|
||||
|
||||
private fun updateButtonTexts() {
|
||||
questionnaireFiles.forEach { (button, fileName) ->
|
||||
val key = fileName.substringAfter("questionnaire_").substringAfter("_").removeSuffix(".json")
|
||||
@ -290,16 +279,13 @@ class HandlerOpeningScreen(private val activity: MainActivity) {
|
||||
|
||||
private fun setButtonsEnabled(enabledButtons: List<Button>) {
|
||||
questionnaireFiles.keys.forEach { button ->
|
||||
val fileName = questionnaireFiles[button] ?: ""
|
||||
val shouldDisable = fileName.contains("questionnaire_5_final_interview.json", ignoreCase = true) &&
|
||||
buttonPoints.entries.firstOrNull { it.key.contains("questionnaire_2_rhs", ignoreCase = true) }?.value in 13..36
|
||||
|
||||
button.isEnabled = enabledButtons.contains(button) && !shouldDisable
|
||||
button.isEnabled = enabledButtons.contains(button)
|
||||
button.alpha = if (button.isEnabled) 1.0f else 0.5f
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun startQuestionnaireForButton(button: Button) {
|
||||
val fileName = questionnaireFiles[button] ?: return
|
||||
val questionnaire = QuestionnaireGeneric(fileName)
|
||||
@ -357,7 +343,6 @@ class HandlerOpeningScreen(private val activity: MainActivity) {
|
||||
println("Entry " + entry)
|
||||
println("Question " + questionKey)
|
||||
println("Answer " + answer.answerValue)
|
||||
//if (questionKey = "counsultation_decision" and answer.answerValue == "red")
|
||||
val answerText = rawAnswerText.trim().removePrefix("[").removeSuffix("]")
|
||||
|
||||
// PDF
|
||||
|
||||
@ -48,12 +48,12 @@
|
||||
android:id="@+id/loadButton"
|
||||
android:layout_width="166dp"
|
||||
android:layout_height="52dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.816"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.167" />
|
||||
app:layout_constraintTop_toBottomOf="@id/editText"
|
||||
app:layout_constraintStart_toStartOf="@id/editText"
|
||||
app:layout_constraintEnd_toEndOf="@id/editText"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
|
||||
Reference in New Issue
Block a user