From 3ed711bb790fe84e6dd292e8c457e1db07868e97 Mon Sep 17 00:00:00 2001 From: li-xiaojun <16167479@qq.com> Date: Mon, 11 Dec 2023 10:59:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Loading=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lxj/xpopup/core/BasePopupView.java | 5 ----- .../com/lxj/xpopup/impl/LoadingPopupView.java | 15 ++++++++++----- .../res/layout/_xpopup_center_impl_loading.xml | 15 +++++---------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/library/src/main/java/com/lxj/xpopup/core/BasePopupView.java b/library/src/main/java/com/lxj/xpopup/core/BasePopupView.java index d5e29e76..8f0ddf17 100644 --- a/library/src/main/java/com/lxj/xpopup/core/BasePopupView.java +++ b/library/src/main/java/com/lxj/xpopup/core/BasePopupView.java @@ -5,13 +5,10 @@ import android.app.Application; import android.content.Context; import android.content.res.Configuration; -import android.graphics.Color; -import android.graphics.Point; import android.graphics.Rect; import android.os.Build; import android.os.Handler; import android.os.Looper; -import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -21,7 +18,6 @@ import android.view.Window; import android.view.WindowInsets; import android.view.WindowManager; -import android.view.animation.LayoutAnimationController; import android.widget.EditText; import android.widget.FrameLayout; import androidx.annotation.NonNull; @@ -48,7 +44,6 @@ import com.lxj.xpopup.impl.PartShadowPopupView; import com.lxj.xpopup.util.KeyboardUtils; import com.lxj.xpopup.util.XPopupUtils; - import java.util.ArrayList; import java.util.List; diff --git a/library/src/main/java/com/lxj/xpopup/impl/LoadingPopupView.java b/library/src/main/java/com/lxj/xpopup/impl/LoadingPopupView.java index f9295f14..18b46fc6 100644 --- a/library/src/main/java/com/lxj/xpopup/impl/LoadingPopupView.java +++ b/library/src/main/java/com/lxj/xpopup/impl/LoadingPopupView.java @@ -75,12 +75,12 @@ protected void setup() { @Override public void run() { if(!firstShow) { + TransitionSet set = new TransitionSet() + .setDuration(getAnimationDuration()) + .addTransition(new MaterialFade()) + .addTransition(new ChangeBounds()); + TransitionManager.beginDelayedTransition(centerPopupContainer, set); } - TransitionSet set = new TransitionSet() - .setDuration(getAnimationDuration()) - .addTransition(new MaterialFade()) - .addTransition(new ChangeBounds()); - TransitionManager.beginDelayedTransition(centerPopupContainer, set); if (title == null || title.length() == 0) { XPopupUtils.setVisible(tv_title, false); } else { @@ -113,4 +113,9 @@ public LoadingPopupView setStyle(Style style){ return this; } + @Override + protected void onDismiss() { + super.onDismiss(); + firstShow = true; + } } diff --git a/library/src/main/res/layout/_xpopup_center_impl_loading.xml b/library/src/main/res/layout/_xpopup_center_impl_loading.xml index dbaf7d93..d4de1d5a 100644 --- a/library/src/main/res/layout/_xpopup_center_impl_loading.xml +++ b/library/src/main/res/layout/_xpopup_center_impl_loading.xml @@ -2,10 +2,7 @@ @@ -13,19 +10,17 @@ + android:layout_width="28dp" + android:layout_height="28dp"/> + android:layout_width="28dp" + android:layout_height="28dp" />