本文整理汇总了Java中android.widget.LinearLayout.setOnLongClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java LinearLayout.setOnLongClickListener方法的具体用法?Java LinearLayout.setOnLongClickListener怎么用?Java LinearLayout.setOnLongClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.LinearLayout
的用法示例。
在下文中一共展示了LinearLayout.setOnLongClickListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getView
import android.widget.LinearLayout; //导入方法依赖的package包/类
public View getView(LayoutInflater inflater, Setting setting, View convertView, Context context) {
if (mView != null) return mView;
mView = convertView = inflater.inflate(R.layout.row_setting_link, null);
// re-initialize views
mTitle = (TextView) convertView.findViewById(R.id.title_view);
mDescr = (TextView) convertView.findViewById(R.id.descr_view);
mIcon = (ImageView) convertView.findViewById(R.id.icon_view);
LinearLayout clicableLeft = (LinearLayout) convertView.findViewById(R.id.clickable_left);
// set values
mSetting = setting;
// set listeners
clicableLeft.setOnClickListener(this);
clicableLeft.setOnLongClickListener(setting.prefs == null ? null : this);
// update view
updateView();
return convertView;
}
示例2: setupIdeaTile
import android.widget.LinearLayout; //导入方法依赖的package包/类
private void setupIdeaTile(MyViewHolder holder, LinearLayout container) {
holder.txtView.setSingleLine();
holder.txtView.setText(mIdea);
holder.txtView.setGravity(Gravity.CENTER_VERTICAL | Gravity.START);
if (mDarkTheme) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
container.setBackgroundResource(R.drawable.grey_ripple);
} else {
container.setBackgroundResource(R.color.md_grey_800);
}
holder.txtView.setTextColor(Color.WHITE);
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
container.setBackgroundResource(R.drawable.white_ripple);
} else {
container.setBackgroundResource(R.color.white);
}
holder.txtView.setTextColor(Color.BLACK);
}
//Listeners
RecyclerOnClickListener listener = new RecyclerOnClickListener(mRecyclerView, mTabNumber);
container.setOnClickListener(listener);
container.setOnLongClickListener(mListener);
}
示例3: ContentRecyclerViewHolder
import android.widget.LinearLayout; //导入方法依赖的package包/类
public ContentRecyclerViewHolder(View itemView) {
super(itemView);
textView = (TextView) itemView.findViewById(R.id.recycler_title);
bodyText = (TextView) itemView.findViewById(R.id.tv_content_id);
imageView = (ImageView) itemView.findViewById(R.id.recycler_img);
itemLayout = (LinearLayout) itemView.findViewById(R.id.recycler_item);
itemLayout.setOnClickListener(this);
itemLayout.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
titleData.remove(textView.getText().toString());
notifyDataSetChanged();
DataSupport.deleteAll(Artical.class, "articalTitle = ?" , textView.getText().toString());
Toast.makeText(context, "删除成功", Toast.LENGTH_SHORT).show();
return true;
}
});
}
示例4: ViewHolder
import android.widget.LinearLayout; //导入方法依赖的package包/类
ViewHolder(View itemView)
{
super(itemView);
image = (SquareImageView)itemView.findViewById(R.id.id_image);
layout_container = (LinearLayout)itemView.findViewById(R.id.id_container);
title = (TextView)itemView.findViewById(R.id.id_title);
text = (TextView)itemView.findViewById(R.id.id_text);
open_image = (LinearLayout)itemView.findViewById(R.id.id_open_image);
open_image.setOnClickListener(this);
open_image.setOnLongClickListener(this);
}
示例5: getView
import android.widget.LinearLayout; //导入方法依赖的package包/类
public View getView(LayoutInflater inflater, Setting setting, View convertView, Context context) {
// reuse if view exists
if (mView != null) return mView;
// create new view always. this is important for "dialog" mode
mView = convertView = inflater.inflate(R.layout.row_setting_toggle, null); // inflate view of needed type
// re-initialize views
mTitle = (TextView) convertView.findViewById(R.id.title_view);
mDescr = (TextView) convertView.findViewById(R.id.descr_view);
mToggle = (ToggleButton) convertView.findViewById(R.id.clicable_right);
mIcon = (ImageView) convertView.findViewById(R.id.icon_view);
ImageButton button = (ImageButton) convertView.findViewById(R.id.popup_button);
button.setVisibility(setting.hasPopup ? View.VISIBLE : View.GONE);
LinearLayout clicableLeft = (LinearLayout) convertView.findViewById(R.id.clickable_left);
// set listeners
mToggle.setOnClickListener(this);
button.setOnClickListener(this);
clicableLeft.setOnClickListener(this);
clicableLeft.setOnLongClickListener(setting.prefs == null ? null : this);
// set values
mSetting = setting;
// update view
updateView();
return convertView;
}