Commit a35f6b58 authored by Alan Viverette's avatar Alan Viverette
Browse files

Only clear A11y focus in date picker on MR1. Expose stable IDs.

BUG: 8659961
Change-Id: I15be1c7208b75f1e85d644299437500c389f45ee
parent 385d36f1
......@@ -18,6 +18,7 @@ package com.android.datetimepicker.date;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.AttributeSet;
......@@ -382,8 +383,10 @@ public class DayPickerView extends ListView implements OnScrollListener, OnDateC
if (child instanceof SimpleMonthView) {
final CalendarDay focus = ((SimpleMonthView) child).getAccessibilityFocus();
if (focus != null) {
// Clear focus to avoid ListView bug in Jelly Bean MR1.
((SimpleMonthView) child).clearAccessibilityFocus();
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR1) {
// Clear focus to avoid ListView bug in Jelly Bean MR1.
((SimpleMonthView) child).clearAccessibilityFocus();
}
return focus;
}
}
......
......@@ -148,6 +148,11 @@ public class SimpleMonthAdapter extends BaseAdapter implements OnDayClickListene
return position;
}
@Override
public boolean hasStableIds() {
return true;
}
@SuppressLint("NewApi")
@SuppressWarnings("unchecked")
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment