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

The following are Jave code examples for showing how to use setOnCreateContextMenuListener() 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: Espresso   File: PackagesAdapter.java   Source Code and License Vote up 6 votes
public PackageViewHolder(View itemView, OnRecyclerViewItemClickListener listener) {
    super(itemView);
    textViewPackageName = (AppCompatTextView) itemView.findViewById(R.id.textViewPackageName);
    textViewStatus = (AppCompatTextView) itemView.findViewById(R.id.textViewStatus);
    textViewTime = (AppCompatTextView) itemView.findViewById(R.id.textViewTime);
    textViewAvatar = (AppCompatTextView) itemView.findViewById(R.id.textViewAvatar);
    textViewRemove = (AppCompatTextView) itemView.findViewById(R.id.textViewRemove);
    imageViewRemove = (ImageView) itemView.findViewById(R.id.imageViewRemove);
    circleImageViewAvatar = (CircleImageView) itemView.findViewById(R.id.circleImageView);
    layoutMain = (LinearLayout) itemView.findViewById(R.id.layoutPackageItemMain);
    wrapperView = itemView.findViewById(R.id.layoutPackageItem);

    this.listener = listener;
    itemView.setOnClickListener(this);
    itemView.setOnCreateContextMenuListener(this);

}
 
Example 2
Project: AppsTimeline   File: MainActivity.java   Source Code and License Vote up 5 votes
MyViewHolder(View itemView) {
    super(itemView);
    mName = itemView.findViewById(R.id.app_name);
    mUsage = itemView.findViewById(R.id.app_usage);
    mTime = itemView.findViewById(R.id.app_time);
    mIcon = itemView.findViewById(R.id.app_image);
    mProgress = itemView.findViewById(R.id.progressBar);
    itemView.setOnCreateContextMenuListener(this);
}
 
Example 3
Project: Goalie_Android   File: FriendsListRecycler.java   Source Code and License Vote up 5 votes
public FriendsHolder(View itemView, FragmentActivity context) {
    super(itemView);
    mContext = context;
    mFriendImage = itemView.findViewById(R.id.friend_image);
    mFriendName = itemView.findViewById(R.id.friend_name);
    mFriendReputation = itemView.findViewById(R.id.friend_reputation);
    itemView.setOnCreateContextMenuListener(this);
}
 
Example 4
Project: Phoenix-for-VK   File: FaveLinksAdapter.java   Source Code and License Vote up 5 votes
public Holder(View itemView) {
    super(itemView);
    itemView.setOnCreateContextMenuListener(this);

    image = itemView.findViewById(R.id.link_image);
    title = itemView.findViewById(R.id.link_title);
    description = itemView.findViewById(R.id.link_description);
}
 
Example 5
Project: HabitUp   File: EventListAdapter.java   Source Code and License Vote up 5 votes
public EventHolder(Context context, View itemView) {
    super(itemView);

    this.context = context;

    this.itemView = itemView;
    this.eventNameView = itemView.findViewById(R.id.event_name);
    this.eventDateView = itemView.findViewById(R.id.event_date);
    this.eventCommentView = itemView.findViewById(R.id.event_comment);
    this.photoIcon = itemView.findViewById(R.id.event_has_image);
    this.markerIcon = itemView.findViewById(R.id.event_has_location);

    itemView.setOnLongClickListener(this);
    itemView.setOnCreateContextMenuListener(this);

    // Call onItemClick interface to pass position when list view item is clicked
    itemView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (clickListener!= null) {
                int position = getAdapterPosition();
                if (position != RecyclerView.NO_POSITION) {
                    clickListener.onItemClick(v, position);
                }
            }
        }
    });
}
 
Example 6
Project: Phoenix-for-VK   File: FaveUsersAdapter.java   Source Code and License Vote up 5 votes
public Holder(View itemView) {
    super(itemView);
    itemView.setOnCreateContextMenuListener(this);

    avatar = itemView.findViewById(R.id.avatar);
    name = itemView.findViewById(R.id.name);
}
 
Example 7
Project: GitHub   File: AppCompatListActivity.java   Source Code and License Vote up 4 votes
public ItemViewHolder(View v) {
	super(v);
	v.setOnClickListener(this);
	v.setOnCreateContextMenuListener(this);
}
 
Example 8
Project: boohee_v5.6   File: Fragment.java   Source Code and License Vote up 4 votes
public void registerForContextMenu(View view) {
    view.setOnCreateContextMenuListener(this);
}
 
Example 9
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Prevents a context menu to be shown for the given view. This method will remove the
 * {@link OnCreateContextMenuListener} on the view.
 *
 * @see #registerForContextMenu(View)
 * @param view The view that should stop showing a context menu.
 */
public void unregisterForContextMenu(View view) {
    view.setOnCreateContextMenuListener(null);
}
 
