Skip to content

Commit

Permalink
Merge pull request #7 from GwonDongHyeon21/main
Browse files Browse the repository at this point in the history
ControlWard
  • Loading branch information
GwonDongHyeon21 authored Dec 6, 2024
2 parents c031023 + cec8d27 commit ec76f87
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 423 deletions.
2 changes: 1 addition & 1 deletion ControlWard/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ControlWard/.idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ControlWard/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ControlWard/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

329 changes: 0 additions & 329 deletions ControlWard/.idea/other.xml

This file was deleted.

17 changes: 17 additions & 0 deletions ControlWard/.idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ object Value {
)
val disasterCategory = listOf(
"인명피해" to BitmapDescriptorFactory.HUE_CYAN,
"가뭄" to BitmapDescriptorFactory.HUE_BLUE,
"지진" to BitmapDescriptorFactory.HUE_VIOLET,
"가뭄" to BitmapDescriptorFactory.HUE_ORANGE,
"지진" to BitmapDescriptorFactory.HUE_BLUE,
"화재" to BitmapDescriptorFactory.HUE_RED,
"수해" to BitmapDescriptorFactory.HUE_MAGENTA,
)
Expand Down

This file was deleted.

16 changes: 13 additions & 3 deletions ControlWard/app/src/main/java/com/example/controlward/ui/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import androidx.core.content.ContextCompat
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.example.controlward.R
import com.example.controlward.Value
import com.example.controlward.Value.disasterCategory
Expand All @@ -52,10 +54,12 @@ import com.google.maps.android.compose.MapUiSettings
import com.google.maps.android.compose.Marker
import com.google.maps.android.compose.MarkerState
import com.google.maps.android.compose.rememberCameraPositionState
import java.net.URLEncoder
import java.nio.charset.StandardCharsets

@SuppressLint("AutoboxingStateValueProperty")
@Composable
fun MainScreen() {
fun MainScreen(navController: NavController) {
val context = LocalContext.current
val cameraPositionState = rememberCameraPositionState {
position = CameraPosition.fromLatLngZoom(Value.location, 15f)
Expand Down Expand Up @@ -109,7 +113,13 @@ fun MainScreen() {
title = disaster.image,
snippet = disaster.text,
icon = customMarker(context, hue, alpha),
onInfoWindowClick = { },
onInfoWindowClick = {
val encodedImage = URLEncoder.encode(
disaster.image,
StandardCharsets.UTF_8.toString()
)
navController.navigate("DisasterDetailScreen/${encodedImage}/${disaster.text}")
},
)
}
}
Expand Down Expand Up @@ -217,5 +227,5 @@ fun customMarker(context: Context, hue: Float, alphaValue: Float): BitmapDescrip
@Preview(showBackground = true)
@Composable
fun PreviewMainLayout() {
MainScreen()
MainScreen(rememberNavController())
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fun TabScreen(navController: NavController) {
}
) {
when (pagerState.value) {
0 -> MainScreen()
0 -> MainScreen(navController)
1 -> DisasterListScreen(navController)
2 -> UserInfoScreen()
}
Expand Down

0 comments on commit ec76f87

Please sign in to comment.