下载合集 修改二级版本背景,微调布局
This commit is contained in:
@ -110,7 +110,7 @@ public class DownloadDialog {
|
||||
|
||||
if (position - 1 < adapterMap.size()) {
|
||||
adapterMap.get(position - 1).notifyItemChanged(location % (row * column));
|
||||
if (collectionAdapterMap != null && collectionAdapterMap.size() >= position - 1){
|
||||
if (collectionAdapterMap != null && collectionAdapterMap.size() >= position - 1 && collectionAdapterMap.size() >= 1){
|
||||
collectionAdapterMap.get(position - 1).notifyItemChanged(location % (row * column));
|
||||
}
|
||||
}
|
||||
@ -212,12 +212,12 @@ public class DownloadDialog {
|
||||
TextView textView = (TextView) contentView.findViewById(R.id.dialog_title);
|
||||
textView.setText(gameName);
|
||||
|
||||
int count = game.getApk().size();
|
||||
int count = gameApk.size();
|
||||
int vpHeight = 0;
|
||||
if (count <= 3){
|
||||
vpHeight = 72;
|
||||
vpHeight = 80;
|
||||
}else if (count <= 6){
|
||||
vpHeight = 136;
|
||||
vpHeight = 140;
|
||||
}else {
|
||||
vpHeight = 200;
|
||||
}
|
||||
@ -509,13 +509,13 @@ public class DownloadDialog {
|
||||
entryMap.remove(url);
|
||||
int position = (int) Math.ceil((location + 1) / (double) (row * column));
|
||||
adapterMap.get(position - 1).notifyItemChanged(location % (row * column));
|
||||
if (collectionAdapterMap != null && collectionAdapterMap.size() >= position - 1){
|
||||
if (collectionAdapterMap != null && collectionAdapterMap.size() >= position - 1 && collectionAdapterMap.size() >= 1){
|
||||
collectionAdapterMap.get(position - 1).notifyItemChanged(location % (row * column));
|
||||
}
|
||||
} else if ("卸载".equals(busFour.getType())) {
|
||||
int position = (int) Math.ceil((location + 1) / (double) (row * column));
|
||||
adapterMap.get(position - 1).notifyItemChanged(location % (row * column));
|
||||
if (collectionAdapterMap != null && collectionAdapterMap.size() >= position - 1){
|
||||
if (collectionAdapterMap != null && collectionAdapterMap.size() >= position - 1 && collectionAdapterMap.size() >= 1){
|
||||
collectionAdapterMap.get(position - 1).notifyItemChanged(location % (row * column));
|
||||
}
|
||||
}
|
||||
@ -530,7 +530,7 @@ public class DownloadDialog {
|
||||
entryMap.remove(url);
|
||||
int position = (int) Math.ceil((location + 1) / (double) (row * column));
|
||||
adapterMap.get(position - 1).notifyItemChanged(location % (row * column));
|
||||
if (collectionAdapterMap != null && collectionAdapterMap.size() >= position - 1){
|
||||
if (collectionAdapterMap != null && collectionAdapterMap.size() >= position - 1 && collectionAdapterMap.size() >= 1){
|
||||
collectionAdapterMap.get(position - 1).notifyItemChanged(location % (row * column));
|
||||
}
|
||||
}
|
||||
@ -1156,15 +1156,17 @@ public class DownloadDialog {
|
||||
}
|
||||
|
||||
private void showCollectionLayout(GameCollectionEntity gameCollectionEntity) {
|
||||
|
||||
int count = gameCollectionEntity.getSaveApkEntity().size();
|
||||
int vpHeight = 0;
|
||||
if (count <= 3){
|
||||
vpHeight = 72;
|
||||
vpHeight = 80;
|
||||
}else if (count <= 6){
|
||||
vpHeight = 136;
|
||||
vpHeight = 140;
|
||||
}else {
|
||||
vpHeight = 200;
|
||||
}
|
||||
|
||||
ViewGroup.LayoutParams layoutParams = collectionViewPager.getLayoutParams();
|
||||
layoutParams.height = DisplayUtils.dip2px(context, vpHeight);
|
||||
collectionViewPager.setLayoutParams(layoutParams);
|
||||
@ -1193,6 +1195,7 @@ public class DownloadDialog {
|
||||
collectionLinearLayout.addView(imageView);
|
||||
}
|
||||
}
|
||||
|
||||
int currentItem = 0;
|
||||
if (viewPager != null) {
|
||||
currentItem = viewPager.getCurrentItem();
|
||||
@ -1234,7 +1237,6 @@ public class DownloadDialog {
|
||||
this.saveApkEntity = saveApkEntity;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return (int) Math.ceil(saveApkEntity.size() / (double) (row * column));
|
||||
|
||||
Reference in New Issue
Block a user