Skip to content

Commit cb0352d

Browse files
author
MFlisar
committed
bugfix: touch outside may have been determined incorrectly
better log messages by making more result classes data classes kotbilling dependency changed to 0.5
1 parent 7512a45 commit cb0352d

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

core/src/main/java/com/michaelflisar/dialogs/presenters/AlertDialogPresenter.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
44
import android.app.Dialog
55
import android.content.Context
66
import android.os.Bundle
7+
import android.util.Log
78
import android.view.*
89
import android.widget.Button
910
import android.widget.ScrollView
@@ -15,6 +16,7 @@ import androidx.lifecycle.LifecycleOwner
1516
import androidx.lifecycle.LifecycleRegistry
1617
import androidx.viewbinding.ViewBinding
1718
import com.google.android.material.dialog.MaterialAlertDialogBuilder
19+
import com.michaelflisar.dialogs.MaterialDialog
1820
import com.michaelflisar.dialogs.MaterialDialogSetup
1921
import com.michaelflisar.dialogs.MaterialDialogUtil
2022
import com.michaelflisar.dialogs.classes.*
@@ -270,10 +272,10 @@ class AlertDialogPresenter<S : MaterialDialogSetup<S>, E : IMaterialDialogEvent>
270272
private fun catchTouchOutside(dlg: Dialog, onBackPress: () -> Unit) {
271273
val decorView = dlg.window!!.decorView
272274
val contentView = decorView.findViewById<View>(android.R.id.content)
273-
val bounds = MaterialDialogUtil.getBoundsOnScreen(contentView)
274275
decorView.setOnTouchListener { view, event ->
275276
val rawX = event.rawX
276277
val rawY = event.rawY
278+
val bounds = MaterialDialogUtil.getBoundsOnScreen(contentView)
277279
if (rawX < bounds.left || rawX > bounds.right || rawY < bounds.top || rawY > bounds.bottom) {
278280
onBackPress()
279281
true

dialogs/ads/src/main/java/com/michaelflisar/dialogs/DialogAds.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ class DialogAds(
6565
val data: Data
6666
) : Event() {
6767
sealed class Data {
68-
class BannerShown(val error: Exception?) : Data()
69-
class RewardShown(val error: Exception?, val type: String, val amount: Int) : Data()
70-
class InterstitialShown(val successfullyLoaded: Boolean) : Data()
71-
class ClosedByUser(val error: Exception?) : Data()
68+
data class BannerShown(val error: Exception?) : Data()
69+
data class RewardShown(val error: Exception?, val type: String, val amount: Int) : Data()
70+
data class InterstitialShown(val successfullyLoaded: Boolean) : Data()
71+
data class ClosedByUser(val error: Exception?) : Data()
7272
}
7373
}
7474

dialogs/gdpr/src/main/java/com/michaelflisar/dialogs/utils/DataUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ internal object DataUtil {
2626
}
2727

2828
private sealed class InternalData {
29-
class Success(
29+
data class Success(
3030
val location: GDPRLocation = GDPRLocation.UNDEFINED,
3131
val subNetworks: List<GDPRSubNetwork> = emptyList()
3232
) : InternalData()
3333

34-
class Error(
34+
data class Error(
3535
val error: Exception
3636
) : InternalData()
3737
}

gradle/dependencies.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# mflisar
44
text = "1.2"
55
lumberjack = "5.3.0"
6-
kotbilling = "0.4"
6+
kotbilling = "0.5"
77

88
# google
99
material = "1.7.0"

0 commit comments

Comments
 (0)