diff --git a/app/src/main/java/com/makaryostudio/lovebird/feature/diagnosis/DiagnosisActivity.kt b/app/src/main/java/com/makaryostudio/lovebird/feature/diagnosis/DiagnosisActivity.kt index 6db0f7e..51c1f54 100644 --- a/app/src/main/java/com/makaryostudio/lovebird/feature/diagnosis/DiagnosisActivity.kt +++ b/app/src/main/java/com/makaryostudio/lovebird/feature/diagnosis/DiagnosisActivity.kt @@ -1,7 +1,6 @@ package com.makaryostudio.lovebird.feature.diagnosis import android.os.Bundle -import android.widget.EditText import androidx.appcompat.app.AppCompatActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView diff --git a/app/src/main/java/com/makaryostudio/lovebird/feature/diagnosis/DiagnosisAdapter.kt b/app/src/main/java/com/makaryostudio/lovebird/feature/diagnosis/DiagnosisAdapter.kt index 0f807ec..3c3aebb 100644 --- a/app/src/main/java/com/makaryostudio/lovebird/feature/diagnosis/DiagnosisAdapter.kt +++ b/app/src/main/java/com/makaryostudio/lovebird/feature/diagnosis/DiagnosisAdapter.kt @@ -6,6 +6,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.CheckBox +import android.widget.Toast import androidx.recyclerview.widget.RecyclerView import com.makaryostudio.lovebird.R import com.makaryostudio.lovebird.feature.hasil.HasilActivity @@ -76,6 +77,11 @@ class DiagnosisAdapter internal constructor(private val context: Context) : gejala.isChecked = false mCheckedGejala.remove(gejala) inputGejala.remove(gejala.kodeGejala) + + if (mCheckedGejala.isEmpty()) { + Toast.makeText(context,"Pilih gejala yang dialami", Toast.LENGTH_SHORT).show() + + } } intent.putParcelableArrayListExtra("checked",mCheckedGejala) @@ -378,15 +384,15 @@ class DiagnosisAdapter internal constructor(private val context: Context) : } } - println("Diagnosa Penyakit : $penyakit") + println("Diagnosis Penyakit : $penyakit") println("Persentase CBR : $persentaseCBR") - intent.putExtra("penyakit", penyakit) intent.putExtra("solusi", solusi) intent.putExtra("pencegahan", pencegahan) intent.putExtra("persentaseCBR", persentaseCBR.toString()) + context.startActivity(intent) } } \ No newline at end of file diff --git a/app/src/main/java/com/makaryostudio/lovebird/feature/hasil/HasilActivity.kt b/app/src/main/java/com/makaryostudio/lovebird/feature/hasil/HasilActivity.kt index 842a57b..62d73dc 100644 --- a/app/src/main/java/com/makaryostudio/lovebird/feature/hasil/HasilActivity.kt +++ b/app/src/main/java/com/makaryostudio/lovebird/feature/hasil/HasilActivity.kt @@ -19,16 +19,18 @@ class HasilActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_hasil) + bindView() + textHasilDiagnosis = findViewById(R.id.text_hasil_diagnosis) textSolusi = findViewById(R.id.text_solusi) - textPencegahan = findViewById(R.id.title_pencegahan) + textPencegahan = findViewById(R.id.text_pencegahan) - val checked = intent.getParcelableExtra("checked") + val checked = intent.getParcelableArrayListExtra("checked") val penyakitBurung = intent.getStringExtra("penyakit") val solusi = intent.getStringExtra("solusi") val pencegahan = intent.getStringExtra("pencegahan") - val mListData: ArrayList = arrayListOf(checked) + val mListData: List = checked adapter.loadListData(mListData) @@ -36,7 +38,6 @@ class HasilActivity : AppCompatActivity() { textSolusi.text = solusi textPencegahan.text = pencegahan - bindView() } private fun bindView() { diff --git a/app/src/main/res/drawable/app_logo_upper.png b/app/src/main/res/drawable/app_logo_upper.png index d1f3770..adf9a14 100644 Binary files a/app/src/main/res/drawable/app_logo_upper.png and b/app/src/main/res/drawable/app_logo_upper.png differ diff --git a/app/src/main/res/drawable/ic_app_logo_upper.xml b/app/src/main/res/drawable/ic_app_logo_upper.xml new file mode 100644 index 0000000..53fea89 --- /dev/null +++ b/app/src/main/res/drawable/ic_app_logo_upper.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_diagnosis.xml b/app/src/main/res/layout/activity_diagnosis.xml index 3adac14..8a8ec03 100644 --- a/app/src/main/res/layout/activity_diagnosis.xml +++ b/app/src/main/res/layout/activity_diagnosis.xml @@ -7,13 +7,13 @@ tools:context=".feature.diagnosis.DiagnosisActivity"> + app:layout_constraintBottom_toTopOf="@id/guideline_horizontal_25" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> - + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.15" /> + app:layout_constraintTop_toBottomOf="@id/guideline_horizontal_15"> - + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:text="@string/diagnosis_pilih_gejala_text" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/primary_text" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toBottomOf="@id/title_pilih_gejala"> + diff --git a/app/src/main/res/layout/activity_hasil.xml b/app/src/main/res/layout/activity_hasil.xml index 37da358..017244d 100644 --- a/app/src/main/res/layout/activity_hasil.xml +++ b/app/src/main/res/layout/activity_hasil.xml @@ -10,7 +10,7 @@ android:layout_width="match_parent" android:layout_height="0dp" android:background="@color/colorPrimary" - app:layout_constraintBottom_toTopOf="@id/guideline_horizontal_top" + app:layout_constraintBottom_toTopOf="@id/guideline_horizontal_25" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> @@ -22,25 +22,22 @@ android:layout_marginStart="16dp" android:layout_marginTop="8dp" android:contentDescription="@string/diagnosis_logo_img_description" - android:src="@drawable/app_logo_upper" + android:src="@drawable/ic_app_logo_upper" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + - + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.15" /> + app:layout_constraintTop_toBottomOf="@id/guideline_horizontal_15"> + app:layout_constraintTop_toBottomOf="@id/guideline_horizontal_25"> + + + diff --git a/app/src/main/res/layout/activity_splash_screen.xml b/app/src/main/res/layout/activity_splash_screen.xml index 9adafbb..5cc21f3 100644 --- a/app/src/main/res/layout/activity_splash_screen.xml +++ b/app/src/main/res/layout/activity_splash_screen.xml @@ -10,12 +10,12 @@ android:layout_width="match_parent" android:layout_height="0dp" android:background="@color/colorPrimary" - app:layout_constraintBottom_toTopOf="@id/guideline_horizontal_top" + app:layout_constraintBottom_toTopOf="@id/guideline_horizontal_25" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> \ No newline at end of file