diff options
author | Alan Viverette <alanv@google.com> | 2013-07-29 16:15:38 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2013-07-29 16:15:38 -0700 |
commit | a35f6b580aefd7bf1c7e92306e13dacd44316714 (patch) | |
tree | 94ba4b390033db7a51514212d45a6e7dfa053a18 /src | |
parent | 385d36f15358e7d035b2e89e395588eb7952ebc2 (diff) | |
download | datetimepicker-a35f6b580aefd7bf1c7e92306e13dacd44316714.tar.gz |
Only clear A11y focus in date picker on MR1. Expose stable IDs.
BUG: 8659961
Change-Id: I15be1c7208b75f1e85d644299437500c389f45ee
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/datetimepicker/date/DayPickerView.java | 7 | ||||
-rw-r--r-- | src/com/android/datetimepicker/date/SimpleMonthAdapter.java | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/datetimepicker/date/DayPickerView.java b/src/com/android/datetimepicker/date/DayPickerView.java index 0147d4a..e57a7fa 100644 --- a/src/com/android/datetimepicker/date/DayPickerView.java +++ b/src/com/android/datetimepicker/date/DayPickerView.java @@ -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; } } diff --git a/src/com/android/datetimepicker/date/SimpleMonthAdapter.java b/src/com/android/datetimepicker/date/SimpleMonthAdapter.java index c6b615c..b8d13d8 100644 --- a/src/com/android/datetimepicker/date/SimpleMonthAdapter.java +++ b/src/com/android/datetimepicker/date/SimpleMonthAdapter.java @@ -148,6 +148,11 @@ public class SimpleMonthAdapter extends BaseAdapter implements OnDayClickListene return position; } + @Override + public boolean hasStableIds() { + return true; + } + @SuppressLint("NewApi") @SuppressWarnings("unchecked") @Override |