Android 仿萤石客户端横向滚动时间轴

来源:互联网 发布:免费淘宝账号和密码 编辑:程序博客网 时间:2024/06/07 09:45

24小时制时间滚动轴能自定义颜色和填充时间段,有兴趣的可以看看


项目地址


使用方式1

    <com.scenery7f.timeaxis.view.TimerShaft        android:id="@+id/timer_shaft"        android:layout_width="match_parent"        android:layout_height="wrap_content"        app:markColor="@color/olivedrab"        app:scaleColor="@color/blue">    </com.scenery7f.timeaxis.view.TimerShaft>

使用方式2

    TimerShaft s = new TimerShaft(this,Color.YELLOW,Color.RED);


添加监听

        s.setOnTimeChange(new TimerShaft.OnTimeChange() {            @Override            public void timeChangeOver(String time) {                TestUtil.showToast(MainActivity.this,time);            }            @Override            public void timeChangeAction() {                TestUtil.log(MainActivity.this.getClass(),"正在移动时间轴");            }        });


添加填充区域:

Calendar start = Calendar.getInstance();        Calendar end = Calendar.getInstance();        end.setTimeInMillis(start.getTimeInMillis() + 1000 * 60 * 60);        PeriodTime periodTime = new PeriodTime(start,end);        List<PeriodTime> list = new ArrayList<>();        list.add(periodTime);        s.setRecordList(list);



原创粉丝点击