Skip to content

Commit 6e5741a

Browse files
两端对齐的TextView
1 parent f58c997 commit 6e5741a

28 files changed

Lines changed: 700 additions & 2 deletions

.classpath

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="gen">
4+
<attributes>
5+
<attribute name="maven.pomderived" value="true"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="con" path="me.gladwell.eclipse.m2e.android.classpath.NONRUNTIME_DEPENDENCIES">
9+
<attributes>
10+
<attribute name="maven.pomderived" value="true"/>
11+
</attributes>
12+
</classpathentry>
13+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
14+
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
15+
<classpathentry kind="src" output="bin/classes" path="src/main/java">
16+
<attributes>
17+
<attribute name="optional" value="true"/>
18+
<attribute name="maven.pomderived" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
22+
<attributes>
23+
<attribute name="maven.pomderived" value="true"/>
24+
</attributes>
25+
</classpathentry>
26+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES">
27+
<attributes>
28+
<attribute name="maven.pomderived" value="true"/>
29+
</attributes>
30+
</classpathentry>
31+
<classpathentry kind="output" path="bin/classes"/>
32+
</classpath>

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Built application files
2-
*.apk
2+
.apk
33
*.ap_
44

55
# Files for the Dalvik VM
@@ -24,3 +24,4 @@ proguard/
2424

2525
# Log Files
2626
*.log
27+
/target/

.project

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>AlignTextView</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.jdt.core.javabuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
<buildCommand>
34+
<name>org.eclipse.m2e.core.maven2Builder</name>
35+
<arguments>
36+
</arguments>
37+
</buildCommand>
38+
</buildSpec>
39+
<natures>
40+
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
41+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
42+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
43+
<nature>org.eclipse.jdt.core.javanature</nature>
44+
</natures>
45+
</projectDescription>

AndroidManifest.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="cn.androiddevelop.aligntextview"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="14"
9+
android:targetSdkVersion="21" />
10+
11+
<application
12+
android:allowBackup="true"
13+
android:icon="@drawable/ic_launcher"
14+
android:label="@string/app_name"
15+
android:theme="@style/AppTheme" >
16+
<activity android:name=".example.AlignTextViewExample" >
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
<category android:name="android.intent.category.LAUNCHER" />
20+
</intent-filter>
21+
</activity>
22+
</application>
23+
24+
</manifest>

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
1-
# AlginTextView
1+
# AlignTextView
22
字体对齐的textview
3+
4+
![](align-text-align.png)
5+
6+
###系统要求
7+
Android 4.0以上
8+
9+
### 快速使用
10+
<cn.androiddevelop.aligntextview.lib.AlignTextView
11+
android:id="@+id/alignTv"
12+
android:layout_width="match_parent"
13+
android:layout_height="wrap_content"
14+
android:textSize="@dimen/small_font" />
15+
16+
### 相关方法
17+
setAlign(Align align)
18+
设置每一段最后一行对齐方式,默认居左对齐
19+
20+
21+
### 使用说明
22+
AlignTextView在对齐的时候不会对英文单词等进行考虑,使其连在一起。

align-text-view-0.1.0.apk

46.7 KB
Binary file not shown.

align-text-view.png

135 KB
Loading

lint.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<lint>
3+
<issue id="RtlHardcoded">
4+
<ignore path="src/main/java/cn/androiddevelop/aligntextview/lib/Align.java" />
5+
</issue>
6+
</lint>

pom.xml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
<?xml version="1.0" encoding="UTF-8"?>
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>cn.androiddevelop</groupId>
7+
<artifactId>align-text-view</artifactId>
8+
<version>0.1.0</version>
9+
<packaging>apk</packaging>
10+
11+
<properties>
12+
<!-- use UTF-8 for everything -->
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>com.google.android</groupId>
20+
<artifactId>android</artifactId>
21+
<version>5.0.1</version>
22+
<scope>provided</scope>
23+
</dependency>
24+
25+
</dependencies>
26+
27+
<build>
28+
<plugins>
29+
<plugin>
30+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
31+
<artifactId>android-maven-plugin</artifactId>
32+
<version>3.9.0-rc.1</version>
33+
<configuration>
34+
<sdk>
35+
<platform>21</platform>
36+
</sdk>
37+
<deleteConflictingFiles>true</deleteConflictingFiles>
38+
<undeployBeforeDeploy>true</undeployBeforeDeploy>
39+
</configuration>
40+
<extensions>true</extensions>
41+
</plugin>
42+
<plugin>
43+
<artifactId>maven-compiler-plugin</artifactId>
44+
<version>3.1</version>
45+
<configuration>
46+
<source>1.6</source>
47+
<target>1.6</target>
48+
</configuration>
49+
</plugin>
50+
51+
</plugins>
52+
</build>
53+
54+
</project>

proguard-project.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}

0 commit comments

Comments
 (0)