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:com.CardMemorizer.android.MainNavigation.AboutFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mLayout = inflater.inflate(R.layout.about_page, container, false);
    TextView apacheText = (TextView) mLayout.findViewById(R.id.apache);
    apacheText.setText(/*from w  w  w  .j  a  v  a2s .c  o  m*/
            "Some parts of this software are protected by the Apache License, version 2.0. It can be found at "
                    + "http://www.apache.org/licenses/LICENSE-2.0.html");
    apacheText.setMovementMethod(LinkMovementMethod.getInstance());
    return mLayout;
}

From source file:edu.usf.cutr.opentripplanner.android.AboutActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.about);/*from  w w w. j a  va2 s  . co  m*/
    TextView description = (TextView) findViewById(R.id.appDescription);
    TextView acknowledgements = (TextView) findViewById(R.id.acknowledgements);
    TextView license = (TextView) findViewById(R.id.license);
    Button playServicesButton = (Button) findViewById(R.id.playServicesButton);
    description.setMovementMethod(LinkMovementMethod.getInstance());
    acknowledgements.setMovementMethod(LinkMovementMethod.getInstance());
    license.setMovementMethod(LinkMovementMethod.getInstance());
    playServicesButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(AboutActivity.this, AboutPlayServicesActivity.class);
            startActivity(intent);
        }
    });
}

From source file:fr.tvbarthel.apps.simpleweatherforcast.fragments.LicenseDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final LayoutInflater inflater = getActivity().getLayoutInflater();

    final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity());
    final View dialogView = inflater.inflate(R.layout.dialog_license, null);

    if (dialogView != null) {
        final TextView textViewContent = (TextView) dialogView.findViewById(R.id.dialog_license_content);
        if (textViewContent != null) {
            textViewContent.setMovementMethod(LinkMovementMethod.getInstance());
            Linkify.addLinks(textViewContent, Linkify.WEB_URLS);
        }/*from w w  w. ja  v a 2  s. c  om*/
    }

    dialogBuilder.setCancelable(true).setView(dialogView).setPositiveButton(android.R.string.ok, null)
            .setTitle(R.string.dialog_license_title).setInverseBackgroundForced(true);

    return dialogBuilder.create();
}

From source file:com.jamesgiang.aussnowcam.Utils.java

public static void About(Context c) {
    AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(c);
    dialogBuilder.setTitle(R.string.app_name);
    dialogBuilder.setIcon(R.drawable.icon);
    TextView textView = new TextView(c);
    SpannableString s = new SpannableString(c.getString(R.string.about_info));
    Linkify.addLinks(s, Linkify.WEB_URLS);
    textView.setText(s);/*from w  w  w  .  j av a  2 s .  c  o m*/
    textView.setGravity(Gravity.CENTER);
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    dialogBuilder.setView(textView);
    dialogBuilder.show();
}

From source file:io.github.importre.android.chromeadb.HelpFragment.java

private void setContents(View view) {
    TextView see = (TextView) view.findViewById(R.id.see_chromeadb);
    see.setText(Html.fromHtml(getActivity().getString(R.string.help_desc2)));
    see.setMovementMethod(LinkMovementMethod.getInstance());
}

From source file:com.pennapps.labs.pennmobile.AboutFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_about, container, false);
    ButterKnife.bind(this, v);
    TextView featureRequest = (TextView) v.findViewById(R.id.about_desc);
    featureRequest.setMovementMethod(LinkMovementMethod.getInstance());
    String text = "PennMobile was developed by Penn Labs, with funding<br>"
            + "and support from the Undergraduate Assembly. Special thanks to Vishwa Patel. <br><br> &copy; 2016 Penn Labs <br><br>"
            + "<a href='mailto:contact@pennlabs.org?subject=[Penn Mobile Android]'>Request a feature</a><br><br>"
            + "<a href='http://pennlabs.org'>More information</a>";
    featureRequest.setText(Html.fromHtml(text));
    return v;//from  www . jav  a  2s.c o  m
}

From source file:org.residuum.sensosc.AboutActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    String versionString = getResources().getString(R.string.app_name);
    try {//from www  .j  a v a  2s .  co m
        versionString += " " + getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }
    TextView nameAndVersion = (TextView) findViewById(R.id.name_and_version);
    nameAndVersion.setText(versionString);
    TextView javaOsc = (TextView) findViewById(R.id.javaosc_links);
    javaOsc.setMovementMethod(LinkMovementMethod.getInstance());
    javaOsc.setText(Html.fromHtml(getResources().getString(R.string.about_license_javaosc)));
    TextView buglinks = (TextView) findViewById(R.id.buglinks);
    buglinks.setMovementMethod(LinkMovementMethod.getInstance());
    buglinks.setText(Html.fromHtml(getResources().getString(R.string.about_buglinks)));
    getActionBar().setDisplayHomeAsUpEnabled(true);
}

