Explorar el Código

0.0.50.beta22 pre
- 修复 PopNotification 在允许同时显示多条通知时,关闭后依然能够接收到触摸事件的问题;

Kongzue hace 9 meses
padre
commit
615fb1eb49

+ 17 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopNotification.java

@@ -655,6 +655,10 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
             boxBody.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
+                    if (dismissAnimFlag){
+                        log("skip click @ A");
+                        return;
+                    }
                     haptic(v);
                     if (onPopNotificationClickListener != null) {
                         if (!onPopNotificationClickListener.onClick(me, v)) {
@@ -669,6 +673,9 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
             txtDialogxButton.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
+                    if (dismissAnimFlag){
+                        return;
+                    }
                     haptic(v);
                     if (onButtonClickListener != null) {
                         if (!onButtonClickListener.onClick(me, v)) {
@@ -847,6 +854,16 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
 
             if (!dismissAnimFlag && boxRoot != null) {
                 dismissAnimFlag = true;
+                boxBody.setFocusable(false);
+                boxBody.setClickable(false);
+                boxBody.setOnTouchListener(new View.OnTouchListener() {
+                    @Override
+                    public boolean onTouch(View v, MotionEvent event) {
+                        return false;
+                    }
+                });
+                txtDialogxButton.setFocusable(false);
+                txtDialogxButton.setClickable(false);
                 boxRoot.post(new Runnable() {
                     @Override
                     public void run() {

+ 1 - 1
app/release/output-metadata.json

@@ -12,7 +12,7 @@
       "filters": [],
       "attributes": [],
       "versionCode": 50,
-      "versionName": "0.0.50.beta20",
+      "versionName": "0.0.50.beta21",
       "outputFile": "app-release.apk"
     }
   ],

+ 0 - 1
app/src/main/AndroidManifest.xml

@@ -12,7 +12,6 @@
         android:label="@string/app_name"
         android:roundIcon="@mipmap/ic_launcher_round"
         android:supportsRtl="true"
-        android:hardwareAccelerated="true"
         android:theme="@style/AppTheme">
 
         <activity

+ 1 - 0
app/src/main/java/com/kongzue/dialogxdemo/App.java

@@ -42,6 +42,7 @@ public class App extends BaseApp<App> {
 
         DialogX.globalTheme = DialogX.THEME.AUTO;
         DialogX.onlyOnePopTip = false;
+        DialogX.onlyOnePopNotification=false;
         DialogX.DEBUGMODE = BuildConfig.DEBUG;
         //DialogX.ignoreUnsafeInsetsHorizontal = true;