Android 4.0の画面をタップすると、 の値getPressure()
は常に1.0
です。この値はAndroid 2.1では問題ありません。何か問題ある?テスト デバイスはSamsung Galaxy S IIIです。コードは次のようになります。
@Override
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
float allWidth = this.getWidth();
float allHeight = this.getHeight();
calculate(event.getX(), event.getY(), allWidth, allHeight,
event.getPressure());
return true;
}