Android Open Source - pinpoint-android Grid Activity






From Project

Back to project page pinpoint-android.

License

The source code is released under:

MIT License

If you think the Android project pinpoint-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package co.islovely.pinpoint;
/*from   w  ww .j  a  va  2  s  .  c om*/
public class GridActivity extends PinpointActivity {
  @Override
  protected int getLayoutId() {
    return R.layout.grid;
  }

  @Override
  protected int[] getButtonIds() {
    return new int[]{
        R.id.columnOne_rowOne,
        R.id.columnOne_rowTwo,
        R.id.columnOne_rowThree,
        R.id.columnOne_rowFour,

        R.id.columnTwo_rowOne,
        R.id.columnTwo_rowTwo,
        R.id.columnTwo_rowThree,
        R.id.columnTwo_rowFour,

        R.id.columnThree_rowOne,
        R.id.columnThree_rowTwo,
        R.id.columnThree_rowThree,
        R.id.columnThree_rowFour,

        R.id.columnFour_rowOne,
        R.id.columnFour_rowTwo,
        R.id.columnFour_rowThree,
        R.id.columnFour_rowFour
    };
  }

  @Override
  protected boolean isClickCorrect(int id) {
    LauncherItem launcherItem = this.getLauncherItem();
    int
        cellX = launcherItem.getCellX(),
        cellY = launcherItem.getCellY();
    boolean
        isColumnOne   = cellX == 0,
        isColumnTwo   = cellX == 1,
        isColumnThree = cellX == 2,
        isColumnFour  = cellX == 3,
        isRowOne   = cellY == 0,
        isRowTwo   = cellY == 1,
        isRowThree = cellY == 2,
        isRowFour  = cellY == 3;

    switch (id) {
      case R.id.columnOne_rowOne:
        return isColumnOne && isRowOne;
      case R.id.columnTwo_rowOne:
        return isColumnTwo && isRowOne;
      case R.id.columnThree_rowOne:
        return isColumnThree && isRowOne;
      case R.id.columnFour_rowOne:
        return isColumnFour && isRowOne;
      case R.id.columnOne_rowTwo:
        return isColumnOne && isRowTwo;
      case R.id.columnTwo_rowTwo:
        return isColumnTwo && isRowTwo;
      case R.id.columnThree_rowTwo:
        return isColumnThree && isRowTwo;
      case R.id.columnFour_rowTwo:
        return isColumnFour && isRowTwo;
      case R.id.columnOne_rowThree:
        return isColumnOne && isRowThree;
      case R.id.columnTwo_rowThree:
        return isColumnTwo && isRowThree;
      case R.id.columnThree_rowThree:
        return isColumnThree && isRowThree;
      case R.id.columnFour_rowThree:
        return isColumnFour && isRowThree;
      case R.id.columnOne_rowFour:
        return isColumnOne && isRowFour;
      case R.id.columnTwo_rowFour:
        return isColumnTwo && isRowFour;
      case R.id.columnThree_rowFour:
        return isColumnThree && isRowFour;
      case R.id.columnFour_rowFour:
        return isColumnFour && isRowFour;
    }

    return false;
  }
}




Java Source Code List

co.islovely.pinpoint.ColumnsActivity.java
co.islovely.pinpoint.Configuration.java
co.islovely.pinpoint.DeviceMetrics.java
co.islovely.pinpoint.GridActivity.java
co.islovely.pinpoint.HomescreenAdapter.java
co.islovely.pinpoint.HomescreenSelectActivity.java
co.islovely.pinpoint.Homescreen.java
co.islovely.pinpoint.IntermissionActivity.java
co.islovely.pinpoint.LauncherItem.java
co.islovely.pinpoint.LauncherReader.java
co.islovely.pinpoint.LayoutConfigurationActivity.java
co.islovely.pinpoint.MainActivity.java
co.islovely.pinpoint.MyApplication.java
co.islovely.pinpoint.PinpointActivity.java
co.islovely.pinpoint.Pinpoint.java
co.islovely.pinpoint.QuadrantsActivity.java
co.islovely.pinpoint.RowsActivity.java
co.islovely.pinpoint.StatisticsActivity.java
co.islovely.pinpoint.TaskLogEntry.java
co.islovely.pinpoint.TaskLog.java
co.islovely.pinpoint.TaskManager.java
co.islovely.pinpoint.Task.java
co.islovely.pinpoint.User.java
util.Base64.java