Skip to content

Commit

Permalink
Log a warning when trying to announce before interface has been initi…
Browse files Browse the repository at this point in the history
…alized

Fixes #561
  • Loading branch information
wdullaer committed Feb 9, 2019
1 parent 0024dbd commit 884a412
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public int getMostVisiblePosition() {
return getChildAdapterPosition(getMostVisibleMonth());
}

public MonthView getMostVisibleMonth() {
public @Nullable MonthView getMostVisibleMonth() {
boolean verticalScroll = mController.getScrollOrientation() == DatePickerDialog.ScrollOrientation.VERTICAL;
final int maxSize = verticalScroll ? getHeight() : getWidth();
int maxDisplayedSize = 0;
Expand Down Expand Up @@ -358,6 +358,8 @@ void accessibilityAnnouncePageChanged() {
if (mv != null) {
String monthYear = getMonthAndYearString(mv.mMonth, mv.mYear, mController.getLocale());
Utils.tryAccessibilityAnnounce(this, monthYear);
} else {
Log.w("DayPickerView", "Tried to announce before layout was initialized");
}
}

Expand Down

0 comments on commit 884a412

Please sign in to comment.