From 282dee5bbef4b3a09af317a9f16278e5f8737d43 Mon Sep 17 00:00:00 2001 From: otcroz Date: Wed, 14 Sep 2022 02:22:02 +0900 Subject: [PATCH] =?UTF-8?q?#19=20=EC=97=85=EC=A0=81=20=EB=8B=AC=EC=84=B1?= =?UTF-8?q?=EC=97=90=20=EB=94=B0=EB=9D=BC=20=EC=9C=A0=EC=A0=80=20=EC=A4=80?= =?UTF-8?q?=EB=B9=84=EB=8F=84=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shape_up_2022/achieve/AchieveActivity.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SHAPEUP2022/app/src/main/java/com/example/shape_up_2022/achieve/AchieveActivity.kt b/SHAPEUP2022/app/src/main/java/com/example/shape_up_2022/achieve/AchieveActivity.kt index f78d206..fa2355c 100644 --- a/SHAPEUP2022/app/src/main/java/com/example/shape_up_2022/achieve/AchieveActivity.kt +++ b/SHAPEUP2022/app/src/main/java/com/example/shape_up_2022/achieve/AchieveActivity.kt @@ -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 ->