Coder Social home page Coder Social logo

yan25920928 / alarmclockview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hnsycsxhzcsh/alarmclockview

0.0 1.0 0.0 793 KB

Android自定义控件时钟、钟表AlarmClockView,仿华为手机世界时钟控件效果(Android custom control clock, clock AlarmClockView, imitation Huawei mobile phone world clock control effect)

Java 100.00%

alarmclockview's Introduction

AlarmClockView

Android custom control clock, clock AlarmClockView, imitation Huawei mobile phone world clock control effect
Android自定义控件时钟、钟表AlarmClockView,仿华为手机世界时钟控件效果

Download Apk

效果图

The method referenced in the project:
项目中引用的步骤:

Step 1. Add the JitPack repository to your build file

步骤1.将JitPack存储库添加到构建文件中
项目的根build.gradle中添加以下代码:

 	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2. Add the dependency

步骤2.build.gradle添加依赖项

	dependencies {
         implementation 'com.github.hnsycsxhzcsh:AlarmClockView:v1.6'
	}

Step 3. Reference control in layout

步骤3. 布局中引用控件

	<com.alarmclockview.AlarmClockView
        android:id="@+id/clock"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

Step 4. Add listener to the activity

步骤4. activity中添加监听

    mClock = findViewById(R.id.clock);
    //运行闹钟
    mClock.start(new TimeChangeListener() {
             @Override
             public void onTimeChange(Calendar calendar) {
                  //根据calendar获取当前时间

              }
        });

Other functions:
其他功能:

setIsNight(boolean) 设置是否是夜间效果true是夜间效果,false不是夜间效果
stop() 停止自动运行闹钟
setCurrentTime(Calendar) 自定义当前时间

我的博客地址:https://blog.csdn.net/m0_38074457/article/details/85790550

If my control helps you, please help click on the top right corner, thank you!

如果有帮助到大家希望点下右上角Star,谢谢!

alarmclockview's People

Watchers

 avatar

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.