Giter Site home page Giter Site logo

timeticker's Introduction

TimeTicker

This is a custom countdown widget,with the rolling-over 3D effect. ##如何使用 ###1.在根布局中添加自定义属性的标签 xmlns:custom="http://schemas.android.com/apk/res-auto" 然后在布局文件中放置view

<com.zjutcmos.timeticker.MyClockView
    android:id="@+id/myClockView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/clock_view_bg"
    android:gravity="center"
    custom:dayTextBackground="@drawable/time_bg"
    custom:dayTextColor="#ffffff"
    custom:hourTextBackground="@drawable/time_bg"
    custom:hourTextColor="#ffffff"
    custom:minTextBackground="@drawable/time_bg"
    custom:minTextColor="#ffffff"
    custom:secTextBackground="@drawable/time_bg"
    custom:secTextColor="#ffffff"
    />

###2.在使用的Activity中设置时间和监听的回调

        myClockView= (MyClockView) findViewById(R.id.myClockView);
        myClockView.setDownCountTime(1000*60*60*24*3+1000*12);
        myClockView.startDownCountTimer();
        myClockView.setDownCountTimerListener(this);

##注意: 1.如果有部分机型不适配,可以在xml的布局中设置padding属性 2.部分机型在翻转动画时出现闪烁的现象,请将硬件加速关掉。具体代码如下:

myClockView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

timeticker's People

Contributors

zjutcmos avatar

Stargazers

 avatar

Watchers

 avatar

timeticker's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.