本文整理匯總了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;
}
});
}