List of usage examples for android.text.method LinkMovementMethod getInstance
public static MovementMethod getInstance()
From source file:org.dkf.jmule.fragments.AboutFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_about, container, false); final TextView title = (TextView) view.findViewById(R.id.fragment_about_title); title.setText("Mule on Android " + " v" + Constants.JED2K_VERSION_STRING); final TextView buildNumber = (TextView) view.findViewById(R.id.fragment_about_build_number); buildNumber.setText(/*from www.j a v a 2s. c om*/ "\nBuild " + BuildConfig.VERSION_CODE + " - SDK level " + Build.VERSION.SDK_INT + " sources on: "); final TextView content = (TextView) view.findViewById(R.id.fragment_about_content); content.setText(Html.fromHtml(getAboutText())); content.setMovementMethod(LinkMovementMethod.getInstance()); final ImageButton githubButton = (ImageButton) view.findViewById(R.id.fragment_github_button); githubButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { UIUtils.openURL(v.getContext(), "http://github.com/a-pavlov/jed2k"); } }); return view; }
From source file:com.xabber.android.ui.activity.AboutActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default); toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override// w w w. ja v a 2s . co m public void onClick(View v) { NavUtils.navigateUpFromSameTask(AboutActivity.this); } }); findViewById(R.id.about_github).setOnClickListener(this); findViewById(R.id.about_twitter).setOnClickListener(this); findViewById(R.id.about_redsolution).setOnClickListener(this); findViewById(R.id.about_text_xmpp_protocol).setOnClickListener(this); ((TextView) findViewById(R.id.about_text_developers)).setMovementMethod(LinkMovementMethod.getInstance()); ((TextView) findViewById(R.id.about_text_translators)).setMovementMethod(LinkMovementMethod.getInstance()); ((TextView) findViewById(R.id.about_text_license)).setMovementMethod(LinkMovementMethod.getInstance()); CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar); collapsingToolbar.setTitle(getString(R.string.application_title_short)); ((TextView) findViewById(R.id.about_version)).setText(getVersionName()); loadBackdrop(); }
From source file:com.color.kid.kidpaint.dialog.DialogTermsOfUseAndService.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override// ww w .j av a 2 s . co m public Dialog onCreateDialog(Bundle savedInstanceState) { LayoutInflater inflater = getActivity().getLayoutInflater(); AlertDialog.Builder builder = new CustomAlertDialogBuilder(getActivity()); builder.setTitle(R.string.terms_of_use_and_service_title); View view = inflater.inflate(R.layout.dialog_terms_of_use_and_service, null); TextView termsOfUseAndServiceTextView = (TextView) view .findViewById(R.id.terms_of_use_and_service_tview_Text); termsOfUseAndServiceTextView.setText(R.string.terms_of_use_and_service_content); TextView termsOfUseAndServiceUrlTextView = (TextView) view .findViewById(R.id.terms_of_use_and_service_tview_Url); termsOfUseAndServiceUrlTextView.setMovementMethod(LinkMovementMethod.getInstance()); Resources resources = getActivity().getResources(); String paintroidTermsOfUseAndService = String.format( resources.getString(R.string.terms_of_use_and_service_link_template), resources.getString(R.string.terms_of_use_and_service_url), resources.getString(R.string.terms_of_use_and_service_url_text)); termsOfUseAndServiceUrlTextView.append(Html.fromHtml(paintroidTermsOfUseAndService)); termsOfUseAndServiceUrlTextView.append("\n\n"); String aboutCatroid = String.format( /*resources.getString(R.string.about_link_template), resources.getString(R.string.catroid_url),*/ resources.getString(R.string.about_catroid_url_text)); termsOfUseAndServiceUrlTextView.append(Html.fromHtml(aboutCatroid)); termsOfUseAndServiceUrlTextView.append("\n"); builder.setView(view); builder.setNeutralButton(R.string.done, this); return builder.create(); }
From source file:com.battlelancer.seriesguide.ui.ConnectTraktFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // connect button getView().findViewById(R.id.buttonConnectTrakt).setOnClickListener(new OnClickListener() { @Override/*from w w w. j ava2 s . co m*/ public void onClick(View v) { ConnectTraktCredentialsFragment f = ConnectTraktCredentialsFragment.newInstance(); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.content_frame, f); ft.commit(); } }); // discard button getView().findViewById(R.id.buttonDiscard).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { getActivity().finish(); } }); // make learn more link clickable ((TextView) getView().findViewById(R.id.textViewAbout)).setMovementMethod(LinkMovementMethod.getInstance()); }
From source file:color.kidpaint.com.kidpaintcolor.dialog.DialogTermsOfUseAndService.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override// ww w. j a v a2s . c o m public Dialog onCreateDialog(Bundle savedInstanceState) { LayoutInflater inflater = getActivity().getLayoutInflater(); AlertDialog.Builder builder = new CustomAlertDialogBuilder(getActivity()); builder.setTitle(R.string.terms_of_use_and_service_title); View view = inflater.inflate(R.layout.dialog_terms_of_use_and_service, null); TextView termsOfUseAndServiceTextView = (TextView) view .findViewById(R.id.terms_of_use_and_service_tview_Text); termsOfUseAndServiceTextView.setText(R.string.terms_of_use_and_service_content); TextView termsOfUseAndServiceUrlTextView = (TextView) view .findViewById(R.id.terms_of_use_and_service_tview_Url); termsOfUseAndServiceUrlTextView.setMovementMethod(LinkMovementMethod.getInstance()); Resources resources = getActivity().getResources(); String paintroidTermsOfUseAndService = String.format( resources.getString(R.string.terms_of_use_and_service_link_template), resources.getString(R.string.terms_of_use_and_service_url), resources.getString(R.string.terms_of_use_and_service_url_text)); termsOfUseAndServiceUrlTextView.append(Html.fromHtml(paintroidTermsOfUseAndService)); termsOfUseAndServiceUrlTextView.append("\n\n"); String aboutCatroid = String.format(resources.getString(R.string.about_link_template), resources.getString(R.string.catroid_url), resources.getString(R.string.about_catroid_url_text)); termsOfUseAndServiceUrlTextView.append(Html.fromHtml(aboutCatroid)); termsOfUseAndServiceUrlTextView.append("\n"); builder.setView(view); builder.setNeutralButton(R.string.done, this); return builder.create(); }
From source file:com.forrestguice.suntimeswidget.AboutDialog.java
public void initViews(Context context, View dialogContent) { TextView versionView = (TextView) dialogContent.findViewById(R.id.txt_about_version); versionView.setMovementMethod(LinkMovementMethod.getInstance()); versionView.setText(Html.fromHtml(htmlVersionString())); TextView urlView = (TextView) dialogContent.findViewById(R.id.txt_about_url); urlView.setMovementMethod(LinkMovementMethod.getInstance()); urlView.setText(Html.fromHtml(context.getString(R.string.app_url))); TextView supportView = (TextView) dialogContent.findViewById(R.id.txt_about_support); supportView.setMovementMethod(LinkMovementMethod.getInstance()); supportView.setText(Html.fromHtml(context.getString(R.string.app_support_url))); TextView legalView1 = (TextView) dialogContent.findViewById(R.id.txt_about_legal1); legalView1.setMovementMethod(LinkMovementMethod.getInstance()); legalView1.setText(Html.fromHtml(context.getString(R.string.app_legal1))); TextView legalView2 = (TextView) dialogContent.findViewById(R.id.txt_about_legal2); legalView2.setMovementMethod(LinkMovementMethod.getInstance()); legalView2.setText(Html.fromHtml(context.getString(R.string.app_legal2))); TextView legalView3 = (TextView) dialogContent.findViewById(R.id.txt_about_legal3); legalView3.setMovementMethod(LinkMovementMethod.getInstance()); legalView3.setText(Html.fromHtml(context.getString(R.string.app_legal3))); }
From source file:de.grobox.liberario.fragments.AboutFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_about, container, false); Activity activity = getActivity();/*from www. ja v a 2s . co m*/ String versionName; try { versionName = activity.getPackageManager().getPackageInfo(activity.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { versionName = "?.?"; } // add app name and version TextView aboutApp = (TextView) view.findViewById(R.id.aboutApp); aboutApp.setText(getResources().getString(R.string.app_name) + " " + versionName); // create real paragraphs TextView t = (TextView) view.findViewById(R.id.aboutTextView); t.setText(Html.fromHtml(getString(R.string.about) + String.format(getString(R.string.about_bottom), getString(R.string.website), getString(R.string.bugtracker), getString(R.string.website) + "#donate"))); // make links in about text clickable t.setMovementMethod(LinkMovementMethod.getInstance()); t.setLinkTextColor(ContextCompat.getColor(activity, R.color.accent)); Button website = (Button) view.findViewById(R.id.websiteButton); website.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent launchBrowser = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.website))); startActivity(launchBrowser); } }); return view; }
From source file:com.farmerbb.notepad.fragment.dialog.AboutDialogFragment.java
@NonNull @Override//from w w w . j a v a 2 s . co m public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the Builder class for convenient dialog construction AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); // Get the layout inflater final LayoutInflater inflater = getActivity().getLayoutInflater(); // Inflate and set the layout for the dialog // Pass null as the parent view because its going in the dialog layout final View view = inflater.inflate(R.layout.fragment_dialogs, null); builder.setView(view).setTitle(R.string.dialog_about_title).setPositiveButton(R.string.action_close, null); SignatureUtils.ReleaseType releaseType = SignatureUtils.getReleaseType(getActivity()); if (!releaseType.equals(SignatureUtils.ReleaseType.UNKNOWN)) { builder.setNegativeButton(R.string.check_for_updates, (dialogInterface, i) -> checkForUpdates(releaseType)); } textView = view.findViewById(R.id.dialogMessage); textView.setText(R.string.dialog_about_message); textView.setMovementMethod(LinkMovementMethod.getInstance()); // Create the AlertDialog object and return it return builder.create(); }
From source file:damo.three.ie.fragment.AboutFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_about, container, false); String content = ""; try {/*from www.ja va 2 s. co m*/ content = FileUtils.readFile(getActivity(), R.raw.about); } catch (IOException e) { /* something went wrong reading the raw file */ e.printStackTrace(); } TextView versionText = (TextView) view.findViewById(R.id.about_version); versionText.setText(getString(R.string.about_version) + " " + getVersion()); TextView aboutTextView = (TextView) view.findViewById(R.id.about_text); aboutTextView.setMovementMethod(LinkMovementMethod.getInstance()); aboutTextView.setText(Html.fromHtml(content, null, new CustomTagHandler())); return view; }
From source file:co.dilaver.quoter.fragments.CreditsFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_credits, container, false); TextView androidLink = (TextView) view.findViewById(R.id.tvAndroidLink); TextView androidSupportLibraryLink = (TextView) view.findViewById(R.id.tvAndroidSupportLibraryLink); TextView asyncHTTPLink = (TextView) view.findViewById(R.id.tvAsyncHTTPLink); TextView gsonLink = (TextView) view.findViewById(R.id.tvGsonLink); TextView autoTextViewLink = (TextView) view.findViewById(R.id.tvAutoTextViewLink); TextView lobsterpickerLink = (TextView) view.findViewById(R.id.tvLobsterpickerLink); TextView fButtonLink = (TextView) view.findViewById(R.id.tvFButtonLink); TextView jSoupLink = (TextView) view.findViewById(R.id.tvJSoupLink); TextView circleImageViewLink = (TextView) view.findViewById(R.id.tvCircleImageViewLink); TextView googleCredit = (TextView) view.findViewById(R.id.tvGoogleCredit); TextView freepikCredit = (TextView) view.findViewById(R.id.tvFreepikCredit); TextView qodCredit = (TextView) view.findViewById(R.id.tvQodCredit); TextView popularCredit = (TextView) view.findViewById(R.id.tvPopularCredit); TextView fontsCredit = (TextView) view.findViewById(R.id.tvFontsCredit); TextView backgroundCredit = (TextView) view.findViewById(R.id.tvBackgroundCredit); androidLink.setMovementMethod(LinkMovementMethod.getInstance()); androidSupportLibraryLink.setMovementMethod(LinkMovementMethod.getInstance()); asyncHTTPLink.setMovementMethod(LinkMovementMethod.getInstance()); gsonLink.setMovementMethod(LinkMovementMethod.getInstance()); autoTextViewLink.setMovementMethod(LinkMovementMethod.getInstance()); lobsterpickerLink.setMovementMethod(LinkMovementMethod.getInstance()); fButtonLink.setMovementMethod(LinkMovementMethod.getInstance()); jSoupLink.setMovementMethod(LinkMovementMethod.getInstance()); circleImageViewLink.setMovementMethod(LinkMovementMethod.getInstance()); googleCredit.setText(Html.fromHtml(getString(R.string.str_googleCredit))); googleCredit.setMovementMethod(LinkMovementMethod.getInstance()); freepikCredit.setText(Html.fromHtml(getString(R.string.str_freepikCredit))); freepikCredit.setMovementMethod(LinkMovementMethod.getInstance()); qodCredit.setMovementMethod(LinkMovementMethod.getInstance()); popularCredit.setMovementMethod(LinkMovementMethod.getInstance()); fontsCredit.setMovementMethod(LinkMovementMethod.getInstance()); backgroundCredit.setMovementMethod(LinkMovementMethod.getInstance()); return view;/* w ww.j av a2 s. c o m*/ }