use of com.android.gallery3d.filtershow.filters.FiltersManager 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.FiltersManager in project android_packages_apps_Gallery2 by LineageOS.
the class ProcessingService method setupPipeline.
public void setupPipeline() {
Resources res = getResources();
FiltersManager.setResources(res);
CachingPipeline.createRenderscriptContext(this);
FiltersManager filtersManager = FiltersManager.getManager();
filtersManager.addLooks(this);
filtersManager.addBorders(this);
filtersManager.addTools(this);
filtersManager.addEffects();
filtersManager.addDualCam(this);
filtersManager.addMakeups(this);
filtersManager.addTrueScanner();
filtersManager.addHazeBuster();
filtersManager.addSeeStraight();
filtersManager.addTruePortrait(this);
filtersManager.addFilterPreset(this);
filtersManager.addWaterMarks(this);
filtersManager.addLocations(this);
filtersManager.addTimes(this);
filtersManager.addWeather(this);
filtersManager.addEmotions(this);
filtersManager.addFoods(this);
FiltersManager highresFiltersManager = FiltersManager.getHighresManager();
highresFiltersManager.addLooks(this);
highresFiltersManager.addBorders(this);
highresFiltersManager.addTools(this);
highresFiltersManager.addEffects();
highresFiltersManager.addDualCam(this);
// highresFiltersManager.addMakeups(this);
highresFiltersManager.addTrueScanner();
highresFiltersManager.addHazeBuster();
highresFiltersManager.addSeeStraight();
highresFiltersManager.addTruePortrait(this);
highresFiltersManager.addFilterPreset(this);
highresFiltersManager.addWaterMarks(this);
highresFiltersManager.addLocations(this);
highresFiltersManager.addTimes(this);
highresFiltersManager.addWeather(this);
highresFiltersManager.addEmotions(this);
highresFiltersManager.addFoods(this);
}
use of com.android.gallery3d.filtershow.filters.FiltersManager in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillLooks.
private void fillLooks() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getLooks();
if (mCategoryLooksAdapter != null) {
mCategoryLooksAdapter.clear();
}
mCategoryLooksAdapter = new CategoryAdapter(this);
int verticalItemHeight = (int) getResources().getDimension(R.dimen.action_item_height);
mCategoryLooksAdapter.setItemHeight(verticalItemHeight);
for (FilterRepresentation representation : filtersRepresentations) {
mCategoryLooksAdapter.add(new Action(this, representation, Action.FULL_VIEW));
}
if (FilterGeneratorNativeEngine.getInstance().isLibLoaded()) {
if (mUserPresetsManager.getRepresentations() == null || mUserPresetsManager.getRepresentations().size() == 0) {
mCategoryLooksAdapter.add(new Action(this, Action.ADD_ACTION));
}
}
fillPresetFilter();
Fragment panel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
if (panel != null) {
if (panel instanceof MainPanel) {
MainPanel mainPanel = (MainPanel) panel;
mainPanel.loadCategoryLookPanel(true);
}
}
}
use of com.android.gallery3d.filtershow.filters.FiltersManager in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillWaterMarks.
private void fillWaterMarks() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<ArrayList<FilterRepresentation>> filters = new ArrayList<>();
filters.add(filtersManager.getWaterMarks());
filters.add(filtersManager.getLocations());
filters.add(filtersManager.getTimes());
filters.add(filtersManager.getWeathers());
filters.add(filtersManager.getEmotions());
filters.add(filtersManager.getFoods());
if (mCategoryWatermarkAdapters != null) {
mCategoryWatermarkAdapters.clear();
}
mCategoryWatermarkAdapters = new ArrayList<>();
for (int i = 0; i < filters.size(); i++) {
mCategoryWatermarkAdapters.add(new CategoryAdapter(this));
for (FilterRepresentation representation : filters.get(i)) {
mCategoryWatermarkAdapters.get(i).add(new Action(this, representation));
}
}
}
use of com.android.gallery3d.filtershow.filters.FiltersManager in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillTools.
private void fillTools() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getTools();
if (mCategoryGeometryAdapter != null) {
mCategoryGeometryAdapter.clear();
}
mCategoryGeometryAdapter = new CategoryAdapter(this);
for (FilterRepresentation representation : filtersRepresentations) {
mCategoryGeometryAdapter.add(new Action(this, representation));
}
}
Aggregations