Skip to content

Commit

Permalink
v1.0.1版本
Browse files Browse the repository at this point in the history
修改不设置倒计时提醒时间会出现空指针的bug
隐藏部分不需要的方法
  • Loading branch information
ccaong committed Jan 15, 2019
1 parent dbb9efe commit 317b833
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {
applicationId "com.ccaong.devel.countdown"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CountDownView extends FrameLayout {
/**
* 间隔时间
*/
private int mTimeInterval = 1;
private int mTimeInterval;

/**
* 倒计时不足多少时提醒
Expand All @@ -38,19 +38,19 @@ public class CountDownView extends FrameLayout {
/**
* 显示 天
*/
private int mTimeDD = 0;
private int mTimeDD;
/**
* 显示 小时
*/
private int mTimeHH = 0;
private int mTimeHH;
/**
* 显示 分钟
*/
private int mTimeMM = 100;
private int mTimeMM;
/**
* 显示 秒
*/
private int mTimeSS = 0;
private int mTimeSS;

private Boolean showDay = false;
private Boolean showHour = false;
Expand All @@ -59,7 +59,7 @@ public class CountDownView extends FrameLayout {

private Boolean showRemind = false;

private int showSeparatorStyle = 0;
private int showSeparatorStyle;
private TimesUpListener mTimesUpListener;
private TextView tvCountTime;
private TextView tvTitle;
Expand Down Expand Up @@ -149,6 +149,14 @@ private void initView() {
View view = LayoutInflater.from(mContext).inflate(R.layout.time, null);
tvTitle = view.findViewById(R.id.textView);
tvCountTime = view.findViewById(R.id.tv_time);
mStartTime = 60 * 1000L;
mRemindTime = 10L;
mTimeInterval = 1;
mTimeDD = 0;
mTimeHH = 0;
mTimeMM = 1;
mTimeSS = 0;
showSeparatorStyle = 0;
this.addView(view);
}

Expand Down Expand Up @@ -229,6 +237,11 @@ public void setStyle(Boolean day, Boolean Hour, Boolean minute, Boolean second)

}

/**
* 设置分隔符的样式,有两个选项:ZN_CH->1天00时15分01秒和 EN-> 1:00:15:01
*
* @param countDownStyle
*/
public void setSeparatorStyle(CountDownConstant.CountDownStyle countDownStyle) {
if (countDownStyle == CountDownConstant.CountDownStyle.EN) {
this.showSeparatorStyle = 0;
Expand Down Expand Up @@ -288,7 +301,7 @@ public void pause() {
}


public void setTime() {
private void setTime() {
String strTime = "";
String[] styleEN = {":", ":", ":", ""};
String[] styleZN_CH = {"天", "时", "分", "秒"};
Expand Down

0 comments on commit 317b833

Please sign in to comment.