Search in sources :

Example 1 with TextLayer

use of org.thoughtcrime.securesms.scribbles.viewmodel.TextLayer in project Signal-Android by WhisperSystems.

the class ScribbleActivity method addTextSticker.

protected void addTextSticker() {
    TextLayer textLayer = createTextLayer();
    TextEntity textEntity = new TextEntity(textLayer, scribbleView.getWidth(), scribbleView.getHeight());
    scribbleView.addEntityAndPosition(textEntity);
    // move text sticker up so that its not hidden under keyboard
    PointF center = textEntity.absoluteCenter();
    center.y = center.y * 0.5F;
    textEntity.moveCenterTo(center);
    // redraw
    scribbleView.invalidate();
    startTextEntityEditing();
    changeTextEntityColor(toolbar.getToolColor());
}
Also used : TextLayer(org.thoughtcrime.securesms.scribbles.viewmodel.TextLayer) PointF(android.graphics.PointF) TextEntity(org.thoughtcrime.securesms.scribbles.widget.entity.TextEntity)

Example 2 with TextLayer

use of org.thoughtcrime.securesms.scribbles.viewmodel.TextLayer in project Signal-Android by WhisperSystems.

the class ScribbleActivity method createTextLayer.

private TextLayer createTextLayer() {
    TextLayer textLayer = new TextLayer();
    Font font = new Font();
    font.setColor(TextLayer.Limits.INITIAL_FONT_COLOR);
    font.setSize(TextLayer.Limits.INITIAL_FONT_SIZE);
    textLayer.setFont(font);
    return textLayer;
}
Also used : TextLayer(org.thoughtcrime.securesms.scribbles.viewmodel.TextLayer) Font(org.thoughtcrime.securesms.scribbles.viewmodel.Font)

Aggregations

TextLayer (org.thoughtcrime.securesms.scribbles.viewmodel.TextLayer)2 PointF (android.graphics.PointF)1 Font (org.thoughtcrime.securesms.scribbles.viewmodel.Font)1 TextEntity (org.thoughtcrime.securesms.scribbles.widget.entity.TextEntity)1