preview.gif
原文地址
https://github.com/Airsaid/TimeLineLayout
布局中:
<com.github.airsaid.timelinelayout.widget.TimeLineLayout
android:id="@+id/timeLineLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:paddingLeft="20dp"
android:paddingRight="16dp"
app:tll_dotColor="@color/colorAccent"
app:tll_dotRadius="4dp"
app:tll_height="40dp"
app:tll_lineColor="#E4E4E4"
app:tll_lineWidth="1px"
app:tll_padding="16dp"
app:tll_textColor="@android:color/black"
app:tll_textSize="14sp"/>
代碼中:
ArrayList<CharSequence> data = new ArrayList<>();
data.add("拍攝時間:2017-9-10至2017-11-20");
data.add("拍攝周期:1");
data.add("拍攝地址:北京");
data.add("出品方:某某傳媒");
data.add("報名截止日期:2017-09-30");
TimeLineLayout timeLineLayout = (TimeLineLayout) findViewById(R.id.timeLineLayout);
timeLineLayout.setData(data);
時間軸樣式布局
<declare-styleable name="TimeLineLayout">
<!--每行高度-->
<attr name="tll_height" format="dimension|reference"/>
<!--文字大小-->
<attr name="tll_textSize" format="dimension|reference"/>
<!--文字顏色-->
<attr name="tll_textColor" format="color|reference"/>
<!--文字和時間軸間距-->
<attr name="tll_padding" format="dimension|reference"/>
<!--時間軸圓點顏色-->
<attr name="tll_dotColor" format="color|reference"/>
<!--時間軸圓點半徑-->
<attr name="tll_dotRadius" format="dimension|reference"/>
<!--時間線顏色-->
<attr name="tll_lineColor" format="color|reference"/>
<!--時間線寬度-->
<attr name="tll_lineWidth" format="dimension|reference"/>
</declare-styleable>