use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class UserPresetsAdapter method deletePreset.
private void deletePreset(Action action) {
FilterRepresentation rep = action.getRepresentation();
if (rep instanceof FilterUserPresetRepresentation) {
mDeletedRepresentations.add((FilterUserPresetRepresentation) rep);
}
remove(action);
notifyDataSetChanged();
}
use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class StateAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
StateView view = null;
if (convertView == null) {
convertView = new StateView(getContext());
}
view = (StateView) convertView;
State state = getItem(position);
view.setState(state);
view.setOrientation(mOrientation);
FilterRepresentation currentRep = MasterImage.getImage().getCurrentFilterRepresentation();
FilterRepresentation stateRep = state.getFilterRepresentation();
if (currentRep != null && stateRep != null && currentRep.getFilterClass() == stateRep.getFilterClass() && currentRep.getEditorId() != ImageOnlyEditor.ID) {
view.setSelected(true);
} else {
view.setSelected(false);
}
return view;
}
use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class StateAdapter method remove.
@Override
public void remove(State state) {
super.remove(state);
FilterRepresentation filterRepresentation = state.getFilterRepresentation();
FilterShowActivity activity = (FilterShowActivity) getContext();
activity.removeFilterRepresentation(filterRepresentation);
}
use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class Editor method reflectCurrentFilter.
/**
* called after the filter is set and the select is called
*/
public void reflectCurrentFilter() {
mLocalRepresentation = null;
FilterRepresentation representation = getLocalRepresentation();
if (representation != null && mFilterTitle != null && representation.getTextId() != 0) {
String text = mContext.getString(representation.getTextId()).toUpperCase();
mFilterTitle.setText(text);
updateText();
}
}
use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class Editor method getLocalRepresentation.
public FilterRepresentation getLocalRepresentation() {
if (mLocalRepresentation == null) {
ImagePreset preset = MasterImage.getImage().getPreset();
FilterRepresentation filterRepresentation = MasterImage.getImage().getCurrentFilterRepresentation();
mLocalRepresentation = preset.getFilterRepresentationCopyFrom(filterRepresentation);
if (mShowParameter == SHOW_VALUE_UNDEFINED && filterRepresentation != null) {
boolean show = filterRepresentation.showParameterValue();
mShowParameter = show ? SHOW_VALUE_INT : SHOW_VALUE_OFF;
}
}
return mLocalRepresentation;
}
Aggregations