Search in sources :

Example 16 with EditorModel

use of org.signal.imageeditor.core.model.EditorModel in project Signal-Android by signalapp.

the class ImageEditorFragment method restoreState.

@Override
public void restoreState(@NonNull Object state) {
    if (state instanceof Data) {
        Data data = (Data) state;
        EditorModel model = data.readModel();
        if (model != null) {
            if (imageEditorView != null) {
                imageEditorView.setModel(model);
                onDrawingChanged(false, false);
            } else {
                this.restoredModel = model;
            }
        }
    } else {
        Log.w(TAG, "Received a bad saved state. Received class: " + state.getClass().getName());
    }
}
Also used : EditorModel(org.signal.imageeditor.core.model.EditorModel)

Aggregations

EditorModel (org.signal.imageeditor.core.model.EditorModel)16 EditorElement (org.signal.imageeditor.core.model.EditorElement)10 Point (android.graphics.Point)8 Intent (android.content.Intent)4 AlertDialog (androidx.appcompat.app.AlertDialog)4 MultiLineTextRenderer (org.signal.imageeditor.core.renderers.MultiLineTextRenderer)4 Bitmap (android.graphics.Bitmap)2 Matrix (android.graphics.Matrix)2 Paint (android.graphics.Paint)2 DisplayMetrics (android.util.DisplayMetrics)2 MenuItem (android.view.MenuItem)2 Nullable (androidx.annotation.Nullable)2 Toolbar (androidx.appcompat.widget.Toolbar)2 LiveData (androidx.lifecycle.LiveData)2 UriRenderer (org.signal.imageeditor.app.renderers.UriRenderer)2 UrlRenderer (org.signal.imageeditor.app.renderers.UrlRenderer)2 ImageEditorView (org.signal.imageeditor.core.ImageEditorView)2 ImageEditorFragment (org.thoughtcrime.securesms.scribbles.ImageEditorFragment)2 UriGlideRenderer (org.thoughtcrime.securesms.scribbles.UriGlideRenderer)2 DefaultValueLiveData (org.thoughtcrime.securesms.util.DefaultValueLiveData)2