| | | |
Offset 1218, 49 lines modified | Offset 1218, 50 lines modified |
1218 | ············} | 1218 | ············} |
1219 | ············++n; | 1219 | ············++n; |
1220 | ········} | 1220 | ········} |
1221 | ········return·this.applyOperations(); | 1221 | ········return·this.applyOperations(); |
1222 | ····} | 1222 | ····} |
1223 | ···· | 1223 | ···· |
1224 | ····protected·void·migrateScreen(final·int·n)·{ | 1224 | ····protected·void·migrateScreen(final·int·n)·{ |
1225 | ········final·int·n2·=·1; | |
1226 | ········final·int·n3·=·(n·==·0·&&·n2)·?·1·:·0; | |
1227 | ········final·ArrayList·loadWorkspaceEntries·=·this.loadWorkspaceEntries(n); | 1225 | ········final·ArrayList·loadWorkspaceEntries·=·this.loadWorkspaceEntries(n); |
1228 | ········int·n4·=·-1·>>>·1; | 1226 | ········int·n2·=·-1·>>>·1; |
1229 | ········int·n5·=·-1·>>>·1; | 1227 | ········int·n3·=·-1·>>>·1; |
1230 | ········float·n6·=·Float.MAX_VALUE; | 1228 | ········float·n4·=·Float.MAX_VALUE; |
1231 | ········float·n7·=·Float.MAX_VALUE; | 1229 | ········float·n5·=·Float.MAX_VALUE; |
1232 | ········final·int·n8·=·2; | 1230 | ········final·int·n6·=·2; |
1233 | ········final·float[]·array·=·new·float[n8]; | 1231 | ········final·float[]·array·=·new·float[n6]; |
1234 | ········ArrayList<GridSizeMigrationTask$DbEntry>·list·=·null; | 1232 | ········ArrayList<GridSizeMigrationTask$DbEntry>·list·=·null; |
1235 | ········int·i·=·0; | 1233 | ········int·n7·=·0; |
1236 | ····Label_0478: | 1234 | ········int·n8·=·0; |
| 1235 | ········int·j·=·0; |
| 1236 | ········int·k·=·0; |
| 1237 | ········float·n18·=·0.0f; |
| 1238 | ········ArrayList<GridSizeMigrationTask$DbEntry>·list3·=·null; |
| 1239 | ····Label_0429: |
1237 | ········while·(true)·{ | 1240 | ········while·(true)·{ |
1238 | ············while·(i·<·this.mSrcX)·{ | 1241 | ············final·int·mSrcX·=·this.mSrcX; |
1239 | ················int·j·=·this.mSrcY·-·n2; | 1242 | ············n8·=·1; |
1240 | ················int·n9·=·n4; | 1243 | ············if·(n7·<·mSrcX)·{ |
1241 | ················int·n10·=·n5; | 1244 | ················int·i·=·this.mSrcY·-·n8; |
1242 | ················float·n11·=·n6; | 1245 | ················int·n9·=·n2; |
1243 | ················float·n12·=·n7; | 1246 | ················int·n10·=·n3; |
| 1247 | ················float·n11·=·n4; |
| 1248 | ················float·n12·=·n5; |
1244 | ················ArrayList<GridSizeMigrationTask$DbEntry>·list2·=·list; | 1249 | ················ArrayList<GridSizeMigrationTask$DbEntry>·list2·=·list; |
1245 | ················int·k; | |
1246 | ················int·l; | |
1247 | ················float·n18; | |
1248 | ················ArrayList<GridSizeMigrationTask$DbEntry>·list3; | |
1249 | ················while·(true)·{ | 1250 | ················while·(true)·{ |
1250 | ····················while·(j·>=·n3)·{ | 1251 | ····················while·(i·>=·0)·{ |
1251 | ························final·ArrayList·deepCopy·=·deepCopy(loadWorkspaceEntries); | 1252 | ························final·ArrayList·deepCopy·=·deepCopy(loadWorkspaceEntries); |
1252 | ························final·int·n13·=·j; | 1253 | ························final·int·n13·=·i; |
1253 | ························final·ArrayList·tryRemove·=·this.tryRemove(i,·j,·n3,·deepCopy,·array); | 1254 | ························final·ArrayList·tryRemove·=·this.tryRemove(n7,·i,·0,·deepCopy,·array); |
1254 | ························if·(array[0]·<·n11·||·(array[0]·==·n11·&&·array[n2]·<·n12))·{ | 1255 | ························if·(array[0]·<·n11·||·(array[0]·==·n11·&&·array[n8]·<·n12))·{ |
1255 | ····························final·float·n14·=·array[0]; | 1256 | ····························final·float·n14·=·array[0]; |
1256 | ····························final·float·n15·=·array[n2]; | 1257 | ····························final·float·n15·=·array[n8]; |
1257 | ····························int·n16; | 1258 | ····························int·n16; |
1258 | ····························if·(this.mShouldRemoveX)·{ | 1259 | ····························if·(this.mShouldRemoveX)·{ |
1259 | ································n16·=·i; | 1260 | ································n16·=·n7; |
1260 | ····························} | 1261 | ····························} |
1261 | ····························else·{ | 1262 | ····························else·{ |
1262 | ································n16·=·n9; | 1263 | ································n16·=·n9; |
1263 | ····························} | 1264 | ····························} |
1264 | ····························int·n17; | 1265 | ····························int·n17; |
1265 | ····························if·(this.mShouldRemoveY)·{ | 1266 | ····························if·(this.mShouldRemoveY)·{ |
1266 | ································n17·=·n13; | 1267 | ································n17·=·n13; |
Offset 1271, 88 lines modified | Offset 1272, 85 lines modified |
1271 | ····························n11·=·n14; | 1272 | ····························n11·=·n14; |
1272 | ····························n12·=·n15; | 1273 | ····························n12·=·n15; |
1273 | ····························n9·=·n16; | 1274 | ····························n9·=·n16; |
1274 | ····························n10·=·n17; | 1275 | ····························n10·=·n17; |
1275 | ····························list2·=·(ArrayList<GridSizeMigrationTask$DbEntry>)tryRemove; | 1276 | ····························list2·=·(ArrayList<GridSizeMigrationTask$DbEntry>)tryRemove; |
1276 | ························} | 1277 | ························} |
1277 | ························if·(!this.mShouldRemoveY)·{ | 1278 | ························if·(!this.mShouldRemoveY)·{ |
1278 | ····························n4·=·n9; | 1279 | ····························n2·=·n9; |
1279 | ····························n5·=·n10; | 1280 | ····························n3·=·n10; |
1280 | ····························n6·=·n11; | 1281 | ····························n4·=·n11; |
1281 | ····························n7·=·n12; | 1282 | ····························n5·=·n12; |
1282 | ····························list·=·list2; | 1283 | ····························list·=·list2; |
1283 | ····························if·(!this.mShouldRemoveX)·{ | 1284 | ····························if·(!this.mShouldRemoveX)·{ |
1284 | ································k·=·n4; | 1285 | ································j·=·n2; |
1285 | ································l·=·n5; | 1286 | ································k·=·n3; |
1286 | ································n18·=·n6; | 1287 | ································n18·=·n4; |
1287 | ································list3·=·list; | 1288 | ································list3·=·list; |
1288 | ································break·Label_0478; | 1289 | ································break·Label_0429; |
1289 | ····························} | 1290 | ····························} |
1290 | ····························++i; | 1291 | ····························++n7; |
1291 | ····························continue·Label_0478; | 1292 | ····························continue·Label_0429; |
1292 | ························} | 1293 | ························} |
1293 | ························else·{ | 1294 | ························else·{ |
1294 | ····························j·=·n13·-·1; | 1295 | ····························i·=·n13·-·1; |
1295 | ························} | 1296 | ························} |
1296 | ····················} | 1297 | ····················} |
1297 | ····················n4·=·n9; | 1298 | ····················n2·=·n9; |
1298 | ····················n5·=·n10; | 1299 | ····················n3·=·n10; |
1299 | ····················n6·=·n11; | 1300 | ····················n4·=·n11; |
1300 | ····················n7·=·n12; | 1301 | ····················n5·=·n12; |
1301 | ····················list·=·list2; | 1302 | ····················list·=·list2; |
1302 | ····················continue; | 1303 | ····················continue; |
1303 | ················} | 1304 | ················} |
1304 | ················final·Object[]·args·=·{·l,·null,·null·}; | 1305 | ············} |
1305 | ················args[n2]·=·k; | 1306 | ············j·=·n2; |
1306 | ················args[n8]·=·n; | 1307 | ············k·=·n3; |
1307 | ················Log.d("GridSizeMigrationTask",·String.format("Removing·row·%d,·column·%d·on·screen·%d",·args)); | 1308 | ············n18·=·n4; |
1308 | ················final·IntSparseArrayMap·intSparseArrayMap·=·new·IntSparseArrayMap(); | 1309 | ············list3·=·list; |
1309 | ················for·(final·GridSizeMigrationTask$DbEntry·gridSizeMigrationTask$DbEntry·:·deepCopy(loadWorkspaceEntries))·{ | 1310 | ············break; |
1310 | ····················intSparseArrayMap.put(gridSizeMigrationTask$DbEntry.id,·(Object)gridSizeMigrationTask$DbEntry); | 1311 | ········} |
1311 | ················} | 1312 | ········final·Object[]·args·=·{·k,·null,·null·}; |
1312 | ················for·(final·GridSizeMigrationTask$DbEntry·gridSizeMigrationTask$DbEntry2·:·list3)·{ | 1313 | ········args[n8]·=·j; |
1313 | ····················final·GridSizeMigrationTask$DbEntry·gridSizeMigrationTask$DbEntry3·=·(GridSizeMigrationTask$DbEntry)intSparseArrayMap.get(gridSizeMigrationTask$DbEntry2.id); | 1314 | ········args[n6]·=·n; |
1314 | ····················intSparseArrayMap.remove(gridSizeMigrationTask$DbEntry2.id); | 1315 | ········Log.d("GridSizeMigrationTask",·String.format("Removing·row·%d,·column·%d·on·screen·%d",·args)); |
1315 | ····················if·(!gridSizeMigrationTask$DbEntry2.columnsSame(gridSizeMigrationTask$DbEntry3))·{ | 1316 | ········final·IntSparseArrayMap·intSparseArrayMap·=·new·IntSparseArrayMap(); |
1316 | ························this.update(gridSizeMigrationTask$DbEntry2); | 1317 | ········for·(final·GridSizeMigrationTask$DbEntry·gridSizeMigrationTask$DbEntry·:·deepCopy(loadWorkspaceEntries))·{ |
1317 | ····················} | 1318 | ············intSparseArrayMap.put(gridSizeMigrationTask$DbEntry.id,·(Object)gridSizeMigrationTask$DbEntry); |
1318 | ················} | 1319 | ········} |
1319 | ················final·Iterator·iterator3·=·intSparseArrayMap.iterator(); | 1320 | ········for·(final·GridSizeMigrationTask$DbEntry·gridSizeMigrationTask$DbEntry2·:·list3)·{ |
1320 | ················while·(iterator3.hasNext())·{ | 1321 | ············final·GridSizeMigrationTask$DbEntry·gridSizeMigrationTask$DbEntry3·=·(GridSizeMigrationTask$DbEntry)intSparseArrayMap.get(gridSizeMigrationTask$DbEntry2.id); |
1321 | ····················this.mCarryOver.add(iterator3.next()); | 1322 | ············intSparseArrayMap.remove(gridSizeMigrationTask$DbEntry2.id); |
1322 | ················} | 1323 | ············if·(!gridSizeMigrationTask$DbEntry2.columnsSame(gridSizeMigrationTask$DbEntry3))·{ |
1323 | ················if·(!this.mCarryOver.isEmpty()·&&·n18·==·0.0f)·{ | 1324 | ················this.update(gridSizeMigrationTask$DbEntry2); |
1324 | ····················final·GridOccupancy·gridOccupancy2; | 1325 | ············} |
1325 | ····················final·GridOccupancy·gridOccupancy·=·gridOccupancy2·=·new·GridOccupancy(this.mTrgX,·this.mTrgY); | 1326 | ········} |
1326 | ····················final·int·mTrgX·=·this.mTrgX; | 1327 | ········final·Iterator·iterator3·=·intSparseArrayMap.iterator(); |
1327 | ····················final·boolean·b·=·true; | 1328 | ········while·(iterator3.hasNext())·{ |
1328 | ····················final·int·n19·=·n3; | 1329 | ············this.mCarryOver.add(iterator3.next()); |
1329 | ····················final·int·n20·=·n3; | 1330 | ········} |
1330 | ····················gridOccupancy.markCells(0,·0,·mTrgX,·n19,·b); | 1331 | ········if·(!this.mCarryOver.isEmpty()·&&·n18·==·0.0f)·{ |
1331 | ····················final·Iterator<GridSizeMigrationTask$DbEntry>·iterator4·=·list3.iterator(); | 1332 | ············final·GridOccupancy·gridOccupancy·=·new·GridOccupancy(this.mTrgX,·this.mTrgY); |
1332 | ····················while·(iterator4.hasNext())·{ | 1333 | ············final·int·mTrgX·=·this.mTrgX; |
1333 | ························gridOccupancy2.markCells((ItemInfo)(GridSizeMigrationTask$DbEntry)iterator4.next(),·(boolean)(n2·!=·0)); | 1334 | ············final·boolean·b·=·true; |
1334 | ····················} | 1335 | ············final·GridOccupancy·gridOccupancy2·=·gridOccupancy; |
1335 | ····················final·GridSizeMigrationTask$OptimalPlacementSolution·gridSizeMigrationTask$OptimalPlacementSolution·=·new·GridSizeMigrationTask$OptimalPlacementSolution(this,·gridOccupancy2,·deepCopy(this.mCarryOver),·n20,·true); | 1336 | ············gridOccupancy.markCells(0,·0,·mTrgX,·0,·b); |
1336 | ····················gridSizeMigrationTask$OptimalPlacementSolution.find(); | 1337 | ············final·Iterator<GridSizeMigrationTask$DbEntry>·iterator4·=·list3.iterator(); |
1337 | ····················if·(gridSizeMigrationTask$OptimalPlacementSolution.lowestWeightLoss·==·0.0f)·{ | 1338 | ············while·(iterator4.hasNext())·{ |
1338 | ························for·(final·GridSizeMigrationTask$DbEntry·gridSizeMigrationTask$DbEntry4·:·gridSizeMigrationTask$OptimalPlacementSolution.finalPlacedItems)·{ | 1339 | ················gridOccupancy2.markCells((ItemInfo)(GridSizeMigrationTask$DbEntry)iterator4.next(),·(boolean)(n8·!=·0)); |
1339 | ····························gridSizeMigrationTask$DbEntry4.screenId·=·n; | 1340 | ············} |
1340 | ····························this.update(gridSizeMigrationTask$DbEntry4); | 1341 | ············final·GridSizeMigrationTask$OptimalPlacementSolution·gridSizeMigrationTask$OptimalPlacementSolution·=·new·GridSizeMigrationTask$OptimalPlacementSolution(this,·gridOccupancy2,·deepCopy(this.mCarryOver),·0,·true); |
1341 | ························} | 1342 | ············gridSizeMigrationTask$OptimalPlacementSolution.find(); |
1342 | ························this.mCarryOver.clear(); | 1343 | ············if·(gridSizeMigrationTask$OptimalPlacementSolution.lowestWeightLoss·==·0.0f)·{ |
1343 | ····················} | 1344 | ················for·(final·GridSizeMigrationTask$DbEntry·gridSizeMigrationTask$DbEntry4·:·gridSizeMigrationTask$OptimalPlacementSolution.finalPlacedItems)·{ |
| 1345 | ····················gridSizeMigrationTask$DbEntry4.screenId·=·n; |
| 1346 | ····················this.update(gridSizeMigrationTask$DbEntry4); |
1344 | ················} | 1347 | ················} |
1345 | ················return; | 1348 | ················this.mCarryOver.clear(); |
1346 | ············} | 1349 | ············} |
1347 | ············int·k·=·n4; | |
1348 | ············int·l·=·n5; | |
1349 | ············float·n18·=·n6; | |
1350 | ············ArrayList<GridSizeMigrationTask$DbEntry>·list3·=·list; | |
1351 | ············continue·Label_0478; | |
1352 | ········} | 1350 | ········} |
1353 | ····} | 1351 | ····} |
1354 | ···· | 1352 | ···· |
1355 | ····protected·boolean·migrateWorkspace()·{ | 1353 | ····protected·boolean·migrateWorkspace()·{ |
1356 | ········final·IntArray·workspaceScreenIds·=·getWorkspaceScreenIds(this.mDb,·this.mTableName); | 1354 | ········final·IntArray·workspaceScreenIds·=·getWorkspaceScreenIds(this.mDb,·this.mTableName); |
1357 | ········if·(!workspaceScreenIds.isEmpty())·{ | 1355 | ········if·(!workspaceScreenIds.isEmpty())·{ |
1358 | ············for·(int·i·=·0;·i·<·workspaceScreenIds.size();·++i)·{ | 1356 | ············for·(int·i·=·0;·i·<·workspaceScreenIds.size();·++i)·{ |