Example usage for android.widget TextView setMovementMethod

List of usage examples for android.widget TextView setMovementMethod

Introduction

In this page you can find the example usage for android.widget TextView setMovementMethod.

Prototype

public final void setMovementMethod(MovementMethod movement) 

Source Link

Document

Sets the android.text.method.MovementMethod for handling arrow key movement for this TextView.

Usage

From source file:cc.softwarefactory.lokki.android.fragments.HelpFragment.java

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

    TextView textView = new TextView(getActivity());
    textView.setPadding(15, 15, 15, 15);
    textView.setMovementMethod(LinkMovementMethod.getInstance());

    ScrollView scroller = new ScrollView(getActivity());
    scroller.addView(textView);/* w ww. j ava 2  s .c o  m*/

    return scroller;
}

From source file:com.android.settings.widget.FooterPreference.java

@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);/*from  www .ja  v  a2 s  .  co  m*/
    title.setLongClickable(false);
}

From source file:io.jari.geenstijl.Dialogs.AboutDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    LayoutInflater inflater = getActivity().getLayoutInflater();

    final View view = inflater.inflate(R.layout.dialog_about, null);
    builder.setView(view);/*from w w w  .j  ava 2s . c om*/
    TextView version = (TextView) view.findViewById(R.id.about_version);
    TextView desc = (TextView) view.findViewById(R.id.about_desc);
    desc.setMovementMethod(LinkMovementMethod.getInstance());

    try {
        version.setText(activity.getResources().getString(R.string.about_version)
                + activity.getPackageManager().getPackageInfo(activity.getPackageName(), 0).versionName);
    } catch (PackageManager.NameNotFoundException e) {
        version.setText(activity.getResources().getString(R.string.about_version) + "????");
    }
    return builder.create();
}

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 ww w . j a  va2 s . 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.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: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 {/*ww  w. ja  va2  s .c o 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.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: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;//  w  ww.j  a  v a2 s  . c o  m
}

From source file:io.pure.sixgrid.fragments.AboutFragment.java

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

    TextView tv = (TextView) rootView.findViewById(R.id.aboutTextView);
    tv.setMovementMethod(LinkMovementMethod.getInstance());

    Button bt = (Button) rootView.findViewById(R.id.license);
    bt.setOnClickListener(new View.OnClickListener() {
        @Override/*  www. j a va 2  s .  c  o  m*/
        public void onClick(View v) {
            Intent i = new Intent(getActivity(), License.class);
            startActivity(i);
            getActivity().overridePendingTransition(R.anim.slide_up_bottom, R.anim.slide_down_bottom);
        }
    });

    Button ct = (Button) rootView.findViewById(R.id.custombt);
    ct.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent i = new Intent(getActivity(), SimplePreference.class);
            startActivity(i);
            getActivity().overridePendingTransition(R.anim.slide_up_bottom, R.anim.slide_down_bottom);
            getActivity().finish();
        }
    });

    return rootView;
}

From source file:de.tobiasbielefeld.solitaire.ui.about.LicenseFragment.java

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

    TextView textMaterialIconsLicense = (TextView) view.findViewById(R.id.about_license_material_icons);
    TextView textMaterialIconsLicense2 = (TextView) view.findViewById(R.id.about_license_material_icons_2);
    TextView textMaterialIconsUsage2 = (TextView) view.findViewById(R.id.about_license_material_icons_2_usage);
    TextView textCardThemesLicense = (TextView) view.findViewById(R.id.about_license_cards_theme);
    TextView textCardThemesLicenseUsage = (TextView) view.findViewById(R.id.about_license_card_themes_usage);
    TextView textPokerLicense = (TextView) view.findViewById(R.id.about_license_poker_theme);
    TextView textPokerLicenseUsage = (TextView) view.findViewById(R.id.about_license_poker_theme_usage);
    TextView textParisLicenseUsage = (TextView) view.findViewById(R.id.about_license_paris_theme_usage);
    TextView textCustomColorPickerLicense = (TextView) view
            .findViewById(R.id.about_license_custom_color_picker);
    TextView textSoundsLicense = (TextView) view.findViewById(R.id.about_license_sounds);
    TextView textSoundsLicenseUsage = (TextView) view.findViewById(R.id.about_license_sounds_usage);
    TextView textSlidingTabsLicense = (TextView) view.findViewById(R.id.about_license_sliding_tabs);
    TextView textAndroidSupportLicense = (TextView) view
            .findViewById(R.id.about_license_android_support_libraries);

    TextView[] textViews = new TextView[] { textMaterialIconsLicense, textMaterialIconsLicense2,
            textMaterialIconsUsage2, textCardThemesLicense, textCardThemesLicenseUsage, textPokerLicense,
            textPokerLicenseUsage, textCustomColorPickerLicense, textSoundsLicense, textSoundsLicenseUsage,
            textSlidingTabsLicense, textAndroidSupportLicense, textParisLicenseUsage };

    //explicitly set the strings here, otherwise the links in them wouldn't show properly
    textCardThemesLicenseUsage.setText(Html.fromHtml(getString(R.string.about_card_themes_usage)));
    textPokerLicenseUsage.setText(Html.fromHtml(getString(R.string.about_poker_themes_usage)));
    textParisLicenseUsage.setText(Html.fromHtml(getString(R.string.about_paris_themes_usage)));
    textSoundsLicenseUsage.setText(Html.fromHtml(getString(R.string.about_sounds_usage)));
    textMaterialIconsUsage2.setText(Html.fromHtml(getString(R.string.about_material_icons_2_usage)));

    for (TextView textView : textViews) {
        textView.setMovementMethod(LinkMovementMethod.getInstance());
    }//w  ww.jav  a2 s .  c om

    return view;
}

From source file:com.idevity.card.read.IdevityInfo.java

/**
 * Method onCreate.//from w  w  w  .ja v a 2 s.  co m
 * 
 * @param savedInstanceState
 *            Bundle
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_idevity_info);
    // Show the Up button in the action bar.
    setupActionBar();
    // Turn URL(s) into a clickable link(s)
    TextView feedback = (TextView) findViewById(R.id.feedback);
    feedback.setMovementMethod(LinkMovementMethod.getInstance());
    TextView website = (TextView) findViewById(R.id.website);
    website.setMovementMethod(LinkMovementMethod.getInstance());
}

From source file:de.yazo_games.mensaguthaben.AboutActivity.java

private void makeLinkClickable(int id) {

    TextView tv = (TextView) findViewById(id);
    tv.setMovementMethod(LinkMovementMethod.getInstance());
}