Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

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.

8 changes: 1 addition & 7 deletions .idea/gradle.xml

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

18 changes: 1 addition & 17 deletions .idea/misc.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ protected void onCreate(Bundle savedInstanceState) {
.setCyclic(false)
.setMinMillseconds(System.currentTimeMillis())
.setMaxMillseconds(System.currentTimeMillis() + tenYears)
.setCurrentMillseconds(System.currentTimeMillis())
.setThemeColor(ContextCompat.getColor(this, R.color.timepicker_dialog_bg))
.setType(Type.ALL)
.setWheelItemTextNormalColor(getResources().getColor(R.color.timetimepicker_default_text_color))
Expand Down Expand Up @@ -92,6 +91,7 @@ protected void onCreate(Bundle savedInstanceState) {
.setCallBack(this)
.setMaxDay(24)
.setWheelItemSelectorTextSize(16)
.setCurrentMillseconds(259140000)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ void initExpirationViews(View view) {
RadioButton op2 = (RadioButton) view.findViewById(R.id.expiration_option_right);
op2.setText(mPickerConfig.mExpirationOp2Label);

op1.toggle();
if(choseRight){
op2.toggle();
}
else {
op1.toggle();
}
op1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) { choseRight = false; }
Expand Down Expand Up @@ -99,6 +104,10 @@ public void setCallBack(OnDateSetListener listener) {
mPickerConfig.mCallBack = listener;
}

public void setExpirationOnSent() {
this.choseRight = true;
}

public static class Builder {
PickerConfig mPickerConfig;

Expand Down Expand Up @@ -178,7 +187,25 @@ public Builder setMaxMillseconds(long millseconds) {
return this;
}

public Builder setCurrentDay(int day) {
mPickerConfig.mCurrentDay = day;
return this;
}

public Builder setCurrentHour(int hour) {
mPickerConfig.mCurrentHour = hour;
return this;
}

public Builder setCurrentMinute(int minute) {
mPickerConfig.mCurrentMinute = minute;
return this;
}

public Builder setCurrentMillseconds(long millseconds) {
mPickerConfig.mCurrentDay = (int)(millseconds / TimeDuration.daysInMS);
mPickerConfig.mCurrentHour = (int)(millseconds / TimeDuration.hoursInMS) % 24;
mPickerConfig.mCurrentMinute = (int)(millseconds / TimeDuration.minutesInMS) % 60;
mPickerConfig.mCurrentCalendar = new WheelCalendar(millseconds);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,19 @@ void initMonth() {

void initDay() {
updateDays();
day.setCurrentItem(mPickerConfig.mCurrentDay);
day.setCyclic(mPickerConfig.cyclic);
}

void initHour() {
updateHours();
hour.setCurrentItem(mPickerConfig.mCurrentHour);
hour.setCyclic(mPickerConfig.cyclic);
}

void initMinute() {
updateMinutes();
minute.setCurrentItem(mPickerConfig.mCurrentMinute);
minute.setCyclic(mPickerConfig.cyclic);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public class PickerConfig {
public String mExpirationOp1Label = DefaultConfig.EXPIRATION_OPTION_1;
public String mExpirationOp2Label = DefaultConfig.EXPIRATION_OPTION_2;

public int mCurrentDay = 0;
public int mCurrentHour = 0;
public int mCurrentMinute = 0;

public int minDay = DefaultConfig.MIN_DAY;
public int maxDay = DefaultConfig.MAX_DAY;
Expand Down