Skip to content
Snippets Groups Projects

add repeat visibility gone

parent 05be07f0
Branches
Tags
2 merge requests!38Dev,!29Camera
......@@ -60,7 +60,8 @@ class ScanResultFragment: Fragment() {
binding.buttonUlang.setOnClickListener {
Navigation.findNavController(root).navigate(R.id.action_navigation_result_to_scan)
}
// binding.testAja.text = "Waiting for result..."
binding.repeatContainer.visibility = View.GONE
binding.buttonTidakUlang.setOnClickListener{
var tempName= ""
var tempAmount = 0.00
......@@ -91,16 +92,21 @@ class ScanResultFragment: Fragment() {
adapter = ScanResultAdapter(itemList)
binding.rvTransactionScan.adapter= adapter
binding.rvTransactionScan.layoutManager = LinearLayoutManager(context)
binding.repeatContainer.visibility = View.GONE
scanViewModel.uploadResult.observe(viewLifecycleOwner) { uploadResult ->
itemList = uploadResult?.items?.items!!
if(itemList.isEmpty()){
binding.clEmptyRvScan.visibility = View.VISIBLE
binding.rvTransactionScan.visibility = View.GONE
}else{
adapter = ScanResultAdapter(itemList)
binding.rvTransactionScan.adapter = adapter
}
binding.repeatContainer.visibility = View.VISIBLE
}
file = scanViewModel.getUploadFile()
......@@ -114,6 +120,11 @@ class ScanResultFragment: Fragment() {
}
}
override fun onResume(){
super.onResume()
binding.repeatContainer.visibility = View.GONE
}
override fun onDestroyView() {
super.onDestroyView()
......
......@@ -45,6 +45,7 @@
</LinearLayout>
<LinearLayout
android:id= "@+id/repeat_container"
android:layout_width="match_parent"
android:layout_height="180dp"
android:orientation="vertical"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment