Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the windmill effect of sliding adjusting time and page rotation by alarm clock AlarmAndMusic

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article to share with you is about the alarm clock AlarmAndMusic how to achieve sliding adjustment time and page rotation windmill effect, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after some harvest, not much to say, follow Xiaobian to see it.

Alarm Clock AlarmAndMusic Slide to adjust time and page rotation Windmill effect

AlarmAndMusic and support for music effects, sliding up and down to adjust the time and page rotation windmill effect

Due to the production of gif some problems, the effect is not obvious, welcome to download to see the real effect.

This example is mainly completed by AlartActivity and AlarmService and AlarmAlartWakeLock.

AlarmAlartWakeLock main code:

public class AlarmAlertWakeLock {

private static PowerManager.WakeLock sCpuWakeLock;

public static void acquireCpuWakeLock(Context context) {

Log.v("Acquiring cpu wake lock");

if (sCpuWakeLock != null) {

return;

}

PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);

sCpuWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK

| PowerManager.ACQUIRE_CAUSES_WAKEUP

| PowerManager.ON_AFTER_RELEASE, Log.LOGTAG);

sCpuWakeLock.acquire();

}

public static void releaseCpuLock() {

Log.v("Releasing cpu wake lock");

if (sCpuWakeLock != null) {

sCpuWakeLock.release();

sCpuWakeLock = null;

}

}

}

AlarmService is mainly used to play() music.

The above is how the alarm clock AlarmAndMusic realizes sliding adjustment time and page rotation windmill effect. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report