22
33import android .graphics .Color ;
44import android .os .Bundle ;
5- import android .view .Gravity ;
65import android .widget .Toast ;
76
87import androidx .annotation .NonNull ;
1413import com .zeoflow .stylar .core .StylarTheme ;
1514import com .zeoflow .stylar .view .StylarView ;
1615
17- import static com .zeoflow .stylar .view .StylarView .ALIGNMENT_LEFT ;
18- import static com .zeoflow .utils .FileUtil .readFile ;
19-
20- public class MainActivity extends Activity
21- {
16+ public class MainActivity extends Activity {
2217
2318 @ Override
24- protected void onCreate (@ Nullable Bundle savedInstanceState )
25- {
19+ protected void onCreate (@ Nullable Bundle savedInstanceState ) {
2620 super .onCreate (savedInstanceState );
2721 setContentView (R .layout .activity_main );
2822
@@ -32,22 +26,20 @@ protected void onCreate(@Nullable Bundle savedInstanceState)
3226 String accClosed = "### Your account has been closed.\n \n It looks like the **`Terms of Service`** may have been violated.\n \n To have our support team look into this, please [**`contact us`**]($contact_us)." ;
3327 StylarView stylarView = findViewById (R .id .zStylarView );
3428 final Stylar stylar = Stylar .builder (zContext )
35- .withLayoutElement (stylarView )
36- .withAnchoredHeadings (true )
37- .withImagePlugins (true )
38- .withCodeStyle (false )
39- .setClickEvent (link -> Toast .makeText (MainActivity .this , link , Toast .LENGTH_SHORT ).show ())
40- .usePlugin (new AbstractStylarPlugin ()
41- {
42- @ Override
43- public void configureTheme (@ NonNull StylarTheme .Builder builder )
44- {
45- builder
46- .codeTextColor (Color .parseColor ("#CE570CC1" ))
47- .codeBackgroundColor (Color .parseColor ("#EDEDED" ));
48- }
49- })
50- .build ();
29+ .withLayoutElement (stylarView )
30+ .withAnchoredHeadings (true )
31+ .withImagePlugins (true )
32+ .withCodeStyle (false )
33+ .setClickEvent (link -> Toast .makeText (MainActivity .this , link , Toast .LENGTH_SHORT ).show ())
34+ .usePlugin (new AbstractStylarPlugin () {
35+ @ Override
36+ public void configureTheme (@ NonNull StylarTheme .Builder builder ) {
37+ builder
38+ .codeTextColor (Color .parseColor ("#CE570CC1" ))
39+ .codeBackgroundColor (Color .parseColor ("#EDEDED" ));
40+ }
41+ })
42+ .build ();
5143 stylar .setMarkdown (accClosed );
5244
5345// stylarView.setTextAlignment(ALIGNMENT_LEFT);
0 commit comments