Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 8th, 2013  |  syntax: Java  |  size: 0.27 KB  |  views: 157  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /**
  2.  * Returns number of cells needed for given size of the widget.
  3.  *
  4.  * @param size Widget size in dp.
  5.  * @return Size in number of cells.
  6.  */
  7. private static int getCellsForSize(int size) {
  8.         int n = 2;
  9.         while (70 * n - 30 < size) {
  10.                 ++n;
  11.         }
  12.         return n - 1;
  13. }
clone this paste RAW Paste Data