本文整理汇总了Java中android.widget.TextView.setLinksClickable方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.setLinksClickable方法的具体用法?Java TextView.setLinksClickable怎么用?Java TextView.setLinksClickable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.TextView
的用法示例。
在下文中一共展示了TextView.setLinksClickable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inflateRowItem
import android.widget.TextView; //导入方法依赖的package包/类
private View inflateRowItem(String title, String value) {
View view;
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.detailed_poi_tagitem, null);
//LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.rowContainer);
TextView titleTextView = (TextView) view.findViewById(R.id.rowTitle);
TextView valueTextView = (TextView) view.findViewById(R.id.rowValue);
titleTextView.setText(title);
valueTextView.setText(value);
//Linking content
if (title.toLowerCase().equals("email") || title.toLowerCase().equals("contact:email")) {
Linkify.addLinks(valueTextView, Linkify.EMAIL_ADDRESSES);
valueTextView.setLinksClickable(true);
}
if (title.toLowerCase().equals("website") || title.toLowerCase().equals("contact:website")) {
Linkify.addLinks(valueTextView, Linkify.WEB_URLS);
valueTextView.setLinksClickable(true);
}
if (title.toLowerCase().equals("phone") || title.toLowerCase().equals("phone:mobile") || title.toLowerCase().equals("contact:mobile") || title.toLowerCase().equals("contact:phone")) {
Linkify.addLinks(valueTextView, Linkify.PHONE_NUMBERS);
valueTextView.setLinksClickable(true);
}
return view;
}
示例2: onCreate
import android.widget.TextView; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTextMessage = (TextView) findViewById(R.id.message);
mTextMessage.setLinksClickable(true);
mTextMessage.setMovementMethod(LinkMovementMethod.getInstance());
BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
baseUrl = preferences.getString("base_url", null);
nickname = preferences.getString("nickname", null);
loadLog();
}
示例3: configureLinksBehavior
import android.widget.TextView; //导入方法依赖的package包/类
protected void configureLinksBehavior(final TextView text) {
text.setLinksClickable(false);
text.setMovementMethod(new LinkMovementMethod() {
@Override
public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
boolean result = false;
if (!isSelectionModeEnabled) {
result = super.onTouchEvent(widget, buffer, event);
}
itemView.onTouchEvent(event);
return result;
}
});
}
示例4: configureLinksBehavior
import android.widget.TextView; //导入方法依赖的package包/类
protected void configureLinksBehavior(final TextView text) {
text.setLinksClickable(false);
text.setMovementMethod(new LinkMovementMethod() {
@Override
public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
boolean result = false;
if (!MessagesListAdapter.isSelectionModeEnabled) {
result = super.onTouchEvent(widget, buffer, event);
}
itemView.onTouchEvent(event);
return result;
}
});
}