Skip to content

Commit

Permalink
优化TimePickerPopup
Browse files Browse the repository at this point in the history
  • Loading branch information
junixapp committed Dec 9, 2023
1 parent 79a762c commit 006cd5d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

2 changes: 1 addition & 1 deletion .idea/gradle.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

10 changes: 8 additions & 2 deletions ext/src/main/java/com/lxj/xpopupext/popup/TimePickerPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public enum Mode{
public TimePickerListener timePickerListener;
private Mode mode = Mode.YMD;
private boolean isLunar = false; //是否是农历
private int startYear = 0;
private boolean cyclic = false;
private int startYear = 0;
private int endYear = 0;
private int itemsVisibleCount = 7;
private int itemTextSize = 16;
Expand Down Expand Up @@ -176,7 +177,7 @@ public void onTimeSelectChanged() {
getResources().getString(R.string._xpopup_ext_seconds));
wheelTime.setItemsVisible(itemsVisibleCount);
wheelTime.setAlphaGradient(true);
wheelTime.setCyclic(true);
wheelTime.setCyclic(cyclic);
wheelTime.setDividerColor( popupInfo.isDarkTheme ? Color.parseColor("#444444") : dividerColor);
wheelTime.setDividerType(WheelView.DividerType.FILL);
wheelTime.setLineSpacingMultiplier(lineSpace);
Expand All @@ -195,6 +196,11 @@ public TimePickerPopup setShowLabel(boolean showLabel){
return this;
}

public TimePickerPopup setCyclic(boolean cyclic){
this.cyclic = cyclic;
return this;
}

public TimePickerPopup setTimePickerListener(TimePickerListener listener){
this.timePickerListener = listener;
return this;
Expand Down

0 comments on commit 006cd5d

Please sign in to comment.