-
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
Showing
9 changed files
with
70 additions
and
19 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
13 changes: 13 additions & 0 deletions
13
...s/src/main/java/com/jacob/wakatimeapp/details/domain/models/DetailedProjectStatsUiData.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,13 @@ | ||
package com.jacob.wakatimeapp.details.domain.models | ||
|
||
import com.jacob.wakatimeapp.core.models.Time | ||
import kotlinx.datetime.LocalDate | ||
|
||
data class DetailedProjectStatsUiData( | ||
val totalProjectTime: TotalProjectTime, | ||
val averageTime: Time, | ||
val dailyProjectStats: Map<LocalDate, Time>, | ||
val languages: List<String>, | ||
val operatingSystems: List<String>, | ||
val editors: List<String>, | ||
) |
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
20 changes: 19 additions & 1 deletion
20
details/src/main/java/com/jacob/wakatimeapp/details/ui/DetailsPageViewModel.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,8 +1,26 @@ | ||
package com.jacob.wakatimeapp.details.ui | ||
|
||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.viewModelScope | ||
import com.jacob.wakatimeapp.details.domain.usecases.GetProjectStatsUC | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.asStateFlow | ||
import kotlinx.coroutines.launch | ||
import timber.log.Timber | ||
|
||
@HiltViewModel | ||
class DetailsPageViewModel @Inject constructor() : ViewModel() | ||
internal class DetailsPageViewModel @Inject constructor( | ||
private val getProjectStatsUC: GetProjectStatsUC, | ||
) : ViewModel() { | ||
private val _viewState = MutableStateFlow<DetailsPageViewState>(DetailsPageViewState.Loading) | ||
val viewState = _viewState.asStateFlow() | ||
|
||
init { | ||
viewModelScope.launch { | ||
val data = getProjectStatsUC("WakaTimeApp.Compose") | ||
Timber.w(data.toString()) | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
details/src/main/java/com/jacob/wakatimeapp/details/ui/DetailsPageViewState.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,9 @@ | ||
package com.jacob.wakatimeapp.details.ui | ||
|
||
sealed class DetailsPageViewState { | ||
object Loading : DetailsPageViewState() | ||
|
||
data class Loaded(val detUiDetailsPageViewState: DetailsPageViewState) : DetailsPageViewState() | ||
|
||
data class Error(val error: com.jacob.wakatimeapp.core.models.Error) : DetailsPageViewState() | ||
} |