List of usage examples for android.text.method LinkMovementMethod getInstance
public static MovementMethod getInstance()
From source file:com.armtimes.dialogs.DialogAboutUs.java
@SuppressWarnings("NullableProblems") @Override//from w ww.j a va 2 s .co m 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 { 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.about_us) .setNeutralButton(R.string.about_us_close, null).setView(dialogView).create(); }
From source file:hku.fyp14017.blencode.ui.dialogs.AboutDialogFragment.java
@Override public Dialog onCreateDialog(Bundle bundle) { View view = LayoutInflater.from(getActivity()).inflate(hku.fyp14017.blencode.R.layout.dialog_about, null); TextView license = (TextView) view.findViewById(R.id.dialog_about_text_view_license_info); license.setMovementMethod(LinkMovementMethod.getInstance()); String licenseHTML = getString(hku.fyp14017.blencode.R.string.about_link_template, "https://github.com/fyp14017/BLEnCode/blob/master/Acknowledgements.txt", "Pocket Code Acknowledgements"); license.setText(Html.fromHtml(licenseHTML)); TextView aboutUrlTextView = (TextView) view .findViewById(hku.fyp14017.blencode.R.id.dialog_about_text_view_url); aboutUrlTextView.setMovementMethod(LinkMovementMethod.getInstance()); String aboutUrl = getString(hku.fyp14017.blencode.R.string.about_link_template, Constants.ABOUT_POCKETCODE_LICENSE_URL, getString(hku.fyp14017.blencode.R.string.dialog_about_pocketcode_license_link_text)); aboutUrlTextView.setText(Html.fromHtml(aboutUrl)); TextView aboutUrlCatrobatView = (TextView) view .findViewById(hku.fyp14017.blencode.R.id.dialog_about_text_catrobat_url); aboutUrlCatrobatView.setMovementMethod(LinkMovementMethod.getInstance()); String aboutCatrobatUrl = getString(hku.fyp14017.blencode.R.string.about_link_template, Constants.CATROBAT_ABOUT_URL, getString(hku.fyp14017.blencode.R.string.dialog_about_catrobat_link_text)); aboutUrlCatrobatView.setText(Html.fromHtml(aboutCatrobatUrl)); TextView aboutVersionNameTextView = (TextView) view .findViewById(hku.fyp14017.blencode.R.id.dialog_about_text_view_version_name); String versionName = this.getString(hku.fyp14017.blencode.R.string.android_version_prefix) + Utils.getVersionName(getActivity()); aboutVersionNameTextView.setText(versionName); Dialog aboutDialog = new AlertDialog.Builder(getActivity()).setView(view).setTitle("About BLEnCode") .setNeutralButton(hku.fyp14017.blencode.R.string.ok, new DialogInterface.OnClickListener() { @Override/*w w w. j av a 2 s . c o m*/ public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }).create(); aboutDialog.setCanceledOnTouchOutside(true); return aboutDialog; }
From source file:com.near.chimerarevo.fragments.DeveloperAboutFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.dev_about_layout, container, false); ((BaseActivity) getActivity()).getToolbar().setTitle(getResources().getString(R.string.action_about)); ((TextView) v.findViewById(R.id.dev_website)).setText(Html.fromHtml(Constants.DEV_WEBSITE)); ((TextView) v.findViewById(R.id.dev_website)).setLinksClickable(true); ((TextView) v.findViewById(R.id.dev_website)).setMovementMethod(LinkMovementMethod.getInstance()); ((TextView) v.findViewById(R.id.dev_copy)).setText(Html.fromHtml(Constants.DEV_COPY)); ((TextView) v.findViewById(R.id.dev_copy)).setLinksClickable(true); ((TextView) v.findViewById(R.id.dev_copy)).setMovementMethod(LinkMovementMethod.getInstance()); v.findViewById(R.id.dev_img).setOnClickListener(new OnClickListener() { @Override/*from w w w . j ava 2 s . c om*/ public void onClick(View v) { easter_egg++; if (easter_egg == 5) { easter_egg = 0; ActivityOptionsCompat opts = ActivityOptionsCompat.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); Intent i = new Intent(getActivity(), EasterEggActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getActivity().startActivity(i, opts.toBundle()); } } }); v.findViewById(R.id.gplus).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(Constants.DEV_GP)); startActivity(i); } }); v.findViewById(R.id.facebook).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(Constants.DEV_FB)); startActivity(i); } }); v.findViewById(R.id.twitter).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(Constants.DEV_TW)); startActivity(i); } }); String version = getResources().getString(R.string.about_version_title) + ": "; try { version += getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName; } catch (NameNotFoundException e) { e.printStackTrace(); version += getResources().getString(R.string.error_notavailable); } ((TextView) v.findViewById(R.id.app_version)).setText(version); return v; }
From source file:com.syncedsynapse.kore2.ui.hosts.AddHostFragmentWelcome.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getView() == null) return;/* w ww . j a v a2 s .c o m*/ TextView message = (TextView) getView().findViewById(R.id.add_host_message); message.setText(Html.fromHtml(getString(R.string.wizard_welcome_message))); message.setMovementMethod(LinkMovementMethod.getInstance()); // Next button Button next = (Button) getView().findViewById(R.id.next); next.setText(R.string.next); next.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { listener.onAddHostWelcomeNext(); } }); // Previous button Button previous = (Button) getView().findViewById(R.id.previous); previous.setText(android.R.string.cancel); previous.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { listener.onAddHostWelcomeCancel(); } }); }
From source file:hku.fyp14017.blencode.ui.dialogs.AcceptTermsOfUseDialogFragment.java
@Override public Dialog onCreateDialog(Bundle bundle) { View view = LayoutInflater.from(getActivity()).inflate(hku.fyp14017.blencode.R.layout.dialog_terms_of_use, null);//from w w w.ja v a 2 s . c o m TextView termsOfUseUrlTextView = (TextView) view .findViewById(hku.fyp14017.blencode.R.id.dialog_terms_of_use_text_view_url); termsOfUseUrlTextView.setMovementMethod(LinkMovementMethod.getInstance()); String termsOfUseUrl = getString(hku.fyp14017.blencode.R.string.terms_of_use_link_template, Constants.CATROBAT_TERMS_OF_USE_URL, getString(hku.fyp14017.blencode.R.string.dialog_terms_of_use_link_text)); termsOfUseUrlTextView.setText(Html.fromHtml(termsOfUseUrl)); Dialog termsOfUseDialog = new AlertDialog.Builder(getActivity()).setView(view) .setTitle(hku.fyp14017.blencode.R.string.dialog_terms_of_use_title) .setNeutralButton(hku.fyp14017.blencode.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }).create(); termsOfUseDialog.setCanceledOnTouchOutside(true); return termsOfUseDialog; }
From source file:org.birthdayadapter.ui.InstallWorkaroundDialogFragment.java
@Override public void onStart() { super.onStart(); // Make the textview clickable. Must be called after show() TextView messageTextView = ((TextView) getDialog().findViewById(android.R.id.message)); if (messageTextView != null) { messageTextView.setMovementMethod(LinkMovementMethod.getInstance()); }//from ww w .j a v a2s. com }
From source file:com.grarak.kerneladiutor.elements.cards.download.KernelCardView.java
public KernelCardView(Context context, @NonNull final Downloads.KernelContent kernelContent) { super(context, R.layout.kernel_cardview); Utils.loadImagefromUrl(kernelContent.getLogo(), logoView); nameView.setText(Html.fromHtml(kernelContent.getName())); nameView.setMovementMethod(LinkMovementMethod.getInstance()); descriptionView.setText(Html.fromHtml(kernelContent.getShortDescription())); descriptionView.setMovementMethod(LinkMovementMethod.getInstance()); setOnClickListener(new OnClickListener() { @Override// w w w . j a va 2 s . c om public void onClick(View view) { Intent i = new Intent(getContext(), KernelActivity.class); Bundle bundle = new Bundle(); bundle.putString(KernelActivity.KERNEL_JSON_ARG, kernelContent.getJSON()); i.putExtras(bundle); ActivityOptionsCompat activityOptions = ActivityOptionsCompat .makeSceneTransitionAnimation((Activity) getContext(), logoView, KernelActivity.LOGO_ARG); ActivityCompat.startActivity((Activity) getContext(), i, activityOptions.toBundle()); } }); }
From source file:com.envision_lightning.livefacilitycount.about.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.license);/*from w ww . ja va2 s . c o m*/ DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int width = dm.widthPixels; int height = dm.heightPixels; getWindow().setLayout((int) (width * .80), (int) (height * .47)); // sets pop up window within certain x & y dimensions aboutInfo = (TextView) findViewById(R.id.aboutInfo); aboutInfo.setText( "Live Facility Counts extracts data from the OPERS website when the app is first opened. In order to update all the values after the app has been opened, pull down the Main Menu and wait a few seconds. All values will then be updated. Please note that the database is cached, so DO NOT clear cache!"); setLicenseTwo = (TextView) findViewById(R.id.setLicenseTwo); setLicenseTwo.setText(" jsoup 1.9.2"); licenseInfoTwo = (TextView) findViewById(R.id.licenseInfoTwo); licenseInfoTwo.setText("Released by Jonathan Hedley under the MIT license."); app_icon = (TextView) findViewById(R.id.app_icon); app_icon.setText(" App Icon"); app_icon_two = (TextView) findViewById(R.id.app_icon_two); app_icon_two.setClickable(true); app_icon_two.setMovementMethod(LinkMovementMethod.getInstance()); String text = "<a href='https://icons8.com/'> icons8.com </a>"; app_icon_two.setText(Html.fromHtml(text)); }
From source file:com.syncedsynapse.kore2.ui.hosts.AddHostFragmentFinish.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getView() == null) return;/*from w w w . jav a2 s .c o m*/ TextView message = (TextView) getView().findViewById(R.id.done_message); message.setText(Html.fromHtml(getString(R.string.wizard_done_message))); message.setMovementMethod(LinkMovementMethod.getInstance()); // Finish button Button next = (Button) getView().findViewById(R.id.next); next.setText(R.string.finish); next.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { listener.onAddHostFinish(); } }); // Previous button Button previous = (Button) getView().findViewById(R.id.previous); previous.setText(null); previous.setEnabled(false); // Start the syncing process Intent syncIntent = new Intent(this.getActivity(), LibrarySyncService.class); syncIntent.putExtra(LibrarySyncService.SYNC_ALL_MOVIES, true); syncIntent.putExtra(LibrarySyncService.SYNC_ALL_TVSHOWS, true); syncIntent.putExtra(LibrarySyncService.SYNC_ALL_MUSIC, true); syncIntent.putExtra(LibrarySyncService.SYNC_ALL_MUSIC_VIDEOS, true); getActivity().startService(syncIntent); // InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); // imm.hideSoftInputFromWindow(getActivity() // .getWindow() // .getDecorView() // .getRootView() // .getWindowToken(), 0); }
From source file:org.mozilla.mozstumbler.client.subactivities.FirstRunFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { getDialog().setTitle(getActivity().getString(R.string.first_run_welcome_to_mozstumbler)); getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(0xaa000000)); getDialog().setCanceledOnTouchOutside(false); root = inflater.inflate(R.layout.fragment_first_run, container, false); TextView tv = (TextView) root.findViewById(R.id.textview2); tv.setMovementMethod(LinkMovementMethod.getInstance()); Button button = (Button) root.findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override//from w ww . ja v a 2 s . co m public void onClick(View v) { FragmentActivity thisActivity = getActivity(); if (thisActivity == null) { return; } MainApp theApp = (MainApp) thisActivity.getApplication(); if (theApp == null) { return; } theApp.startScanning(); ClientPrefs.getInstance(getActivity()).setFirstRun(false); Dialog d = getDialog(); if (d != null) { dismiss(); } } }); return root; }