TurkiTAK / Vector Analog Clock
Licence: mit
A Simple Customizable VectorAnalogClock Android View
Stars: ✭ 73
Programming Languages
java
68154 projects - #9 most used programming language
Labels
Projects that are alternatives of or similar to Vector Analog Clock
ChinaMapView
自定义View,可缩放、可平移、可点击的中国地图,有中国地图的全部省份,具备每个省份的点击接口
Stars: ✭ 1,211 (+1558.9%)
Mutual labels: android-view
Avatar View
Avatar ImageView with user's name first letter Drawable placeholder
Stars: ✭ 309 (+323.29%)
Mutual labels: android-view
Polygondrawingutil
A compact Android utility for constructing and drawing rounded regular polygons.
Stars: ✭ 805 (+1002.74%)
Mutual labels: android-view
SignatureView
【Android View】:好用的Android电子签名板,能保存所签名的图片
Stars: ✭ 89 (+21.92%)
Mutual labels: android-view
Shadowhelper
A library to add shadows for the Android View.(一个方便为Android View添加自然的阴影的库)
Stars: ✭ 322 (+341.1%)
Mutual labels: android-view
MaterialChipView
Material Chip View can be used as tags for categories, contacts or creating text clouds. Port of
Stars: ✭ 13 (-82.19%)
Mutual labels: android-view
com.jonaswanke.calendar
📅 Material Design CalendarView for Android
Stars: ✭ 46 (-36.99%)
Mutual labels: android-view
Android Tips
An awesome list of tips for Android.
Stars: ✭ 3,239 (+4336.99%)
Mutual labels: android-view
QuantityPickerView
A View capable of increasing or decreasing a unit value with a toggle animation
Stars: ✭ 42 (-42.47%)
Mutual labels: android-view
Smarttable
一款android自动生成表格框架---An Android automatically generated table framework
Stars: ✭ 4,621 (+6230.14%)
Mutual labels: android-view
Krumbsview
🍞 The ultimate breadcrumbs view for Android!
Stars: ✭ 170 (+132.88%)
Mutual labels: android-view
Colorpicker
🎨 A color picker for Android. Pick a color using color wheel and slider (HSV & alpha).
Stars: ✭ 254 (+247.95%)
Mutual labels: android-view
Androidtips
A collections of tips in Android developing.Android开发总结。我的博客:
Stars: ✭ 713 (+876.71%)
Mutual labels: android-view
Proswipebutton
A swipe button for Android with a circular progress bar for async operations
Stars: ✭ 319 (+336.99%)
Mutual labels: android-view
Vector Analog Clock
A Simple, Customizable VectorAnalogClock View for Android.
Resizable. Smooth movement. Tested on various screen sizes and densities. Supports Custom Vector Assets. Supports back to API 14.
Usage:
Add the gradle dependency
dependencies {
implementation 'turki.alkhateeb:vectoranalogclock:1.0.0'
}
Extend the VectorAnalogClock class
package com.turki.alwaysonlibrarycontainer;
import android.content.Context;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
import com.turki.vectoranalogclock.VectorAnalogClock;
public class MyVectorClock extends VectorAnalogClock{
private void init(){
//use this for the default Analog Clock (recommended)
initializeSimple();
//or use this if you want to use your own vector assets (not recommended)
//initializeCustom(faceResourceId, hourResourceId, minuteResourceId, secondResourceId);
}
//mandatory constructor
public MyVectorClock(Context ctx) {
super(ctx);
init();
}
// the other constructors are in case you want to add the view in XML
public MyVectorClock(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public MyVectorClock(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public MyVectorClock(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init();
}
}
Add the view to your layout
Note: XML attributes are not supported currently. Use WRAP_CONTENT for both width and height. Instead, use setDiameterInDp()
and setDiameterInPixels()
to control the size.
Add the view to XML or Java
<com.turki.alwaysonlibrarycontainer.MyVectorClock
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/clock"
android:layout_gravity="center"/>
In your Activity:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR,-2);
MyVectorClock vectorAnalogClock = findViewById(R.id.clock);
//customization
vectorAnalogClock.setCalendar(calendar)
.setDiameterInDp(400.0f)
.setOpacity(1.0f)
.setShowSeconds(true)
.setColor(Color.BLACK);
}
This will be the result:
That's it!! Have fun.
Twitter: @TurkiAlkhateeb
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].