当前位置: 首页>>代码示例>>Java>>正文


Java View.setOnCreateContextMenuListener方法代码示例

本文整理汇总了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);

}
 
开发者ID:TonnyL,项目名称:Espresso,代码行数:18,代码来源:PackagesAdapter.java

示例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);
}
 
开发者ID:zhaobao,项目名称:AppsTimeline,代码行数:10,代码来源:MainActivity.java

示例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);
}
 
开发者ID:Q115,项目名称:Goalie_Android,代码行数:9,代码来源:FriendsListRecycler.java

示例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);
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:9,代码来源:FaveLinksAdapter.java

示例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);
                }
            }
        }
    });
}
 
开发者ID:CMPUT301F17T29,项目名称:HabitUp,代码行数:29,代码来源:EventListAdapter.java

示例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);
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:8,代码来源:FaveUsersAdapter.java

示例7: ItemViewHolder

import android.view.View; //导入方法依赖的package包/类
public ItemViewHolder(View v) {
	super(v);
	v.setOnClickListener(this);
	v.setOnCreateContextMenuListener(this);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:AppCompatListActivity.java

示例8: registerForContextMenu

import android.view.View; //导入方法依赖的package包/类
public void registerForContextMenu(View view) {
    view.setOnCreateContextMenuListener(this);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:Fragment.java

示例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);
}
 
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:11,代码来源:a.java

示例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);
}
 
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:14,代码来源:a.java


注:本文中的android.view.View.setOnCreateContextMenuListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。