Back to project page pinpoint-android.
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.
package co.islovely.pinpoint; /*w w w .j a v a 2 s . c om*/ import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; public class QuadrantsActivity extends PinpointActivity implements OnTouchListener { @Override protected int getLayoutId() { return R.layout.quadrants; } @Override protected int[] getButtonIds() { return new int[] { R.id.topLeft, R.id.topRight, R.id.bottomLeft, R.id.bottomRight }; } @Override protected boolean isClickCorrect(int id) { LauncherItem launcherItem = this.getLauncherItem(); int cellX = launcherItem.getCellX(), cellY = launcherItem.getCellY(); boolean isTop = cellY < 2, isBottom = cellY >= 2, isLeft = cellX < 2, isRight = cellX >= 2; switch (id) { case R.id.topLeft: return isTop && isLeft; case R.id.topRight: return isTop && isRight; case R.id.bottomLeft: return isBottom && isLeft; case R.id.bottomRight: return isBottom && isRight; } return false; } }