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