本文整理汇总了Java中android.view.View.setOnCreateContextMenuListener方法的典型用法代码示例。如果您正苦于以下问题:Java View.setOnCreateContextMenuListener方法的具体用法?Java View.setOnCreateContextMenuListener怎么用?Java View.setOnCreateContextMenuListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.setOnCreateContextMenuListener方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PackageViewHolder
import android.view.View; //导入方法依赖的package包/类
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);
}
示例2: MyViewHolder
import android.view.View; //导入方法依赖的package包/类
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);
}
示例3: FriendsHolder
import android.view.View; //导入方法依赖的package包/类
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);
}
示例4: Holder
import android.view.View; //导入方法依赖的package包/类
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);
}
示例5: EventHolder
import android.view.View; //导入方法依赖的package包/类
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);
}
}
}
});
}
示例6: Holder
import android.view.View; //导入方法依赖的package包/类
public Holder(View itemView) {
super(itemView);
itemView.setOnCreateContextMenuListener(this);
avatar = itemView.findViewById(R.id.avatar);
name = itemView.findViewById(R.id.name);
}
示例7: ItemViewHolder
import android.view.View; //导入方法依赖的package包/类
public ItemViewHolder(View v) {
super(v);
v.setOnClickListener(this);
v.setOnCreateContextMenuListener(this);
}
示例8: registerForContextMenu
import android.view.View; //导入方法依赖的package包/类
public void registerForContextMenu(View view) {
view.setOnCreateContextMenuListener(this);
}
示例9: unregisterForContextMenu
import android.view.View; //导入方法依赖的package包/类
/**
* 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);
}
示例10: registerForContextMenu
import android.view.View; //导入方法依赖的package包/类
/**
* 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);
}