diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 251fd6a..6f2d627 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -19,8 +19,8 @@ android { applicationId = "app.priceguard" minSdk = 29 targetSdk = 34 - versionCode = 5 - versionName = "0.3.1" + versionCode = 6 + versionName = "0.3.2" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/android/app/src/main/java/app/priceguard/ui/additem/setprice/SetTargetPriceFragment.kt b/android/app/src/main/java/app/priceguard/ui/additem/setprice/SetTargetPriceFragment.kt index aa7e39b..b3889e3 100644 --- a/android/app/src/main/java/app/priceguard/ui/additem/setprice/SetTargetPriceFragment.kt +++ b/android/app/src/main/java/app/priceguard/ui/additem/setprice/SetTargetPriceFragment.kt @@ -156,7 +156,7 @@ class SetTargetPriceFragment : Fragment() { showDialogWithAction( getString(R.string.success_add), getString(R.string.success_add_message), - DialogConfirmAction.FINISH + DialogConfirmAction.HOME ) } @@ -174,7 +174,7 @@ class SetTargetPriceFragment : Fragment() { showDialogWithAction( getString(R.string.error_add_product), getString(R.string.exist_product), - DialogConfirmAction.FINISH + DialogConfirmAction.HOME ) } diff --git a/android/app/src/main/java/app/priceguard/ui/data/DialogConfirmAction.kt b/android/app/src/main/java/app/priceguard/ui/data/DialogConfirmAction.kt index 18de82e..59455a9 100644 --- a/android/app/src/main/java/app/priceguard/ui/data/DialogConfirmAction.kt +++ b/android/app/src/main/java/app/priceguard/ui/data/DialogConfirmAction.kt @@ -3,5 +3,6 @@ package app.priceguard.ui.data enum class DialogConfirmAction { NOTHING, FINISH, + HOME, CUSTOM } diff --git a/android/app/src/main/java/app/priceguard/ui/util/ConfirmDialogFragment.kt b/android/app/src/main/java/app/priceguard/ui/util/ConfirmDialogFragment.kt index fdd309e..f68a051 100644 --- a/android/app/src/main/java/app/priceguard/ui/util/ConfirmDialogFragment.kt +++ b/android/app/src/main/java/app/priceguard/ui/util/ConfirmDialogFragment.kt @@ -1,10 +1,12 @@ package app.priceguard.ui.util import android.app.Dialog +import android.content.Intent import android.os.Bundle import androidx.fragment.app.DialogFragment import app.priceguard.R import app.priceguard.ui.data.DialogConfirmAction +import app.priceguard.ui.home.HomeActivity import com.google.android.material.dialog.MaterialAlertDialogBuilder class ConfirmDialogFragment : DialogFragment() { @@ -36,6 +38,10 @@ class ConfirmDialogFragment : DialogFragment() { resultListener?.onDialogResult(true) } + DialogConfirmAction.HOME -> { + goToHomeActivity() + } + DialogConfirmAction.NOTHING -> {} } dismiss() @@ -61,6 +67,16 @@ class ConfirmDialogFragment : DialogFragment() { } } + private fun goToHomeActivity() { + val activityIntent = requireActivity().intent + if (activityIntent?.action == Intent.ACTION_SEND) { + val intent = Intent(requireActivity(), HomeActivity::class.java) + intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + startActivity(intent) + } + requireActivity().finish() + } + override fun onStart() { super.onStart() diff --git a/android/app/src/main/res/layout-land/activity_intro.xml b/android/app/src/main/res/layout-land/activity_intro.xml deleted file mode 100644 index c555fdf..0000000 --- a/android/app/src/main/res/layout-land/activity_intro.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - -