Search in sources :

Example 46 with FilterShowActivity

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

the class EditorCrop method showPopupMenu.

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

        @Override
        public boolean onMenuItemClick(MenuItem item) {
            changeCropAspect(item.getItemId());
            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)

Example 47 with FilterShowActivity

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

the class EditorDraw 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_draw, popupMenu.getMenu());
    if (!ParametricEditor.useCompact(mContext)) {
        Menu menu = popupMenu.getMenu();
        int count = menu.size();
        for (int i = 0; i < count; i++) {
            MenuItem item = menu.getItem(i);
            if (item.getItemId() != R.id.draw_menu_clear) {
                item.setVisible(false);
            }
        }
        popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {

            @Override
            public boolean onMenuItemClick(MenuItem item) {
                clearDrawing();
                return true;
            }
        });
    } else {
        popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {

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

Example 48 with FilterShowActivity

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

the class EditorTruePortraitFusion method setEditPanelUI.

@Override
public void setEditPanelUI(View editControl) {
    ViewGroup controlContainer = (ViewGroup) editControl;
    controlContainer.removeAllViews();
    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View controls = inflater.inflate(R.layout.filtershow_seekbar, controlContainer);
    View seekbar = controls.findViewById(R.id.primarySeekBar);
    seekbar.setVisibility(View.GONE);
    View saveButton = controls.findViewById(R.id.slider_save);
    if (saveButton != null) {
        saveButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                FilterShowActivity activity = (FilterShowActivity) mContext;
                finalApplyCalled();
                activity.leaveSeekBarPanel();
            }
        });
    }
    View cancelButton = controls.findViewById(R.id.slider_cancel);
    if (cancelButton != null) {
        cancelButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                FilterShowActivity activity = (FilterShowActivity) mContext;
                activity.cancelCurrentFilter();
                activity.leaveSeekBarPanel();
            }
        });
    }
}
Also used : ViewGroup(android.view.ViewGroup) LayoutInflater(android.view.LayoutInflater) OnClickListener(android.view.View.OnClickListener) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity) View(android.view.View)

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