use of com.android.gallery3d.filtershow.filters.FilterGradRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class EditorGrad method setUpPopupMenu.
private void setUpPopupMenu(Button button) {
mPopupMenu = new PopupMenu(mImageShow.getActivity(), button);
mPopupMenu.getMenuInflater().inflate(R.menu.filtershow_menu_grad, mPopupMenu.getMenu());
FilterGradRepresentation rep = (FilterGradRepresentation) getLocalRepresentation();
if (rep == null) {
return;
}
updateMenuItems(rep);
hackFixStrings(mPopupMenu.getMenu());
setEffectName();
updateText();
mPopupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
FilterRepresentation tmpRep = getLocalRepresentation();
if (tmpRep instanceof FilterGradRepresentation) {
FilterGradRepresentation rep = (FilterGradRepresentation) tmpRep;
int cmdID = item.getItemId();
switch(cmdID) {
case R.id.editor_grad_brightness:
mSliderMode = MODE_BRIGHTNESS;
mEffectName = item.getTitle().toString();
break;
case R.id.editor_grad_contrast:
mSliderMode = MODE_CONTRAST;
mEffectName = item.getTitle().toString();
break;
case R.id.editor_grad_saturation:
mSliderMode = MODE_SATURATION;
mEffectName = item.getTitle().toString();
break;
}
updateMenuItems(rep);
updateSeekBar(rep);
commitLocalRepresentation();
mView.invalidate();
}
return true;
}
});
}
use of com.android.gallery3d.filtershow.filters.FilterGradRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class EditorGrad method reflectCurrentFilter.
@Override
public void reflectCurrentFilter() {
super.reflectCurrentFilter();
FilterRepresentation tmpRep = getLocalRepresentation();
if (tmpRep instanceof FilterGradRepresentation) {
FilterGradRepresentation rep = (FilterGradRepresentation) tmpRep;
boolean f = rep.showParameterValue();
mImageGrad.setRepresentation(rep);
}
}
use of com.android.gallery3d.filtershow.filters.FilterGradRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class EditorGrad method calculateUserMessage.
@Override
public String calculateUserMessage(Context context, String effectName, Object parameterValue) {
FilterGradRepresentation rep = getGradRepresentation();
if (rep == null) {
return mEffectName;
}
int val = rep.getParameter(mSliderMode);
return mEffectName + ((val > 0) ? " +" : " ") + val;
}
use of com.android.gallery3d.filtershow.filters.FilterGradRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class EditorGrad method setValue.
@Override
public void setValue(int value) {
FilterGradRepresentation rep = getGradRepresentation();
if (rep == null) {
return;
}
rep.setParameter(mSliderMode, value);
}
use of com.android.gallery3d.filtershow.filters.FilterGradRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class EditorGrad method fireLeftAction.
@Override
public void fireLeftAction() {
FilterGradRepresentation rep = getGradRepresentation();
if (rep == null) {
return;
}
rep.addBand(MasterImage.getImage().getOriginalBounds());
updateMenuItems(rep);
updateSeekBar(rep);
commitLocalRepresentation();
mView.invalidate();
}
Aggregations