Example usage for android.text.util Linkify ALL

List of usage examples for android.text.util Linkify ALL

Introduction

In this page you can find the example usage for android.text.util Linkify ALL.

Prototype

int ALL

To view the source code for android.text.util Linkify ALL.

Click Source Link

Document

Bit mask indicating that all available patterns should be matched in methods that take an options mask

Note:

#MAP_ADDRESSES is deprecated.

Usage

From source file:com.savvywits.wethepeople.AboutFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    View view = inflater.inflate(R.layout.about_layout, container, false);
    String text = new String(AboutText.ABOUT);
    TextView tv = (TextView) view.findViewById(R.id.aboutpage);
    tv.setText(Html.fromHtml(text));//from  ww  w . j  a  v a  2  s .  c  om

    Linkify.addLinks(tv, Linkify.ALL);

    return view;
}

From source file:com.byagowi.persiancalendar.view.fragment.AboutFragment.java

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_about, container, false);
    utils = Utils.getInstance(getContext());
    utils.setActivityTitleAndSubtitle(getActivity(), getString(R.string.about), "");

    String version = utils.programVersion();

    TextView versionTextView = (TextView) view.findViewById(R.id.version2);
    utils.setFont(versionTextView);/*from   w  ww  .ja v  a2  s  .co m*/
    versionTextView.setText(
            utils.shape(getString(R.string.version)) + " " + utils.formatNumber(version.split("-")[0]));

    TextView licenseTextView = (TextView) view.findViewById(R.id.license);
    licenseTextView.setText(
            "Android Persian Calendar Version " + version + "\n" + utils.readRawResource(R.raw.credits));

    Linkify.addLinks(licenseTextView, Linkify.ALL);

    return view;
}

From source file:com.contralabs.inmap.fragments.LegalNoticesDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Context context = getActivity();

    ScrollView scrollView = new ScrollView(context);
    // Set up the TextView
    final TextView message = new TextView(context);
    // We'll use a spannablestring to be able to make links clickable
    final SpannableString s = new SpannableString(
            GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(context));

    // Set some padding
    int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10,
            getResources().getDisplayMetrics());
    message.setPadding(padding, padding, padding, padding);
    // Set up the final string
    message.setText(s);//from w  w w .ja v a2  s .c  o m
    scrollView.addView(message);
    // Now linkify the text
    Linkify.addLinks(message, Linkify.ALL);
    Linkify.addLinks(message, Pattern.compile("@([A-Za-z0-9_-]+)"), "https://twitter.com/#!/");
    return new AlertDialog.Builder(getActivity()).setTitle(R.string.legal_notices).setCancelable(true)
            .setIcon(R.drawable.ic_launcher)
            .setPositiveButton(context.getString(R.string.voltar), (OnClickListener) null).setView(scrollView)
            .create();
}

From source file:org.uab.deic.uabdroid.fragments.GeneralInfoFragment.java

@Override
public void onActivityCreated(Bundle _savedInstanceState) {
    super.onActivityCreated(_savedInstanceState);

    GeneralInfoActivity parentActivity = (GeneralInfoActivity) getActivity();
    GeneralInfo generalInfo = parentActivity.getGeneralinfo();

    TextView textviewGeneralInfo = (TextView) parentActivity.findViewById(R.id.generalinfo_text);
    textviewGeneralInfo.setText(Html.fromHtml(generalInfo.getDescription()), BufferType.SPANNABLE);
    Linkify.addLinks(textviewGeneralInfo, Linkify.ALL);
}

From source file:com.tortel.syslog.dialog.FaqDialog.java

@NonNull
@Override//from   w w  w. j  a va  2s  . c  om
public Dialog onCreateDialog(Bundle savedInstanceState) {
    MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.about, null);
    TextView text = (TextView) view.findViewById(R.id.text);

    text.setText(Html.fromHtml(readRawTextFile(R.raw.faq)));
    Linkify.addLinks(text, Linkify.ALL);
    text.setMovementMethod(LinkMovementMethod.getInstance());

    builder.customView(view, false);
    builder.title(R.string.syslog_faq);
    builder.positiveText(R.string.close);

    return builder.build();
}

From source file:com.tortel.syslog.dialog.AboutDialog.java

@NonNull
@Override// w  ww  . j av a 2 s.  c o m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());

    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.about, null);
    TextView text = (TextView) view.findViewById(R.id.text);

    text.setText(Html.fromHtml(readRawTextFile(R.raw.about)));
    Linkify.addLinks(text, Linkify.ALL);
    text.setMovementMethod(LinkMovementMethod.getInstance());

    builder.customView(view, false);
    builder.title(R.string.about);
    builder.positiveText(R.string.close);

    return builder.build();
}

From source file:cn.newgxu.android.notty.ui.AboutBoxDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    View v = getActivity().getLayoutInflater().inflate(R.layout.about, null);
    TextView tv = (TextView) v.findViewById(android.R.id.text1);
    SpannableString aboutTxt = new SpannableString(getString(R.string.version) + ": "
            + AppUtils.version(getActivity()) + "\n" + getString(R.string.about_text));
    tv.setText(aboutTxt);//from  w ww. jav a2s . co  m
    Linkify.addLinks(tv, Linkify.ALL);
    return new AlertDialog.Builder(getActivity()).setTitle(getString(R.string.about)).setCancelable(true)
            .setIcon(R.drawable.ic_launcher).setPositiveButton(R.string.ok, null).setView(v).create();
}

From source file:com.tortel.syslog.dialog.AboutLogcatDialog.java

@NonNull
@Override//from  ww w  .  j  a  v  a2s.  c o m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());

    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.about, null);
    TextView text = (TextView) view.findViewById(R.id.text);

    text.setText(Html.fromHtml(readRawTextFile(R.raw.logcat)));
    Linkify.addLinks(text, Linkify.ALL);
    text.setMovementMethod(LinkMovementMethod.getInstance());

    builder.customView(view, false);
    builder.title(R.string.about_live);
    builder.positiveText(R.string.close);

    return builder.build();
}

From source file:com.tortel.deploytrack.fragments.AboutDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Context wrappedContext = new ContextThemeWrapper(getActivity(), R.style.Theme_DeployThemeLight);

    MaterialDialog.Builder builder = new MaterialDialog.Builder(wrappedContext);

    LayoutInflater inflater = getActivity().getLayoutInflater().cloneInContext(wrappedContext);
    View view = inflater.inflate(R.layout.about, null);
    TextView text = (TextView) view.findViewById(R.id.about_view);

    text.setText(Html.fromHtml(readRawTextFile(R.raw.about)));
    Linkify.addLinks(text, Linkify.ALL);
    text.setMovementMethod(LinkMovementMethod.getInstance());

    builder.customView(view, false);/*from w w  w  .ja  v a  2  s. co  m*/
    builder.title(R.string.app_name);
    builder.positiveText(R.string.close);

    return builder.build();
}

From source file:org.birthdayadapter.ui.InstallWorkaroundDialogFragment.java

/**
 * Creates dialog/*from  w ww .  jav a  2 s . c  o m*/
 */
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    // Linkify the message
    final SpannableString message = new SpannableString(getString(R.string.workaround_dialog_message));
    Linkify.addLinks(message, Linkify.ALL);

    AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
    alert.setTitle(R.string.workaround_dialog_title);
    alert.setMessage(message);
    alert.setCancelable(true);
    alert.setIcon(android.R.drawable.ic_dialog_info);

    alert.setNegativeButton(R.string.workaround_dialog_close_button, new OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            dismiss();
        }
    });
    alert.setNeutralButton(R.string.workaround_dialog_dont_show_again_button, new OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            PreferencesHelper.setShowWorkaroundDialog(getActivity(), false);
            dismiss();
        }
    });
    alert.setPositiveButton(R.string.workaround_dialog_install_button, new OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            String workaroundName = "org.birthdayadapter.jb.workaround";
            try {
                startActivity(
                        new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + workaroundName)));
            } catch (ActivityNotFoundException anfe) {
                // No Google Play installed? Weird! Try with browser!
                startActivity(new Intent(Intent.ACTION_VIEW,
                        Uri.parse("http://play.google.com/store/apps/details?id=" + workaroundName)));
            }
        }
    });
    return alert.create();
}