Search in sources :

Example 41 with FilterShowActivity

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

the class EditorGrad method showPopupMenu.

private void showPopupMenu(LinearLayout accessoryViewList) {
    Button button = (Button) accessoryViewList.findViewById(R.id.applyEffect);
    if (button == null) {
        return;
    }
    if (mPopupMenu == null) {
        setUpPopupMenu(button);
    }
    mPopupMenu.show();
    ((FilterShowActivity) mContext).onShowMenu(mPopupMenu);
}
Also used : Button(android.widget.Button) ToggleButton(android.widget.ToggleButton) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 42 with FilterShowActivity

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

the class EditorPanel method cancelCurrentFilter.

public void cancelCurrentFilter() {
    MasterImage masterImage = MasterImage.getImage();
    HistoryManager adapter = masterImage.getHistory();
    int position = adapter.undo();
    masterImage.onHistoryItemClick(position);
    ((FilterShowActivity) getActivity()).invalidateViews();
}
Also used : MasterImage(com.android.gallery3d.filtershow.imageshow.MasterImage) HistoryManager(com.android.gallery3d.filtershow.history.HistoryManager) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 43 with FilterShowActivity

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

Example 44 with FilterShowActivity

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

the class EditorPanel method onAttach.

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    FilterShowActivity filterShowActivity = (FilterShowActivity) activity;
    mEditor = filterShowActivity.getEditor(mEditorID);
    if (mEditor != null) {
        mEditor.attach();
    }
    Log.d(LOGTAG, "EditorPanel.onAttach(): mEditorID is " + mEditorID + ", mEditor is " + mEditor);
}
Also used : FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 45 with FilterShowActivity

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

the class EditorColorBorder method showPopupMenu.

private void showPopupMenu(LinearLayout accessoryViewList) {
    final Button button = (Button) accessoryViewList.findViewById(R.id.applyEffect);
    if (button == null) {
        return;
    }
    final PopupMenu popupMenu = new PopupMenu(mImageShow.getActivity(), button);
    popupMenu.getMenuInflater().inflate(R.menu.filtershow_menu_color_border, popupMenu.getMenu());
    popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {

        @Override
        public boolean onMenuItemClick(MenuItem item) {
            selectMenuItem(item);
            return true;
        }
    });
    popupMenu.show();
    ((FilterShowActivity) mContext).onShowMenu(popupMenu);
}
Also used : Button(android.widget.Button) MenuItem(android.view.MenuItem) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity) PopupMenu(android.widget.PopupMenu)

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