Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-05-13 09:01:10 +02:00
commit a1c826aa79
4 changed files with 13 additions and 9 deletions

View file

@ -2,10 +2,11 @@ package net.osmand.access;
import android.app.Activity;
import android.os.Build;
import android.support.v4.view.AccessibilityDelegateCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.SparseArray;
import android.view.View;
import android.view.View.AccessibilityDelegate;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.widget.Button;
@ -14,7 +15,7 @@ import android.widget.ImageView;
import net.osmand.plus.OsmandApplication;
public class AccessibilityAssistant extends AccessibilityDelegate implements OnPageChangeListener {
public class AccessibilityAssistant extends AccessibilityDelegateCompat implements OnPageChangeListener {
private final Activity hostActivity;
private final OsmandApplication app;
@ -33,7 +34,7 @@ public class AccessibilityAssistant extends AccessibilityDelegate implements OnP
discourageUiUpdates = false;
eventsLocked = false;
focusedView = null;
monitoredPages = new SparseArray<View>();
monitoredPages = new SparseArray<>();
visiblePage = null;
visiblePageId = 0;
}
@ -68,7 +69,7 @@ public class AccessibilityAssistant extends AccessibilityDelegate implements OnP
monitoredPages.put(id, page);
if (id == visiblePageId)
visiblePage = page;
page.setAccessibilityDelegate(this);
ViewCompat.setAccessibilityDelegate(page, this);
}

View file

@ -27,6 +27,7 @@ import android.app.ActionBar;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.support.v7.app.ActionBar.OnNavigationListener;
@ -205,7 +206,7 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
View itemView = super.getDropDownView(position, convertView, parent);
itemView.setAccessibilityDelegate(accessibilityAssistant);
ViewCompat.setAccessibilityDelegate(itemView, accessibilityAssistant);
return itemView;
}
};

View file

@ -11,6 +11,7 @@ import android.os.AsyncTask;
import android.os.AsyncTask.Status;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.Toolbar;
@ -792,7 +793,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
String poiType = OsmAndFormatter.getPoiStringWithoutType(amenity, app.getSettings().MAP_PREFERRED_LOCALE.get());
label.setText(poiType);
distanceText.setText(distance);
row.setAccessibilityDelegate(accessibilityAssistant);
ViewCompat.setAccessibilityDelegate(row, accessibilityAssistant);
return (row);
}

View file

@ -6,6 +6,7 @@ import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.PopupMenu;
import android.util.TypedValue;
@ -84,9 +85,9 @@ public class ItemViewHolder {
rightImageButton = (ImageView) view.findViewById(R.id.secondaryIcon);
nameTextView = (TextView) view.findViewById(R.id.title);
view.setAccessibilityDelegate(context.getAccessibilityAssistant());
rightButton.setAccessibilityDelegate(context.getAccessibilityAssistant());
rightImageButton.setAccessibilityDelegate(context.getAccessibilityAssistant());
ViewCompat.setAccessibilityDelegate(view, context.getAccessibilityAssistant());
ViewCompat.setAccessibilityDelegate(rightButton, context.getAccessibilityAssistant());
ViewCompat.setAccessibilityDelegate(rightImageButton, context.getAccessibilityAssistant());
TypedValue typedValue = new TypedValue();
Resources.Theme theme = context.getTheme();