This repository was archived by the owner on Nov 4, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +32
-17
lines changed
sample/src/main/java/com/zeoflow/stylar/sample
java/com/zeoflow/stylar/view Expand file tree Collapse file tree 5 files changed +32
-17
lines changed Original file line number Diff line number Diff line change 4141 buildToolsVersion = ' 30.0.1'
4242 minSdkVersion = 21
4343 targetSdkVersion = 30
44- versionCode = 2
45- versionName = " 1.0.1 "
44+ versionCode = 3
45+ versionName = " 1.1.0 "
4646 ndk = " 21.3.6528147"
47-
48- ANNOTATIONS = ' org.jetbrains:annotations-java5:17.0.0'
49-
50- IX_JAVA = ' com.github.akarnokd:ixjava:1.0.0'
51- COMMONS_IO = ' commons-io:commons-io:2.6'
52- GOOGLE_JAVA_FORMAT = ' com.google.googlejavaformat:google-java-format:1.6'
53- GSON = ' com.google.code.gson:gson:2.8.5'
54- JSON_UNIT = ' net.javacrumbs.json-unit:json-unit:2.0.0.RC1'
55-
56- JUNIT = ' junit:junit:4.12'
5747}
Original file line number Diff line number Diff line change 22
33import android .graphics .Color ;
44import android .os .Bundle ;
5+ import android .view .Gravity ;
56import android .widget .Toast ;
67
78import androidx .annotation .NonNull ;
1314import com .zeoflow .stylar .core .StylarTheme ;
1415import com .zeoflow .stylar .view .StylarView ;
1516
17+ import static com .zeoflow .stylar .view .StylarView .ALIGNMENT_LEFT ;
1618import static com .zeoflow .utils .FileUtil .readFile ;
1719
1820public class MainActivity extends ActivityCore
@@ -48,9 +50,11 @@ public void configureTheme(@NonNull StylarTheme.Builder builder)
4850 .build ();
4951 stylar .setMarkdown (accClosed );
5052
51- stylar . setMarkdown ( readFile ( getAssets (), "content.txt" , " \n \n " ) );
53+ // stylarView.setTextAlignment(ALIGNMENT_LEFT );
5254
53- logger (stylarView .getText ());
55+ // stylar.setMarkdown(readFile(getAssets(), "content.txt", "\n\n"));
56+
57+ // logger(stylarView.getText());
5458
5559 }
5660
Original file line number Diff line number Diff line change 11POM_NAME =Stylar
22POM_ARTIFACT_ID =stylar
33POM_PACKAGING =aar
4- VERSION_NAME =1.0.1
5- VERSION_CODE =2
4+
5+ VERSION_NAME =1.1.0
6+ VERSION_CODE =3
67GROUP =com.zeoflow
8+
79POM_DESCRIPTION =An Android markdown library - it does not require WebView
810POM_URL =https://github.com/zeoflow/stylar
911POM_SCM_URL =https://github.com/zeoflow/stylar
@@ -14,7 +16,9 @@ POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
1416POM_LICENCE_DIST =repo
1517POM_DEVELOPER_ID =zeoflow
1618POM_DEVELOPER_NAME =ZeoFlow
19+
1720org.gradle.daemon =true
21+
1822NEXUS_USERNAME =
1923NEXUS_PASSWORD =
2024signing.keyId =
Original file line number Diff line number Diff line change 22
33import android .content .Context ;
44import android .util .AttributeSet ;
5+ import android .view .Gravity ;
56import android .view .LayoutInflater ;
7+ import android .view .View ;
68import android .widget .FrameLayout ;
79import android .widget .ScrollView ;
810import android .widget .TextView ;
@@ -69,6 +71,21 @@ public String getText()
6971 return String .valueOf (this .mtvTextView .getText ());
7072 }
7173
74+ public static String ALIGNMENT_LEFT = "left" ;
75+ public static String ALIGNMENT_CENTER = "center" ;
76+ public static String ALIGNMENT_RIGHT = "right" ;
77+
78+ public void setTextAlignment (String alignment )
79+ {
80+ if (alignment .equals (ALIGNMENT_LEFT )) {
81+ mtvTextView .setGravity (Gravity .START );
82+ } else if (alignment .equals (ALIGNMENT_CENTER )) {
83+ mtvTextView .setGravity (Gravity .CENTER );
84+ } else if (alignment .equals (ALIGNMENT_RIGHT )) {
85+ mtvTextView .setGravity (Gravity .END );
86+ }
87+ }
88+
7289 public TextView getMtvTextView ()
7390 {
7491 return this .mtvTextView ;
Original file line number Diff line number Diff line change 1717 android : background =" #ffffff"
1818 android : fontFamily =" @font/zeoflow_normal"
1919 android : padding =" 5dp"
20- android : textAlignment =" center" />
20+ android : gravity =" center" />
2121 </LinearLayout >
2222</ScrollView >
You can’t perform that action at this time.
0 commit comments