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