-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from hometerview/6/03_wrote_review
[마이페이지 화면 - 03] 내가 작성한 집터뷰 화면
- Loading branch information
Showing
39 changed files
with
1,547 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,4 +84,5 @@ class MainFragmentViewModelModule { | |
getFavoriteReviewsUseCase | ||
) | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/ftw/hometerview/di/usecase/MyReviewsUseCaseModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.ftw.hometerview.di.usecase | ||
|
||
import com.ftw.domain.usecase.myreviews.GetMyReviewsUseCase | ||
import com.ftw.domain.usecase.myreviews.GetMyReviewsUseCaseImpl | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
class MyReviewsUseCaseModule { | ||
@Provides | ||
@Singleton | ||
fun provideGetMyReviewsUseCase(): GetMyReviewsUseCase { | ||
return GetMyReviewsUseCaseImpl() | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
app/src/main/java/com/ftw/hometerview/ui/dialog/LogoutDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.ftw.hometerview.ui.dialog | ||
|
||
import android.graphics.Color | ||
import android.graphics.drawable.ColorDrawable | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.DialogFragment | ||
import com.ftw.hometerview.databinding.DialogLogoutBinding | ||
|
||
class LogoutDialog() : DialogFragment() { | ||
private var _binding: DialogLogoutBinding? = null | ||
private val binding get() = _binding!! | ||
|
||
interface Listener { | ||
fun onClickLogoutFromLogoutDialog() | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
_binding = DialogLogoutBinding.inflate(inflater, container, false) | ||
val view = binding.root | ||
dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) | ||
binding.logoutSelect.setOnClickListener { | ||
(parentFragment as? Listener)?.onClickLogoutFromLogoutDialog() | ||
} | ||
binding.logoutCancle.setOnClickListener { | ||
dismiss() | ||
} | ||
return view | ||
} | ||
|
||
override fun onDestroyView() { | ||
super.onDestroyView() | ||
_binding = null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
app/src/main/java/com/ftw/hometerview/ui/manageaccount/ManageAccountActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package com.ftw.hometerview.ui.manageaccount | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.databinding.DataBindingUtil | ||
import androidx.lifecycle.Lifecycle | ||
import androidx.lifecycle.lifecycleScope | ||
import androidx.lifecycle.repeatOnLifecycle | ||
import com.ftw.hometerview.R | ||
import com.ftw.hometerview.databinding.ActivityManageAccountBinding | ||
import com.ftw.hometerview.ui.withdrawal.WithdrawalActivity | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
@AndroidEntryPoint | ||
class ManageAccountActivity : AppCompatActivity() { | ||
|
||
companion object { | ||
fun newIntent(context: Context): Intent { | ||
return Intent(context, ManageAccountActivity::class.java) | ||
} | ||
} | ||
|
||
@Inject | ||
lateinit var viewModel: ManageAccountViewModel | ||
|
||
private lateinit var binding: ActivityManageAccountBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = DataBindingUtil.setContentView<ActivityManageAccountBinding>( | ||
this, | ||
R.layout.activity_manage_account | ||
).apply { | ||
viewModel = this@ManageAccountActivity.viewModel | ||
} | ||
observe() | ||
} | ||
|
||
|
||
private fun observe() { | ||
lifecycleScope.launch { | ||
repeatOnLifecycle(Lifecycle.State.STARTED) { | ||
viewModel.event.collect { event -> | ||
when (event) { | ||
ManageAccountViewModel.Event.None -> {} | ||
ManageAccountViewModel.Event.onClickServiceUseTerms -> onClickServiceUseTerms() | ||
ManageAccountViewModel.Event.onClickUseUserInfo -> onClickUseUserInfo() | ||
ManageAccountViewModel.Event.onClickLocationForService -> onClickLocationForService() | ||
ManageAccountViewModel.Event.onClickOpenSourceLibrary -> onClickOpenSourceLibrary() | ||
ManageAccountViewModel.Event.onClickWithdrawal -> onClickWithdrawal() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
private fun onClickServiceUseTerms() { } | ||
private fun onClickUseUserInfo() { } | ||
private fun onClickLocationForService() { } | ||
private fun onClickOpenSourceLibrary() { } | ||
private fun onClickWithdrawal() { | ||
startActivity(WithdrawalActivity.newIntent(this)) | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/ftw/hometerview/ui/manageaccount/ManageAccountViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.ftw.hometerview.ui.manageaccount | ||
|
||
import kotlinx.coroutines.flow.* | ||
|
||
class ManageAccountViewModel() { | ||
|
||
sealed class Event { | ||
object None : Event() | ||
object onClickServiceUseTerms : Event() | ||
object onClickUseUserInfo : Event() | ||
object onClickLocationForService : Event() | ||
object onClickOpenSourceLibrary : Event() | ||
object onClickWithdrawal : Event() | ||
} | ||
|
||
private val _event: MutableStateFlow<Event> = MutableStateFlow(Event.None) | ||
val event: StateFlow<Event> = _event.asStateFlow() | ||
|
||
fun onClickServiceUseTerms() { | ||
_event.value = Event.onClickServiceUseTerms | ||
_event.value = Event.None | ||
} | ||
fun onClickUseUserInfo() { | ||
_event.value = Event.onClickUseUserInfo | ||
_event.value = Event.None | ||
} | ||
fun onClickLocationForService() { | ||
_event.value = Event.onClickLocationForService | ||
_event.value = Event.None | ||
} | ||
fun onClickOpenSourceLibrary() { | ||
_event.value = Event.onClickOpenSourceLibrary | ||
_event.value = Event.None | ||
} | ||
fun onClickWithdrawal() { | ||
_event.value = Event.onClickWithdrawal | ||
_event.value = Event.None | ||
} | ||
} |
Oops, something went wrong.