Compare commits

...

3 Commits

23 changed files with 107 additions and 49 deletions

View File

@ -1,55 +1,29 @@
# Kalkulator BMI 📱⚖️ Kalkulator BMI
**Raihan Ariq Muzakki (202310715297)** ===============
**F5A5 Mobile Programming**
Aplikasi **Kalkulator BMI** ini dikembangkan menggunakan **Android Studio + Jetpack Compose** dengan fokus pada akurasi perhitungan, pengalaman pengguna yang sederhana, serta dukungan dua standar pengukuran: **SI (kg/m²)** dan **USC (lbs/in²)**. Raihan Ariq Muzakki (202310715297)
**F5A5 Mobile Programming**
--- Petunjuk lebih detil dapat dibaca di
## ✨ Fitur Utama
- ✅ Perhitungan BMI berdasarkan dua standar (SI dan USC)
- ✅ Reset nilai input otomatis menggunakan **LaunchedEffect** saat pengguna berpindah standar
- ✅ Penentuan kategori BMI dengan kondisi yang lebih bersih & mudah dipahami
- ✅ Desain UI memakai Compose: gambar atau icon, dan tombol aksi (Calculate & Clear)
- ✅ Termasuk **Unit Testing** untuk fungsi perhitungan BMI
---
## 📘 Dokumentasi
Petunjuk detail dapat dibaca di:
https://docs.google.com/document/d/1iGiC0Bg3Bdcd2Maq45TYkCDUkZ5Ql51E/edit?rtpof=true https://docs.google.com/document/d/1iGiC0Bg3Bdcd2Maq45TYkCDUkZ5Ql51E/edit?rtpof=true
Starter dimodifikasi dan terinspirasi dari: Starter dimodifikasi dan terinspirasi dari:
https://developer.android.com/codelabs/basic-android-compose-calculate-tip#0 https://developer.android.com/codelabs/basic-android-compose-calculate-tip#0
--- Referensi:
- [kotlin.math](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.math/)
- [Calculate the Power of a Number in Kotlin](https://www.baeldung.com/kotlin/power-of-a-number)
- [Centimeters to Inches](https://www.splashlearn.com/math-vocabulary/cm-to-inches)
- [Kilograms to Pound](https://convertlive.com/id/u/mengkonversi/kilo/ke/pound)
- [Unit Testing](https://medium.com/@deonolarewaju/introduction-to-unit-testing-in-android-kotlin-4331eb2366a9)
- [Icon PNG](https://www.flaticon.com/)
## 🔧 Referensi
- Kotlin Math Library
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.math/
- Perhitungan pangkat pada Kotlin
https://www.baeldung.com/kotlin/power-of-a-number
- Konversi cm → inch
https://www.splashlearn.com/math-vocabulary/cm-to-inches
- Konversi kg → lbs
https://convertlive.com/id/u/mengkonversi/kilo/ke/pound
- Unit Testing pada Android
https://medium.com/@deonolarewaju/introduction-to-unit-testing-in-android-kotlin-4331eb2366a9
- Ikon PNG
https://www.flaticon.com/
--- Dibantu oleh [Claude AI](https://claude.ai/share/a3d9c1c9-9766-45f8-8fee-c0d7c4676ab1) dan [ChatGPT](https://chatgpt.com/share/690ce7bb-ab84-8012-9d44-2fded8e2d6d6) :
- Mengubah NaN yang muncul di tampilan menjadi 0, sebelum kalkulasi.
## 🤝 Kontribusi AI - Membuat Format Angka Desimal (1 angka dibelakang koma)
Pengembangan aplikasi ini turut dibantu oleh: - Membuat Perhitungan sesuai dengan Standar Rumus BMI yang Diinginkan (USC atau SI)
- **Claude AI** - Membuat LaunchedEffect untuk Reset Nilai Input Ketika Berpindah Standar Rumus BMI
- **ChatGPT** - Mengubah Condition Statement untuk Penentuan Kategori BMI agar lebih Clean
- Membantu pembuatan Class Unit Testing untuk fungsi sampai Implementasi
Kontribusi yang diberikan: - Desain tata letak, Menambahkan gambar dan button (kalkulasi dan clear)
- Penanganan nilai *NaN → 0*
- Format desimal
- Penerapan rumus BMI sesuai standar SI & USC
- *LaunchedEffect* untuk reset input
- Simplifikasi kondisi kategori BMI
- Penyusunan Unit Testing
- Penyempurnaan layout, penambahan ikon, dan tombol aksi

View File

@ -20,9 +20,9 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/bmi_icon"
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/bmi_icon_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.TipTime" android:theme="@style/Theme.TipTime"
tools:targetApi="33"> tools:targetApi="33">

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/bmi_icon_background"/>
<foreground android:drawable="@mipmap/bmi_icon_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/bmi_icon_background"/>
<foreground android:drawable="@mipmap/bmi_icon_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB