Example usage for android.text.method LinkMovementMethod getInstance

List of usage examples for android.text.method LinkMovementMethod getInstance

Introduction

In this page you can find the example usage for android.text.method LinkMovementMethod getInstance.

Prototype

public static MovementMethod getInstance() 

Source Link

Usage

From source file:it.gulch.linuxday.android.fragments.dialogs.AboutDialogFragment.java

@Override
public void onStart() {
    super.onStart();
    // Make links clickable; must be called after the dialog is shown
    ((TextView) getDialog().findViewById(android.R.id.message))
            .setMovementMethod(LinkMovementMethod.getInstance());
}

From source file:com.github.michalbednarski.intentslab.TextFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.xml_viewer, container, false);
    mLoaderView = view.findViewById(R.id.loader);
    mXmlWrapperView = view.findViewById(R.id.xml_wrapper);
    mXmlTextView = (TextView) view.findViewById(R.id.xml);
    mXmlTextView.setMovementMethod(LinkMovementMethod.getInstance());
    mFakeLongText = (ListView) view.findViewById(R.id.xml_fake_long_view);
    if (mText != null) {
        putTextInView();/*from  www  .j av a  2  s . co m*/
    }
    return view;
}

From source file:fi.iki.kuitsi.bitbeaker.fragments.AboutDialog.java

@NonNull
@Override/*  w  w w . j  a  v a2  s. c  o  m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final View aboutView = View.inflate(getActivity(), R.layout.about_dialog, null);
    unbinder = ButterKnife.bind(this, aboutView);

    license.setText(Html.fromHtml(
            String.format(getString(R.string.about_license), LICENSE_NAME, Helper.getHtmlLink(README_URL))));
    license.setMovementMethod(LinkMovementMethod.getInstance());

    contributors.setText(Html.fromHtml(
            String.format(getString(R.string.about_contributors), Helper.getHtmlLink(CONTRIBUTORS_URL))));
    contributors.setMovementMethod(LinkMovementMethod.getInstance());

    issues.setText(Html.fromHtml(String.format(getString(R.string.about_issues),
            Helper.getHtmlLink(ISSUE_TRACKER_URL), Helper.getHtmlLink(REPO_URL))));
    issues.setMovementMethod(LinkMovementMethod.getInstance());

    return new MaterialDialog.Builder(getActivity())
            .title(getString(R.string.app_name) + "\n"
                    + String.format(getString(R.string.bitbeaker_version), BuildConfig.VERSION_NAME))
            .customView(aboutView, true).iconRes(R.drawable.ic_launcher).positiveText(R.string.dialog_close)
            .negativeText(R.string.changelog).neutralText(R.string.privacypolicy)
            .callback(new MaterialDialog.ButtonCallback() {
                @Override
                public void onNegative(MaterialDialog dialog) {
                    startActivity(WikiActivity.createIntent(getActivity(), Bitbeaker.REPO_OWNER,
                            Bitbeaker.REPO_SLUG, "Changelog"));
                }

                @Override
                public void onNeutral(MaterialDialog dialog) {
                    startActivity(WikiActivity.createIntent(getActivity(), Bitbeaker.REPO_OWNER,
                            Bitbeaker.REPO_SLUG, "PrivacyPolicy"));
                }
            }).build();
}

From source file:co.dilaver.quoter.fragments.AboutMeFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_about_me, container, false);

    TextView mail = (TextView) view.findViewById(R.id.tvEmail);
    TextView twitter = (TextView) view.findViewById(R.id.tvTwitter);
    TextView facebook = (TextView) view.findViewById(R.id.tvFacebook);
    TextView linkedIn = (TextView) view.findViewById(R.id.tvLinkedIn);

    mail.setOnClickListener(new View.OnClickListener() {
        @Override//from   w w w.  ja  v  a2  s. c om
        public void onClick(View v) {
            Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
            emailIntent.setData(Uri.parse("mailto: mdilaveroglu@gmail.com"));
            startActivity(emailIntent);
        }
    });
    twitter.setMovementMethod(LinkMovementMethod.getInstance());
    facebook.setMovementMethod(LinkMovementMethod.getInstance());
    linkedIn.setMovementMethod(LinkMovementMethod.getInstance());

    return view;
}

From source file:com.publisnet.leydeinfogobierno.HomeFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.activity_home, container, false);
    ((TextView) rootView.findViewById(R.id.credits)).setMovementMethod(LinkMovementMethod.getInstance());
    ((TextView) rootView.findViewById(R.id.credits))
            .setText(Html.fromHtml(getResources().getString(R.string.credits)));

    return rootView;
}

From source file:org.catrobat.catroid.ui.dialogs.AcceptTermsOfUseDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle bundle) {
    View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_terms_of_use, null);

    TextView termsOfUseUrlTextView = (TextView) view.findViewById(R.id.dialog_terms_of_use_text_view_url);
    termsOfUseUrlTextView.setMovementMethod(LinkMovementMethod.getInstance());

    String termsOfUseUrl = getString(R.string.terms_of_use_link_template, Constants.CATROBAT_TERMS_OF_USE_URL,
            getString(R.string.dialog_terms_of_use_link_text));

    termsOfUseUrlTextView.setText(Html.fromHtml(termsOfUseUrl));

    Dialog termsOfUseDialog = new AlertDialog.Builder(getActivity()).setView(view)
            .setTitle(R.string.dialog_terms_of_use_title)
            .setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() {
                @Override//from w  w  w .j a  va2 s .  co m
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();
                }
            }).create();
    termsOfUseDialog.setCanceledOnTouchOutside(true);

    return termsOfUseDialog;
}

From source file:com.anjalimacwan.fragment.dialog.AboutDialogFragment.java

@NonNull
@Override/*from w w  w  . java 2s  .  co m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {

    // Use the Builder class for convenient dialog construction
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

    // Get the layout inflater
    final LayoutInflater inflater = getActivity().getLayoutInflater();

    // Inflate and set the layout for the dialog
    // Pass null as the parent view because its going in the dialog layout
    final View view = inflater.inflate(R.layout.fragment_dialogs, null);

    builder.setView(view).setTitle(R.string.dialog_about_title).setPositiveButton(R.string.action_close, null);

    textView = (TextView) view.findViewById(R.id.dialogMessage);
    textView.setText(R.string.dialog_about_message);
    textView.setMovementMethod(LinkMovementMethod.getInstance());

    // Create the AlertDialog object and return it
    return builder.create();
}

From source file:am.roadpolice.roadpolice.AboutUsDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    View dialogView = getActivity().getLayoutInflater().inflate(R.layout.dialog_about_us, null);
    TextView tvVersion = (TextView) dialogView.findViewById(R.id.tvAboutUsVersion);
    try {/*from  w ww . j  a  v a  2 s. c o  m*/
        PackageManager manager = getActivity().getPackageManager();
        PackageInfo info = manager.getPackageInfo(getActivity().getPackageName(), 0);
        tvVersion.setText(tvVersion.getText() + " " + info.versionName);

    } catch (PackageManager.NameNotFoundException e) {
        tvVersion.setVisibility(View.GONE);
    }

    // Makes the link in the text view clickable.
    TextView t2 = (TextView) dialogView.findViewById(R.id.tvAboutUsDeveloper);
    t2.setMovementMethod(LinkMovementMethod.getInstance());

    // Creates About Us Alert dialog which extends from DialogFragment.
    return new AlertDialog.Builder(getActivity()).setTitle(R.string.txtAboutUs)
            .setNeutralButton(R.string.about_us_close, null).setView(dialogView).create();
}

