From fba4b6eb0a8efbb8365fcee77af03fca98fae87a Mon Sep 17 00:00:00 2001 From: Tamsiree Date: Mon, 16 Mar 2020 23:27:50 +0800 Subject: [PATCH] update RxDialogDate --- .../rxui/view/dialog/RxDialogDate.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/RxUI/src/main/java/com/tamsiree/rxui/view/dialog/RxDialogDate.java b/RxUI/src/main/java/com/tamsiree/rxui/view/dialog/RxDialogDate.java index 921a3f1a..4fc633b6 100644 --- a/RxUI/src/main/java/com/tamsiree/rxui/view/dialog/RxDialogDate.java +++ b/RxUI/src/main/java/com/tamsiree/rxui/view/dialog/RxDialogDate.java @@ -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; @@ -53,14 +53,12 @@ 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(); @@ -68,7 +66,6 @@ public RxDialogDate(Context mContext, int beginYear) { public RxDialogDate(Context mContext, int beginYear, int endYear) { super(mContext); - // TODO Auto-generated constructor stub this.mContext = mContext; this.beginYear = beginYear; this.endYear = endYear; @@ -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; @@ -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; } @@ -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; } } @@ -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); @@ -251,7 +247,7 @@ public TextView getSureView() { } public TextView getCancleView() { - return mTvCancle; + return mTvCancel; }