Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
bc1dced0a2
1 changed files with 19 additions and 9 deletions
|
@ -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);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue