Initial commit
This commit is contained in:
42
sources/com/ubtrobot/analytics/event/Ticker.java
Normal file
42
sources/com/ubtrobot/analytics/event/Ticker.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.ubtrobot.analytics.event;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class Ticker {
|
||||
private Handler a = new Handler(Looper.getMainLooper());
|
||||
private ListenerRunnable b;
|
||||
|
||||
private class ListenerRunnable implements Runnable {
|
||||
private TicktockListener a;
|
||||
private int b;
|
||||
private TimeUnit c;
|
||||
|
||||
public ListenerRunnable(TicktockListener ticktockListener, int i, TimeUnit timeUnit) {
|
||||
this.a = ticktockListener;
|
||||
this.b = i;
|
||||
this.c = timeUnit;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
this.a.a();
|
||||
Ticker.this.a.postDelayed(this, this.c.toMillis(this.b));
|
||||
}
|
||||
}
|
||||
|
||||
public void a(TicktockListener ticktockListener, int i, TimeUnit timeUnit) {
|
||||
ListenerRunnable listenerRunnable = this.b;
|
||||
if (listenerRunnable == null) {
|
||||
listenerRunnable = new ListenerRunnable(ticktockListener, i, timeUnit);
|
||||
}
|
||||
this.b = listenerRunnable;
|
||||
this.a.post(this.b);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.a.removeCallbacks(this.b);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user