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);
}
}
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);
}
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();
}
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();
}
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();
}
Aggregations