@@ -61,7 +61,8 @@ public class SpanActivity extends BaseBackActivity {
6161 float density ;
6262 TextView tvAboutSpan ;
6363 TextView tvAboutAnimRainbow ;
64- TextView tvAboutAnimBlur ;
64+ TextView tvAboutSpan1 ;
65+ TextView tvAboutAnimRainbow1 ;
6566
6667 public static void start (Context context ) {
6768 Intent starter = new Intent (context , SpanActivity .class );
@@ -106,18 +107,6 @@ public void updateDrawState(TextPaint ds) {
106107 textSize = tvAboutSpan .getTextSize ();
107108 density = getResources ().getDisplayMetrics ().density ;
108109
109- // tvAboutSpan.setText(new SpanUtils()
110- // .appendLine("测试图标文字顶部对齐测试图标文字顶部对齐测试图标文字顶部对齐测试图标文字顶部对齐").setIconMargin(R.drawable.shape_spannable_block_high, 20, SpanUtils.ALIGN_CENTER).setBackgroundColor(Color.LTGRAY)
111- // .appendLine("测试图标文字居中对齐,后面的字是为了凑到两行的效果").setIconMargin(R.drawable.shape_spannable_block_high, 20, SpanUtils.ALIGN_CENTER).setBackgroundColor(Color.GREEN)
112- // .appendLine("测试图标文字底部对齐,后面的字是为了凑到两行的效果").setIconMargin(R.drawable.shape_spannable_block_high, 20, SpanUtils.ALIGN_BOTTOM).setBackgroundColor(Color.LTGRAY)
113- // .appendLine("测试图标顶部对齐,后面的字是为了凑到两行的效果").setIconMargin(R.drawable.shape_spannable_block_low, 20, SpanUtils.ALIGN_TOP).setBackgroundColor(Color.GREEN)
114- // .appendLine("测试图标居中对齐,后面的字是为了凑到两行的效果").setIconMargin(R.drawable.shape_spannable_block_low, 20, SpanUtils.ALIGN_CENTER).setBackgroundColor(Color.LTGRAY)
115- // .appendLine("测试图标底部对齐,后面的字是为了凑到两行的效果").setIconMargin(R.drawable.shape_spannable_block_low, 20, SpanUtils.ALIGN_BOTTOM).setBackgroundColor(Color.GREEN)
116- // .append("测试大图字体顶部对齐").setBackgroundColor(Color.GREEN)
117- // .appendImage(R.drawable.shape_spannable_block_high, SpanUtils.ALIGN_TOP)
118- // .appendLine()
119- // .create());
120-
121110 initAnimSpan ();
122111 startAnim ();
123112
@@ -131,12 +120,15 @@ public void updateDrawState(TextPaint ds) {
131120 .appendLine ("测试段落缩,首行缩进两字,其他行不缩进" ).setLeadingMargin ((int ) textSize * 2 , 10 ).setBackgroundColor (Color .GREEN )
132121 .appendLine ("测试引用,后面的字是为了凑到两行的效果" ).setQuoteColor (Color .GREEN , 10 , 10 ).setBackgroundColor (Color .LTGRAY )
133122 .appendLine ("测试列表项,后面的字是为了凑到两行的效果" ).setBullet (Color .GREEN , 20 , 10 ).setBackgroundColor (Color .LTGRAY ).setBackgroundColor (Color .GREEN )
123+
134124 .appendLine ("测试图标文字顶部对齐,后面的字是为了凑到两行的效果" ).setIconMargin (R .drawable .shape_spannable_block_high , 20 , SpanUtils .ALIGN_TOP ).setBackgroundColor (Color .LTGRAY )
135125 .appendLine ("测试图标文字居中对齐,后面的字是为了凑到两行的效果" ).setIconMargin (R .drawable .shape_spannable_block_high , 20 , SpanUtils .ALIGN_CENTER ).setBackgroundColor (Color .GREEN )
136126 .appendLine ("测试图标文字底部对齐,后面的字是为了凑到两行的效果" ).setIconMargin (R .drawable .shape_spannable_block_high , 20 , SpanUtils .ALIGN_BOTTOM ).setBackgroundColor (Color .LTGRAY )
127+
137128 .appendLine ("测试图标顶部对齐,后面的字是为了凑到两行的效果" ).setIconMargin (R .drawable .shape_spannable_block_low , 20 , SpanUtils .ALIGN_TOP ).setBackgroundColor (Color .GREEN )
138129 .appendLine ("测试图标居中对齐,后面的字是为了凑到两行的效果" ).setIconMargin (R .drawable .shape_spannable_block_low , 20 , SpanUtils .ALIGN_CENTER ).setBackgroundColor (Color .LTGRAY )
139130 .appendLine ("测试图标底部对齐,后面的字是为了凑到两行的效果" ).setIconMargin (R .drawable .shape_spannable_block_low , 20 , SpanUtils .ALIGN_BOTTOM ).setBackgroundColor (Color .GREEN )
131+
140132 .appendLine ("32dp 字体" ).setFontSize (32 , true )
141133 .appendLine ("2 倍字体" ).setFontProportion (2 )
142134 .appendLine ("横向 2 倍字体" ).setFontXProportion (1.5f )
@@ -165,27 +157,36 @@ public void updateDrawState(TextPaint ds) {
165157 Shader .TileMode .REPEAT ))
166158 .appendLine ("阴影效果" ).setFontSize (64 , true ).setBackgroundColor (Color .BLACK ).setShadow (24 , 8 , 8 , Color .WHITE )
167159
168- .append ("测试小图对齐 " ).setBackgroundColor (Color .LTGRAY )
160+ .append ("小图 " ).setBackgroundColor (Color .GREEN )
169161 .appendImage (R .drawable .shape_spannable_block_low , SpanUtils .ALIGN_TOP )
162+ .append ("顶部" ).setBackgroundColor (Color .GREEN )
170163 .appendImage (R .drawable .shape_spannable_block_low , SpanUtils .ALIGN_CENTER )
164+ .append ("居中" ).setBackgroundColor (Color .GREEN )
171165 .appendImage (R .drawable .shape_spannable_block_low , SpanUtils .ALIGN_BASELINE )
166+ .append ("底部" ).setBackgroundColor (Color .GREEN )
172167 .appendImage (R .drawable .shape_spannable_block_low , SpanUtils .ALIGN_BOTTOM )
173- .appendLine ("end " ).setBackgroundColor (Color .LTGRAY )
168+ .appendLine ("对齐 " ).setBackgroundColor (Color .GREEN )
174169
175- .append ("测试大图字体顶部对齐" ).setBackgroundColor (Color .GREEN )
176170 .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_TOP )
177- .append ("测试大图字体顶部对齐" ).setBackgroundColor (Color .GREEN )
178- .appendLine ()
171+ .append ("大图" ).setBackgroundColor (Color .LTGRAY )
172+ .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_TOP )
173+ .append ("顶部" ).setBackgroundColor (Color .LTGRAY )
174+ .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_TOP )
175+ .appendLine ("对齐" ).setBackgroundColor (Color .LTGRAY )
179176
180- .append ("测试大图字体居中对齐" ).setBackgroundColor (Color .LTGRAY )
181177 .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_CENTER )
182- .append ("测试大图字体居中对齐" ).setBackgroundColor (Color .LTGRAY )
183- .appendLine ()
178+ .append ("大图" ).setBackgroundColor (Color .GREEN )
179+ .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_CENTER )
180+ .append ("居中" ).setBackgroundColor (Color .GREEN )
181+ .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_CENTER )
182+ .appendLine ("对齐" ).setBackgroundColor (Color .GREEN )
184183
185- .append ("测试大图字体底部对齐" ).setBackgroundColor (Color .GREEN )
186184 .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_BOTTOM )
187- .append ("测试大图字体底部对齐" ).setBackgroundColor (Color .GREEN )
188- .appendLine ()
185+ .append ("大图" ).setBackgroundColor (Color .LTGRAY )
186+ .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_BOTTOM )
187+ .append ("底部" ).setBackgroundColor (Color .LTGRAY )
188+ .appendImage (R .drawable .shape_spannable_block_high , SpanUtils .ALIGN_BOTTOM )
189+ .appendLine ("对齐" ).setBackgroundColor (Color .LTGRAY )
189190
190191 .append ("测试空格" ).appendSpace (30 , Color .LTGRAY ).appendSpace (50 , Color .GREEN ).appendSpace (100 ).appendSpace (30 , Color .LTGRAY ).appendSpace (50 , Color .GREEN )
191192 .create ());
0 commit comments