Search in sources :

Example 46 with LinkMovementMethod

use of android.text.method.LinkMovementMethod in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class NotificationFooterPreference method onBindViewHolder.

@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);
    title.setLongClickable(false);
}
Also used : LinkMovementMethod(android.text.method.LinkMovementMethod) TextView(android.widget.TextView)

Example 47 with LinkMovementMethod

use of android.text.method.LinkMovementMethod in project Stringlate by LonamiWebs.

the class ActivityUtils method showDialogWithHtmlTextView.

public void showDialogWithHtmlTextView(@StringRes int resTitleId, String text, boolean isHtml, DialogInterface.OnDismissListener dismissedListener) {
    AppCompatTextView textView = new AppCompatTextView(_context);
    int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, _context.getResources().getDisplayMetrics());
    textView.setMovementMethod(new LinkMovementMethod());
    textView.setPadding(padding, 0, padding, 0);
    textView.setText(isHtml ? new SpannableString(Html.fromHtml(text)) : text);
    AlertDialog.Builder dialog = new AlertDialog.Builder(_context).setPositiveButton(android.R.string.ok, null).setOnDismissListener(dismissedListener).setTitle(resTitleId).setView(textView);
    dialog.show();
}
Also used : SpannableString(android.text.SpannableString) AlertDialog(android.support.v7.app.AlertDialog) AppCompatTextView(android.support.v7.widget.AppCompatTextView) LinkMovementMethod(android.text.method.LinkMovementMethod)

Example 48 with LinkMovementMethod

use of android.text.method.LinkMovementMethod in project FBReaderJ by geometer.

the class BookInfoActivity method setupAnnotation.

private void setupAnnotation(Book book, PluginCollection pluginCollection) {
    final TextView titleView = (TextView) findViewById(R.id.book_info_annotation_title);
    final TextView bodyView = (TextView) findViewById(R.id.book_info_annotation_body);
    final String annotation = BookUtil.getAnnotation(book, pluginCollection);
    if (annotation == null) {
        titleView.setVisibility(View.GONE);
        bodyView.setVisibility(View.GONE);
    } else {
        titleView.setText(myResource.getResource("annotation").getValue());
        bodyView.setText(HtmlUtil.getHtmlText(NetworkLibrary.Instance(Paths.systemInfo(this)), annotation));
        bodyView.setMovementMethod(new LinkMovementMethod());
        bodyView.setTextColor(ColorStateList.valueOf(bodyView.getTextColors().getDefaultColor()));
    }
}
Also used : LinkMovementMethod(android.text.method.LinkMovementMethod)

Example 49 with LinkMovementMethod

use of android.text.method.LinkMovementMethod in project cardslib by gabrielemariotti.

the class GuidelinesActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    setContentView(R.layout.carddemo_activity_guidelines);
    TextView tx = (TextView) findViewById(R.id.guidelines_text);
    tx.setText(Html.fromHtml(getString(R.string.guidelines_text)));
    tx.setMovementMethod(new LinkMovementMethod());
    overridePendingTransition(0, 0);
}
Also used : LinkMovementMethod(android.text.method.LinkMovementMethod) TextView(android.widget.TextView)

Example 50 with LinkMovementMethod

use of android.text.method.LinkMovementMethod in project memetastic by gsantner.

the class ActivityUtils method showDialogWithHtmlTextView.

public void showDialogWithHtmlTextView(@StringRes int resTitleId, String text, boolean isHtml, DialogInterface.OnDismissListener dismissedListener) {
    AppCompatTextView textView = new AppCompatTextView(_context);
    int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, _context.getResources().getDisplayMetrics());
    textView.setMovementMethod(new LinkMovementMethod());
    textView.setPadding(padding, 0, padding, 0);
    textView.setText(isHtml ? new SpannableString(Html.fromHtml(text)) : text);
    AlertDialog.Builder dialog = new AlertDialog.Builder(_context).setPositiveButton(android.R.string.ok, null).setOnDismissListener(dismissedListener).setTitle(resTitleId).setView(textView);
    dialog.show();
}
Also used : SpannableString(android.text.SpannableString) AlertDialog(android.support.v7.app.AlertDialog) AppCompatTextView(android.support.v7.widget.AppCompatTextView) LinkMovementMethod(android.text.method.LinkMovementMethod)

Aggregations

LinkMovementMethod (android.text.method.LinkMovementMethod)52 TextView (android.widget.TextView)40 SmallTest (android.test.suitebuilder.annotation.SmallTest)18 View (android.view.View)12 Spannable (android.text.Spannable)8 TextAppearanceSpan (android.text.style.TextAppearanceSpan)7 ImageView (android.widget.ImageView)7 SpannableStringBuilder (android.text.SpannableStringBuilder)6 SpannableString (android.text.SpannableString)5 ActivityNotFoundException (android.content.ActivityNotFoundException)3 Context (android.content.Context)3 ViewGroup (android.view.ViewGroup)3 SystemUIDialog (com.android.systemui.statusbar.phone.SystemUIDialog)3 Intent (android.content.Intent)2 PackageManager (android.content.pm.PackageManager)2 Resources (android.content.res.Resources)2 Paint (android.graphics.Paint)2 Bundle (android.os.Bundle)2 ActionBar (android.support.v7.app.ActionBar)2 AlertDialog (android.support.v7.app.AlertDialog)2