public void showViewAt(int index) { ViewBundle vb = this.gridBundle.get(index); if (vb == null) { return; } if (!vb.isEmpty()) { vb.displayed.setVisibility(View.VISIBLE); } }
public Map<String, Integer> getTagIndexMap() { Map<String, Integer> tagIndexMap = new HashMap<String, Integer>(); for (int i = 0; i < col * row; i++) { ViewBundle vb = gridBundle.get(i); if (vb.isEmpty()) continue; for (View v : vb.vlist) { tagIndexMap.put((String) v.getTag(), i); } } return tagIndexMap; }
public int getIndex(View v) { int result = -1; for (int i = 0; i < col; i++) { for (int j = 0; j < row; j++) { int index = coordinatesToIndex(i, j); ViewBundle bundle = gridBundle.get(index); if (bundle != null && !bundle.isEmpty() && bundle.displayed == v) { return index; } } } return result; }
public void transportView(int sourceIndex, int destIndex) { if (sourceIndex == destIndex) return; ViewBundle spot_src = gridBundle.get(sourceIndex); ViewBundle spot_dest = gridBundle.get(destIndex); if (spot_src.displayed == null) return; // should not be if (spot_dest.isEmpty() || enableOverlay) { spot_dest.addFromViewBundle(spot_src); spot_src.clear(); addpartialView(destIndex); } else { showViewAt(sourceIndex); } }
public void addView(View v, int index) { ViewBundle spot = gridBundle.get(index); spot.addView(v); }
public void addView(View v, int x, int y) { int index = coordinatesToIndex(x, y); ViewBundle spot = gridBundle.get(index); spot.addView(v); }