List of usage examples for android.text.method LinkMovementMethod LinkMovementMethod
LinkMovementMethod
From source file:com.renard.ocr.help.LicenseActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_license); getSupportActionBar().setDisplayHomeAsUpEnabled(true); TextView leptonica = (TextView) findViewById(R.id.textView_leptonica); TextView tesseract = (TextView) findViewById(R.id.textView_tesseract); TextView hocr2pdf = (TextView) findViewById(R.id.textView_hocr2pdf); leptonica.setMovementMethod(new LinkMovementMethod()); tesseract.setMovementMethod(new LinkMovementMethod()); hocr2pdf.setMovementMethod(new LinkMovementMethod()); }
From source file:com.example.linhdq.test.main_menu.LicenseActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_license); initToolbar();// w w w . j a v a2 s . com setToolbarMessage(R.string.pref_title_license); getSupportActionBar().setDisplayHomeAsUpEnabled(true); TextView leptonica = (TextView) findViewById(R.id.textView_leptonica); TextView tesseract = (TextView) findViewById(R.id.textView_tesseract); TextView hocr2pdf = (TextView) findViewById(R.id.textView_hocr2pdf); leptonica.setMovementMethod(new LinkMovementMethod()); tesseract.setMovementMethod(new LinkMovementMethod()); hocr2pdf.setMovementMethod(new LinkMovementMethod()); }
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);/*ww w . ja v a 2 s. co m*/ title.setLongClickable(false); }
From source file:com.siyuan.muzei.ample.settings.AboutActivity.java
void setupBody() { TextView view = (TextView) findViewById(R.id.about_body); view.setText(Html.fromHtml(getString(R.string.about_body))); view.setMovementMethod(new LinkMovementMethod()); }
From source file:org.aminb.id3r.fragment.AboutDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { // Get app version PackageManager pm = getActivity().getPackageManager(); String packageName = getActivity().getPackageName(); String versionName;/*from w ww. j av a 2 s. c o m*/ try { PackageInfo info = pm.getPackageInfo(packageName, 0); versionName = info.versionName; } catch (PackageManager.NameNotFoundException e) { versionName = VERSION_UNAVAILABLE; } LayoutInflater layoutInflater = getActivity().getLayoutInflater(); View rootView = layoutInflater.inflate(R.layout.dialog_custom, null); TextView aboutBodyView = (TextView) rootView.findViewById(R.id.body); aboutBodyView .setText(Html.fromHtml(getString(R.string.about_body, Calendar.getInstance().get(Calendar.YEAR)))); aboutBodyView.setMovementMethod(new LinkMovementMethod()); return new MaterialDialog.Builder(getActivity()).positiveText(android.R.string.ok) .positiveColorRes(R.color.accent) .title(Html.fromHtml(getString(R.string.app_name_and_version, versionName))).customView(rootView) .callback(new MaterialDialog.SimpleCallback() { @Override public void onPositive(MaterialDialog dialog) { } }).build(); }
From source file:com.google.android.apps.santatracker.map.cardstream.DestinationViewHolder.java
private void ensureMethods(Context context) { if (sAllCaps == null) { sAllCaps = new AllCaps(context); }/* w w w. j ava 2 s. com*/ if (sLinkMovementMethod == null) { sLinkMovementMethod = new LinkMovementMethod(); } }
From source file:com.derdoktor667.dev.thematrix.fragments.overview.OverviewFragment.java
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.about_popup_layout, container, false); PackageManager pm;//from ww w .j av a 2 s .c o m pm = getActivity().getPackageManager(); String packageName = getActivity().getPackageName(); String versionName = null; try { PackageInfo info = null; if (pm != null) { info = pm.getPackageInfo(packageName, 0); } if (info != null) { versionName = info.versionName; } } catch (PackageManager.NameNotFoundException e) { versionName = VERSION_UNAVAILABLE; } TextView nameAndVersionView = null; if (view != null) { nameAndVersionView = (TextView) view.findViewById(R.id.app_name_and_version); } if (nameAndVersionView != null) { nameAndVersionView.setText(Html.fromHtml(getString(R.string.app_name_and_version, versionName))); } TextView aboutBodyView = null; if (view != null) { aboutBodyView = (TextView) view.findViewById(R.id.about_body); } if (aboutBodyView != null) { aboutBodyView.setText(Html.fromHtml(getString(R.string.about_body))); } if (aboutBodyView != null) { aboutBodyView.setMovementMethod(new LinkMovementMethod()); } return view; }
From source file:com.google.android.apps.muzei.settings.AboutActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.about_activity); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); ((Toolbar) findViewById(R.id.app_bar)).setNavigationOnClickListener(new View.OnClickListener() { @Override//from w w w . jav a 2s. co m public void onClick(View view) { onNavigateUp(); } }); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(R.id.demo_view_container, MuzeiRendererFragment.createInstance(true, false)).commit(); } // Get app version PackageManager pm = getPackageManager(); String packageName = getPackageName(); String versionName; try { PackageInfo info = pm.getPackageInfo(packageName, 0); versionName = info.versionName; } catch (PackageManager.NameNotFoundException e) { versionName = VERSION_UNAVAILABLE; } // Build the about body view and append the link to see OSS licenses TextView versionView = (TextView) findViewById(R.id.app_version); versionView.setText(Html.fromHtml(getString(R.string.about_version_template, versionName))); TextView aboutBodyView = (TextView) findViewById(R.id.about_body); aboutBodyView.setText(Html.fromHtml(getString(R.string.about_body))); aboutBodyView.setMovementMethod(new LinkMovementMethod()); findViewById(R.id.android_experiment_link).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CustomTabsIntent cti = new CustomTabsIntent.Builder().setShowTitle(true) .setToolbarColor(ContextCompat.getColor(AboutActivity.this, R.color.theme_primary)).build(); try { cti.launchUrl(AboutActivity.this, Uri.parse("https://www.androidexperiments.com/experiment/muzei")); } catch (ActivityNotFoundException ignored) { } } }); }
From source file:fr.simon.marquis.installreferrer.MainActivity.java
private void updateData() { boolean isReferrerDetected = Application.isReferrerDetected(getApplicationContext()); String firstLaunch = Application.getFirstLaunch(getApplicationContext()); String referrerDate = Application.getReferrerDate(getApplicationContext()); String referrerDataRaw = Application.getReferrerDataRaw(getApplicationContext()); String referrerDataDecoded = Application.getReferrerDataDecoded(getApplicationContext()); StringBuilder sb = new StringBuilder(); sb.append("<b>First launch:</b>").append("<br/>").append(firstLaunch).append("<br/><br/>") .append("<b>Referrer detection:</b>").append("<br/>").append(referrerDate); if (isReferrerDetected) { sb.append("<br/><br/>").append("<b>Raw referrer:</b>").append("<br/>").append(referrerDataRaw); if (referrerDataDecoded != null) { sb.append("<br/><br/>").append("<b>Decoded referrer:</b>").append("<br/>") .append(referrerDataDecoded); }//www. j a va2 s . c o m } content.setText(Html.fromHtml(sb.toString())); content.setMovementMethod(new LinkMovementMethod()); }
From source file:com.derdoktor667.dev.thematrix.utils.AboutDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { /**/* w ww .j av a2s .c om*/ * Get Application Version */ PackageManager pm = getActivity().getPackageManager(); String packageName = getActivity().getPackageName(); TextView nameAndVersionView = null; TextView aboutBodyView = null; String versionName = null; PackageInfo info = null; try { if (pm != null) { info = pm.getPackageInfo(packageName, 0); } if (info != null) { versionName = info.versionName; } } catch (PackageManager.NameNotFoundException e) { versionName = Constants.VERSION_UNAVAILABLE; } /** * Build the aboutTextView aboutBodyView = null; body view and append * the link to see OSS licenses */ LayoutInflater layoutInflater = getActivity().getLayoutInflater(); View rootView = layoutInflater.inflate(R.layout.about_popup_layout, null); if (rootView != null) { nameAndVersionView = (TextView) rootView.findViewById(R.id.app_name_and_version); } if (rootView != null) { aboutBodyView = (TextView) rootView.findViewById(R.id.about_body); } if (nameAndVersionView != null) { nameAndVersionView.setText(Html.fromHtml(getString(R.string.app_name_and_version, versionName))); } if (aboutBodyView != null) { aboutBodyView.setText(Html.fromHtml(getString(R.string.about_body))); } if (aboutBodyView != null) { aboutBodyView.setMovementMethod(new LinkMovementMethod()); } return new AlertDialog.Builder(getActivity()).setView(rootView) .setPositiveButton(R.string.close, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { dialog.dismiss(); } }).create(); }