use of com.android.gallery3d.filtershow.history.HistoryItem in project android_packages_apps_Gallery2 by LineageOS.
the class MasterImage method setPreset.
public synchronized void setPreset(ImagePreset preset, FilterRepresentation change, boolean addToHistory, boolean updateCategory) {
if (DEBUG) {
preset.showFilters();
}
mPreset = preset;
mPreset.fillImageStateAdapter(mState);
if (addToHistory) {
HistoryItem historyItem = new HistoryItem(mPreset, change);
mHistory.addHistoryItem(historyItem);
}
updatePresets(true);
resetGeometryImages(false);
if (updateCategory) {
mActivity.updateCategories();
}
}
use of com.android.gallery3d.filtershow.history.HistoryItem 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.HistoryItem in project android_packages_apps_Gallery2 by LineageOS.
the class MasterImage method onHistoryItemClick.
public void onHistoryItemClick(int position, boolean updateCategory) {
HistoryItem historyItem = mHistory.getItem(position);
// We need a copy from the history
if (historyItem == null) {
return;
}
ImagePreset newPreset = new ImagePreset(historyItem.getImagePreset());
// don't need to add it to the history
setPreset(newPreset, historyItem.getFilterRepresentation(), false, updateCategory);
mHistory.setCurrentPreset(position);
}
Aggregations