Skip to content

Commit

Permalink
tst
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Mamane committed Oct 2, 2023
1 parent e3da7d1 commit 63e530f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/java/com/android/calendar/event/EditEventView.java
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,9 @@ public void setModel(CalendarEventModel model) {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setAllDayViewsVisibility(isChecked);
if(!isChecked) {
resetToDefaultDuration();
}
}
});

Expand Down Expand Up @@ -1385,6 +1388,15 @@ private void setTime(TextView view, long millis) {
view.setText(timeString);
}

protected void resetToDefaultDuration(boolean isChecked) {
mEndTime.setDay(mEndTime.getDay() - 1);
mEndTime.set(mStartTime.normalize() +
getDefaultEventDurationInMillis(this));
long endMillis = mEndTime.normalize();
setDate(mEndDateButton, endMillis);
setTime(mEndTimeButton, endMillis);
}

/**
* @param isChecked
*/
Expand Down

0 comments on commit 63e530f

Please sign in to comment.