Skip to content

Commit e00a33d

Browse files
committed
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.
1 parent f5690db commit e00a33d

File tree

10 files changed

+25
-2
lines changed

10 files changed

+25
-2
lines changed

customalert/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'com.github.dcendents.android-maven'
33

44
group='com.github.searchy2'
5-
version = '2.4.0'
5+
version = '2.4.1'
66

77
android {
88
compileSdkVersion 28

customalert/src/main/java/stream/customalert/CustomAlertDialogue.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import android.widget.EditText;
3535
import android.widget.LinearLayout;
3636
import android.widget.ListView;
37+
import android.widget.RelativeLayout;
3738
import android.widget.TextView;
3839

3940
import java.util.ArrayList;
@@ -55,6 +56,7 @@ public static CustomAlertDialogue getInstance() {
5556
return instance;
5657
}
5758

59+
private View layout;
5860
private TextView title, message;
5961

6062
@Override
@@ -192,6 +194,20 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
192194

193195
private void initCommonView(View view) {
194196
//Common elements
197+
layout = view.findViewById(R.id.main_layout);
198+
layout.setOnClickListener(new View.OnClickListener() {
199+
@Override
200+
public void onClick(View view) {
201+
if (!builder.getCancelable())
202+
{
203+
204+
}
205+
else
206+
{
207+
dismiss();
208+
}
209+
}
210+
});
195211
title = view.findViewById(R.id.title);
196212
message = view.findViewById(R.id.message);
197213
if (builder.getTitle() != null) {

customalert/src/main/res/layout-land-v21/alert.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:id="@+id/main_layout"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
67
android:orientation="vertical">

customalert/src/main/res/layout-land/alert.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/main_layout"
34
android:layout_width="match_parent"
45
android:layout_height="match_parent"
56
android:background="@color/transparent"

customalert/src/main/res/layout-v21/alert.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:id="@+id/main_layout"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
67
android:orientation="vertical">

customalert/src/main/res/layout-v21/alert_actionsheet.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:id="@+id/main_layout"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent">
67

customalert/src/main/res/layout-v21/alert_input.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:id="@+id/main_layout"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
6-
77
android:background="@color/transparent"
88
android:orientation="vertical">
99

customalert/src/main/res/layout/alert.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/main_layout"
34
android:layout_width="match_parent"
45
android:layout_height="match_parent"
56
android:background="@color/transparent"

customalert/src/main/res/layout/alert_actionsheet.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/main_layout"
34
android:layout_width="match_parent"
45
android:layout_height="match_parent">
56

customalert/src/main/res/layout/alert_input.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/main_layout"
34
android:layout_width="match_parent"
45
android:layout_height="match_parent"
56
android:background="@color/transparent"

0 commit comments

Comments
 (0)