Example usage for android.widget TextView setLongClickable

List of usage examples for android.widget TextView setLongClickable

Introduction

In this page you can find the example usage for android.widget TextView setLongClickable.

Prototype

public void setLongClickable(boolean longClickable) 

Source Link

Document

Enables or disables long click events for this view.

Usage

From source file:com.android.settings.widget.FooterPreference.java

@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
    super.onBindViewHolder(holder);
    TextView title = holder.itemView.findViewById(android.R.id.title);
    title.setMovementMethod(new LinkMovementMethod());
    title.setClickable(false);/*from w  w  w .j  a v a  2s  . c  o  m*/
    title.setLongClickable(false);
}

From source file:jahirfiquitiva.iconshowcase.adapters.ChangelogAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    if (convertView == null) {
        LayoutInflater inflater = LayoutInflater.from(context);
        convertView = inflater.inflate(R.layout.changelog_content, parent, false);
        convertView.setClickable(false);
        convertView.setLongClickable(false);
        convertView.setFocusable(false);
        convertView.setFocusableInTouchMode(false);
        convertView.setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent));
    }/*w  ww  .j  a  v  a2s . co m*/

    TextView title = (TextView) convertView.findViewById(R.id.changelog_title);
    TextView content = (TextView) convertView.findViewById(R.id.changelog_content);
    String nameStr = mChangelog[position][0];
    String contentStr = "";

    for (int i = 1; i < mChangelog[position].length; i++) {
        if (i > 1) {
            // No need for new line on the first item
            contentStr += "\n";
        }
        contentStr += "\u2022 ";
        contentStr += mChangelog[position][i];
    }

    title.setText(nameStr);
    title.setClickable(false);
    title.setLongClickable(false);
    title.setFocusable(false);
    title.setFocusableInTouchMode(false);
    title.setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent));

    content.setText(contentStr);
    content.setClickable(false);
    content.setLongClickable(false);
    content.setFocusable(false);
    content.setFocusableInTouchMode(false);
    content.setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent));

    return convertView;
}