Merge branch 'feature-GHZS-1066' into 'dev-5.20.0'
fix:【光环助手】资讯文章-下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-1066 See merge request halo/android/assistant-android!669
This commit is contained in:
@ -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
|
||||
|
||||
@ -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">
|
||||
|
||||
<include layout="@layout/reuse_toolbar" />
|
||||
@ -75,7 +76,7 @@
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/detail_ll_bottom"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
@ -87,12 +88,46 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:download_button_show_progress="true"
|
||||
app:download_button_text_size="@dimen/primary_text_size" />
|
||||
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" />
|
||||
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:id="@+id/multiVersionDownloadTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/primary_text_size"
|
||||
android:visibility="gone"
|
||||
app:drawableEndCompat="@drawable/ic_jump_universal"
|
||||
app:layout_constraintBottom_toBottomOf="@id/detail_progressbar"
|
||||
app:layout_constraintEnd_toEndOf="@id/detail_progressbar"
|
||||
app:layout_constraintStart_toStartOf="@id/detail_progressbar"
|
||||
app:layout_constraintTop_toTopOf="@id/detail_progressbar"
|
||||
tools:text="选择下载你的版本" />
|
||||
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:id="@+id/downloadTipsLottie"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="-8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="gone"
|
||||
app:lottie_autoPlay="false"
|
||||
app:lottie_loop="true"
|
||||
app:lottie_repeatMode="restart"
|
||||
app:layout_constraintRight_toRightOf="@+id/detail_progressbar"
|
||||
app:layout_constraintTop_toTopOf="@+id/detail_progressbar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user