Skip to content

Commit

Permalink
commontetview新增left-top,left-bottom,center-top,center-bottom,right-to…
Browse files Browse the repository at this point in the history
…p,right-bottom文本显示控件
  • Loading branch information
lygttpod committed Nov 29, 2016
1 parent 02e6fbe commit 2127f83
Show file tree
Hide file tree
Showing 6 changed files with 668 additions and 115 deletions.
204 changes: 103 additions & 101 deletions app/src/main/res/layout/common_textview_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,122 +5,124 @@
android:layout_height="match_parent"
android:orientation="vertical">

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<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:cCenterTextString="中间文字"
ctv:cLeftTextString="左边文字"
ctv:cRightTextString="右边文字" />
<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="60dp"
ctv:cShowDividerLineType="bottom"
ctv:cCenterTextString="年龄\n250"
ctv:cLeftTextViewLineSpacingExtra="8dp"
ctv:cCenterTextViewLineSpacingExtra="8dp"
ctv:cRightTextViewLineSpacingExtra="8dp"
ctv:cSetSingleLine="false"
ctv:cLeftTextString="姓名\n欧阳峰鸟"
ctv:cRightTextString="学籍\n北京科技大学" />

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="60dp"
ctv:cShowDividerLineType="bottom"
ctv:cLeftIconResForDrawableLeft="@drawable/head_default"
ctv:cLeftTextViewLineSpacingExtra="8dp"
ctv:cCenterTextViewLineSpacingExtra="8dp"
ctv:cRightTextViewLineSpacingExtra="8dp"
ctv:cSetSingleLine="false"
ctv:cLeftTextString="姓名\n欧阳峰"
ctv:cLeftTextViewGravity="left_center"
ctv:cRightTextString="已实名"
ctv:cRightTextColor="@color/colorAccent"
ctv:cRightIconResForDrawableRight="@drawable/arrow_right_red"/>


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

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

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_height="match_parent"
android:orientation="vertical">

<com.allen.library.CommonTextView
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1"
ctv:cCenterIconResForDrawableTop="@mipmap/ic_launcher"
ctv:cCenterTextString="文字"
android:layout_width="match_parent"
android:layout_height="60dp"
ctv:cLeftBottomTextColor="@color/colorAccent"
ctv:cLeftBottomTextSize="13sp"
ctv:cLeftBottomTextString="188******88"
ctv:cLeftImageViewDrawableRes="@drawable/head_default"
ctv:cLeftTopTextColor="@color/colorPrimary"
ctv:cLeftTopTextSize="15sp"
ctv:cLeftTopTextString="张三"
ctv:cRightIconResForDrawableRight="@drawable/arrow_right_red"
ctv:cRightTextColor="@color/colorAccent"
ctv:cRightTextString="已实名"
ctv:cUseRipple="true" />


<com.allen.library.CommonTextView
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1"
ctv:cCenterIconResForDrawableTop="@mipmap/ic_launcher"
ctv:cCenterTextString="文字"
ctv:cUseRipple="true" />
android:layout_width="match_parent"
android:layout_height="60dp"
ctv:cCenterTextString="年龄\n250"
ctv:cCenterTextViewLineSpacingExtra="8dp"
ctv:cLeftTextString="姓名\n欧阳峰鸟"
ctv:cLeftTextViewLineSpacingExtra="8dp"
ctv:cRightTextString="学籍\n北京科技大学"
ctv:cRightTextViewLineSpacingExtra="8dp"
ctv:cSetSingleLine="false"
ctv:cShowDividerLineType="bottom" />

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="60dp"
ctv:cCenterTextViewLineSpacingExtra="8dp"
ctv:cLeftIconResForDrawableLeft="@drawable/head_default"
ctv:cLeftTextString="姓名\n欧阳峰"
ctv:cLeftTextViewGravity="left_center"
ctv:cLeftTextViewLineSpacingExtra="8dp"
ctv:cRightIconResForDrawableRight="@drawable/arrow_right_red"
ctv:cRightTextColor="@color/colorAccent"
ctv:cRightTextString="已实名"
ctv:cRightTextViewLineSpacingExtra="8dp"
ctv:cSetSingleLine="false"
ctv:cShowDividerLineType="bottom" />


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

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

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<com.allen.library.CommonTextView
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1"
ctv:cCenterIconResForDrawableTop="@mipmap/ic_launcher"
ctv:cCenterTextString="文字"
ctv:cUseRipple="true" />

