use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method onMediaPickerResult.
public void onMediaPickerResult(Uri selImg) {
mFilterPresetSource = new FilterPresetSource(this);
int id = nameFilter(mFilterPresetSource, tempFilterArray);
FilterPresetRepresentation fp = new FilterPresetRepresentation(getString(R.string.filtershow_preset_title) + id, id, id);
fp.setSerializationName("Custom");
fp.setUri(selImg);
ImagePreset preset = new ImagePreset();
preset.addFilter(fp);
SaveOption sp = new SaveOption();
sp._id = id;
sp.name = "Custom" + id;
sp.Uri = selImg.toString();
tempFilterArray.add(sp);
FiltersManager.getManager().addRepresentation(fp);
mCategoryLooksAdapter.add(new Action(this, fp, Action.FULL_VIEW, true));
useFilterRepresentation(fp);
int pos = mCategoryLooksAdapter.getPositionOfPresentation(fp);
if (pos != -1)
backAndSetCustomFilterSelected(pos);
}
use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillDualCamera.
private void fillDualCamera() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getDualCamera();
if (mCategoryDualCamAdapter != null) {
mCategoryDualCamAdapter.clear();
}
mCategoryDualCamAdapter = new CategoryAdapter(this);
for (FilterRepresentation representation : filtersRepresentations) {
if (representation.getTextId() != 0) {
representation.setName(getString(representation.getTextId()));
}
mCategoryDualCamAdapter.add(new Action(this, representation));
}
}
use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillMakeup.
private void fillMakeup() {
if (!SimpleMakeupImageFilter.HAS_TS_MAKEUP) {
return;
}
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> makeups = filtersManager.getMakeup();
if (mCategoryMakeupAdapter != null) {
mCategoryMakeupAdapter.clear();
}
mCategoryMakeupAdapter = new CategoryAdapter(this);
for (FilterRepresentation makeup : makeups) {
if (makeup.getTextId() != 0) {
makeup.setName(getString(makeup.getTextId()));
}
mCategoryMakeupAdapter.add(new Action(this, makeup));
}
}
use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method updateUserPresetsFromManager.
public void updateUserPresetsFromManager() {
ArrayList<FilterUserPresetRepresentation> presets = mUserPresetsManager.getRepresentations();
if (presets == null) {
return;
}
if (mCategoryLooksAdapter != null) {
fillLooks();
}
/* if (presets.size() > 0) {
mCategoryLooksAdapter.add(new Action(this, Action.SPACER));
} */
mUserPresetsAdapter.clear();
if (presets.size() > 0) {
mCategoryLooksAdapter.add(new Action(this, Action.ADD_ACTION));
}
for (int i = 0; i < presets.size(); i++) {
FilterUserPresetRepresentation representation = presets.get(i);
mCategoryLooksAdapter.add(new Action(this, representation, Action.FULL_VIEW, true));
mUserPresetsAdapter.add(new Action(this, representation, Action.FULL_VIEW));
}
mCategoryLooksAdapter.notifyDataSetChanged();
mCategoryLooksAdapter.notifyDataSetInvalidated();
}
use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class UserPresetsAdapter method onClick.
@Override
public void onClick(View v) {
switch(v.getId()) {
case R.id.editView:
v.requestFocus();
break;
case R.id.deleteUserPreset:
Action action = (Action) v.getTag();
deletePreset(action);
break;
}
}
Aggregations