From source file:org.sensors2.pd.activities.AboutActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    String versionString = getResources().getString(R.string.app_name);
    try {/*from   w  w  w . ja  v  a 2s .  c om*/
        versionString += " " + getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }
    TextView nameAndVersion = (TextView) findViewById(R.id.name_and_version);
    nameAndVersion.setText(versionString);
    TextView copyright = (TextView) findViewById(R.id.copyright_links);
    copyright.setMovementMethod(LinkMovementMethod.getInstance());
    copyright.setText(Html.fromHtml(getResources().getString(R.string.about_copyright)));
    TextView javaOsc = (TextView) findViewById(R.id.libpd_links);
    javaOsc.setMovementMethod(LinkMovementMethod.getInstance());
    javaOsc.setText(Html.fromHtml(getResources().getString(R.string.about_license_libpd)));
    TextView bugLinks = (TextView) findViewById(R.id.buglinks);
    bugLinks.setMovementMethod(LinkMovementMethod.getInstance());
    bugLinks.setText(Html.fromHtml(getResources().getString(R.string.about_buglinks)));
    if (android.os.Build.VERSION.SDK_INT >= 11) {
        getActionBar().setDisplayHomeAsUpEnabled(true);
    }
}

From source file:org.sensors2.osc.activities.AboutActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    String versionString = getResources().getString(R.string.app_name);
    try {//from w ww . ja  v a2 s . co m
        versionString += " " + getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }
    TextView nameAndVersion = (TextView) findViewById(R.id.name_and_version);
    nameAndVersion.setText(versionString);
    TextView copyright = (TextView) findViewById(R.id.copyright_links);
    copyright.setMovementMethod(LinkMovementMethod.getInstance());
    copyright.setText(Html.fromHtml(getResources().getString(R.string.about_copyright)));
    TextView javaOsc = (TextView) findViewById(R.id.javaosc_links);
    javaOsc.setMovementMethod(LinkMovementMethod.getInstance());
    javaOsc.setText(Html.fromHtml(getResources().getString(R.string.about_license_javaosc)));
    TextView bugLinks = (TextView) findViewById(R.id.buglinks);
    bugLinks.setMovementMethod(LinkMovementMethod.getInstance());
    bugLinks.setText(Html.fromHtml(getResources().getString(R.string.about_buglinks)));
    if (android.os.Build.VERSION.SDK_INT >= 11) {
        getActionBar().setDisplayHomeAsUpEnabled(true);
    }
}

From source file:com.italikdesign.pont.chaban.AproposFragment.java

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

    rootView = inflater.inflate(R.layout.fragment_apropos, container, false);
    // Inflate the layout for this fragment

    TextView feedback = (TextView) rootView.findViewById(R.id.contact);
    feedback.setText(Html//from  w ww.  j a  va  2s  . c o  m
            .fromHtml("<a href=\"mailto:italikdesignbordeaux@gmail.com\">italikdesignbordeaux@gmail.com</a>"));
    feedback.setMovementMethod(LinkMovementMethod.getInstance());

    TextView feedback1 = (TextView) rootView.findViewById(R.id.lien_site1);
    feedback1.setText(Html.fromHtml(
            "<a href=\"http://sedeplacer.bordeaux-metropole.fr/Toutes-les-infos-circulation/Pont-Chaban-Delmas-Fermetures\">http://sedeplacer.bordeaux-metropole.fr</a>"));
    feedback1.setMovementMethod(LinkMovementMethod.getInstance());

    TextView feedback2 = (TextView) rootView.findViewById(R.id.lien_opendata);
    feedback2.setText(Html.fromHtml(
            "<a href=\"http://data.bordeaux-metropole.fr/data.php?layer=PREVISIONS_PONT_CHABAN\">http://data.bordeaux-metropole.fr</a>"));
    feedback2.setMovementMethod(LinkMovementMethod.getInstance());

    TextView feedback3 = (TextView) rootView.findViewById(R.id.lien_blog);
    feedback3.setText(
            Html.fromHtml("<a href=\"http://www.bordeauxpaquebots.com\">http://www.bordeauxpaquebots.com</a>"));
    feedback3.setMovementMethod(LinkMovementMethod.getInstance());

    TextView feedback4 = (TextView) rootView.findViewById(R.id.lien_twitter);
    feedback4.setText(Html.fromHtml("<a href=\"https://twitter.com/SebD333\">https://twitter.com/SebD333</a>"));
    feedback4.setMovementMethod(LinkMovementMethod.getInstance());

    TextView feedback5 = (TextView) rootView.findViewById(R.id.licence_name);
    feedback5.setText(Html.fromHtml(
            "<a href=\"https://github.com/marlenech/PontChabanDelmas/blob/master/licence\">Apache License Version 2.0</a>"));
    feedback5.setMovementMethod(LinkMovementMethod.getInstance());

    return rootView;

}