v.setLetterSpacing(appearance.getFloat(attr, 0));
v.setLetterSpacing(appearance.getFloat(attr, 0)); v.setLetterSpacing(a.getFloat(attr, 0));
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private void applyLetterSpacing() { String letterSpacing = binding.letterSpacingEditText.getText().toString(); try { float letterEms = Float.parseFloat(letterSpacing); binding.fillerTextView.setLetterSpacing(letterEms); binding.letterSpacingTextInputLayout.setErrorEnabled(false); } catch (NumberFormatException e) { Log.e(TAG, "Unable to format letter spacing"); binding.letterSpacingTextInputLayout.setErrorEnabled(true); binding.letterSpacingTextInputLayout.setError(getString(R.string.nah)); } }
TextView headerTv = new TextView(context); LinearLayout.LayoutParams textViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); headerTv.setLetterSpacing(0.04f); headerTv.setText(model.getHeaderText()); headerTv.setTextColor(Color.parseColor("#646262")); textView.setLayoutParams(textViewParams); textView.setGravity(Gravity.CENTER); textView.setLetterSpacing(0.05f); textView.setPadding(DimensionsUtils.dp(9), DimensionsUtils.dp(7), DimensionsUtils.dp(9), DimensionsUtils.dp(7)); textView.setTextSize(Dimension.SP, 12);
String ss = value.toString(); if (ss.equals("normal")) { textView.setLetterSpacing(textView.getLetterSpacing()); } else { try { PixelValue f = toPixel(value); textView.setLetterSpacing(f.getEmValue()); } catch (ParametersUtils.ParametersParseException e) { e.printStackTrace();
textView.setLetterSpacing((float) attributes.getDouble("letterSpacing"));