fix [修复动态发布,时间选择问题]
This commit is contained in:
parent
80fd2a1bbc
commit
e386fbfdbb
@ -27,4 +27,5 @@
|
|||||||
<string name="focus_on">Focus on</string>
|
<string name="focus_on">Focus on</string>
|
||||||
<string name="see_more">See more</string>
|
<string name="see_more">See more</string>
|
||||||
<string name="close">close</string>
|
<string name="close">close</string>
|
||||||
|
<string name="time_cannot_be_greater_than_the_current_time">Time cannot be greater than the current time</string>
|
||||||
</resources>
|
</resources>
|
@ -1492,4 +1492,5 @@
|
|||||||
<string name="focus_on">關注</string>
|
<string name="focus_on">關注</string>
|
||||||
<string name="see_more">查看更多</string>
|
<string name="see_more">查看更多</string>
|
||||||
<string name="close">收起</string>
|
<string name="close">收起</string>
|
||||||
|
<string name="time_cannot_be_greater_than_the_current_time">时间不能大于当前时间</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1492,4 +1492,5 @@
|
|||||||
<string name="focus_on">關注</string>
|
<string name="focus_on">關注</string>
|
||||||
<string name="see_more">查看更多</string>
|
<string name="see_more">查看更多</string>
|
||||||
<string name="close">收起</string>
|
<string name="close">收起</string>
|
||||||
|
<string name="time_cannot_be_greater_than_the_current_time">时间不能大于当前时间</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1490,4 +1490,5 @@
|
|||||||
<string name="focus_on">關注</string>
|
<string name="focus_on">關注</string>
|
||||||
<string name="see_more">查看更多</string>
|
<string name="see_more">查看更多</string>
|
||||||
<string name="close">收起</string>
|
<string name="close">收起</string>
|
||||||
|
<string name="time_cannot_be_greater_than_the_current_time">时间不能大于当前时间</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1512,6 +1512,7 @@ Limited ride And limited avatar frame</string>
|
|||||||
<string name="focus_on">關注</string>
|
<string name="focus_on">關注</string>
|
||||||
<string name="see_more">查看更多</string>
|
<string name="see_more">查看更多</string>
|
||||||
<string name="close">收起</string>
|
<string name="close">收起</string>
|
||||||
|
<string name="time_cannot_be_greater_than_the_current_time">时间不能大于当前时间</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -288,25 +288,32 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TimePickerView timePickerView;
|
||||||
|
|
||||||
public void showTimeChooseDialog() {
|
public void showTimeChooseDialog() {
|
||||||
Calendar startCalendar = Calendar.getInstance();
|
Calendar startCalendar = Calendar.getInstance();
|
||||||
startCalendar.set(1990, 1, 1);
|
startCalendar.set(1990, 1, 1);
|
||||||
Calendar endCalendar = Calendar.getInstance();
|
Calendar endCalendar = Calendar.getInstance();
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
int year = calendar.get(Calendar.YEAR);
|
int year = calendar.get(Calendar.YEAR);
|
||||||
int month = calendar.get(Calendar.MONTH) + 1; // Calendar.MONTH 从0开始计数
|
int month = calendar.get(Calendar.MONTH); // Calendar.MONTH 从0开始计数
|
||||||
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||||
int hour = calendar.get(Calendar.HOUR); // 使用24小时制
|
int hour = calendar.get(Calendar.HOUR_OF_DAY); // 使用24小时制
|
||||||
int minute = calendar.get(Calendar.MINUTE);
|
int minute = calendar.get(Calendar.MINUTE);
|
||||||
int second = calendar.get(Calendar.SECOND);
|
int second = calendar.get(Calendar.SECOND);
|
||||||
endCalendar.set(year, month, day, hour, minute, second);
|
endCalendar.set(year, month, day, hour, minute, second);
|
||||||
|
|
||||||
TimePickerView timePickerView = new TimePickerBuilder(CommunitySendActivity.this, new OnTimeSelectListener() {
|
timePickerView = new TimePickerBuilder(CommunitySendActivity.this, new OnTimeSelectListener() {
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
public void onTimeSelect(Date date, View v) {
|
public void onTimeSelect(Date date, View v) {
|
||||||
|
if (date.getTime() > new Date().getTime()) {
|
||||||
|
ToastUtil.show(getResources().getString(com.yunbao.main.R.string.time_cannot_be_greater_than_the_current_time));
|
||||||
|
timePickerView.show();
|
||||||
|
} else {
|
||||||
chooseTime.setText(DateFormatUtil.getTimeStrings(date.getTime()));
|
chooseTime.setText(DateFormatUtil.getTimeStrings(date.getTime()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}).setType(new boolean[]{true, true, true, true, true, false})// 默认全部显示
|
}).setType(new boolean[]{true, true, true, true, true, false})// 默认全部显示
|
||||||
.setCancelText(getResources().getString(R.string.cancel))//取消按钮文字
|
.setCancelText(getResources().getString(R.string.cancel))//取消按钮文字
|
||||||
.setSubmitText(getResources().getString(R.string.back_community_sure))//确认按钮文字
|
.setSubmitText(getResources().getString(R.string.back_community_sure))//确认按钮文字
|
||||||
@ -318,12 +325,6 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
|
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
|
||||||
.build();
|
.build();
|
||||||
timePickerView.show();
|
timePickerView.show();
|
||||||
timePickerView.setOnDismissListener(new OnDismissListener() {
|
|
||||||
@Override
|
|
||||||
public void onDismiss(Object o) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openImageChooserActivity() {
|
private void openImageChooserActivity() {
|
||||||
|
Loading…
Reference in New Issue
Block a user