Skip to content

Commit

Permalink
SuperTextView对分割线设置添加设置线宽和线的颜色值的方法,添加上下两个文字间距高度;新增CommonTextView类,是Su…
Browse files Browse the repository at this point in the history
…perTextView的简化版,回归textview初心
  • Loading branch information
lygttpod committed Nov 22, 2016
1 parent 426604d commit fef98a7
Show file tree
Hide file tree
Showing 12 changed files with 1,040 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</activity>
<activity android:name=".TypeActivity"/>
<activity android:name=".ListActivity"/>
<activity android:name=".CommonTextViewActivity"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.allen.supertextview;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
* Created by allen on 2016/11/22.
*/

public class CommonTextViewActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.common_textview_layout);
}
}
3 changes: 2 additions & 1 deletion app/src/main/java/com/allen/supertextview/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public void onClick(View v) {
startActivity(intent);
break;
case R.id.button6:
intent.setClass(this, ListActivity.class);
// intent.setClass(this, ListActivity.class);
intent.setClass(this, CommonTextViewActivity.class);
intent.putExtra("type", 6);
startActivity(intent);
break;
Expand Down
61 changes: 61 additions & 0 deletions app/src/main/res/layout/common_textview_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ctv="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="50dp"
ctv:cLeftTextColor="@color/colorAccent"
ctv:cLeftTextSize="15dp"
ctv:cLeftTextString="帐号管理"
ctv:cRightIconResForDrawableRight="@drawable/arrow_right_red"
ctv:cShowDividerLineType="none" />

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="50dp"
ctv:cLeftTextString="清除缓存"
ctv:cRightIconResForDrawableRight="@drawable/arrow_right_red"
ctv:cRightTextColor="@color/colorAccent"
ctv:cRightTextString="20.5M"
ctv:cShowDividerLineType="both"
ctv:cUseRipple="true" />

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="50dp"
ctv:cLeftIconResForDrawableLeft="@drawable/uu"
ctv:cLeftTextColor="@color/colorAccent"
ctv:cLeftTextSize="15dp"
ctv:cLeftTextString="收获地址" />

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="50dp"
ctv:cCenterTextString="中间文字"
ctv:cLeftTextString="左边文字"
ctv:cRightTextString="右边文字" />

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="50dp"
ctv:cLeftIconResForDrawableLeft="@drawable/scatter_time"
ctv:cLeftTextString="起息时间"
ctv:cRightTextString="T+1日" />

<com.allen.library.CommonTextView
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="50dp"
ctv:cCenterIconResForDrawableTop="@drawable/scatter_use"
ctv:cCenterTextString="还款方式"
ctv:cLeftIconResForDrawableTop="@drawable/scatter_time"
ctv:cLeftTextString="起息时间"
ctv:cRightIconResForDrawableTop="@drawable/scatter_type"
ctv:cRightTextString="截至日期" />


</LinearLayout>
16 changes: 0 additions & 16 deletions app/src/main/res/layout/text.xml

This file was deleted.

4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 24
versionCode 104
versionName "1.0.4"
versionCode 105
versionName "1.0.5"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Loading

0 comments on commit fef98a7

Please sign in to comment.