use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class EditorGrad method showPopupMenu.
private void showPopupMenu(LinearLayout accessoryViewList) {
Button button = (Button) accessoryViewList.findViewById(R.id.applyEffect);
if (button == null) {
return;
}
if (mPopupMenu == null) {
setUpPopupMenu(button);
}
mPopupMenu.show();
((FilterShowActivity) mContext).onShowMenu(mPopupMenu);
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class EditorPanel method cancelCurrentFilter.
public void cancelCurrentFilter() {
MasterImage masterImage = MasterImage.getImage();
HistoryManager adapter = masterImage.getHistory();
int position = adapter.undo();
masterImage.onHistoryItemClick(position);
((FilterShowActivity) getActivity()).invalidateViews();
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class EditorPanel method showImageStatePanel.
public void showImageStatePanel(boolean show) {
View container = mMainView.findViewById(R.id.state_panel_container);
FragmentTransaction transaction = null;
boolean child = false;
if (container == null) {
FilterShowActivity activity = (FilterShowActivity) getActivity();
container = activity.getMainStatePanelContainer(R.id.state_panel_container);
} else {
transaction = getChildFragmentManager().beginTransaction();
child = true;
}
if (container == null) {
return;
} else {
transaction = getFragmentManager().beginTransaction();
}
Fragment panel = getActivity().getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
if (panel == null || panel instanceof MainPanel) {
transaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
}
if (show) {
container.setVisibility(View.VISIBLE);
StatePanel statePanel = new StatePanel();
transaction.replace(R.id.state_panel_container, statePanel, StatePanel.FRAGMENT_TAG);
} else {
Fragment statePanel = getChildFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG);
if (child) {
statePanel = getFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG);
}
if (statePanel != null) {
transaction.remove(statePanel);
}
}
transaction.commit();
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class EditorPanel method onAttach.
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
FilterShowActivity filterShowActivity = (FilterShowActivity) activity;
mEditor = filterShowActivity.getEditor(mEditorID);
if (mEditor != null) {
mEditor.attach();
}
Log.d(LOGTAG, "EditorPanel.onAttach(): mEditorID is " + mEditorID + ", mEditor is " + mEditor);
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class EditorColorBorder 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_color_border, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
selectMenuItem(item);
return true;
}
});
popupMenu.show();
((FilterShowActivity) mContext).onShowMenu(popupMenu);
}
Aggregations