diff --git a/app/src/main/java/com/gh/common/databind/BindingAdapters.java b/app/src/main/java/com/gh/common/databind/BindingAdapters.java
index ba5d6f9f00..1f10cd7dc6 100644
--- a/app/src/main/java/com/gh/common/databind/BindingAdapters.java
+++ b/app/src/main/java/com/gh/common/databind/BindingAdapters.java
@@ -519,6 +519,9 @@ public class BindingAdapters {
Intent i = new Intent(WebActivity.getIntentForWebGame(progressBar.getContext(), linkEntity.getLink(), gameEntity.getName(), isPlay,linkEntity.getCloseButton()));
progressBar.getContext().startActivity(i);
break;
+ case UPDATING:
+ Utils.toast(progressBar.getContext(), "正在加急更新版本,敬请后续留意");
+ break;
}
});
@@ -548,10 +551,14 @@ public class BindingAdapters {
} else {
if (offStatus != null && "dialog".equals(offStatus)) {
progressBar.setText("查看");
+ progressBar.setDownloadType(DownloadProgressBar.DownloadType.NONE);
+ } else if ("updating".equals(offStatus)) {
+ progressBar.setText("更新中");
+ progressBar.setDownloadType(DownloadProgressBar.DownloadType.UPDATING);
} else {
progressBar.setText("暂无");
+ progressBar.setDownloadType(DownloadProgressBar.DownloadType.NONE);
}
- progressBar.setDownloadType(DownloadProgressBar.DownloadType.NONE);
}
} else {
diff --git a/app/src/main/java/com/gh/common/util/DetailDownloadUtils.java b/app/src/main/java/com/gh/common/util/DetailDownloadUtils.java
index 59f4daa6d2..279b08d91b 100644
--- a/app/src/main/java/com/gh/common/util/DetailDownloadUtils.java
+++ b/app/src/main/java/com/gh/common/util/DetailDownloadUtils.java
@@ -66,6 +66,9 @@ public class DetailDownloadUtils {
if ("dialog".equals(viewHolder.gameEntity.getDownloadOffStatus())) {
viewHolder.mDownloadPb.setText(TextUtils.isEmpty(viewHolder.gameEntity.getDownloadOffText()) ? "查看详情" : viewHolder.gameEntity.getDownloadOffText());
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.NONE_WITH_HINT);
+ } else if ("updating".equals(viewHolder.gameEntity.getDownloadOffStatus())) {
+ viewHolder.mDownloadPb.setText(TextUtils.isEmpty(viewHolder.gameEntity.getDownloadOffText()) ? "更新中" : viewHolder.gameEntity.getDownloadOffText());
+ viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.UPDATING);
} else {
viewHolder.mDownloadPb.setText(TextUtils.isEmpty(viewHolder.gameEntity.getDownloadOffText()) ? "暂无下载" : viewHolder.gameEntity.getDownloadOffText());
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.NONE);
diff --git a/app/src/main/java/com/gh/common/util/DownloadItemUtils.java b/app/src/main/java/com/gh/common/util/DownloadItemUtils.java
index 89163114fe..b72076fbd4 100644
--- a/app/src/main/java/com/gh/common/util/DownloadItemUtils.java
+++ b/app/src/main/java/com/gh/common/util/DownloadItemUtils.java
@@ -8,6 +8,12 @@ import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.collection.ArrayMap;
+import androidx.core.content.ContextCompat;
+import androidx.recyclerview.widget.RecyclerView;
+
import com.gh.common.constant.Config;
import com.gh.common.dialog.CertificationDialog;
import com.gh.common.dialog.DeviceRemindDialog;
@@ -36,12 +42,6 @@ import com.lightgame.utils.Utils;
import java.util.concurrent.LinkedBlockingQueue;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.collection.ArrayMap;
-import androidx.core.content.ContextCompat;
-import androidx.recyclerview.widget.RecyclerView;
-
/**
* todo 下载判断不能以按钮文案为判断条件,否则按钮文案修改时又要修改判断逻辑
*/
@@ -195,6 +195,10 @@ public class DownloadItemUtils {
holder.gameDownloadBtn.setText("查看");
holder.gameDownloadBtn.setTextColor(ContextCompat.getColor(context, R.color.white));
holder.gameDownloadBtn.setBackgroundResource(R.drawable.game_item_btn_download_style);
+ } else if ("updating".equals(offStatus)) {
+ holder.gameDownloadBtn.setText("更新中");
+ holder.gameDownloadBtn.setTextColor(ContextCompat.getColor(context, R.color.white));
+ holder.gameDownloadBtn.setBackgroundResource(R.drawable.download_button_updating_style);
} else {
holder.gameDownloadBtn.setText("暂无");
holder.gameDownloadBtn.setTextColor(ContextCompat.getColor(context, R.color.button_gray));
@@ -468,7 +472,7 @@ public class DownloadItemUtils {
HistoryHelper.insertGameEntity(gameEntity);
}
- Intent i = WebActivity.getIntentForWebGame(context, gameEntity.getH5Link().getLink(), gameEntity.getName(), isPlay,linkEntity.getCloseButton());
+ Intent i = WebActivity.getIntentForWebGame(context, gameEntity.getH5Link().getLink(), gameEntity.getName(), isPlay, linkEntity.getCloseButton());
context.startActivity(i);
});
} else if (gameEntity.getApk().size() == 1) {
diff --git a/app/src/main/java/com/gh/common/view/DownloadProgressBar.java b/app/src/main/java/com/gh/common/view/DownloadProgressBar.java
index 91c336bed8..2c10c2c542 100644
--- a/app/src/main/java/com/gh/common/view/DownloadProgressBar.java
+++ b/app/src/main/java/com/gh/common/view/DownloadProgressBar.java
@@ -39,6 +39,7 @@ public class DownloadProgressBar extends ProgressBar {
RESERVABLE,
RESERVED,
H5_GAME,
+ UPDATING,
XAPK_UNZIPPING,
XAPK_SUCCESS,
@@ -214,6 +215,10 @@ public class DownloadProgressBar extends ProgressBar {
setProgressDrawable(getResources().getDrawable(R.drawable.button_reserve));
mDefaultColor = ContextCompat.getColor(getContext(), R.color.white);
break;
+ case UPDATING:
+ setProgressDrawable(getResources().getDrawable(R.drawable.download_button_updating_style));
+ mDefaultColor = ContextCompat.getColor(getContext(), R.color.white);
+ break;
case RESERVED:
setProgressDrawable(getResources().getDrawable(R.drawable.game_item_btn_pause_dn));
mDefaultColor = ContextCompat.getColor(getContext(), R.color.white);
diff --git a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java
index acc83304a5..2b6f0d77c2 100644
--- a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java
+++ b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java
@@ -5,6 +5,10 @@ import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.FragmentActivity;
+
import com.gh.common.dialog.CertificationDialog;
import com.gh.common.dialog.DeviceRemindDialog;
import com.gh.common.dialog.GameOffServiceDialogFragment;
@@ -41,10 +45,6 @@ import com.lightgame.utils.Utils;
import org.greenrobot.eventbus.EventBus;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.fragment.app.FragmentActivity;
-
/**
* Created by khy on 27/06/17.
* 详情页面下载ViewHolder
@@ -251,7 +251,9 @@ public class DetailViewHolder {
Intent i = new Intent(WebActivity.getIntentForWebGame(mViewHolder.context, linkEntity.getLink(), mGameEntity.getName(), isPlay, linkEntity.getCloseButton()));
mViewHolder.context.startActivity(i);
break;
-
+ case UPDATING:
+ Utils.toast(mViewHolder.context, "正在加急更新版本,敬请后续留意");
+ break;
default:
Intent intent = DownloadManagerActivity.getDownloadMangerIntent(mViewHolder.context,
mGameEntity.getApk().get(0).getUrl(),
diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt
index 37ffca2eef..20282e4e54 100644
--- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt
+++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt
@@ -189,6 +189,10 @@ class RatingReplyAdapter(context: Context,
if ("dialog" == offStatus) {
text = "查看"
setTextColor(ContextCompat.getColor(mContext, R.color.white))
+ } else if ("updating" == offStatus) {
+ text = "更新中"
+ setTextColor(ContextCompat.getColor(mContext, R.color.white))
+ setBackgroundResource(R.drawable.download_button_updating_style)
} else {
text = "暂无"
setTextColor(ContextCompat.getColor(mContext, R.color.button_gray))
diff --git a/app/src/main/java/com/gh/gamecenter/video/detail/VideoAdapter.kt b/app/src/main/java/com/gh/gamecenter/video/detail/VideoAdapter.kt
index 7972b08533..879bc85075 100644
--- a/app/src/main/java/com/gh/gamecenter/video/detail/VideoAdapter.kt
+++ b/app/src/main/java/com/gh/gamecenter/video/detail/VideoAdapter.kt
@@ -185,6 +185,10 @@ class VideoAdapter(val mContext: Context, val mRecyclerView: RecyclerView, val m
if ("dialog" == offStatus) {
text = "查看"
setTextColor(ContextCompat.getColor(mContext, R.color.white))
+ } else if ("updating" == offStatus) {
+ text = "更新中"
+ setTextColor(ContextCompat.getColor(mContext, R.color.white))
+ setBackgroundResource(R.drawable.download_button_updating_style)
} else {
text = "暂无"
setTextColor(ContextCompat.getColor(mContext, R.color.button_gray))
diff --git a/app/src/main/res/drawable/download_button_updating_style.xml b/app/src/main/res/drawable/download_button_updating_style.xml
new file mode 100644
index 0000000000..aa0866048f
--- /dev/null
+++ b/app/src/main/res/drawable/download_button_updating_style.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 8b6cb11436..f697ab2c00 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -117,6 +117,8 @@
#ECF6FF
#EDEDED
#F2F2F2
+ #FFC247
+ #FF9933
#80000000
#404040
#ededed
diff --git a/gradle.properties b/gradle.properties
index 745ea7d60f..43296d42e5 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -46,7 +46,7 @@ DOUYIN_CLIENTKEY=aw66h51ftb71dkhi
DOUYIN_CLIENTSECRET=155dee6c1de9ae31bffcbf32475dc161
# hosts
-DEV_API_HOST=https\://dev.api.ghzs.com/v4d3d0/
+DEV_API_HOST=https\://dev.api.ghzs.com/v4d4d0/
API_HOST=https\://and-api.ghzs.com/v4d3d0/
SENSITIVE_API_HOST=https\://and-core-api.ghzs.com/v4d3d0/