Пример #1
0
  @Override
  protected void onLayout(boolean changed, int l, int t, int r, int b) {
    int count = getChildCount();

    for (int i = 0; i < count; i++) {
      View child = getChildAt(i);
      if (child.getVisibility() != GONE) {

        CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();

        int childLeft = lp.x;
        int childTop = lp.y;
        child.layout(childLeft, childTop, childLeft + lp.width, childTop + lp.height);

        if (lp.dropped) {
          lp.dropped = false;

          //                    final int[] cellXY = mCellXY;
          //                    getLocationOnScreen(cellXY);
          //                    mWallpaperManager.sendWallpaperCommand(getWindowToken(),
          // "android.home.drop",
          //                            cellXY[0] + childLeft + lp.width / 2,
          //                            cellXY[1] + childTop + lp.height / 2, 0, null);
        }
      }
    }
  }