• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps DatePicker accessibility

vonniekinsey

Lurker
Aug 27, 2023
7
0
On Play Console, it asks for accessibility on parts of DatePicker. The variables they provided were date_picker_header_year & month_view. The style does not have those variables in style [<style name="DatePickerTheme" parent="ThemeOverlay.MaterialComponents.Dialog.Alert">]. Neither did I find these in docs. The code was used.
With OpenAI, was able to resolve the date_picker_header_year, but not for month_view.

The date_picker_header_year code:
Java:
[CODE=java]int yearPickerId = Resources.getSystem().getIdentifier("date_picker_header_year", "id", "android");
TextView yearPicker = view.findViewById(yearPickerId);
if (yearPicker != null) {
yearPicker.setContentDescription(getString(R.string.year_picker_content_description, year));
}

The month_view code:
Code:
[CODE]int monthPickerId = Resources.getSystem().getIdentifier("month_view", "id", "android");
TextView monthPicker = view.findViewById(monthPickerId);

This TextView caused a cast error for android.widget.SimpleMonthView. Tried to import it and would not resolve
Tried to capture ViewGroup and walk thru looking for month_view. No go.


Can you tell me how to have reference
 
Last edited:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones