Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-01-03 14:21:25 +01:00
commit bc1dced0a2

View file

@ -506,17 +506,27 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
@Override @Override
public void updateCompassValue(float value) { public void updateCompassValue(float value) {
float lastHeading = heading;
heading = value; heading = value;
if(!uiHandler.hasMessages(COMPASS_REFRESH_MSG_ID)){ if(heading != null && lastheading != null && Math.abs(MapUtils.degreesDiff(lastHeading, heading)) > 3) {
Message msg = Message.obtain(uiHandler, new Runnable(){ @Override
@Override public void run() {
public void run() { amenityAdapter.notifyDataSetChanged();
amenityAdapter.notifyDataSetChanged(); }
} } else {
}); heading = lastHeading;
msg.what = COMPASS_REFRESH_MSG_ID;
uiHandler.sendMessageDelayed(msg, 100);
} }
//Comment out and use lastHeading above to see if this fixes issues seen on some devices
//if(!uiHandler.hasMessages(COMPASS_REFRESH_MSG_ID)){
// Message msg = Message.obtain(uiHandler, new Runnable(){
// @Override
// public void run() {
// amenityAdapter.notifyDataSetChanged();
// }
// });
// msg.what = COMPASS_REFRESH_MSG_ID;
// uiHandler.sendMessageDelayed(msg, 100);
//}
} }