android 特效闹钟GoogleClock
来源:互联网 发布:gis数据挖掘前景 编辑:程序博客网 时间:2024/05/16 18:19
An imitation of the clock in Google I/O 2016 . Almost all of the animations and images in it are made by the SVG , so this library may be a wonderful material to learn the SVG's usage in Android . Chinese README is here .
show
Installation
You can install GoogleClock by adding the following dependency to your build.gradle:
allprojects { repositories { ... maven { url "https://jitpack.io" } }}
dependencies { compile 'com.github.lypeer:GoogleClock:1.0.0'}
Usage
Simple Usage :
Just to add the GoogleClock to your activity's xml :
<com.lypeer.googleioclock.GoogleClock android:layout_width="wrap_content" android:layout_height="wrap_content"/>
And then the clock will appear .
Complex Usage
Of course , you can do some configuration in the xml :
<com.lypeer.googleioclock.GoogleClock android:layout_width="wrap_content" android:layout_height="wrap_content" app:lyClockWidth="32dp" app:lyHourWidth="32dp" app:lyMinWidth="32dp" app:lySecWidth="32dp" app:lyDividerHorizontal="32dp" app:lyDividerVertical="32dp" app:lyTheme="@style/LyTheme3" />
You can configure the following xml attributes for the clock :
Your can define a custom theme to change more in the clock , such as following :
<style name="LyTheme2" parent="LyTheme"> <item name="lyColor0">@color/colorRed</item> <item name="lyColor1">@color/colorYellow</item> <item name="lyColor2">@color/colorGreen</item> <item name="lyColor3">@color/colorBlue</item> <item name="lyColorColon">@color/colorDarkBlue</item> <item name="lyThickness">@integer/lyThickness_4</item> <item name="lyColonThickness">@integer/lyThickness_1</item></style>
You should let The custom theme's parent be LyTheme so that you can only override the attributes you want to change . If not , your theme must contains all of the attributes in LyTheme , or some view may can't work . LyTheme contains following attributes :
Ok , that's all about usage . There is a demo in the library .
Dependencies
- org.greenrobot:eventbus:3.0.0
- android 特效闹钟GoogleClock
- android闹钟
- ANDROID 闹钟
- Android 闹钟
- android 闹钟
- Android闹钟
- Android 闹钟
- android闹钟
- android--闹钟
- Android--闹钟
- android 闹钟
- Android闹钟
- Android 闹钟
- Android闹钟最终版【android源码闹钟解析】
- Android闹钟最终版【android源码闹钟解析】
- Android闹钟最终版【android源码闹钟解析】
- Android闹钟最终版【android源码闹钟解析】
- Android闹钟最终版【android源码闹钟解析】
- ORACLE 格式化日期的语句
- Java IO流学习总结
- 赛码网常见接受参数的方法
- Docker基础:文件系统之AUFS
- linux sed、awk、diff命令常用操作
- android 特效闹钟GoogleClock
- react生命周期方法介绍
- std::find_if_not的使用
- 简单抽奖活动js代码
- jquery的ajax方法的回调函数详解
- 在kvm中使用网桥模式(BRIDGE NETWORKING MODE)
- JAVA多线程 基础知识 001
- iOS beginUpdates && endUpdates用法
- android 每行读取本地文件并转换为map对象