-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
228 additions
and
17 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
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
44 changes: 44 additions & 0 deletions
44
presentation/src/main/java/com/d83t/bpm/presentation/ui/main/add/MainAddBottomSheet.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,44 @@ | ||
package com.d83t.bpm.presentation.ui.main.add | ||
|
||
import androidx.fragment.app.viewModels | ||
import com.d83t.bpm.presentation.R | ||
import com.d83t.bpm.presentation.base.BaseBottomSheetFragment | ||
import com.d83t.bpm.presentation.databinding.BottomsheetMainAddBinding | ||
import com.d83t.bpm.presentation.util.repeatCallDefaultOnStarted | ||
import com.d83t.bpm.presentation.util.showToast | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class MainAddBottomSheet : | ||
BaseBottomSheetFragment<BottomsheetMainAddBinding>(BottomsheetMainAddBinding::inflate) { | ||
|
||
override fun getTheme(): Int = R.style.DdoreumBottomSheetDialog | ||
|
||
override val viewModel: MainAddViewModel by viewModels() | ||
|
||
override fun initLayout() { | ||
bind { | ||
vm = viewModel | ||
lifecycleOwner = viewLifecycleOwner | ||
} | ||
} | ||
|
||
override fun setupCollect() { | ||
repeatCallDefaultOnStarted { | ||
viewModel.event.collect { event -> | ||
when (event) { | ||
MainAddViewEvent.Click -> { | ||
requireContext().showToast("오픈 예정입니다!") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
|
||
fun newInstance(): MainAddBottomSheet { | ||
return MainAddBottomSheet() | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
presentation/src/main/java/com/d83t/bpm/presentation/ui/main/add/MainAddViewEvent.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,5 @@ | ||
package com.d83t.bpm.presentation.ui.main.add | ||
|
||
sealed interface MainAddViewEvent { | ||
object Click : MainAddViewEvent | ||
} |
24 changes: 24 additions & 0 deletions
24
presentation/src/main/java/com/d83t/bpm/presentation/ui/main/add/MainAddViewModel.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,24 @@ | ||
package com.d83t.bpm.presentation.ui.main.add | ||
|
||
import androidx.lifecycle.viewModelScope | ||
import com.d83t.bpm.presentation.base.BaseViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
import kotlinx.coroutines.flow.MutableSharedFlow | ||
import kotlinx.coroutines.flow.SharedFlow | ||
import kotlinx.coroutines.launch | ||
|
||
@HiltViewModel | ||
class MainAddViewModel @Inject constructor() : BaseViewModel() { | ||
|
||
private val _event = MutableSharedFlow<MainAddViewEvent>() | ||
val event: SharedFlow<MainAddViewEvent> | ||
get() = _event | ||
|
||
fun clickDisable() { | ||
viewModelScope.launch { | ||
_event.emit(MainAddViewEvent.Click) | ||
} | ||
} | ||
|
||
} |
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
5 changes: 5 additions & 0 deletions
5
presentation/src/main/java/com/d83t/bpm/presentation/ui/main/mypage/MyPageViewEvent.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,5 @@ | ||
package com.d83t.bpm.presentation.ui.main.mypage | ||
|
||
sealed interface MyPageViewEvent { | ||
object Click : MyPageViewEvent | ||
} |
13 changes: 13 additions & 0 deletions
13
presentation/src/main/java/com/d83t/bpm/presentation/ui/main/mypage/MyPageViewModel.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 |
---|---|---|
@@ -1,10 +1,23 @@ | ||
package com.d83t.bpm.presentation.ui.main.mypage | ||
|
||
import androidx.lifecycle.viewModelScope | ||
import com.d83t.bpm.presentation.base.BaseViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
import kotlinx.coroutines.flow.MutableSharedFlow | ||
import kotlinx.coroutines.flow.SharedFlow | ||
import kotlinx.coroutines.launch | ||
|
||
@HiltViewModel | ||
class MyPageViewModel @Inject constructor() : BaseViewModel() { | ||
|
||
private val _event = MutableSharedFlow<MyPageViewEvent>() | ||
val event: SharedFlow<MyPageViewEvent> | ||
get() = _event | ||
|
||
fun clickDisable() { | ||
viewModelScope.launch { | ||
_event.emit(MyPageViewEvent.Click) | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<solid android:color="@color/white" /> | ||
<corners | ||
android:topLeftRadius="12dp" | ||
android:topRightRadius="12dp" /> | ||
</shape> |
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,64 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:bind="http://schemas.android.com/bind"> | ||
|
||
<data> | ||
|
||
<variable | ||
name="vm" | ||
type="com.d83t.bpm.presentation.ui.main.add.MainAddViewModel" /> | ||
|
||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingBottom="40dp"> | ||
|
||
<View | ||
android:id="@+id/divider" | ||
android:layout_width="56dp" | ||
android:layout_height="4dp" | ||
android:layout_marginTop="12dp" | ||
android:background="@color/gray_05" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<include | ||
android:id="@+id/content_eyebody" | ||
layout="@layout/layout_mypage_content_disable" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/divider" | ||
app:onItemClick="@{vm.clickDisable}" | ||
bind:content="@{@string/main_add_eyebody}" /> | ||
|
||
<include | ||
android:id="@+id/content_share" | ||
layout="@layout/layout_mypage_content_disable" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/content_eyebody" | ||
app:onItemClick="@{vm.clickDisable}" | ||
bind:content="@{@string/mypage_content_history_bf}" /> | ||
|
||
<include | ||
android:id="@+id/content_ask" | ||
layout="@layout/layout_mypage_content_disable" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/content_share" | ||
app:onItemClick="@{vm.clickDisable}" | ||
bind:content="@{@string/mypage_content_history_bf}" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
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
Oops, something went wrong.