diff --git a/app/src/androidTest/java/com/hotstuff/ui/learn/LearnFragmentTest.kt b/app/src/androidTest/java/com/hotstuff/ui/learn/LearnFragmentTest.kt index 8ecc3a3..873ca24 100644 --- a/app/src/androidTest/java/com/hotstuff/ui/learn/LearnFragmentTest.kt +++ b/app/src/androidTest/java/com/hotstuff/ui/learn/LearnFragmentTest.kt @@ -1,5 +1,3 @@ package com.hotstuff.ui.learn -class LearnFragmentTest { - -} \ No newline at end of file +class LearnFragmentTest \ No newline at end of file diff --git a/app/src/androidTest/java/com/hotstuff/utils/OnboardAdapterTest.kt b/app/src/androidTest/java/com/hotstuff/utils/OnboardAdapterTest.kt index 3651508..41a8873 100644 --- a/app/src/androidTest/java/com/hotstuff/utils/OnboardAdapterTest.kt +++ b/app/src/androidTest/java/com/hotstuff/utils/OnboardAdapterTest.kt @@ -1,4 +1,3 @@ package com.hotstuff.utils -class OnboardAdapterTest { -} \ No newline at end of file +class OnboardAdapterTest \ No newline at end of file diff --git a/app/src/main/java/com/hotstuff/ui/items/ItemDetailFragment.kt b/app/src/main/java/com/hotstuff/ui/items/ItemDetailFragment.kt index 649f5cf..8cfa907 100644 --- a/app/src/main/java/com/hotstuff/ui/items/ItemDetailFragment.kt +++ b/app/src/main/java/com/hotstuff/ui/items/ItemDetailFragment.kt @@ -71,13 +71,6 @@ class ItemDetailFragment : Fragment() { image.setImageResource(R.drawable.image_default_item) bundle.putString("image", null) DatabaseHelper(requireContext()).removeInvalidImageURI(bundle.getInt("id")) -// val item = Item(id = bundle.get("id")) -// item.id = -// item.name = bundle.getString("name") -// category.text = bundle.getString("category") -// room.text = bundle.getString("room") - - val quantityNumeral = bundle.getInt("quantity") } val editButton = view.findViewById(R.id.item_detail_edit_button) @@ -89,15 +82,15 @@ class ItemDetailFragment : Fragment() { val deleteButton = view.findViewById(R.id.item_detail_delete_button) deleteButton.setOnClickListener{ val alertDialogBuilder = MaterialAlertDialogBuilder(requireContext(), R.style.dialog_alert) - alertDialogBuilder.setTitle("Delete item?") - alertDialogBuilder.setMessage("${name.text} will be permanently removed from your device") - alertDialogBuilder.setPositiveButton("Delete") { dialog, _ -> + alertDialogBuilder.setTitle(getString(R.string.dialog_delete_item_title)) + alertDialogBuilder.setMessage(getString(R.string.dialog_delete_item_message, name.text)) + alertDialogBuilder.setPositiveButton(getString(R.string.dialog_delete)) { dialog, _ -> DatabaseHelper(requireContext()).deleteItem(bundle.getInt("id")) bundle.putInt("delete", bundle.getInt("position")) findNavController().navigate(R.id.action_item_detail_to_items, bundle) dialog.dismiss() } - alertDialogBuilder.setNegativeButton("Cancel") { dialog, _ -> + alertDialogBuilder.setNegativeButton(getString(R.string.dialog_negative)) { dialog, _ -> dialog.dismiss() } val alertDialog = alertDialogBuilder.create() diff --git a/app/src/main/java/com/hotstuff/ui/onboard/CreateBuildingFragment.kt b/app/src/main/java/com/hotstuff/ui/onboard/CreateBuildingFragment.kt index b93ceed..199b20c 100644 --- a/app/src/main/java/com/hotstuff/ui/onboard/CreateBuildingFragment.kt +++ b/app/src/main/java/com/hotstuff/ui/onboard/CreateBuildingFragment.kt @@ -54,7 +54,7 @@ class CreateBuildingFragment : Fragment() { } createBuildingButton.setOnClickListener { fun confirmForm() { - val newBuilding = com.hotstuff.models.Building() + val newBuilding = Building() newBuilding.name = buildingNameText.text.toString().trim() newBuilding.type = buildingTypeText.text.toString().trim() newBuilding.description = buildingDescriptionText.text.toString().trim() diff --git a/app/src/main/java/com/hotstuff/ui/settings/SettingsFragment.kt b/app/src/main/java/com/hotstuff/ui/settings/SettingsFragment.kt index 6f024e3..3d50b3b 100644 --- a/app/src/main/java/com/hotstuff/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/hotstuff/ui/settings/SettingsFragment.kt @@ -118,7 +118,7 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP val shareMessage = "$shareApp https://play.google.com/store/apps/details?id=$appPackageName" textIntent.putExtra(Intent.EXTRA_TEXT, shareMessage) - startActivity(Intent.createChooser(textIntent, appName)); + startActivity(Intent.createChooser(textIntent, appName)) } /** diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f6afef1..ceca25f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -82,6 +82,7 @@ OK Cancel + Delete Export item data? Your records will be saved to your device\'s downloads folder Missing required value @@ -90,6 +91,8 @@ Building Name Building Type Building Description + Delete item? + %1$s will be permanently removed from your device Expand dropdown Building Details