當前位置: 首頁>>代碼示例>>Java>>正文


Java LinearLayout.setOnLongClickListener方法代碼示例

本文整理匯總了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;
}
 
開發者ID:sdrausty,項目名稱:buildAPKsApps,代碼行數:24,代碼來源:LinkSettingRenderer.java

示例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);
}
 
開發者ID:IdeaTrackerPlus,項目名稱:IdeaTrackerPlus,代碼行數:27,代碼來源:HorizontalAdapter.java

示例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;
        }
    });
}
 
開發者ID:ChenTianSaber,項目名稱:DailyZhiHu,代碼行數:20,代碼來源:DownloadAdapter.java

示例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);
}
 
開發者ID:MSay2,項目名稱:Mire,代碼行數:14,代碼來源:AdapterWallpaper.java

示例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;
	}
 
開發者ID:sdrausty,項目名稱:buildAPKsApps,代碼行數:33,代碼來源:ToggleSettingRenderer.java


注:本文中的android.widget.LinearLayout.setOnLongClickListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。