public class SmoothHandler extends Handler
ISmoothTargetHandler.Callback| Modifier and Type | Field and Description |
|---|---|
static float |
ALLOWED_PRECISION_ERROR |
static boolean |
NEED_LOG |
| Constructor and Description |
|---|
SmoothHandler(WeakReference<ISmoothTarget> targetWeakReference)
generally use for the progress widget
|
SmoothHandler(WeakReference<ISmoothTarget> targetWeakReference,
Looper looper) |
| Modifier and Type | Method and Description |
|---|---|
void |
commitPercent(float percent)
Must be invoked by some method which will change the percent for monitor all changes
about percent.
|
float |
getMinInternalPercent() |
int |
getSmoothIncreaseDelayMillis() |
float |
getSmoothInternalPercent() |
void |
handleMessage(Message msg) |
void |
loopSmooth(float percent) |
void |
loopSmooth(float percent,
long durationMillis)
If the provider percent(the aim percent) more than
minInternalPercent, it will
be split to the several smoothInternalPercent. |
void |
setMinInternalPercent(float minInternalPercent)
if the provider percent more than minInternalPercent, it will be split to the several smoothInternalPercent
|
void |
setSmoothIncreaseDelayMillis(int smoothIncreaseDelayMillis) |
void |
setSmoothInternalPercent(float smoothInternalPercent)
if the provider percent more than minInternalPercent, it will be split to the several smoothInternalPercent
|
dispatchMessage, dump, getLooper, getMessageName, hasMessages, hasMessages, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, post, postAtFrontOfQueue, postAtTime, postAtTime, postDelayed, removeCallbacks, removeCallbacks, removeCallbacksAndMessages, removeMessages, removeMessages, sendEmptyMessage, sendEmptyMessageAtTime, sendEmptyMessageDelayed, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtTime, sendMessageDelayed, toStringpublic static boolean NEED_LOG
public static float ALLOWED_PRECISION_ERROR
public SmoothHandler(WeakReference<ISmoothTarget> targetWeakReference)
targetWeakReference - the weak reference of the smooth targetpublic SmoothHandler(WeakReference<ISmoothTarget> targetWeakReference, Looper looper)
public float getMinInternalPercent()
public void setMinInternalPercent(float minInternalPercent)
minInternalPercent - the min internal of the percent, default 0.03setSmoothInternalPercent(float)public float getSmoothInternalPercent()
public void setSmoothInternalPercent(float smoothInternalPercent)
smoothInternalPercent - the internal of the percent will provide the smooth effect, default 0.01setMinInternalPercent(float)public int getSmoothIncreaseDelayMillis()
public void setSmoothIncreaseDelayMillis(int smoothIncreaseDelayMillis)
smoothIncreaseDelayMillis - the delay of increase duration, default 1mspublic void handleMessage(Message msg)
handleMessage in class Handlerpublic void commitPercent(float percent)
percent - the percent will be effect by the target.public void loopSmooth(float percent)
public void loopSmooth(float percent,
long durationMillis)
minInternalPercent, it will
be split to the several smoothInternalPercent.percent - The aim percent.durationMillis - Temporary duration for percent. If lesson than 0, it will be
ignored.