Skip to content

Commit

Permalink
update RxDialogDate
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamsiree committed Mar 16, 2020
1 parent 3e0b0f8 commit fba4b6e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions RxUI/src/main/java/com/tamsiree/rxui/view/dialog/RxDialogDate.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class RxDialogDate extends RxDialog {
private int curMonth;
private int curDay;
private TextView mTvSure;
private TextView mTvCancle;
private TextView mTvCancel;
private CheckBox mCheckBoxDay;
private Calendar mCalendar;
private LinearLayout llType;
Expand All @@ -53,22 +53,19 @@ public class RxDialogDate extends RxDialog {

public RxDialogDate(Context mContext) {
super(mContext);
// TODO Auto-generated constructor stub
this.mContext = mContext;
build();
}

public RxDialogDate(Context mContext, int beginYear) {
super(mContext);
// TODO Auto-generated constructor stub
this.mContext = mContext;
this.beginYear = beginYear;
build();
}

public RxDialogDate(Context mContext, int beginYear, int endYear) {
super(mContext);
// TODO Auto-generated constructor stub
this.mContext = mContext;
this.beginYear = beginYear;
this.endYear = endYear;
Expand All @@ -77,7 +74,6 @@ public RxDialogDate(Context mContext, int beginYear, int endYear) {

public RxDialogDate(Context mContext, DateFormat dateFormat) {
super(mContext);
// TODO Auto-generated constructor stub
this.mContext = mContext;
build();
this.mDateFormat = dateFormat;
Expand All @@ -88,11 +84,11 @@ public String getDateCN() {
String dateCN;
switch (mDateFormat) {
case 年月:
dateCN = curYear + "年" + mMonths[curMonth] + "月";
dateCN = getSelectorYear() + "年" + getSelectorMonth() + "月";
break;
case 年月日:
default:
dateCN = curYear + "年" + mMonths[curMonth] + "月" + mDays[curDay] + "日";
dateCN = getSelectorYear() + "年" + getSelectorMonth() + "月" + getSelectorDay() + "日";
break;
}

Expand All @@ -117,12 +113,12 @@ public void setDateFormat(DateFormat dateFormat) {
switch (dateFormat) {
case 年月:
llType.setVisibility(View.VISIBLE);
mCheckBoxDay.setChecked(true);
mCheckBoxDay.setChecked(false);
break;
case 年月日:
default:
llType.setVisibility(View.INVISIBLE);
mCheckBoxDay.setChecked(false);
mCheckBoxDay.setChecked(true);
break;
}
}
Expand Down Expand Up @@ -185,7 +181,7 @@ public void onChanged(WheelView wheel, int oldValue, int newValue) {
mDayView.setShadowColor(0xFFDADCDB, 0x88DADCDB, 0x00DADCDB);

mTvSure = dialogView1.findViewById(R.id.tv_sure);
mTvCancle = dialogView1.findViewById(R.id.tv_cancel);
mTvCancel = dialogView1.findViewById(R.id.tv_cancel);
llType = dialogView1.findViewById(R.id.ll_month_type);

mCheckBoxDay = dialogView1.findViewById(R.id.checkBox_day);
Expand Down Expand Up @@ -251,7 +247,7 @@ public TextView getSureView() {
}

public TextView getCancleView() {
return mTvCancle;
return mTvCancel;
}


Expand Down

0 comments on commit fba4b6e

Please sign in to comment.