use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class StraightenPanel method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (mName != null) {
mEditorName.setText(mName);
}
mBottomPanel.setVisibility(View.VISIBLE);
final FilterShowActivity activity = (FilterShowActivity) getActivity();
mExitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
activity.cancelCurrentFilter();
activity.backToMain();
activity.setActionBar();
}
});
mApplyButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mEditor != null) {
mEditor.finalApplyCalled();
}
activity.backToMain();
activity.setActionBar();
}
});
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class StraightenPanel method onAttach.
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
initArguments(getArguments());
if (mEditorID != NO_EDITOR) {
FilterShowActivity filterShowActivity = (FilterShowActivity) activity;
mEditor = filterShowActivity.getEditor(mEditorID);
if (mEditor != null) {
mEditor.attach();
}
}
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class TruePortraitMaskEditorPanel method onAttach.
@Override
public void onAttach(Context context) {
super.onAttach(context);
FilterShowActivity filterShowActivity = (FilterShowActivity) context;
mEditor = (EditorTruePortraitMask) filterShowActivity.getEditor(EditorTruePortraitMask.ID);
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class BasicSlider method setUp.
@Override
public void setUp(ViewGroup container, Parameter parameter, Editor editor) {
container.removeAllViews();
mEditor = editor;
final Context context = container.getContext();
mParameter = (ParameterInteger) parameter;
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View lp = inflater.inflate(R.layout.filtershow_seekbar, container, true);
mSeekBar = (SeekBar) lp.findViewById(R.id.primarySeekBar);
mSeekBar.setVisibility(View.VISIBLE);
View saveButton = lp.findViewById(R.id.slider_save);
if (saveButton != null) {
saveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FilterShowActivity activity = (FilterShowActivity) context;
mEditor.finalApplyCalled();
activity.leaveSeekBarPanel();
}
});
}
View cancelButton = lp.findViewById(R.id.slider_cancel);
if (cancelButton != null) {
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FilterShowActivity activity = (FilterShowActivity) context;
activity.cancelCurrentFilter();
activity.leaveSeekBarPanel();
}
});
}
updateUI();
mSeekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (mParameter != null) {
mParameter.setValue(progress + mParameter.getMinimum());
mEditor.commitLocalRepresentation();
}
}
});
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class StatePanelTrack method checkEndState.
public void checkEndState() {
mTouchPoint = null;
mTouchTime = 0;
if (mExited || mCurrentView.getBackgroundAlpha() < mDeleteSlope) {
int origin = findChild(mCurrentView);
if (origin != -1) {
State current = mAdapter.getItem(origin);
FilterRepresentation currentRep = MasterImage.getImage().getCurrentFilterRepresentation();
FilterRepresentation removedRep = current.getFilterRepresentation();
mAdapter.remove(current);
fillContent(true);
if (currentRep != null && removedRep != null && currentRep.getFilterClass() == removedRep.getFilterClass()) {
FilterShowActivity activity = (FilterShowActivity) getContext();
activity.backToMain();
return;
}
}
} else {
mCurrentView.setBackgroundAlpha(1.0f);
mCurrentView.setTranslationX(0);
mCurrentView.setTranslationY(0);
}
if (mCurrentSelectedView != null) {
mCurrentSelectedView.invalidate();
}
if (mCurrentView != null) {
mCurrentView.invalidate();
}
mCurrentView = null;
mExited = false;
mStartedDrag = false;
}
Aggregations