光环助手V3.6优化需求汇总(20181206)(1.2.5.7.8.9.10.13.21.22)https://gitlab.ghzhushou.com/pm/halo-app-issues/issues/402#note_14212

This commit is contained in:
kehaoyuan
2018-12-09 17:40:47 +08:00
parent 1abb783f4c
commit 22387e8e60
21 changed files with 473 additions and 304 deletions

View File

@ -89,6 +89,7 @@ public class DownloadDialog implements OnCollectionCallBackListener {
private String entrance;
private String location;
private ExposureEvent traceEvent;
private String mAutoDownloadPlatform;
private final int row = 3;
private final int column = 3;
private boolean isLoadPlatform;
@ -105,12 +106,19 @@ public class DownloadDialog implements OnCollectionCallBackListener {
return instance;
}
// 自动下载并翻到相应页面
public void showPopupWindowAutoDownload(View view, GameEntity gameEntity, String autoDownloadPlatform,
String entrance, String location, ExposureEvent traceEvent) {
mAutoDownloadPlatform = autoDownloadPlatform;
showPopupWindow(view, gameEntity, entrance, location, traceEvent);
}
public void showPopupWindow(View view, GameEntity gameEntity, String entrance, String location) {
showPopupWindow(view, gameEntity, entrance, location, null);
}
public void showPopupWindow(View view, GameEntity gameEntity, String entrance, String location, @Nullable ExposureEvent traceEvent) {
public void showPopupWindow(View view, GameEntity gameEntity, String entrance, String location,
@Nullable ExposureEvent traceEvent) {
if (isShow && (popupWindow == null || !popupWindow.isShowing())) {
isShow = false;
}
@ -397,10 +405,34 @@ public class DownloadDialog implements OnCollectionCallBackListener {
if (viewPager != null) {
currentItem = viewPager.getCurrentItem();
}
if (!TextUtils.isEmpty(mAutoDownloadPlatform)) {
for (int i = 0; i < apkList.size(); i++) {
ApkEntity apkEntity = apkList.get(i);
if (mAutoDownloadPlatform.equals(apkEntity.getPlatform())) {
currentItem = (i / 9);
break;
}
GameCollectionEntity apkCollection = apkEntity.getApkCollection();
if (apkCollection != null) {
List<ApkEntity> saveApkEntity = apkCollection.getSaveApkEntity();
if (saveApkEntity != null) {
for (ApkEntity entity : saveApkEntity) {
if (mAutoDownloadPlatform.equals(entity.getPlatform())) {
currentItem = (i / 9);
break;
}
}
}
}
}
}
Utils.log("currentItem = " + currentItem);
adapter = new PlatformPagerAdapter(mContext, this, gameEntity, apkList, entrance, location, traceEvent);
adapter = new PlatformPagerAdapter(mContext, this,
gameEntity, apkList, mAutoDownloadPlatform, entrance, location, traceEvent);
viewPager.setAdapter(adapter);
viewPager.setCurrentItem(currentItem);
if (currentItem != 0) setDownloadOvalHint(dialog_ll_hint, currentItem);
}
private void addHintPoint(LinearLayout linearLayout, int size) {
@ -467,7 +499,8 @@ public class DownloadDialog implements OnCollectionCallBackListener {
public void showCollection(GameCollectionEntity gameCollectionEntity) {
dialog_ll_collection.setVisibility(View.VISIBLE);
int count = gameCollectionEntity.getSaveApkEntity().size();
List<ApkEntity> saveApkList = gameCollectionEntity.getSaveApkEntity();
int count = saveApkList.size();
int vpHeight;
if (count <= 3) {
vpHeight = 82;
@ -482,14 +515,31 @@ public class DownloadDialog implements OnCollectionCallBackListener {
collectionViewPager.setLayoutParams(layoutParams);
dialog_ll_collection_hint.removeAllViews();
int size = (int) Math.ceil(gameCollectionEntity.getSaveApkEntity().size() / (double) (row * column));
int size = (int) Math.ceil(count / (double) (row * column));
addHintPoint(dialog_ll_collection_hint, size);
collectionAdapter = new PlatformPagerAdapter(
mContext, null, gameEntity, gameCollectionEntity.getSaveApkEntity(), entrance, location, traceEvent);
mContext, null, gameEntity, saveApkList,
mAutoDownloadPlatform, entrance, location, traceEvent);
collectionViewPager.setAdapter(collectionAdapter);
collectionViewPager.addOnPageChangeListener(new MyPageChangeListener(dialog_ll_collection_hint));
int currentItem = 0;
if (!TextUtils.isEmpty(mAutoDownloadPlatform)) {
for (int i = 0; i < saveApkList.size(); i++) {
ApkEntity apkEntity = saveApkList.get(i);
if (mAutoDownloadPlatform.equals(apkEntity.getPlatform())) {
currentItem = (i / 9);
break;
}
}
}
if (currentItem != 0) {
collectionViewPager.setCurrentItem(currentItem);
setDownloadOvalHint(dialog_ll_collection_hint, currentItem);
}
mAutoDownloadPlatform = null;
}
// 隐藏合集
@ -514,15 +564,7 @@ public class DownloadDialog implements OnCollectionCallBackListener {
@Override
public void onPageSelected(int position) {
for (int i = 0, size = linearLayout.getChildCount(); i < size; i++) {
if (i == position % size) {
((ImageView) linearLayout.getChildAt(i))
.setImageResource(R.drawable.download_oval_hint_up);
} else {
((ImageView) linearLayout.getChildAt(i))
.setImageResource(R.drawable.oval_hint_gray_bg);
}
}
setDownloadOvalHint(linearLayout, position);
}
@Override
@ -531,4 +573,16 @@ public class DownloadDialog implements OnCollectionCallBackListener {
}
}
private void setDownloadOvalHint(LinearLayout linearLayout, int position) {
for (int i = 0, size = linearLayout.getChildCount(); i < size; i++) {
if (i == position % size) {
((ImageView) linearLayout.getChildAt(i))
.setImageResource(R.drawable.download_oval_hint_up);
} else {
((ImageView) linearLayout.getChildAt(i))
.setImageResource(R.drawable.oval_hint_gray_bg);
}
}
}
}