woheller69/gpscockpit

compass don't work

paulle opened this issue · 2 comments

The compass don't work. The compass scale is always grey, no blue as in the screenshot on f-droid and showing north in every position.
Android 11
Sony Xperia 4

Then your GPS position is not good enough and does not provide data on direction (bearing).

if (mGpsLocation.hasBearing()) {
        mB.gpsCont.compass.setLineColor(ContextCompat.getColor(this,R.color.accent));
        mB.gpsCont.compass.setTextColor(ContextCompat.getColor(this,R.color.dynamicFgDim));
        mB.gpsCont.compass.setShowMarker(true);
        bearing = mGpsLocation.getBearing();
      } else {
        mB.gpsCont.compass.setLineColor(ContextCompat.getColor(this,R.color.disabledStateColor));
        mB.gpsCont.compass.setTextColor(ContextCompat.getColor(this,R.color.disabledStateColor));
        mB.gpsCont.compass.setShowMarker(false);
      }

Or you are not moving. Direction is only available in GPS while moving