Skip to content

Commit

Permalink
#298 [ui] 책중복 다이얼로그 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
2zerozu committed Feb 25, 2024
1 parent 919e673 commit bafd43f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
package com.sopt.peekabookaos.presentation.createBook

import android.content.Intent
import android.os.Handler
import android.os.Looper
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.sopt.peekabookaos.R
import com.sopt.peekabookaos.domain.entity.Book
import com.sopt.peekabookaos.domain.usecase.PostCreateBookUseCase
import com.sopt.peekabookaos.presentation.login.LoginActivity
import com.sopt.peekabookaos.util.ToastMessageUtil
import com.sopt.peekabookaos.util.UiEvent
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import retrofit2.HttpException
import timber.log.Timber
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ data class WarningDialogContent(
cancel = context.getString(R.string.warning_dialog_cancel),
confirm = context.getString(R.string.warning_dialog_unfollow)
)

fun getWarningDuplicateBook(context: Context) : WarningDialogContent =
WarningDialogContent(
title = context.getString(R.string.warning_dialog_duplicate_book),
cancel = context.getString(R.string.warning_dialog_cancel),
confirm = context.getString(R.string.warning_dialog_unfollow)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class WarningDialogFragment : DialogFragment() {

WarningType.WARNING_UNFOLLOW ->
WarningDialogContent().getWarningUnfollow(requireContext(), follower)

WarningType.WARNING_DUPLICATE_BOOK ->
WarningDialogContent().getWarningDuplicateBook(requireContext())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ enum class WarningType {
WARNING_RECOMMEND,
WARNING_DELETE_BOOK,
WARNING_DELETE_FOLLOWER,
WARNING_UNFOLLOW
WARNING_UNFOLLOW,
WARNING_DUPLICATE_BOOK
}
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,12 @@
<string name="warning_dialog_delete_follower_title">%s님을\n정말 삭제하시겠어요?</string>
<string name="warning_dialog_delete_book_title">해당 책을\n정말 삭제하시겠습니까?</string>
<string name="warning_dialog_unfollow_title">%s님을\n 언팔로우 하시겠어요?</string>
<string name="warning_dialog_duplicate_book">이미 내 책장에 있는 도서에요.\n하나 더 추가하시겠어요?</string>
<string name="warning_dialog_cancel">취소하기</string>
<string name="warning_dialog_recommend">추천하기</string>
<string name="warning_dialog_delete">삭제하기</string>
<string name="warning_dialog_unfollow">언팔로우</string>
<string name="warning_dialog_add">추가하기</string>

<!-- block -->
<string name="block_title">차단된 계정</string>
Expand Down

0 comments on commit bafd43f

Please sign in to comment.