Open barbeau opened 6 years ago
Seems that this is related to the RealtimeIndicatorView.initAnimation()
method, as this is where the animation for the concentric circles is kicked off. In the master
branch we're instantiating new animations without canceling the old ones. However, I tried adding:
if (mAnimation1 != null) {
clearAnimation();
if (UIUtils.canCancelAnimation()) {
animate().cancel();
}
}
...before adding the new animation but that didn't seem to change anything.
We're also using a custom org.onebusaway.android.util.ArrayAdapter
that extends the platform ArrayAdapter
- not sure if this is related.
So if I comment out the code in ArrayAdapter
that recycles the view (without any other changes to master
branch), then everything works fine - the animations continue and from some quick testing it seems that the indicator is always the correct color:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view;
//if (convertView == null) {
view = mInflater.inflate(mLayoutId, parent, false);
// } else {
// view = convertView;
// }
T item = getItem(position);
So it's definitely an issue with re-using the same View object. I'm assuming the View initialization or animation platform code changed in Android N which has triggered this issue.
Summary:
When you view the list of arrival times, if you scroll down the list the realtime indicator view (to the right of "min") stops animating. If you scroll back up, the color of some views may not match the color of the "min" text.
Steps to reproduce:
Expected behavior:
Realtime indicator should continue animating and should always match color of "min" text
Observed behavior:
All realtime indicators stop animating, and some don't match the color of the "min" text (intermittent)
Device and Android version:
I first noticed this on LG G5 Android 7.0 update - I don't think this happened on the Android 6 version. Also happens on Samsung Galaxy S8+ with Samsung beta Android 8.0
Screenshots:
See above