Search in sources :

Example 11 with FiltersManager

use of com.android.gallery3d.filtershow.filters.FiltersManager in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method fillHazeBuster.

private void fillHazeBuster() {
    FiltersManager filtersManager = FiltersManager.getManager();
    ArrayList<FilterRepresentation> hazeBusterRepresentations = filtersManager.getHazeBuster();
    if (mCategoryHazeBusterAdapter != null) {
        mCategoryHazeBusterAdapter.clear();
    }
    mCategoryHazeBusterAdapter = new CategoryAdapter(this);
    for (FilterRepresentation representation : hazeBusterRepresentations) {
        if (representation.getTextId() != 0) {
            representation.setName(getString(representation.getTextId()));
        }
        mCategoryHazeBusterAdapter.add(new Action(this, representation));
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 12 with FiltersManager

use of com.android.gallery3d.filtershow.filters.FiltersManager 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));
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 13 with FiltersManager

use of com.android.gallery3d.filtershow.filters.FiltersManager 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));
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 14 with FiltersManager

use of com.android.gallery3d.filtershow.filters.FiltersManager in project android_packages_apps_Gallery2 by LineageOS.

the class GeometryPanel method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    FiltersManager filtersManager = FiltersManager.getManager();
    mFiltersRepresentations = filtersManager.getTools();
    return super.onCreateView(inflater, container, savedInstanceState);
}
Also used : FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager)

Example 15 with FiltersManager

use of com.android.gallery3d.filtershow.filters.FiltersManager in project android_packages_apps_Gallery2 by LineageOS.

the class CategoryPanelLevelTwo method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    LinearLayout main = (LinearLayout) inflater.inflate(R.layout.filtershow_category_panel_two, container, false);
    FiltersManager filtersManager = FiltersManager.getManager();
    mFiltersRepresentations = filtersManager.getWaterMarks();
    mBottomPanel = main.findViewById(R.id.bottom_panel);
    mExitButton = (ImageButton) main.findViewById(R.id.cancel);
    mApplyButton = (ImageButton) main.findViewById(R.id.done);
    final FilterShowActivity activity = (FilterShowActivity) getActivity();
    mApplyButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // Todo xukd add watermark to bufferimage
            activity.disableTouchEvent();
            activity.backToMain();
            activity.setActionBar();
        }
    });
    mExitButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            activity.cancelCurrentFilter();
            activity.backToMain();
            activity.setActionBar();
        }
    });
    mEditName = (TextView) main.findViewById(R.id.editor_name);
    int adapterId = mCurrentAdapter % FilterWatermarkRepresentation.LOCATION;
    if (adapterId >= 0 && adapterId < mFiltersRepresentations.size()) {
        mEditName.setText(mFiltersRepresentations.get(adapterId).getTextId());
    } else {
        mEditName.setText(DEFAULT_NAME);
    }
    View panelView = main.findViewById(R.id.listItems);
    if (panelView instanceof CategoryTrack) {
        CategoryTrack panel = (CategoryTrack) panelView;
        if (mAdapter != null) {
            mAdapter.setOrientation(CategoryView.HORIZONTAL);
            panel.setAdapter(mAdapter);
            mAdapter.setContainer(panel);
        }
    }
    mAddButton = (IconView) main.findViewById(R.id.addButton);
    if (mAddButton != null) {
        mAddButton.setOnClickListener(this);
        updateAddButtonVisibility();
    }
    return main;
}
Also used : FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity) TextView(android.widget.TextView) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Aggregations

FiltersManager (com.android.gallery3d.filtershow.filters.FiltersManager)15 Action (com.android.gallery3d.filtershow.category.Action)12 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)12 CategoryAdapter (com.android.gallery3d.filtershow.category.CategoryAdapter)11 Point (android.graphics.Point)4 ArrayList (java.util.ArrayList)2 Resources (android.content.res.Resources)1 Uri (android.net.Uri)1 DialogFragment (android.support.v4.app.DialogFragment)1 Fragment (android.support.v4.app.Fragment)1 View (android.view.View)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1 FilterShowActivity (com.android.gallery3d.filtershow.FilterShowActivity)1 MainPanel (com.android.gallery3d.filtershow.category.MainPanel)1 SaveOption (com.android.gallery3d.filtershow.data.FilterPresetSource.SaveOption)1 FilterPresetRepresentation (com.android.gallery3d.filtershow.filters.FilterPresetRepresentation)1 MediaPickerFragment (com.android.gallery3d.filtershow.mediapicker.MediaPickerFragment)1