Example 10
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Prevents a context menu to be shown for the given view. This method will remove the
 * {@link OnCreateContextMenuListener} on the view.
 *
 * @see #registerForContextMenu(View)
 * @param view The view that should stop showing a context menu.
 */
public void unregisterForContextMenu(View view) {
    view.setOnCreateContextMenuListener(null);
}
 
Example 11
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Registers a context menu to be shown for the given view (multiple views
 * can show the context menu). This method will set the
 * {@link OnCreateContextMenuListener} on the view to this activity, so
 * {@link #onCreateContextMenu(ContextMenu, View, ContextMenuInfo)} will be
 * called when it is time to show the context menu.
 *
 * @see #unregisterForContextMenu(View)
 * @param view The view that should show a context menu.
 */
public void registerForContextMenu(View view) {
    view.setOnCreateContextMenuListener(this);
}
 
Example 12
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Prevents a context menu to be shown for the given view. This method will remove the
 * {@link OnCreateContextMenuListener} on the view.
 *
 * @see #registerForContextMenu(View)
 * @param view The view that should stop showing a context menu.
 */
public void unregisterForContextMenu(View view) {
    view.setOnCreateContextMenuListener(null);
}
 
Example 13
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Registers a context menu to be shown for the given view (multiple views
 * can show the context menu). This method will set the
 * {@link OnCreateContextMenuListener} on the view to this activity, so
 * {@link #onCreateContextMenu(ContextMenu, View, ContextMenuInfo)} will be
 * called when it is time to show the context menu.
 *
 * @see #unregisterForContextMenu(View)
 * @param view The view that should show a context menu.
 */
public void registerForContextMenu(View view) {
    view.setOnCreateContextMenuListener(this);
}
 
Example 14
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Prevents a context menu to be shown for the given view. This method will remove the
 * {@link OnCreateContextMenuListener} on the view.
 *
 * @see #registerForContextMenu(View)
 * @param view The view that should stop showing a context menu.
 */
public void unregisterForContextMenu(View view) {
    view.setOnCreateContextMenuListener(null);
}
 
Example 15
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Registers a context menu to be shown for the given view (multiple views
 * can show the context menu). This method will set the
 * {@link OnCreateContextMenuListener} on the view to this activity, so
 * {@link #onCreateContextMenu(ContextMenu, View, ContextMenuInfo)} will be
 * called when it is time to show the context menu.
 *
 * @see #unregisterForContextMenu(View)
 * @param view The view that should show a context menu.
 */
public void registerForContextMenu(View view) {
    view.setOnCreateContextMenuListener(this);
}
 
Example 16
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Registers a context menu to be shown for the given view (multiple views
 * can show the context menu). This method will set the
 * {@link OnCreateContextMenuListener} on the view to this activity, so
 * {@link #onCreateContextMenu(ContextMenu, View, ContextMenuInfo)} will be
 * called when it is time to show the context menu.
 *
 * @see #unregisterForContextMenu(View)
 * @param view The view that should show a context menu.
 */
public void registerForContextMenu(View view) {
    view.setOnCreateContextMenuListener(this);
}
 
Example 17
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Registers a context menu to be shown for the given view (multiple views
 * can show the context menu). This method will set the
 * {@link OnCreateContextMenuListener} on the view to this activity, so
 * {@link #onCreateContextMenu(ContextMenu, View, ContextMenuInfo)} will be
 * called when it is time to show the context menu.
 *
 * @see #unregisterForContextMenu(View)
 * @param view The view that should show a context menu.
 */
public void registerForContextMenu(View view) {
    view.setOnCreateContextMenuListener(this);
}
 
Example 18
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Prevents a context menu to be shown for the given view. This method will remove the
 * {@link OnCreateContextMenuListener} on the view.
 *
 * @see #registerForContextMenu(View)
 * @param view The view that should stop showing a context menu.
 */
public void unregisterForContextMenu(View view) {
    view.setOnCreateContextMenuListener(null);
}
 
Example 19
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Prevents a context menu to be shown for the given view. This method will remove the
 * {@link OnCreateContextMenuListener} on the view.
 *
 * @see #registerForContextMenu(View)
 * @param view The view that should stop showing a context menu.
 */
public void unregisterForContextMenu(View view) {
    view.setOnCreateContextMenuListener(null);
}
 
Example 20
Project: ProgressManager   File: a.java   Source Code and License Vote up 2 votes
/**
 * Prevents a context menu to be shown for the given view. This method will remove the
 * {@link OnCreateContextMenuListener} on the view.
 *
 * @see #registerForContextMenu(View)
 * @param view The view that should stop showing a context menu.
 */
public void unregisterForContextMenu(View view) {
    view.setOnCreateContextMenuListener(null);
}