This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.requestAnimFrame = ( -> | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
( callback ) -> | |
window.setTimeout(callback, 1000 / 60) #定义每秒执行60次动画 | |
)(); | |
//======================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ValueAnimator animator = new ValueAnimator(); | |
int cashBalance = Integer.valueOf(mCashBalanceResObject.cashBalance); | |
animator.setObjectValues(0,cashBalance); | |
animator.addUpdateListener(new AnimatorUpdateListener() { | |
public void onAnimationUpdate(ValueAnimator animation) { | |
mACommon.doAutoResizeTextCash(R.id.layout_cash_charge_title,String.valueOf(animation.getAnimatedValue())); | |
} | |
}); | |
animator.setEvaluator(new TypeEvaluator<Integer>() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.alfroid.android.util.widget; | |
import android.content.Context; | |
import android.text.Editable; | |
import android.util.AttributeSet; | |
import android.widget.EditText; | |
public class EditTextSelectable extends EditText{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EditText edit_pincode = (EditText) findViewById(R.id.layout_input_pincode); | |
EditText edit_pincode_date = (EditText) findViewById(R.id.btn_input_pincode_date); | |
edit_pincode.setOnClickListener(pincodeOnClickListener); | |
edit_pincode_date.setOnClickListener(dateOnClickListener); | |
edit_pincode.setOnFocusChangeListener(pincodeOnFocusListener); | |
edit_pincode_date.setOnFocusChangeListener(dateOnFocusListener); | |
edit_pincode.addTextChangedListener(pincodeWatcher); | |
edit_pincode_date.addTextChangedListener(dateWatcher); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i=0; i<ET_COUNT ; i++){ | |
EditText et = et_pincode[i]; | |
final int index = i; | |
et.setOnKeyListener(new OnKeyListener() { | |
@Override | |
public boolean onKey(View v, int keyCode, KeyEvent event) { | |
// TODO Auto-generated method stub | |
EditText et = (EditText)v; | |
if(keyCode==KeyEvent.KEYCODE_DEL){ |
NewerOlder