Skip to content

Commit

Permalink
#19 업적 달성에 따라 유저 준비도 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
otcroz committed Sep 13, 2022
1 parent 792ae9d commit 282dee5
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ class AchieveActivity : AppCompatActivity() {
binding = ActivityAchieveBinding.inflate(layoutInflater)
setContentView(binding.root)

binding.pbAchieveTodo.progress = 30
/* 준비도: progressBar */
var clearCount = 0
val checkedArray = SaveSharedPreference.getAchieve(this)!!
for(i in 0 until checkedArray.size){
if(checkedArray[i]) clearCount++
if(i == checkedArray.size - 1){ // 마지막 인덱스일 때
// 준비도 반영하기
val ratio = (clearCount.toFloat() / 14)
Log.d("mobileApp", "$ratio")
binding.pbAchieveTodo.progress = (ratio * 100).toInt()
}
}

/*
binding.btn.setOnClickListener { view ->
Expand Down

0 comments on commit 282dee5

Please sign in to comment.