Skip to content

Commit

Permalink
fix: remove accidental double extension, made sure to use AppTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
GaeaKat committed Nov 27, 2024
1 parent f4399eb commit 1e0e962
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.ui.theme.AppTheme

@Composable
fun AddBuildingLevelsButton(lastLevels: Int, lastRoofLevels: Int?,modifier: Modifier = Modifier){
Expand Down Expand Up @@ -57,5 +58,7 @@ fun AddBuildingLevelsButton(lastLevels: Int, lastRoofLevels: Int?,modifier: Modi
name = "Add Building Levels Button"
)
fun PreviewAddBuildingLevelsButton(){
AddBuildingLevelsButton(3,1)
AppTheme {
AddBuildingLevelsButton(3, 1)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign
import androidx.core.text.isDigitsOnly
import de.westnordost.streetcomplete.util.ktx.conditional
import de.westnordost.streetcomplete.ui.ktx.conditional
import de.westnordost.streetcomplete.ui.theme.AppTheme

@Composable
fun AddBuildingLevelsFormControl(
Expand Down Expand Up @@ -152,15 +153,17 @@ fun AddBuildingLevelsFormControl(
fun PreviewAddBuildingLevelsFormControl() {
var regularLevels = remember { mutableStateOf("55") }
var roofLevels = remember { mutableStateOf("55") }
AddBuildingLevelsFormControl(
regularLevels,
roofLevels,
buildingLevels = listOf(
BuildingLevelsAnswer(5, 2),
BuildingLevelsAnswer(4, 1),
BuildingLevelsAnswer(3, 0)
AppTheme {
AddBuildingLevelsFormControl(
regularLevels,
roofLevels,
buildingLevels = listOf(
BuildingLevelsAnswer(5, 2),
BuildingLevelsAnswer(4, 1),
BuildingLevelsAnswer(3, 0)
)
)
)
}
}

class AddBuildingLevelsForm : AbstractOsmQuestForm<BuildingLevelsAnswer>() {
Expand Down Expand Up @@ -190,12 +193,14 @@ class AddBuildingLevelsForm : AbstractOsmQuestForm<BuildingLevelsAnswer>() {
binding.questBuildingLevelsBase.setContent {
regularLevels = rememberSaveable { mutableStateOf(if(element.tags["building:levels"]!=null) element.tags["building:levels"].toString() else "") }
roofLevels = rememberSaveable { mutableStateOf(if(element.tags["roof:levels"]!=null) element.tags["roof:levels"].toString() else "") }
AddBuildingLevelsFormControl(
regularLevels,
roofLevels,
onFormChanged = { checkIsFormComplete() },
buildingLevels = lastPickedAnswers
)
AppTheme {
AddBuildingLevelsFormControl(
regularLevels,
roofLevels,
onFormChanged = { checkIsFormComplete() },
buildingLevels = lastPickedAnswers
)
}
}
}

Expand Down

This file was deleted.

0 comments on commit 1e0e962

Please sign in to comment.