android水平时间轴控件_教你3分钟了解Android 简易时间轴的实现方法

一.有段时间没更了,因为一直在思索,应该写点什么,真的是无比纠结。这一回,就给大家分享一款简便好用的,小编自制的土晾时间轴。

附上XML预览图:

效果图 注:小黄鸭不是效果哈,是为了保护个人隐私P上去的:

1.新建一个自定义控件:

public class WorkExcView extends LinearLayout {

private TextView dataLeft;

private TextView dataRight;

private TextView company;

private TextView job;

private TextView jobAsses;

private TextView xiTong;

private TextView ziTian;

private LinearLayout jobContentContainer;

private TextView jobContent;

private LinearLayout commentContainer;

private LinearLayout nianContentContainer;

private TextView nianContent;

private LinearLayout base;

private LinearLayout yueXingContainer;

private TextView yueContent;

private LinearLayout nianXingContainer;

private TextView yueMoreContent;

private TextView nianMoreContent;

private String company_id;

public WorkExcView(Context context) {

this(context,null);

}

public WorkExcView(Context context, AttributeSet attrs) {

super(context, attrs);

init();

}

private void init() {

View inflate = View.inflate(getContext(), R.layout.activity_four_workexcview, this);

dataLeft = (TextView) inflate.findViewById(R.id.workexcview_data_left);

dataRight= (TextView) inflate.findViewById(R.id.workexcview_data_right);

company = (TextView) inflate.findViewById(R.id.workexcview_company);

job = (TextView) inflate.findViewById(R.id.workexcview_job);

jobAsses = (TextView) inflate.findViewById(R.id.workexcview__job_asses);

xiTong = (TextView) inflate.findViewById(R.id.workexcview_xitong);

ziTian = (TextView) inflate.findViewById(R.id.workexcview_zitian);

jobContent = (TextView) inflate.findViewById(R.id.workexcview_jobcontent);

nianContent = (TextView) inflate.findViewById(R.id.workexcview_niancontent);

jobContentContainer = (LinearLayout)inflate.findViewById(R.id.workexcview_jobcontent_container);

commentContainer = (LinearLayout)inflate.findViewById(R.id.workexcview__comment_container);

nianContentContainer= (LinearLayout)inflate.findViewById(R.id.workexcview__niancontent_container);

base = (LinearLayout)inflate.findViewById(R.id.workexcview__base);

yueXingContainer = (LinearLayout)inflate.findViewById(R.id.workexcview_yuexing_container);

yueContent = (TextView)inflate.findViewById(R.id.workexcview_yuecontent);

nianXingContainer = (LinearLayout)inflate.findViewById(R.id.workexcview_nianxing_container);

yueMoreContent = (TextView)inflate.findViewById(R.id.workexcview_yuecontentmore);

nianMoreContent = (TextView)inflate.findViewById(R.id.workexcview_niancontentmore);

}

public void initData(final FourBean.JobsBean jobsBean) {

//赋值代码

}

XML文件:

android:layout_width="match_parent"

android:layout_height&#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值