Search in sources :

Example 1 with HistoryManager

use of com.android.gallery3d.filtershow.history.HistoryManager in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method setupMasterImage.

public void setupMasterImage() {
    HistoryManager historyManager = new HistoryManager();
    StateAdapter imageStateAdapter = new StateAdapter(this, 0);
    MasterImage.setMaster(null);
    mMasterImage = MasterImage.getImage();
    mMasterImage.setHistoryManager(historyManager);
    mMasterImage.setStateAdapter(imageStateAdapter);
    mMasterImage.setActivity(this);
    if (Runtime.getRuntime().maxMemory() > LIMIT_SUPPORTS_HIGHRES) {
        mMasterImage.setSupportsHighRes(true);
    } else {
        mMasterImage.setSupportsHighRes(false);
    }
}
Also used : StateAdapter(com.android.gallery3d.filtershow.state.StateAdapter) HistoryManager(com.android.gallery3d.filtershow.history.HistoryManager)

Example 2 with HistoryManager

use of com.android.gallery3d.filtershow.history.HistoryManager in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method setCurrentPanel.

public void setCurrentPanel(int currentPanel) {
    mCurrentPanel = currentPanel;
    if (mMasterImage == null) {
        return;
    }
    HistoryManager adapter = mMasterImage.getHistory();
    adapter.setActiveFilter(currentPanel);
}
Also used : HistoryManager(com.android.gallery3d.filtershow.history.HistoryManager)

Example 3 with HistoryManager

use of com.android.gallery3d.filtershow.history.HistoryManager in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method cancelCurrentFilter.

public void cancelCurrentFilter() {
    MasterImage masterImage = MasterImage.getImage();
    HistoryManager adapter = masterImage.getHistory();
    int position = adapter.undo();
    masterImage.onHistoryItemClick(position);
    invalidateViews();
    if (!masterImage.hasFusionApplied()) {
        masterImage.setFusionUnderlay(null);
        masterImage.setScaleFactor(1);
        masterImage.resetTranslation();
    }
    clearWaterMark();
}
Also used : MasterImage(com.android.gallery3d.filtershow.imageshow.MasterImage) HistoryManager(com.android.gallery3d.filtershow.history.HistoryManager) Point(android.graphics.Point)

Example 4 with HistoryManager

use of com.android.gallery3d.filtershow.history.HistoryManager in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method resetHistory.

void resetHistory() {
    if (mMasterImage == null) {
        return;
    }
    HistoryManager adapter = mMasterImage.getHistory();
    adapter.reset();
    HistoryItem historyItem = adapter.getItem(0);
    ImagePreset original = null;
    original = new ImagePreset();
    FilterRepresentation rep = null;
    if (historyItem != null) {
        rep = historyItem.getFilterRepresentation();
    }
    mMasterImage.setPreset(original, rep, true);
    mMasterImage.setFusionUnderlay(null);
    mMasterImage.resetTranslation();
    mMasterImage.setScaleFactor(1);
    mMasterImage.setCurrentFilterRepresentation(null);
    ArrayList<FilterRepresentation> frList = FiltersManager.getManager().getTools();
    for (FilterRepresentation fr : frList) {
        if (fr instanceof FilterRotateRepresentation) {
            ((FilterRotateRepresentation) fr).resetRotation();
        }
    }
    showDefaultImageView();
    showSaveButtonIfNeed();
    invalidateViews();
}
Also used : HistoryManager(com.android.gallery3d.filtershow.history.HistoryManager) HistoryItem(com.android.gallery3d.filtershow.history.HistoryItem) ImagePreset(com.android.gallery3d.filtershow.pipeline.ImagePreset) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) FilterRotateRepresentation(com.android.gallery3d.filtershow.filters.FilterRotateRepresentation)

Example 5 with HistoryManager

use of com.android.gallery3d.filtershow.history.HistoryManager in project android_packages_apps_Gallery2 by LineageOS.

the class EditorPanel method cancelCurrentFilter.

public void cancelCurrentFilter() {
    MasterImage masterImage = MasterImage.getImage();
    HistoryManager adapter = masterImage.getHistory();
    int position = adapter.undo();
    masterImage.onHistoryItemClick(position);
    ((FilterShowActivity) getActivity()).invalidateViews();
}
Also used : MasterImage(com.android.gallery3d.filtershow.imageshow.MasterImage) HistoryManager(com.android.gallery3d.filtershow.history.HistoryManager) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Aggregations

HistoryManager (com.android.gallery3d.filtershow.history.HistoryManager)5 MasterImage (com.android.gallery3d.filtershow.imageshow.MasterImage)2 Point (android.graphics.Point)1 FilterShowActivity (com.android.gallery3d.filtershow.FilterShowActivity)1 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)1 FilterRotateRepresentation (com.android.gallery3d.filtershow.filters.FilterRotateRepresentation)1 HistoryItem (com.android.gallery3d.filtershow.history.HistoryItem)1 ImagePreset (com.android.gallery3d.filtershow.pipeline.ImagePreset)1 StateAdapter (com.android.gallery3d.filtershow.state.StateAdapter)1