Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 8th, 2013  |  syntax: Java  |  size: 0.27 KB  |  hits: 108  |  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. }