-
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.
- Loading branch information
1 parent
34e7fa1
commit 88d1487
Showing
13 changed files
with
480 additions
and
355 deletions.
There are no files selected for viewing
282 changes: 145 additions & 137 deletions
282
...e/home/filtersetting/FilterBottomSheet.kt → ...policy/filtersetting/FilterBottomSheet.kt
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...olicylist/uistate/PolicyFiltersUiModel.kt → ...icy/filtersetting/PolicyFiltersUiModel.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
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,12 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M21.25,12H8.895M4.534,12H2.75M4.534,12C4.534,11.422 4.764,10.867 5.173,10.458C5.581,10.05 6.136,9.82 6.714,9.82C7.292,9.82 7.847,10.05 8.255,10.458C8.664,10.867 8.894,11.422 8.894,12C8.894,12.578 8.664,13.133 8.255,13.542C7.847,13.95 7.292,14.18 6.714,14.18C6.136,14.18 5.581,13.95 5.173,13.542C4.764,13.133 4.534,12.578 4.534,12ZM21.25,18.607H15.502M15.502,18.607C15.502,19.185 15.272,19.74 14.863,20.149C14.454,20.558 13.899,20.788 13.321,20.788C12.743,20.788 12.188,20.557 11.78,20.149C11.371,19.74 11.141,19.185 11.141,18.607M15.502,18.607C15.502,18.029 15.272,17.475 14.863,17.066C14.454,16.657 13.899,16.427 13.321,16.427C12.743,16.427 12.188,16.657 11.78,17.066C11.371,17.474 11.141,18.029 11.141,18.607M11.141,18.607H2.75M21.25,5.393H18.145M13.784,5.393H2.75M13.784,5.393C13.784,4.815 14.014,4.26 14.422,3.852C14.831,3.443 15.386,3.213 15.964,3.213C16.25,3.213 16.534,3.269 16.798,3.379C17.063,3.489 17.303,3.649 17.506,3.852C17.708,4.054 17.868,4.294 17.978,4.559C18.088,4.823 18.144,5.107 18.144,5.393C18.144,5.679 18.088,5.963 17.978,6.227C17.868,6.492 17.708,6.732 17.506,6.935C17.303,7.137 17.063,7.298 16.798,7.407C16.534,7.517 16.25,7.573 15.964,7.573C15.386,7.573 14.831,7.343 14.422,6.935C14.014,6.526 13.784,5.971 13.784,5.393Z" | ||
android:strokeWidth="1.5" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#9A70E2" | ||
android:strokeLineCap="round"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M6.292,6.318C6.479,6.131 6.733,6.027 6.997,6.027C7.261,6.027 7.515,6.131 7.702,6.318L11.987,10.593L16.271,6.318C16.393,6.187 16.548,6.091 16.72,6.04C16.892,5.99 17.075,5.987 17.248,6.031C17.422,6.075 17.58,6.166 17.707,6.292C17.834,6.419 17.924,6.577 17.968,6.751C18.012,6.924 18.009,7.106 17.959,7.277C17.908,7.449 17.813,7.603 17.681,7.725L13.397,12.001L17.681,16.276C17.813,16.398 17.909,16.552 17.959,16.724C18.01,16.896 18.013,17.078 17.969,17.251C17.924,17.424 17.834,17.583 17.707,17.709C17.58,17.835 17.422,17.925 17.248,17.969C17.074,18.013 16.892,18.01 16.72,17.96C16.548,17.91 16.393,17.814 16.271,17.683L11.987,13.408L7.702,17.683C7.513,17.859 7.263,17.955 7.004,17.951C6.746,17.946 6.499,17.842 6.316,17.66C6.133,17.477 6.029,17.231 6.024,16.973C6.02,16.715 6.116,16.465 6.292,16.276L10.576,12.001L6.292,7.725C6.105,7.538 6,7.285 6,7.022C6,6.758 6.105,6.505 6.292,6.318Z" | ||
android:fillColor="#000000"/> | ||
</vector> |
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
53 changes: 53 additions & 0 deletions
53
feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeViewModel.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,63 @@ | ||
package com.withpeace.withpeace.feature.home | ||
|
||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.viewModelScope | ||
import com.withpeace.withpeace.core.domain.model.policy.PolicyFilters | ||
import com.withpeace.withpeace.core.ui.policy.ClassificationUiModel | ||
import com.withpeace.withpeace.core.ui.policy.RegionUiModel | ||
import com.withpeace.withpeace.core.ui.policy.filtersetting.PolicyFiltersUiModel | ||
import com.withpeace.withpeace.core.ui.policy.filtersetting.toDomain | ||
import com.withpeace.withpeace.core.ui.policy.filtersetting.toUiModel | ||
import com.withpeace.withpeace.core.ui.policy.toDomain | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.SharingStarted | ||
import kotlinx.coroutines.flow.StateFlow | ||
import kotlinx.coroutines.flow.map | ||
import kotlinx.coroutines.flow.stateIn | ||
import kotlinx.coroutines.flow.update | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class HomeViewModel @Inject constructor( | ||
) : ViewModel() { | ||
private val _selectingFilters = MutableStateFlow(PolicyFilters()) | ||
val selectingFilters: StateFlow<PolicyFiltersUiModel> = | ||
_selectingFilters.map { it.toUiModel() }.stateIn( | ||
scope = viewModelScope, | ||
SharingStarted.WhileSubscribed(), | ||
PolicyFiltersUiModel(), | ||
) | ||
|
||
private var completedFilters = PolicyFilters() | ||
|
||
init { | ||
} | ||
|
||
fun onCheckClassification(classification: ClassificationUiModel) { | ||
_selectingFilters.update { | ||
it.updateClassification(classification.toDomain()) | ||
} | ||
} | ||
|
||
fun onCheckRegion(region: RegionUiModel) { | ||
_selectingFilters.update { | ||
it.updateRegion(region.toDomain()) | ||
} | ||
} | ||
|
||
fun onCompleteFilter() { | ||
completedFilters = selectingFilters.value.toDomain() | ||
// api | ||
} | ||
|
||
fun onCancelFilter() { | ||
_selectingFilters.update { completedFilters } | ||
} | ||
|
||
fun onFilterAllOff() { | ||
_selectingFilters.update { | ||
it.removeAll() | ||
} | ||
} | ||
} |
36 changes: 0 additions & 36 deletions
36
...main/java/com/withpeace/withpeace/feature/home/filtersetting/uistate/FilterListUiState.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.