Java Code Examples for android.view.View.showContextMenu()

The following are Jave code examples for showing how to use showContextMenu() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: chromium-for-android-56-debug-video   File: ContextMenuHelper.java   Source Code and License Vote up 6 votes
/**
 * Starts showing a context menu for {@code view} based on {@code params}.
 * @param contentViewCore The {@link ContentViewCore} to show the menu to.
 * @param params          The {@link ContextMenuParams} that indicate what menu items to show.
 */
@CalledByNative
private void showContextMenu(ContentViewCore contentViewCore, ContextMenuParams params) {
    final View view = contentViewCore.getContainerView();

    if (view == null
            || view.getVisibility() != View.VISIBLE
            || view.getParent() == null) {
        return;
    }

    mCurrentContextMenuParams = params;

    view.setOnCreateContextMenuListener(this);
    if (view.showContextMenu()) {
        WebContents webContents = contentViewCore.getWebContents();
        RecordHistogram.recordBooleanHistogram(
                "ContextMenu.Shown", webContents != null);
    }
}
 
Example 2
Project: Brevent   File: AppsItemAdapter.java   Source Code and License Vote up 5 votes
@Override
public void onClick(View v) {
    if (v instanceof CardView) {
        v.showContextMenu();
    } else if (v instanceof ImageView) {
        if (v.getId() == R.id.icon) {
            onSelected((CardView) v.getParent().getParent());
        }
    }
}
 
Example 3
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 4
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 5
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 6
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 7
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 8
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 9
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 10
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 11
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 12
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 13
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 14
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 15
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}
 
Example 16
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Programmatically opens the context menu for a particular {@code view}.
 * The {@code view} should have been added via
 * {@link #registerForContextMenu(View)}.
 *
 * @param view The view to show the context menu for.
 */
public void openContextMenu(View view) {
    view.showContextMenu();
}