File tree Expand file tree Collapse file tree 5 files changed +5
-10
lines changed
palm/src/main/kotlin/com/espressodev/gptmap/api/palm/impl
unsplash/src/main/kotlin/com/espressodev/gptmap/api/unsplash/impl
feature/screenshot/src/main/kotlin/com/espressodev/gptmap/feature/screenshot Expand file tree Collapse file tree 5 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 1
1
package com.espressodev.gptmap.api.palm.impl
2
2
3
- import android.util.Log
4
3
import com.espressodev.gptmap.api.palm.PalmApi
5
4
import com.espressodev.gptmap.api.palm.PalmService
6
5
import com.espressodev.gptmap.core.model.Location
7
- import com.espressodev.gptmap.core.model.ext.classTag
8
6
import com.espressodev.gptmap.core.model.PromptUtil.locationPreText
9
7
import kotlinx.coroutines.Dispatchers
10
8
import kotlinx.coroutines.withContext
@@ -14,7 +12,6 @@ class PalmServiceImpl(private val palmApi: PalmApi) : PalmService {
14
12
withContext(Dispatchers .IO ) {
15
13
try {
16
14
palmApi.generateText(locationPreText + textContent).toLocation().let {
17
- Log .d(classTag(), it.content.toString())
18
15
Result .success(it)
19
16
}
20
17
} catch (e: Exception ) {
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ class UnsplashServiceImpl(private val unsplashApi: UnsplashApi) : UnsplashServic
15
15
response.isSuccessful.let { success ->
16
16
when {
17
17
success -> {
18
- Log .d(classTag(), unsplashApi.getTwoPhotos(query).body().toString())
19
18
response.body()?.let {
20
19
Result .success(it)
21
20
} ? : Result .failure(Throwable (UnsplashApiException ()))
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ fun NavController.navigateToScreenshot(navOptions: NavOptions? = null) {
11
11
navigate(ScreenshotRoute , navOptions)
12
12
}
13
13
14
- fun NavGraphBuilder.screenshotScreen (popUp : () -> Unit , navigateToMap : () -> Unit ) {
14
+ fun NavGraphBuilder.screenshotScreen (popUp : () -> Unit ) {
15
15
composable(ScreenshotRoute ) {
16
- ScreenshotRoute (popUp = popUp, navigateToMap = navigateToMap )
16
+ ScreenshotRoute (popUp = popUp)
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ import com.espressodev.gptmap.core.designsystem.R.string as AppText
85
85
@Composable
86
86
fun ScreenshotRoute (
87
87
popUp : () -> Unit ,
88
- navigateToMap : () -> Unit ,
89
88
viewModel : ScreenshotViewModel = hiltViewModel(),
90
89
) {
91
90
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
@@ -115,7 +114,7 @@ fun ScreenshotRoute(
115
114
onSaveClick = {
116
115
viewModel.onEvent(
117
116
event = ScreenshotUiEvent .OnSaveClicked ,
118
- navigateToMap
117
+ navigate = popUp
119
118
)
120
119
}
121
120
)
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class ScreenshotViewModel @Inject constructor(
18
18
private val _uiState = MutableStateFlow (ScreenshotUiState ())
19
19
val uiState = _uiState .asStateFlow()
20
20
21
- fun onEvent (event : ScreenshotUiEvent , navigateToMap : () -> Unit = {}) {
21
+ fun onEvent (event : ScreenshotUiEvent , navigate : () -> Unit = {}) {
22
22
when (event) {
23
23
is ScreenshotUiEvent .OnBitmapChanged ->
24
24
_uiState .update { currentState ->
@@ -41,7 +41,7 @@ class ScreenshotViewModel @Inject constructor(
41
41
42
42
is ScreenshotUiEvent .OnTitleChanged -> _uiState .update { it.copy(title = event.value) }
43
43
44
- ScreenshotUiEvent .OnSaveClicked -> onSaveClick(navigateToMap )
44
+ ScreenshotUiEvent .OnSaveClicked -> onSaveClick(navigate )
45
45
}
46
46
}
47
47
You can’t perform that action at this time.
0 commit comments