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);
}
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);
}
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();
}
});
}
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;
}
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();
}
}
}
}
Aggregations