<com.allen.library.CommonTextView
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1"
ctv:cCenterIconResForDrawableTop="@mipmap/ic_launcher"
ctv:cCenterTextString="文字"
ctv:cUseRipple="true" />

<com.allen.library.CommonTextView
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1"
ctv:cCenterIconResForDrawableTop="@mipmap/ic_launcher"
ctv:cCenterTextString="文字"
ctv:cUseRipple="true" />
</LinearLayout>

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_weight="1"
ctv:cCenterIconResForDrawableTop="@mipmap/ic_launcher"
ctv:cCenterTextString="文字"
ctv:cCenterTextString="张三\n188******88"
ctv:cCenterTextViewGravity="center"
ctv:cLeftIconResForDrawableLeft="@mipmap/ic_launcher"
ctv:cLeftTextString="张三\n188******88"
ctv:cLeftTextViewGravity="left_center"
ctv:cRightIconResForDrawableRight="@mipmap/ic_launcher"
ctv:cRightTextString="张三\n188******88"
ctv:cRightTextViewGravity="right_center"
ctv:cSetSingleLine="false"
ctv:cShowDividerLineType="both"
ctv:cUseRipple="true" />
</LinearLayout>

<com.allen.library.CommonTextView
android:layout_width="match_parent"
android:layout_height="80dp"
ctv:cShowDividerLineType="both"
ctv:cLeftIconResForDrawableLeft="@mipmap/ic_launcher"
ctv:cRightIconResForDrawableRight="@mipmap/ic_launcher"
ctv:cCenterTextString="张三\n188******88"
ctv:cLeftTextString="张三\n188******88"
ctv:cLeftTextViewGravity="left_center"
ctv:cRightTextString="张三\n188******88"
ctv:cCenterTextViewGravity="center"
ctv:cRightTextViewGravity="right_center"
ctv:cSetSingleLine="false"
ctv:cUseRipple="true" />

</LinearLayout>
</ScrollView>
</LinearLayout>
</ScrollView>


</LinearLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/layout3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
stv:sBottomLineMargin="0dp"
stv:sLeftIconRes="@drawable/scatter_time"
stv:sIsSingLines="true"
stv:sLeftTextString="起息时间起息时间起息时间起息时间起息时间起息时间"
stv:sRightTextString="立即起息立即起息立即起息立即起息立即起息立即起息" />
stv:sLeftTextString="起息时间"
stv:sRightTextString="立即起息" />

<com.allen.library.SuperTextView
android:layout_width="match_parent"
android:layout_height="50dp"
stv:sBottomLineMargin="0dp"
stv:sLeftIconRes="@drawable/scatter_type"
stv:sLeftTextString="还款方式"
stv:sRightTextString="等额本息ADADADASDAADA1231414214141414141" />
stv:sRightTextString="等额本息" />

<com.allen.library.SuperTextView
android:layout_width="match_parent"
Expand Down
83 changes: 77 additions & 6 deletions app/src/main/res/layout/list.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@color/colorAccent"
android:orientation="vertical">

<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<View
android:id="@+id/centerLine"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_centerInParent="true" />
<RelativeLayout
android:layout_above="@+id/centerLine"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
android:layout_height="wrap_content">
<TextView
android:id="@+id/left"
android:textSize="20sp"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name" />

<TextView
android:textSize="15sp"
android:gravity="center"
android:layout_alignBaseline="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/app_name" />

<TextView
android:textSize="10sp"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp" />
</RelativeLayout>
<!--<TextView-->
<!--android:id="@+id/left"-->
<!--android:textSize="20sp"-->
<!--android:gravity="center"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_above="@+id/centerLine"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:text="@string/app_name" />-->

<!--<TextView-->
<!--android:textSize="10sp"-->
<!--android:gravity="center"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_above="@+id/centerLine"-->
<!--android:layout_alignParentRight="true"-->
<!--android:text="@string/app_name" />-->

<!--<TextView-->
<!--android:textSize="15sp"-->
<!--android:gravity="center"-->
<!--android:layout_alignBaseline="@+id/left"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_above="@+id/centerLine"-->
<!--android:layout_centerInParent="true"-->
<!--android:text="@string/app_name" />-->


</RelativeLayout>
Loading

0 comments on commit 2127f83

Please sign in to comment.