android.widget.TextView.setLongClickable()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(184)

本文整理了Java中android.widget.TextView.setLongClickable()方法的一些代码示例,展示了TextView.setLongClickable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setLongClickable()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setLongClickable

TextView.setLongClickable介绍

暂无

代码示例

代码示例来源:origin: nickbutcher/plaid

/**
 * Work around some 'features' of TextView and URLSpans. i.e. vanilla URLSpans do not react to
 * touch so we replace them with our own {@link TouchableUrlSpan}
 * & {@link LinkTouchMovementMethod} to fix this.
 * <p/>
 * Setting a custom MovementMethod on a TextView also alters touch handling (see
 * TextView#fixFocusableAndClickableSettings) so we need to correct this.
 */
public static void setTextWithNiceLinks(TextView textView, CharSequence input) {
  textView.setText(input);
  textView.setMovementMethod(LinkTouchMovementMethod.getInstance());
  textView.setFocusable(false);
  textView.setClickable(false);
  textView.setLongClickable(false);
}

代码示例来源:origin: TeamNewPipe/NewPipe

@Override
protected void initListeners() {
  super.initListeners();
  infoItemBuilder.setOnStreamSelectedListener(new OnClickGesture<StreamInfoItem>() {
    @Override
    public void selected(StreamInfoItem selectedItem) {
      selectAndLoadVideo(selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName());
    }
    @Override
    public void held(StreamInfoItem selectedItem) {
      showStreamDialog(selectedItem);
    }
  });
  videoTitleRoot.setOnClickListener(this);
  uploaderRootLayout.setOnClickListener(this);
  thumbnailBackgroundButton.setOnClickListener(this);
  detailControlsBackground.setOnClickListener(this);
  detailControlsPopup.setOnClickListener(this);
  detailControlsAddToPlaylist.setOnClickListener(this);
  detailControlsDownload.setOnClickListener(this);
  detailControlsDownload.setOnLongClickListener(this);
  relatedStreamExpandButton.setOnClickListener(this);
  detailControlsBackground.setLongClickable(true);
  detailControlsPopup.setLongClickable(true);
  detailControlsBackground.setOnLongClickListener(this);
  detailControlsPopup.setOnLongClickListener(this);
  detailControlsBackground.setOnTouchListener(getOnControlsTouchListener());
  detailControlsPopup.setOnTouchListener(getOnControlsTouchListener());
}

代码示例来源:origin: stackoverflow.com

public static void setTextViewLinkClickable(TextView textView) {
  textView.setMovementMethod(ClickableMovementMethod.getInstance());
  // Reset for TextView.fixFocusableAndClickableSettings(). We don't want View.onTouchEvent()
  // to consume touch events.
  textView.setClickable(false);
  textView.setLongClickable(false);
}

代码示例来源:origin: zulip/zulip-android

public MessageHolder(final View itemView) {
  super(itemView);
  gravatar = (ImageView) itemView.findViewById(R.id.gravatar);
  senderName = (TextView) itemView.findViewById(R.id.senderName);
  timestamp = (TextView) itemView.findViewById(R.id.timestamp);
  leftTimestamp = (TextView) itemView.findViewById(R.id.left_timestamp);
  edited = (TextView) itemView.findViewById(R.id.message_edit_tag);
  leftEdited = (TextView) itemView.findViewById(R.id.left_message_edit_tag);
  contentView = (TextView) itemView.findViewById(R.id.contentView);
  contentView.setMovementMethod(LinkMovementMethod.getInstance());
  leftBar = itemView.findViewById(R.id.leftBar);
  messageTile = (RelativeLayout) itemView.findViewById(R.id.messageTile);
  contentImage = (ImageView) itemView.findViewById(R.id.load_image);
  starImage = (ImageView) itemView.findViewById(R.id.star_image);
  leftStarImage = (ImageView) itemView.findViewById(R.id.left_star_image);
  contentImageContainer = itemView.findViewById(R.id.load_image_container);
  reactionsTable = (TableLayout) itemView.findViewById(R.id.reactions_table);
  contentView.setOnClickListener(this);
  contentView.setLongClickable(true);
  itemView.setOnCreateContextMenuListener(this);
  // Add click listener to sender view
  View senderView = itemView.findViewById(R.id.senderTile);
  if (senderView != null) senderView.setOnClickListener(this);
}

代码示例来源:origin: stackoverflow.com

@Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
   searchView = (SearchView) menu.findItem(R.id.search).getActionView();
   searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
   searchView.setIconifiedByDefault(true);
   searchView.setQueryHint(getActivity().getString(R.string.search_files_hint));
   search = menu.findItem(R.id.search);
   MenuItemCompat.setOnActionExpandListener(search,
       new MenuItemCompat.OnActionExpandListener() {
         @Override
         public boolean onMenuItemActionCollapse(MenuItem item) {
           return true; // Return true to collapse action view
         }
         @Override
         public boolean onMenuItemActionExpand(MenuItem item) {
           // Disabling long-click on the SearchView to remove the CAB glitch
           TextView searchText = (TextView) searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
           if(searchText != null){
             searchText.setLongClickable(false);
           }
           return true; // Return true to expand action view
         }
       });
 }

代码示例来源:origin: Shirlman/YiPlayer

mTimedSubtitleView.setText(spannableStringBuilder);
mTimedSubtitleView.setMovementMethod(LinkMovementMethod.getInstance());
mTimedSubtitleView.setLongClickable(false);

代码示例来源:origin: CooLoongWu/CoolChat

textView.setFocusable(false);
textView.setClickable(false);
textView.setLongClickable(false);

代码示例来源:origin: pkhope/weibo

textView.setFocusable(false);
textView.setClickable(false);
textView.setLongClickable(false);
matcher.reset();

代码示例来源:origin: ydcx/KooReader

reportTextView.setMovementMethod(ScrollingMovementMethod.getInstance());
reportTextView.setClickable(false);
reportTextView.setLongClickable(false);

代码示例来源:origin: Jiangzqts/EpubRead

reportTextView.setMovementMethod(ScrollingMovementMethod.getInstance());
reportTextView.setClickable(false);
reportTextView.setLongClickable(false);

代码示例来源:origin: adolfAn/FBReader_AS

reportTextView.setMovementMethod(ScrollingMovementMethod.getInstance());
reportTextView.setClickable(false);
reportTextView.setLongClickable(false);

代码示例来源:origin: w568w/fuckView

textView.setLongClickable(true);
textView.setOnClickListener(new View.OnClickListener() {
  @Override

代码示例来源:origin: delight-im/Android-Commons

/**
 * Sets the given `TextView` to be read-only or read-and-write
 *
 * @param view a `TextView` or one of its subclasses
 * @param readOnly whether the view should be read-only or not
 */
public static void setReadOnly(final TextView view, final boolean readOnly) {
  view.setFocusable(!readOnly);
  view.setFocusableInTouchMode(!readOnly);
  view.setClickable(!readOnly);
  view.setLongClickable(!readOnly);
  view.setCursorVisible(!readOnly);
}

代码示例来源:origin: antest1/kcanotify

text.setLongClickable(true);
text.setOnLongClickListener(new View.OnLongClickListener() {
  @Override

代码示例来源:origin: Wilm0r/giggity

t.setLongClickable(true);
t.setOnLongClickListener(new OnLongClickListener() {
  @Override

相关文章

TextView类方法