From e00a33dac26b6d985222a2babeee52827aa17c96 Mon Sep 17 00:00:00 2001 From: Ray Li Date: Sun, 1 Jul 2018 17:52:01 -0500 Subject: [PATCH] Touch Outside Cancelable *Add back cancel dialogue when user touches outside the dialogue feature. This feature was removed in BlurView Creation #1 Part 1 due to setting window fullscreen and floating to false to work with BlurView. *Version Bump to v2.4.1. --- customalert/build.gradle | 2 +- .../stream/customalert/CustomAlertDialogue.java | 16 ++++++++++++++++ .../src/main/res/layout-land-v21/alert.xml | 1 + customalert/src/main/res/layout-land/alert.xml | 1 + customalert/src/main/res/layout-v21/alert.xml | 1 + .../main/res/layout-v21/alert_actionsheet.xml | 1 + .../src/main/res/layout-v21/alert_input.xml | 2 +- customalert/src/main/res/layout/alert.xml | 1 + .../src/main/res/layout/alert_actionsheet.xml | 1 + customalert/src/main/res/layout/alert_input.xml | 1 + 10 files changed, 25 insertions(+), 2 deletions(-) diff --git a/customalert/build.gradle b/customalert/build.gradle index 53ad765..e5f33f1 100644 --- a/customalert/build.gradle +++ b/customalert/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' group='com.github.searchy2' -version = '2.4.0' +version = '2.4.1' android { compileSdkVersion 28 diff --git a/customalert/src/main/java/stream/customalert/CustomAlertDialogue.java b/customalert/src/main/java/stream/customalert/CustomAlertDialogue.java index 2657c63..87bbb88 100644 --- a/customalert/src/main/java/stream/customalert/CustomAlertDialogue.java +++ b/customalert/src/main/java/stream/customalert/CustomAlertDialogue.java @@ -34,6 +34,7 @@ import android.widget.EditText; import android.widget.LinearLayout; import android.widget.ListView; +import android.widget.RelativeLayout; import android.widget.TextView; import java.util.ArrayList; @@ -55,6 +56,7 @@ public static CustomAlertDialogue getInstance() { return instance; } + private View layout; private TextView title, message; @Override @@ -192,6 +194,20 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { private void initCommonView(View view) { //Common elements + layout = view.findViewById(R.id.main_layout); + layout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (!builder.getCancelable()) + { + + } + else + { + dismiss(); + } + } + }); title = view.findViewById(R.id.title); message = view.findViewById(R.id.message); if (builder.getTitle() != null) { diff --git a/customalert/src/main/res/layout-land-v21/alert.xml b/customalert/src/main/res/layout-land-v21/alert.xml index 670cc97..354504f 100644 --- a/customalert/src/main/res/layout-land-v21/alert.xml +++ b/customalert/src/main/res/layout-land-v21/alert.xml @@ -1,6 +1,7 @@ diff --git a/customalert/src/main/res/layout-land/alert.xml b/customalert/src/main/res/layout-land/alert.xml index 38d4a97..23eff08 100644 --- a/customalert/src/main/res/layout-land/alert.xml +++ b/customalert/src/main/res/layout-land/alert.xml @@ -1,5 +1,6 @@ diff --git a/customalert/src/main/res/layout-v21/alert_actionsheet.xml b/customalert/src/main/res/layout-v21/alert_actionsheet.xml index 9c4b927..54b9fe1 100644 --- a/customalert/src/main/res/layout-v21/alert_actionsheet.xml +++ b/customalert/src/main/res/layout-v21/alert_actionsheet.xml @@ -1,6 +1,7 @@ diff --git a/customalert/src/main/res/layout-v21/alert_input.xml b/customalert/src/main/res/layout-v21/alert_input.xml index e54c0be..8e51722 100644 --- a/customalert/src/main/res/layout-v21/alert_input.xml +++ b/customalert/src/main/res/layout-v21/alert_input.xml @@ -1,9 +1,9 @@ diff --git a/customalert/src/main/res/layout/alert.xml b/customalert/src/main/res/layout/alert.xml index ad65454..50af360 100644 --- a/customalert/src/main/res/layout/alert.xml +++ b/customalert/src/main/res/layout/alert.xml @@ -1,5 +1,6 @@ diff --git a/customalert/src/main/res/layout/alert_input.xml b/customalert/src/main/res/layout/alert_input.xml index 4de774d..63a4f7d 100644 --- a/customalert/src/main/res/layout/alert_input.xml +++ b/customalert/src/main/res/layout/alert_input.xml @@ -1,5 +1,6 @@