List of utility methods to do TextView Set
void | setText(TextView tv, String str) set Text if (tv == null) { return; tv.setText(checkStr(str)); |
void | setText(TextView tv, int str) set Text if (tv == null) { return; tv.setText(str + ""); |
void | setHtml(TextView view, String html) set Html view.setVisibility(View.GONE);
if (html != null && html.length() != 0) {
view.setText(Html.fromHtml(html));
view.setVisibility(View.VISIBLE);
|
void | setHtml(Activity activity, View parent, int elementId, int resId) set Html TextView view = (TextView) parent.findViewById(elementId); view.setText(Html.fromHtml(activity.getString(resId))); |
void | initDate(TextView view, int days) init Date Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_MONTH, days); int mYear = c.get(Calendar.YEAR); int mMonth = c.get(Calendar.MONTH); int mDay = c.get(Calendar.DAY_OF_MONTH); String dateStr = new StringBuilder().append(mYear).append("-") .append(format(mMonth + 1)).append("-") .append(format(mDay)).toString(); ... |
void | setBold(TextView tv) set Bold TextPaint tp = tv.getPaint(); tp.setFakeBoldText(true); |
void | manageVisibiltyFieldSpeech(Context context, ImageButton button, AutoCompleteTextView text, int idRightof, int idLeftOf, int idBelow) manage Visibilty Field Speech PackageManager pm = context.getPackageManager(); List<ResolveInfo> activities = pm.queryIntentActivities(new Intent( RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); if (activities.size() == 0) { button.setVisibility(View.GONE); if ((text != null) && (Integer.valueOf(Build.VERSION.SDK) <= 3)) { RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); ... |
void | setupMarquee(TextView textView, String text) setup Marquee textView.setText(text); textView.setEllipsize(TextUtils.TruncateAt.MARQUEE); textView.setSingleLine(); textView.setSelected(true); |