feat: navigate to history screen from camera
This commit is contained in:
parent
99d76703e7
commit
b6f232f655
|
|
@ -111,6 +111,9 @@ fun CameraScreen(
|
|||
}
|
||||
|
||||
},
|
||||
onHistoryClick = {
|
||||
navController.navigate("history")
|
||||
}
|
||||
)
|
||||
Image(
|
||||
modifier = Modifier
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.util.Log
|
|||
import androidx.camera.view.LifecycleCameraController
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.core.extention.cropToSquare
|
||||
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.core.extention.resize
|
||||
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.data.repository.CameraRepository
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
|
@ -35,7 +36,7 @@ class CameraViewModel(
|
|||
cameraRepository.takePicture(controller, executor) { bitmap ->
|
||||
Log.d(TAG, "Picture taken, updating state")
|
||||
val croppedImage = cropToSquare(bitmap)
|
||||
_bitmap.value = croppedImage
|
||||
_bitmap.value = croppedImage.resize()
|
||||
// croppedImage.let {
|
||||
// diagnosisViewModel.analyzePlant(bitmap = it, prompt = prompt)
|
||||
// Log.d(TAG, "analyzePlant() called")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ fun CustomCameraShutter(
|
|||
modifier: Modifier = Modifier,
|
||||
onShutterClick: () -> Unit = {},
|
||||
onFlashClick: () -> Unit = {},
|
||||
onGalleryClick: () -> Unit = {}
|
||||
onHistoryClick: () -> Unit = {}
|
||||
) {
|
||||
Row(
|
||||
modifier = modifier
|
||||
|
|
@ -66,12 +66,12 @@ fun CustomCameraShutter(
|
|||
}
|
||||
|
||||
IconButton(
|
||||
onClick = onGalleryClick,
|
||||
onClick = onHistoryClick,
|
||||
|
||||
) {
|
||||
Icon(
|
||||
modifier = Modifier.size(32.dp),
|
||||
painter = painterResource(id = R.drawable.solar_gallery_broken),
|
||||
painter = painterResource(id = R.drawable.solar_history),
|
||||
contentDescription = "Gallery",
|
||||
tint = MaterialTheme.colorScheme.onBackground
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user