Skip to content

Commit

Permalink
[refact] : 유리 코리 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
jihyun0v0 committed Jan 3, 2024
1 parent 11d818a commit 679033c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ object UsageGoalsModule {
@Provides
@Singleton
fun provideUsageGoalModels(): List<UsageGoalModel> {
return listOf(
val usageGoalList = listOf(
UsageGoalModel("total", 201519990),
UsageGoalModel("com.kakao.talk", 15686 * 2),
UsageGoalModel("com.google.android.gms", 7134),
UsageGoalModel("com.google.android.youtube", 71349),
UsageGoalModel("com.android.chrome", 39445),
)
return usageGoalList
}

@Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ class StaticsViewModel
init {
val (startTime, endTime) = getCurrentDayStartEndEpochMillis()
getStatics(startTime, endTime)
// for (i in usageStatList.value) {
// Log.d("app name", i.packageName)
// Log.d("total time", i.totalTimeInForeground.toString())
// Log.d("goal time", i.goalTime.toString())
// }
}

private fun getStatics(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class UsageStaticsTotalViewHolder(
) :
RecyclerView.ViewHolder(binding.root) {
fun onBind(usageStatAndGoal: UsageStatAndGoal) {
binding.tvStaticsHour.text = convertTimeToString(usageStatAndGoal.goalTime)
binding.pbStatics.setProgress(getUsedPercentage(usageStatAndGoal.totalTimeInForeground, usageStatAndGoal.goalTime))
binding.tvStaticsLeftHour.text = getLeftTimeInString(usageStatAndGoal.totalTimeInForeground, usageStatAndGoal.goalTime)
binding.run {
tvStaticsHour.text = convertTimeToString(usageStatAndGoal.goalTime)
pbStatics.setProgress(getUsedPercentage(usageStatAndGoal.totalTimeInForeground, usageStatAndGoal.goalTime))
tvStaticsLeftHour.text = getLeftTimeInString(usageStatAndGoal.totalTimeInForeground, usageStatAndGoal.goalTime)
}
}
}

0 comments on commit 679033c

Please sign in to comment.