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:at.bitfire.davdroid.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    setTitle("CardDroid " + Constants.APP_VERSION);

    TextView tv = (TextView) findViewById(R.id.text_info);
    tv.setText(Html.fromHtml(getString(R.string.html_info)));
    tv.setMovementMethod(LinkMovementMethod.getInstance());
}

From source file:com.floatboth.antigravity.ui.LicenseActivity.java

@AfterViews
public void setUpViews() {
    try {//from   w w  w.j a  v a 2  s . c o m
        InputStream is = getAssets()
                .open(uri.toString().replace("com.floatboth.antigravity.license://", "license_") + ".txt");
        app_info.setText(IOUtils.toString(is, "UTF-8"));
        Linkify.addLinks(app_info, Linkify.WEB_URLS);
        app_info.setMovementMethod(LinkMovementMethod.getInstance());
    } catch (Exception ex) {
    }
}

From source file:com.achow101.bitcointalkforum.AboutActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    setupActionBar();/*from w w w  .  j a v a 2 s  . co  m*/
    TextView about = (TextView) findViewById(R.id.about);
    about.setMovementMethod(LinkMovementMethod.getInstance());
}

From source file:org.openhab.habdroid.ui.AboutFragment.java

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

    View view = inflater.inflate(R.layout.openhababout, container, false);

    TextView about = (TextView) view.findViewById(R.id.license_link);
    about.setText(Html.fromHtml(getString(R.string.about_license)));
    about.setMovementMethod(LinkMovementMethod.getInstance());
    TextView appVersion = (TextView) view.findViewById(R.id.app_version);
    appVersion.setText(getString(R.string.about_version_string, BuildConfig.VERSION_NAME,
            DateFormat.getDateTimeInstance().format(BuildConfig.buildTime)));

    String year = new SimpleDateFormat("yyyy", Locale.US).format(Calendar.getInstance().getTime());
    TextView copyright = (TextView) view.findViewById(R.id.copyright);
    copyright.setText(String.format(getString(R.string.about_copyright), year));
    copyright.setMovementMethod(LinkMovementMethod.getInstance());

    TextView links = (TextView) view.findViewById(R.id.links_list);
    links.setText(Html.fromHtml(getString(R.string.about_links_list)));
    links.setMovementMethod(LinkMovementMethod.getInstance());

    return view;//  ww w  .j  av a  2  s.  c  om
}

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

private void makeLinkClickable(int id) {

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

From source file:org.telegram.ui.Cells.TextInfoPrivacyCell.java

public TextInfoPrivacyCell(Context context) {
    super(context);

    textView = new TextView(context);
    textView.setTextColor(ContextCompat.getColor(context, R.color.disabled_text));
    textView.setLinkTextColor(Theme.MSG_LINK_TEXT_COLOR);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
    textView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT);
    textView.setPadding(0, AndroidUtilities.dp(10), 0, AndroidUtilities.dp(17));
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT,
            (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 17, 0));
}

From source file:com.google.android.apps.gutenberg.EulaFragment.java

@NonNull
@Override/*w  w  w .  j ava  2  s. c om*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    int padding = getResources().getDimensionPixelSize(R.dimen.dialog_padding);
    TextView eulaTextView = new TextView(getActivity());
    eulaTextView.setText(Html.fromHtml(getString(R.string.eula_content)));
    eulaTextView.setMovementMethod(LinkMovementMethod.getInstance());
    eulaTextView.setPadding(padding, padding, padding, padding);
    return new AlertDialog.Builder(getActivity()).setTitle(R.string.eula).setView(eulaTextView)
            .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    dialog.dismiss();
                }
            }).create();
}

From source file:com.envision_lightning.big_o.about.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(com.envision_lightning.big_o.R.layout.about);

    DisplayMetrics dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);

    int width = dm.widthPixels;
    int height = dm.heightPixels;

    getWindow().setLayout((int) (width * .72), (int) (height * .30)); // sets pop up window within certain x & y dimensions

    aboutInfo = (TextView) findViewById(com.envision_lightning.big_o.R.id.aboutInfo);
    aboutInfo.setText("Big-O Reference Website: ");

    note = (TextView) findViewById(com.envision_lightning.big_o.R.id.note);
    note.setClickable(true);// ww  w . j a  v a2s . c  o m
    note.setMovementMethod(LinkMovementMethod.getInstance());
    String text = "<a href='http://bigocheatsheet.com/'> bigocheatsheet.com </a>";
    note.setText(Html.fromHtml(text));

    setLicense = (TextView) findViewById(com.envision_lightning.big_o.R.id.setLicense);
    setLicense.setText("PagerSlidingTabStrip");

    licenseInfo = (TextView) findViewById(com.envision_lightning.big_o.R.id.licenseInfo);
    licenseInfo.setText("Released by Andreas Stuetz under the Apache License, Version 2.0.");
}

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

/**
 * Method onCreate.//from  w w w .  j av a  2 s  .  c om
 * 
 * @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:net.yolosec.upckeygen.ui.AboutTabHostActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.about_dialog);

    try {/*from w ww. j a  v a 2  s.c o m*/
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    } catch (Exception e) {
        Log.e(TAG, "Exception", e);
    }

    TabHost tabs = (TabHost) findViewById(R.id.tabhost);
    tabs.setup();

    TabHost.TabSpec tspec1 = tabs.newTabSpec("about");
    tspec1.setIndicator(getString(R.string.pref_2section));
    tspec1.setContent(R.id.text_about_scroll);
    TextView text = ((TextView) findViewById(R.id.text_about));
    text.setMovementMethod(LinkMovementMethod.getInstance());
    try {
        PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
        String version = pInfo.versionName;
        text.append(version);
    } catch (Exception e) {
        Log.e(TAG, "Exception in getting app version", e);
    }
    tabs.addTab(tspec1);

    TabHost.TabSpec tspec2 = tabs.newTabSpec("credits");
    tspec2.setIndicator(getString(R.string.dialog_about_credits));
    tspec2.setContent(R.id.about_credits_scroll);
    ((TextView) findViewById(R.id.about_credits)).setMovementMethod(LinkMovementMethod.getInstance());
    tabs.addTab(tspec2);
    TabHost.TabSpec tspec3 = tabs.newTabSpec("license");
    tspec3.setIndicator(getString(R.string.dialog_about_license));
    tspec3.setContent(R.id.about_license_scroll);
    ((TextView) findViewById(R.id.about_license)).setMovementMethod(LinkMovementMethod.getInstance());
    tabs.addTab(tspec3);
}