Skip to content

Commit

Permalink
Spotlight improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
therealbluepandabear committed Jul 24, 2022
1 parent 1f90b9e commit 3076407
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,39 @@ fun NewProjectFragment.startSpotLight() {
var current = 1

lyt.findViewById<Button>(R.id.layoutTarget_nextButton).setOnClickListener {
if (current == 1 && binding.fragmentNewCanvasProjectTitleTextInputEditText.text.toString().isNotBlank()) {7
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text = ""
current++
spotlight.next()
} else if (current == 2 && binding.fragmentNewCanvasWidthTextInputEditText.text.toString().isNotBlank()) {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text = ""
current++
spotlight.next()
} else if (current == 3 && binding.fragmentNewCanvasHeightTextInputEditText.text.toString().isNotBlank()) {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text = ""
spotlight.next()
} else {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text = "Please input a value"
when (current) {
1 -> {
if (binding.fragmentNewCanvasProjectTitleTextInputEditText.text.toString().isNotBlank()) {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text = ""
current++
spotlight.next()
} else {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text =
getString(R.string.spot_light_new_project_fragment_input_value, "'${getString(R.string.fragmentNewCanvas_project_name)}'")
}
}

2 -> {
if (binding.fragmentNewCanvasWidthTextInputEditText.text.toString().isNotBlank()) {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text = ""
current++
spotlight.next()
} else {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text =
getString(R.string.spot_light_new_project_fragment_input_value, "'${getString(R.string.fragmentNewColorPalette_width)}'")
}
}

3 -> {
if (binding.fragmentNewCanvasHeightTextInputEditText.text.toString().isNotBlank()) {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text = ""
current++
spotlight.next()
} else {
lyt.findViewById<TextView>(R.id.layoutTarget_errorText).text =
getString(R.string.spot_light_new_project_fragment_input_value,"'${getString(R.string.fragmentNewColorPalette_height)}'")
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
<string name="spot_light_new_project_fragment_2">Now, type in your desired width</string>
<string name="spot_light_new_project_fragment_3">Finally, set your project\'s height</string>
<string name="spot_light_new_project_fragment_4">Tap to create your project</string>
<string name="spot_light_new_project_fragment_input_value">Please input a value for %1$s</string>

<string name="spot_light_activity_canvas_1">Long tap on either your primary or secondary color to get to the color picker</string>
<string name="spot_light_activity_canvas_2">Here you will find your tools</string>
Expand Down

0 comments on commit 3076407

Please sign in to comment.