mirror of
https://github.com/pendragonnn/PalmGuard-App-Thesis.git
synced 2025-08-13 10:52:22 +00:00
feat: [detection & history] add empty history indicator on latest detection and history screen
This commit is contained in:
4
.idea/deploymentTargetSelector.xml
generated
4
.idea/deploymentTargetSelector.xml
generated
@ -4,10 +4,10 @@
|
|||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="app">
|
<SelectionState runConfigName="app">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
<DropdownSelection timestamp="2024-07-20T06:36:39.946968600Z">
|
<DropdownSelection timestamp="2025-04-23T13:38:33.325921500Z">
|
||||||
<Target type="DEFAULT_BOOT">
|
<Target type="DEFAULT_BOOT">
|
||||||
<handle>
|
<handle>
|
||||||
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\rizky\.android\avd\Pixel_7_API_33.avd" />
|
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\wisnu\.android\avd\Pixel_7_Pro_API_34.avd" />
|
||||||
</handle>
|
</handle>
|
||||||
</Target>
|
</Target>
|
||||||
</DropdownSelection>
|
</DropdownSelection>
|
||||||
|
@ -53,7 +53,7 @@ class DetectionFragment : Fragment(R.layout.fragment_detection) {
|
|||||||
navigateToDiagnoseDetail(data)
|
navigateToDiagnoseDetail(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onDeleteClicked(data: HistoryDiagnose) {
|
override fun onDeleteClicked(data: HistoryDiagnose) {
|
||||||
AlertDialog.Builder(requireContext())
|
AlertDialog.Builder(requireContext())
|
||||||
.setTitle("Hapus Riwayat")
|
.setTitle("Hapus Riwayat")
|
||||||
.setMessage("Apakah kamu yakin ingin menghapus riwayat ini?")
|
.setMessage("Apakah kamu yakin ingin menghapus riwayat ini?")
|
||||||
@ -80,6 +80,15 @@ class DetectionFragment : Fragment(R.layout.fragment_detection) {
|
|||||||
viewModel.detectionList.collect { historyDiagnoses ->
|
viewModel.detectionList.collect { historyDiagnoses ->
|
||||||
Log.d("DetectionFragment", "Observing detection list. Count: ${historyDiagnoses.size}")
|
Log.d("DetectionFragment", "Observing detection list. Count: ${historyDiagnoses.size}")
|
||||||
detectionAdapter.submitList(historyDiagnoses)
|
detectionAdapter.submitList(historyDiagnoses)
|
||||||
|
|
||||||
|
if (historyDiagnoses.isEmpty()) {
|
||||||
|
binding.textViewEmptyHistory.visibility = View.VISIBLE
|
||||||
|
binding.rvResultDetection.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
binding.textViewEmptyHistory.visibility = View.GONE
|
||||||
|
binding.rvResultDetection.visibility = View.VISIBLE
|
||||||
|
detectionAdapter.submitList(historyDiagnoses)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,6 +314,7 @@ class HomeFragment : Fragment(R.layout.fragment_home) {
|
|||||||
val confidenceFloat = historyDiagnose.confidence.toFloatOrNull() ?: 0f
|
val confidenceFloat = historyDiagnose.confidence.toFloatOrNull() ?: 0f
|
||||||
binding.confidenceResultDiagnosis.text = "Confidence: %.1f%%".format(confidenceFloat)
|
binding.confidenceResultDiagnosis.text = "Confidence: %.1f%%".format(confidenceFloat)
|
||||||
binding.cdHomeScreenAnalyze.visibility = View.VISIBLE
|
binding.cdHomeScreenAnalyze.visibility = View.VISIBLE
|
||||||
|
binding.tvHsHistoryEmpty.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,6 +48,15 @@
|
|||||||
android:paddingTop="@dimen/margin_component"
|
android:paddingTop="@dimen/margin_component"
|
||||||
app:layout_constraintTop_toBottomOf="@id/dd_cont_title">
|
app:layout_constraintTop_toBottomOf="@id/dd_cont_title">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewEmptyHistory"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="Belum Ada Riwayat"
|
||||||
|
android:textColor="@color/grayFont"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_result_detection"
|
android:id="@+id/rv_result_detection"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -266,7 +266,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/cv_hs_detail_explanation_title">
|
app:layout_constraintTop_toBottomOf="@id/cv_hs_detail_explanation_title">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
@ -421,6 +421,17 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_hs_history_empty"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/margin_component"
|
||||||
|
android:text="Belum Ada Riwayat Deteksi Terbaru"
|
||||||
|
android:textColor="@color/grayFont"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/cv_hs_history_title" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progress_result"
|
android:id="@+id/progress_result"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
Reference in New Issue
Block a user