Android Open Source - pixel-art Config Change Fragment

From Project

Back to project page pixel-art.


The source code is released under:

Apache License

If you think the Android project pixel-art listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jaween.pixelart.util;
/*from   w  w  w. j ava 2 s. co m*/
import android.os.Bundle;

import com.jaween.pixelart.ui.animation.Frame;
import com.jaween.pixelart.ui.layer.Layer;
import com.jaween.pixelart.ui.undo.UndoManager;

import java.util.LinkedList;

 * Worker Fragment which holds onto large objects (such as the Frames or undo stack) when the
 * device has a configuration change. The Activity will be recreated, but this fragment will be
 * retained and the newly recreated Fragment can retrieve the object.
public class ConfigChangeFragment extends Fragment {

    public static final String TAG_CONFIG_CHANGE_FRAGMENT = "config_change_fragment";

    private LinkedList<Frame> frames;
    private UndoManager undoManager;

    public void onCreate(Bundle savedInstanceState) {

        // Retains fragment between device configuration changes

    public LinkedList<Frame> getFrames() {
        return frames;

    public void setFrames(LinkedList<Frame> frames) {
        this.frames= frames;

    public UndoManager getUndoManager() {
        return undoManager;

    public void setUndoManager(UndoManager undoManager) {
        this.undoManager = undoManager;

Java Source Code List