Simplify ruby view code
rubytextview/src/main/java/me/weilunli/views/RubyTextView.java
43 | 43 | ||
44 | 44 | TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.RubyTextView); | |
45 | 45 | try { | |
46 | - | TypedValue tv = new TypedValue(); | |
47 | - | getContext().getTheme().resolveAttribute(android.R.attr.textColorPrimary, tv, true); | |
48 | 46 | combinedText = ta.getString(R.styleable.RubyTextView_combinedText); | |
49 | 47 | rubyTextSize = ta.getDimension(R.styleable.RubyTextView_rubyTextSize, 28f); | |
50 | 48 | rubyTextColor = ta.getColor(R.styleable.RubyTextView_rubyTextColor, rubyTextColor); | |
… | |||
73 | 71 | rubyTextPaint.setTextSize((getRubyTextSize())); | |
74 | 72 | rubyTextPaint.setColor(getRubyTextColor()); | |
75 | 73 | lineheight = getTextSize() + getRubyTextSize() + getLineSpacingExtra() + getSpacing(); | |
76 | - | firstLineheight = lineheight - getLineSpacingExtra(); | |
74 | + | firstLineheight = lineheight - getLineSpacingExtra(); | |
77 | 75 | splitCombinedText(); | |
78 | 76 | setLineHeight((int) lineheight); | |
79 | 77 | } |