Browse Source

style

master
huting 2 years ago
parent
commit
7838f4bb52

+ 8
- 1
app/src/main/java/com/huntersun/vkyes/etcopencard/src/other/CodeCountDown.java View File

@@ -18,19 +18,26 @@ import com.huntersun.vkyes.etcopencard.R;
public class CodeCountDown extends CountDownTimer {
private Button mTextView;
private Context context;
int color;

public CodeCountDown(Context context, Button textView, long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
this.mTextView = textView;
this.context = context;
}
public CodeCountDown(Context context, Button textView, long millisInFuture, long countDownInterval,int color) {
super(millisInFuture, countDownInterval);
this.mTextView = textView;
this.context = context;
this.color = color;
}

@Override
public void onTick(long millisUntilFinished) {
mTextView.setClickable(false); //设置不可点击
mTextView.setEnabled(false);
mTextView.setText(millisUntilFinished / 1000 + "s后重发"); //设置倒计时时间
ColorStateList colors = context.getResources().getColorStateList(R.color.white);
ColorStateList colors = context.getResources().getColorStateList(color != 0 ? color : R.color.white);
mTextView.setTextColor(colors);
//mTextView.setBackgroundResource(R.drawable.bg_identify_code_press); //设置按钮为灰色,这时是不能点击的
//mTextView.setBackgroundResource(R.drawable.boder_radius_5_white); //设置按钮为灰色,这时是不能点击的

+ 1
- 1
app/src/main/java/com/huntersun/vkyes/etcopencard/src/ui/activity/LoginActivity.java View File

@@ -415,7 +415,7 @@ public final class LoginActivity extends AppActivity implements KeyboardWatcher.
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) {
hideDialog();
toast("验证码发送成功!");
mCountDownTimerUtils = new CodeCountDown(LoginActivity.this, mGetCodeBtn, 60000, 1000);
mCountDownTimerUtils = new CodeCountDown(LoginActivity.this, mGetCodeBtn, 60000, 1000,R.color.common_accent_color);
mCountDownTimerUtils.start();
}


Loading…
Cancel
Save