-
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 #45 from Nexters/feature/develop-remained-feature
Beta 출시 피쳐 구현
- Loading branch information
Showing
68 changed files
with
1,540 additions
and
471 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
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/keyme/app/ui/KeymeAppStateViewModel.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,22 @@ | ||
package com.keyme.app.ui | ||
|
||
import com.keyme.domain.repository.MyMemberInfoRepository | ||
import com.keyme.presentation.BaseViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.flow.SharingStarted | ||
import kotlinx.coroutines.flow.stateIn | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class KeymeAppStateViewModel @Inject constructor( | ||
private val myMemberInfoRepository: MyMemberInfoRepository, | ||
) : BaseViewModel() { | ||
|
||
val myMemberInfoState = myMemberInfoRepository | ||
.getInfo() | ||
.stateIn( | ||
started = SharingStarted.Eagerly, | ||
scope = baseViewModelScope, | ||
initialValue = 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
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
32 changes: 32 additions & 0 deletions
32
data/src/main/java/com/keyme/data/local/datasource/TutorialDataSource.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,32 @@ | ||
package com.keyme.data.local.datasource | ||
|
||
import android.content.Context | ||
import androidx.datastore.preferences.core.booleanPreferencesKey | ||
import androidx.datastore.preferences.core.edit | ||
import com.keyme.data.local.di.ApplicationScope | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.flow.map | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
class TutorialDataSource @Inject constructor( | ||
@ApplicationContext context: Context, | ||
@ApplicationScope private val applicationScope: CoroutineScope, | ||
) { | ||
private val dataStore = context.dataStore | ||
|
||
val isLearned = dataStore.data.map { it[KEY_TUTORIAL_LEARNED] ?: false } | ||
|
||
fun setLearned(value: Boolean) { | ||
applicationScope.launch { | ||
dataStore.edit { | ||
it[KEY_TUTORIAL_LEARNED] = value | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
private val KEY_TUTORIAL_LEARNED = booleanPreferencesKey("tutorial_learned") | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
data/src/main/java/com/keyme/data/local/repositoryimpl/TutorialRepositoryImpl.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,18 @@ | ||
package com.keyme.data.local.repositoryimpl | ||
|
||
import com.keyme.data.local.datasource.TutorialDataSource | ||
import com.keyme.domain.repository.TutorialRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class TutorialRepositoryImpl @Inject constructor( | ||
private val tutorialDataSource: TutorialDataSource, | ||
) : TutorialRepository { | ||
override fun isLearned(): Flow<Boolean> { | ||
return tutorialDataSource.isLearned | ||
} | ||
|
||
override fun setLearned(value: Boolean) { | ||
tutorialDataSource.setLearned(value) | ||
} | ||
} |
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
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.