Search in sources :

Example 1 with StatePanel

use of com.android.gallery3d.filtershow.state.StatePanel 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)

Example 2 with StatePanel

use of com.android.gallery3d.filtershow.state.StatePanel 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

Fragment (android.support.v4.app.Fragment)2 FragmentTransaction (android.support.v4.app.FragmentTransaction)2 View (android.view.View)2 FilterShowActivity (com.android.gallery3d.filtershow.FilterShowActivity)2 StatePanel (com.android.gallery3d.filtershow.state.StatePanel)2 TextView (android.widget.TextView)1 MainPanel (com.android.gallery3d.filtershow.category.MainPanel)1