Search in sources :

Example 6 with FilterShowActivity

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

the class MainPanel method setCategoryFragment.

private void setCategoryFragment(Fragment category, boolean fromRight) {
    FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
    FilterShowActivity activity = (FilterShowActivity) getActivity();
    if (fromRight) {
        transaction.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_right);
    } else {
        transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left);
    }
    activity.setActionBar();
    transaction.replace(R.id.category_panel_container, category, CategoryPanel.FRAGMENT_TAG);
    transaction.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 7 with FilterShowActivity

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

the class MainPanel method loadCategoryHazeBusterPanel.

public void loadCategoryHazeBusterPanel() {
    final FilterShowActivity activity = (FilterShowActivity) getActivity();
    CategoryAdapter adapter = activity.getCategoryHazeBusterAdapter();
    if (adapter.getCount() == 1) {
        activity.showRepresentation(adapter.getItem(0).getRepresentation());
    } else {
        boolean fromRight = isRightAnimation(HAZEBUSTER);
        selection(mCurrentSelected, false);
        CategoryPanel categoryPanel = new CategoryPanel();
        categoryPanel.setAdapter(HAZEBUSTER);
        setCategoryFragment(categoryPanel, fromRight);
        mCurrentSelected = HAZEBUSTER;
        selection(mCurrentSelected, true);
    }
}
Also used : FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 8 with FilterShowActivity

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

the class MainPanel method selection.

private void selection(int position, boolean value) {
    if (value) {
        FilterShowActivity activity = (FilterShowActivity) getActivity();
        activity.setCurrentPanel(position);
    }
    switch(position) {
        case LOOKS:
            {
                looksButton.setSelected(value);
                break;
            }
        case BORDERS:
            {
                bordersButton.setSelected(value);
                break;
            }
        case GEOMETRY:
            {
                geometryButton.setSelected(value);
                break;
            }
        case FILTERS:
            {
                filtersButton.setSelected(value);
                break;
            }
        case MAKEUP:
            {
                if (makeupButton != null) {
                    makeupButton.setSelected(value);
                }
                break;
            }
        case DUALCAM:
            {
                dualCamButton.setSelected(value);
                break;
            }
        case TRUEPORTRAIT:
            {
                truePortraitButton.setSelected(value);
                break;
            }
        case TRUESCANNER:
            {
                if (trueScannerButton != null) {
                    trueScannerButton.setSelected(value);
                }
                break;
            }
        case HAZEBUSTER:
            {
                if (hazeBusterButton != null) {
                    hazeBusterButton.setSelected(value);
                }
                break;
            }
        case SEESTRAIGHT:
            {
                if (seeStraightButton != null) {
                    seeStraightButton.setSelected(value);
                }
                break;
            }
        case WATERMARK:
            {
                waterMarkButton.setSelected(value);
                break;
            }
    }
}
Also used : FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 9 with FilterShowActivity

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

the class MainPanel method loadCategoryTrueScannerPanel.

public void loadCategoryTrueScannerPanel() {
    final FilterShowActivity activity = (FilterShowActivity) getActivity();
    CategoryAdapter adapter = activity.getCategoryTrueScannerAdapter();
    if (adapter.getCount() == 1) {
        activity.showRepresentation(adapter.getItem(0).getRepresentation());
    } else {
        boolean fromRight = isRightAnimation(TRUESCANNER);
        selection(mCurrentSelected, false);
        CategoryPanel categoryPanel = new CategoryPanel();
        categoryPanel.setAdapter(TRUESCANNER);
        setCategoryFragment(categoryPanel, fromRight);
        mCurrentSelected = TRUESCANNER;
        selection(mCurrentSelected, true);
    }
}
Also used : FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 10 with FilterShowActivity

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

the class MainPanel method showImageStatePanel.

public void showImageStatePanel(boolean show) {
    View container = mMainView.findViewById(R.id.state_panel_container);
    FragmentTransaction transaction = null;
    if (container == null) {
        FilterShowActivity activity = (FilterShowActivity) getActivity();
        container = activity.getMainStatePanelContainer(R.id.state_panel_container);
    } else {
        transaction = getChildFragmentManager().beginTransaction();
    }
    if (container == null) {
        return;
    } else {
        transaction = getFragmentManager().beginTransaction();
    }
    int currentPanel = mCurrentSelected;
    if (show) {
        container.setVisibility(View.VISIBLE);
        StatePanel statePanel = new StatePanel();
        statePanel.setMainPanel(this);
        FilterShowActivity activity = (FilterShowActivity) getActivity();
        activity.updateVersions();
        transaction.replace(R.id.state_panel_container, statePanel, StatePanel.FRAGMENT_TAG);
    } else {
        container.setVisibility(View.GONE);
        Fragment statePanel = getChildFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG);
        if (statePanel != null) {
            transaction.remove(statePanel);
        }
        if (currentPanel == VERSIONS) {
            currentPanel = LOOKS;
        }
    }
    mCurrentSelected = -1;
    showPanel(currentPanel);
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) StatePanel(com.android.gallery3d.filtershow.state.StatePanel) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity) View(android.view.View) Fragment(android.support.v4.app.Fragment)

Aggregations

FilterShowActivity (com.android.gallery3d.filtershow.FilterShowActivity)48 View (android.view.View)11 Button (android.widget.Button)6 FragmentTransaction (android.support.v4.app.FragmentTransaction)5 TextView (android.widget.TextView)5 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)5 MenuItem (android.view.MenuItem)4 PopupMenu (android.widget.PopupMenu)4 DialogInterface (android.content.DialogInterface)3 LayoutInflater (android.view.LayoutInflater)3 ViewGroup (android.view.ViewGroup)3 Point (android.graphics.Point)2 Fragment (android.support.v4.app.Fragment)2 FragmentManager (android.support.v4.app.FragmentManager)2 OnClickListener (android.view.View.OnClickListener)2 ImageButton (android.widget.ImageButton)2 MasterImage (com.android.gallery3d.filtershow.imageshow.MasterImage)2 StatePanel (com.android.gallery3d.filtershow.state.StatePanel)2 DoNotShowAgainDialog (com.android.gallery3d.filtershow.ui.DoNotShowAgainDialog)2 AlertDialog (android.app.AlertDialog)1