Skip to content

Commit

Permalink
[CHORE/#93] 이미지 저장 이름 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
chattymin committed Jan 14, 2024
1 parent 352f2bd commit 77d387b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class TendencyResultActivity :
resources,
R.drawable.img_tendency_result_ari,
)
val imageFileName = DOWNLOAD_IMAGE_NAME
val imageFileName = DOWNLOAD_IMAGE_NAME.replace("%s", viewModel.tendencyId.value.toString())
val path = DOWNLOAD_PATH

val uploadFolder = Environment.getExternalStoragePublicDirectory(path)
Expand Down Expand Up @@ -212,6 +212,6 @@ class TendencyResultActivity :
companion object {
const val PERMISSION_REQUEST_CODE = 200
const val DOWNLOAD_PATH = "/Download/"
const val DOWNLOAD_IMAGE_NAME = "img_tendency_result.png"
const val DOWNLOAD_IMAGE_NAME = "img_tendency_result%s.png"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.going.presentation.tendency.result

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.going.domain.entity.ProfileMock
Expand All @@ -20,10 +21,13 @@ class TendencyResultViewModel @Inject constructor(
private val _userInfoState = MutableStateFlow<UiState<UserProfileRequestModel>>(UiState.Empty)
val userInfoState: StateFlow<UiState<UserProfileRequestModel>> = _userInfoState

val tendencyId = MutableLiveData(0)

fun getUserInfoState() {
viewModelScope.launch {
_userInfoState.value = UiState.Loading
profileRepository.getUserProfile().onSuccess {
tendencyId.value = it.result
_userInfoState.value = UiState.Success(it)
}.onFailure {
_userInfoState.value = UiState.Failure(it.message.toString())
Expand Down

0 comments on commit 77d387b

Please sign in to comment.