1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
public static SpannableString setAuctionPriceStyle(String price, int rmbSymbolSize, int fenSize) { SpannableString spanText = new SpannableString("¥" + price); spanText.setSpan(new AbsoluteSizeSpan(rmbSymbolSize, true), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); int indexLength = spanText.toString().indexOf("."); if (indexLength > 0) { spanText.setSpan(new AbsoluteSizeSpan(fenSize, true), indexLength, spanText.toString().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } return spanText; }
|