use of org.thoughtcrime.securesms.scribbles.widget.entity.MotionEntity in project Signal-Android by WhisperSystems.
the class MotionView method findEntityAtPoint.
@Nullable
private MotionEntity findEntityAtPoint(float x, float y) {
MotionEntity selected = null;
PointF p = new PointF(x, y);
for (int i = entities.size() - 1; i >= 0; i--) {
if (entities.get(i).pointInLayerRect(p)) {
selected = entities.get(i);
break;
}
}
return selected;
}
use of org.thoughtcrime.securesms.scribbles.widget.entity.MotionEntity in project Signal-Android by WhisperSystems.
the class MotionView method updateSelectionOnTap.
private void updateSelectionOnTap(MotionEvent e) {
MotionEntity entity = findEntityAtPoint(e.getX(), e.getY());
selectEntity(entity, true);
}
use of org.thoughtcrime.securesms.scribbles.widget.entity.MotionEntity in project Signal-Android by WhisperSystems.
the class MotionView method afterTextChanged.
@Override
public void afterTextChanged(Editable s) {
String text = s.toString();
MotionEntity entity = getSelectedEntity();
if (entity != null && entity instanceof TextEntity) {
TextEntity textEntity = (TextEntity) entity;
if (!textEntity.getLayer().getText().equals(text)) {
textEntity.getLayer().setText(text);
textEntity.updateEntity();
MotionView.this.invalidate();
}
}
}
Aggregations