use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillEffects.
private void fillEffects() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getEffects();
if (mCategoryFiltersAdapter != null) {
mCategoryFiltersAdapter.clear();
}
mCategoryFiltersAdapter = new CategoryAdapter(this);
for (FilterRepresentation representation : filtersRepresentations) {
if (representation.getTextId() != 0) {
representation.setName(getString(representation.getTextId()));
}
mCategoryFiltersAdapter.add(new Action(this, representation));
}
}
use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillSeeStraight.
private void fillSeeStraight() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> hazeBusterRepresentations = filtersManager.getSeeStraight();
if (mCategorySeeStraightAdapter != null) {
mCategorySeeStraightAdapter.clear();
}
mCategorySeeStraightAdapter = new CategoryAdapter(this);
for (FilterRepresentation representation : hazeBusterRepresentations) {
if (representation.getTextId() != 0) {
representation.setName(getString(representation.getTextId()));
}
mCategorySeeStraightAdapter.add(new Action(this, representation));
}
}
use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillBorders.
private void fillBorders() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> borders = filtersManager.getBorders();
mCategoryBordersAdapter = new CategoryAdapter(this);
for (int i = 0; i < borders.size(); i++) {
FilterRepresentation filter = borders.get(i);
filter.setName(getString(R.string.frame, i));
if (i == 0) {
filter.setName(getString(R.string.none));
}
mCategoryBordersAdapter.add(new Action(this, filter, Action.FULL_VIEW));
}
}
use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillPresetFilter.
private void fillPresetFilter() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getFilterPreset();
if (mChangeable) {
ArrayList<FilterRepresentation> mFilterPreset = new ArrayList<FilterRepresentation>();
ArrayList<SaveOption> ret = mFilterPresetSource.getAllUserPresets();
if (ret == null)
return;
for (int id = 0; id < ret.size(); id++) {
FilterPresetRepresentation representation = new FilterPresetRepresentation(ret.get(id).name, ret.get(id)._id, id + 1);
Uri filteredUri = Uri.parse(ret.get(id).Uri);
representation.setUri(filteredUri);
representation.setSerializationName("Custom");
mFilterPreset.add(representation);
}
if (tempFilterArray.size() != 0) {
for (int id = 0; id < tempFilterArray.size(); id++) {
FilterPresetRepresentation representation = new FilterPresetRepresentation(tempFilterArray.get(id).name, tempFilterArray.get(id)._id, id + 1);
Uri filteredUri = Uri.parse(tempFilterArray.get(id).Uri);
representation.setUri(filteredUri);
representation.setSerializationName("Custom");
mFilterPreset.add(representation);
}
}
filtersRepresentations = mFilterPreset;
mChangeable = false;
}
if (filtersRepresentations == null)
return;
for (FilterRepresentation representation : filtersRepresentations) {
mCategoryLooksAdapter.add(new Action(this, representation, Action.FULL_VIEW, true));
}
}
use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class EditorGrad method setUpPopupMenu.
private void setUpPopupMenu(Button button) {
mPopupMenu = new PopupMenu(mImageShow.getActivity(), button);
mPopupMenu.getMenuInflater().inflate(R.menu.filtershow_menu_grad, mPopupMenu.getMenu());
FilterGradRepresentation rep = (FilterGradRepresentation) getLocalRepresentation();
if (rep == null) {
return;
}
updateMenuItems(rep);
hackFixStrings(mPopupMenu.getMenu());
setEffectName();
updateText();
mPopupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
FilterRepresentation tmpRep = getLocalRepresentation();
if (tmpRep instanceof FilterGradRepresentation) {
FilterGradRepresentation rep = (FilterGradRepresentation) tmpRep;
int cmdID = item.getItemId();
switch(cmdID) {
case R.id.editor_grad_brightness:
mSliderMode = MODE_BRIGHTNESS;
mEffectName = item.getTitle().toString();
break;
case R.id.editor_grad_contrast:
mSliderMode = MODE_CONTRAST;
mEffectName = item.getTitle().toString();
break;
case R.id.editor_grad_saturation:
mSliderMode = MODE_SATURATION;
mEffectName = item.getTitle().toString();
break;
}
updateMenuItems(rep);
updateSeekBar(rep);
commitLocalRepresentation();
mView.invalidate();
}
return true;
}
});
}
Aggregations