use of org.thoughtcrime.securesms.scribbles.multitouch.RotateGestureDetector in project Signal-Android by WhisperSystems.
the class MotionView method init.
private void init(@NonNull Context context, @Nullable AttributeSet attrs) {
// I fucking love Android
setWillNotDraw(false);
selectedLayerPaint = new Paint();
selectedLayerPaint.setAlpha((int) (255 * Constants.SELECTED_LAYER_ALPHA));
selectedLayerPaint.setAntiAlias(true);
this.editText = new EditText(context, attrs);
ViewCompat.setAlpha(this.editText, 0);
this.editText.setLayoutParams(new LayoutParams(1, 1, Gravity.TOP | Gravity.LEFT));
this.editText.setClickable(false);
this.editText.setBackgroundColor(Color.TRANSPARENT);
this.editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 1);
this.editText.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
this.addView(editText);
this.editText.clearFocus();
this.editText.addTextChangedListener(this);
// init listeners
this.scaleGestureDetector = new ScaleGestureDetector(context, new ScaleListener());
this.rotateGestureDetector = new RotateGestureDetector(context, new RotateListener());
this.moveGestureDetector = new MoveGestureDetector(context, new MoveListener());
this.gestureDetectorCompat = new GestureDetectorCompat(context, new TapsListener());
setOnTouchListener(onTouchListener);
updateUI();
}
Aggregations