Search in sources :

Example 6 with MainPanel

use of com.android.gallery3d.filtershow.category.MainPanel 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);
        }
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) MainPanel(com.android.gallery3d.filtershow.category.MainPanel) CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) Fragment(android.support.v4.app.Fragment) MediaPickerFragment(com.android.gallery3d.filtershow.mediapicker.MediaPickerFragment) DialogFragment(android.support.v4.app.DialogFragment) Point(android.graphics.Point)

Example 7 with MainPanel

use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method toggleVersionsPanel.

public void toggleVersionsPanel() {
    mShowingVersionsPanel = !mShowingVersionsPanel;
    Fragment panel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
    if (panel != null && panel instanceof MainPanel) {
        MainPanel mainPanel = (MainPanel) panel;
        mainPanel.loadCategoryVersionsPanel();
    }
}
Also used : MainPanel(com.android.gallery3d.filtershow.category.MainPanel) Fragment(android.support.v4.app.Fragment) MediaPickerFragment(com.android.gallery3d.filtershow.mediapicker.MediaPickerFragment) DialogFragment(android.support.v4.app.DialogFragment)

Example 8 with MainPanel

use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method toggleImageStatePanel.

// //////////////////////////////////////////////////////////////////////////////
// imageState panel...
public void toggleImageStatePanel() {
    invalidateOptionsMenu();
    mShowingImageStatePanel = !mShowingImageStatePanel;
    Fragment panel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
    if (panel != null) {
        if (panel instanceof EditorPanel) {
            EditorPanel editorPanel = (EditorPanel) panel;
            editorPanel.showImageStatePanel(mShowingImageStatePanel);
        } else if (panel instanceof MainPanel) {
            MainPanel mainPanel = (MainPanel) panel;
            mainPanel.showImageStatePanel(mShowingImageStatePanel);
        }
    }
}
Also used : MainPanel(com.android.gallery3d.filtershow.category.MainPanel) TruePortraitMaskEditorPanel(com.android.gallery3d.filtershow.category.TruePortraitMaskEditorPanel) EditorPanel(com.android.gallery3d.filtershow.editors.EditorPanel) Fragment(android.support.v4.app.Fragment) MediaPickerFragment(com.android.gallery3d.filtershow.mediapicker.MediaPickerFragment) DialogFragment(android.support.v4.app.DialogFragment)

Example 9 with MainPanel

use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method loadMainPanel.

public void loadMainPanel() {
    if (findViewById(R.id.main_panel_container) == null) {
        return;
    }
    MainPanel panel = new MainPanel();
    Bundle bundle = new Bundle();
    bundle.putBoolean(MainPanel.EDITOR_TAG, isComingFromEditorScreen);
    panel.setArguments(bundle);
    isComingFromEditorScreen = false;
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.main_panel_container, panel, MainPanel.FRAGMENT_TAG);
    transaction.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) MainPanel(com.android.gallery3d.filtershow.category.MainPanel) Bundle(android.os.Bundle)

Example 10 with MainPanel

use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.

the class EditorPanel method showImageStatePanel.

public void showImageStatePanel(boolean show) {
    View container = mMainView.findViewById(R.id.state_panel_container);
    FragmentTransaction transaction = null;
    boolean child = false;
    if (container == null) {
        FilterShowActivity activity = (FilterShowActivity) getActivity();
        container = activity.getMainStatePanelContainer(R.id.state_panel_container);
    } else {
        transaction = getChildFragmentManager().beginTransaction();
        child = true;
    }
    if (container == null) {
        return;
    } else {
        transaction = getFragmentManager().beginTransaction();
    }
    Fragment panel = getActivity().getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
    if (panel == null || panel instanceof MainPanel) {
        transaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
    }
    if (show) {
        container.setVisibility(View.VISIBLE);
        StatePanel statePanel = new StatePanel();
        transaction.replace(R.id.state_panel_container, statePanel, StatePanel.FRAGMENT_TAG);
    } else {
        Fragment statePanel = getChildFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG);
        if (child) {
            statePanel = getFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG);
        }
        if (statePanel != null) {
            transaction.remove(statePanel);
        }
    }
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) MainPanel(com.android.gallery3d.filtershow.category.MainPanel) StatePanel(com.android.gallery3d.filtershow.state.StatePanel) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity) TextView(android.widget.TextView) View(android.view.View) Fragment(android.support.v4.app.Fragment)

Aggregations

MainPanel (com.android.gallery3d.filtershow.category.MainPanel)10 Fragment (android.support.v4.app.Fragment)9 DialogFragment (android.support.v4.app.DialogFragment)8 MediaPickerFragment (com.android.gallery3d.filtershow.mediapicker.MediaPickerFragment)8 Point (android.graphics.Point)3 FragmentTransaction (android.support.v4.app.FragmentTransaction)3 Bundle (android.os.Bundle)2 View (android.view.View)2 TruePortraitMaskEditorPanel (com.android.gallery3d.filtershow.category.TruePortraitMaskEditorPanel)2 EditorPanel (com.android.gallery3d.filtershow.editors.EditorPanel)2 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)2 Bitmap (android.graphics.Bitmap)1 Matrix (android.graphics.Matrix)1 Handler (android.os.Handler)1 DisplayMetrics (android.util.DisplayMetrics)1 ViewPropertyAnimator (android.view.ViewPropertyAnimator)1 AdapterView (android.widget.AdapterView)1 TextView (android.widget.TextView)1 FilterShowActivity (com.android.gallery3d.filtershow.FilterShowActivity)1 Action (com.android.gallery3d.filtershow.category.Action)1