From de5420f01df671a9410c61d0fbbbc6751ebcc257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=AD=90=E7=BB=B4?= Date: Wed, 1 Feb 2023 11:14:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E3=80=90=E5=85=89=E7=8E=AF=E5=8A=A9?= =?UTF-8?q?=E6=89=8B=E3=80=91=E8=B5=84=E8=AE=AF=E6=96=87=E7=AB=A0-?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20https://jira.shanqu.cc/browse/GHZS-1066?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gh/gamecenter/NewsDetailActivity.java | 18 +++++++- .../main/res/layout/activity_news_detail.xml | 41 +++++++++++++++++-- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java b/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java index dc420195d4..c33c30f0d7 100644 --- a/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java +++ b/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java @@ -62,6 +62,7 @@ import com.gh.gamecenter.newsdetail.NewsDetailAdapter; import com.gh.gamecenter.retrofit.RetrofitManager; import com.lightgame.download.DataWatcher; import com.lightgame.download.DownloadEntity; +import com.lightgame.download.DownloadStatus; import com.lightgame.utils.Utils; import org.greenrobot.eventbus.Subscribe; @@ -139,6 +140,21 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli DetailDownloadUtils.detailInvalidate(getDetailViewHolder()); } } + } else if (gameEntity != null && gameEntity.getApk().size() > 1) { + if (DownloadStatus.downloading.equals(downloadEntity.getStatus())) { + if (getDetailViewHolder().mDownloadTips.getVisibility() == View.GONE || !getDetailViewHolder().mDownloadTips.isAnimating()) { + getDetailViewHolder().mDownloadTips.setVisibility(View.VISIBLE); + ExtensionsKt.setDownloadTipsAnimation(getDetailViewHolder().mDownloadTips, true); + } + } else if (DownloadStatus.waiting.equals(downloadEntity.getStatus()) || DownloadStatus.done.equals(downloadEntity.getStatus()) || + DownloadStatus.pause.equals(downloadEntity.getStatus()) || DownloadStatus.timeout.equals(downloadEntity.getStatus()) || + DownloadStatus.subscribe.equals(downloadEntity.getStatus()) || DownloadStatus.overflow.equals(downloadEntity.getStatus()) || + DownloadStatus.neterror.equals(downloadEntity.getStatus())) { + getDetailViewHolder().mDownloadTips.setVisibility(View.VISIBLE); + ExtensionsKt.setDownloadTipsAnimation(getDetailViewHolder().mDownloadTips, false); + } else { + getDetailViewHolder().mDownloadTips.setVisibility(View.GONE); + } } } @@ -405,6 +421,7 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli protected void onDestroy() { super.onDestroy(); handler.removeCallbacksAndMessages(null); + DownloadManager.getInstance().removeObserver(dataWatcher); } @Override @@ -421,7 +438,6 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli isSentReport = true; } - DownloadManager.getInstance().removeObserver(dataWatcher); } @Override diff --git a/app/src/main/res/layout/activity_news_detail.xml b/app/src/main/res/layout/activity_news_detail.xml index 1641cdde80..bf368e4bae 100644 --- a/app/src/main/res/layout/activity_news_detail.xml +++ b/app/src/main/res/layout/activity_news_detail.xml @@ -3,6 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical"> @@ -75,7 +76,7 @@ - + app:download_button_text_size="@dimen/primary_text_size" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + + + + +