This commit is contained in:
wangcongtao
2020-03-31 10:44:30 +08:00
parent 54c6b3ef95
commit bbe4691c4d
5 changed files with 25 additions and 14 deletions

View File

@@ -20,9 +20,11 @@ import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@@ -82,13 +84,21 @@ public class AppsPresenter extends Presenter<AppsView> {
}
private Map<Integer, List<AppInfo>> addGuideAppEntrance(Map<Integer, List<AppInfo>> appInfoMap) {
Map<Integer, List<AppInfo>> result;
if (appInfoMap == null) {
result = new HashMap<>();
} else {
result = new HashMap<>();
result.putAll(appInfoMap);
Map<Integer, List<AppInfo>> result = new HashMap<>();
if ( appInfoMap != null && !appInfoMap.isEmpty() ) {
// val deep copy
Set<Integer> keys = appInfoMap.keySet();
for ( Integer key : keys ) {
List<AppInfo> val = appInfoMap.get( key );
try {
result.put( key, new ArrayList<>( val ) );
} catch ( Exception e ) {
result.put( key, new ArrayList<>() );
}
}
}
if (result.isEmpty()) {
result.put(0, new ArrayList<>());
} else if (result.get(result.size() - 1) == null) {