From source file:org.catrobat.catroid.ui.dialogs.AboutDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle bundle) {
    View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_about, null);

    TextView aboutUrlTextView = (TextView) view.findViewById(R.id.dialog_about_text_view_url);
    aboutUrlTextView.setMovementMethod(LinkMovementMethod.getInstance());

    String aboutUrl = getString(R.string.about_link_template, Constants.ABOUT_POCKETCODE_LICENSE_URL,
            getString(R.string.dialog_about_pocketcode_license_link_text));

    aboutUrlTextView.setText(Html.fromHtml(aboutUrl));

    TextView aboutUrlCatrobatView = (TextView) view.findViewById(R.id.dialog_about_text_catrobat_url);
    aboutUrlCatrobatView.setMovementMethod(LinkMovementMethod.getInstance());

    String aboutCatrobatUrl = getString(R.string.about_link_template, Constants.CATROBAT_ABOUT_URL,
            getString(R.string.dialog_about_catrobat_link_text));

    aboutUrlCatrobatView.setText(Html.fromHtml(aboutCatrobatUrl));

    TextView aboutVersionNameTextView = (TextView) view.findViewById(R.id.dialog_about_text_view_version_name);
    String versionName = this.getString(R.string.android_version_prefix) + Utils.getVersionName(getActivity());
    aboutVersionNameTextView.setText(versionName);

    Dialog aboutDialog = new AlertDialog.Builder(getActivity()).setView(view)
            .setTitle(R.string.dialog_about_title)
            .setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() {
                @Override//from   w w w.  ja  v  a  2s.com
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();
                }
            }).create();
    aboutDialog.setCanceledOnTouchOutside(true);

    return aboutDialog;
}

From source file:com.notepadlite.AboutDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    // Use the Builder class for convenient dialog construction
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

    // Get the layout inflater
    final LayoutInflater inflater = getActivity().getLayoutInflater();

    // Inflate and set the layout for the dialog
    // Pass null as the parent view because its going in the dialog layout
    final View view = inflater.inflate(R.layout.fragment_dialogs, null);

    builder.setView(view).setTitle(R.string.dialog_about_title).setPositiveButton(R.string.action_close,
            new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                }/*ww w.j a v a2 s  .  co  m*/
            });

    textView = (TextView) view.findViewById(R.id.dialogMessage);
    textView.setText(R.string.dialog_about_message);
    textView.setMovementMethod(LinkMovementMethod.getInstance());

    // Create the AlertDialog object and return it
    return builder.create();
}