Search in sources :

Example 16 with FilterShowActivity

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

the class EditorCropPanel method onConfigurationChanged.

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    FilterShowActivity activity = (FilterShowActivity) getActivity();
    activity.saveEditorCropState(mSelectPosition);
}
Also used : FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 17 with FilterShowActivity

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

the class EditorCropPanel method onAttach.

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    FilterShowActivity filterShowActivity = (FilterShowActivity) activity;
    if (filterShowActivity.isReloadByConfigurationChanged()) {
        mSelectPosition = filterShowActivity.getEditorCropButtonSelect();
    }
    mEditorCrop = (EditorCrop) filterShowActivity.getEditor(EditorCrop.ID);
}
Also used : FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 18 with FilterShowActivity

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

the class EditorCropPanel method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    if (!isLandscape()) {
        mEditorName.setText(R.string.crop);
        mBottomPanel.setVisibility(View.VISIBLE);
    }
    mMainView.setBackgroundColor(getContext().getResources().getColor(R.color.edit_actionbar_background));
    mBottomPanel.setVisibility(View.VISIBLE);
    if (mEditorCrop != null) {
        mEditorCrop.reflectCurrentFilter();
    }
    highlightIndex(mSelectPosition);
    final FilterShowActivity activity = (FilterShowActivity) getActivity();
    mApplyButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mEditorCrop != null) {
                mEditorCrop.finalApplyCalled();
            }
            activity.backToMain();
            activity.setActionBar();
        }
    });
    mExitButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            activity.cancelCurrentFilter();
            activity.backToMain();
            activity.setActionBar();
        }
    });
}
Also used : FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity) TextView(android.widget.TextView) View(android.view.View)

Example 19 with FilterShowActivity

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

the class EditorPanel method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    FilterShowActivity activity = (FilterShowActivity) getActivity();
    if (mMainView != null) {
        if (mMainView.getParent() != null) {
            ViewGroup parent = (ViewGroup) mMainView.getParent();
            parent.removeView(mMainView);
        }
        showImageStatePanel(activity.isShowingImageStatePanel());
        return mMainView;
    }
    mMainView = (LinearLayout) inflater.inflate(R.layout.filtershow_editor_panel, null);
    // TextView mFilterText = (TextView) mMainView.findViewById(R.id.tvFilterName);
    View editControl = mMainView.findViewById(R.id.controlArea);
    Button toggleState = (Button) mMainView.findViewById(R.id.toggle_state);
    mEditor = activity.getEditor(mEditorID);
    if (mEditor != null) {
        mEditor.setUpEditorUI(editControl, toggleState);
        mEditor.reflectCurrentFilter();
    }
    showImageStatePanel(activity.isShowingImageStatePanel());
    return mMainView;
}
Also used : ImageButton(android.widget.ImageButton) Button(android.widget.Button) ViewGroup(android.view.ViewGroup) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity) TextView(android.widget.TextView) View(android.view.View)

Example 20 with FilterShowActivity

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

the class EditorTruePortraitFusion method resume.

@Override
public void resume() {
    if (mUnderlayUri.equals(Uri.EMPTY) && !pickDialogHasShown) {
        // No underlay set.
        boolean skipIntro = GalleryUtils.getBooleanPref(mContext, mContext.getString(R.string.pref_trueportrait_fusion_intro_show_key), false);
        if (!skipIntro) {
            FragmentManager fm = ((FilterShowActivity) mContext).getSupportFragmentManager();
            DoNotShowAgainDialog dialog = (DoNotShowAgainDialog) fm.findFragmentByTag("trueportrait_fusion_intro");
            if (dialog == null) {
                dialog = new DoNotShowAgainDialog(R.string.fusion_pick_background, R.string.trueportrait_fusion_intro, R.string.pref_trueportrait_fusion_intro_show_key);
                dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {

                    @Override
                    public void onCancel(DialogInterface dialog) {
                        FilterShowActivity activity = (FilterShowActivity) mContext;
                        activity.cancelCurrentFilter();
                        activity.leaveSeekBarPanel();
                    }
                });
                dialog.setOnOkButtonClickListener(new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int id) {
                        pickDialogHasShown = true;
                        MasterImage.getImage().getActivity().pickImage(FilterShowActivity.SELECT_FUSION_UNDERLAY);
                    }
                });
                dialog.setCancelable(true);
                dialog.show(fm, "trueportrait_fusion_intro");
            } else if (dialog.isDetached()) {
                FragmentTransaction ft = fm.beginTransaction();
                ft.attach(dialog);
                ft.commit();
            } else if (dialog.isHidden()) {
                FragmentTransaction ft = fm.beginTransaction();
                ft.show(dialog);
                ft.commit();
            }
        }
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) DialogInterface(android.content.DialogInterface) DoNotShowAgainDialog(com.android.gallery3d.filtershow.ui.DoNotShowAgainDialog) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

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