Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add a stale state to UserLocationView #4799

Closed

Description

@tobrun

Adds the possibility to change the UserLocationView state to stale. This happens when we haven't recevied a location update for some time. The default implementation will change the circle color from blue to a gray color. This state should be configurable and customisable (tint and drawable).

Activity

  1. added
    Android
    on Apr 22, 2016
  2. tobrun commented on May 11, 2016

    @tobrun
    MemberAuthor

    old implementation

    private boolean isStale(Location location) {
            if (location != null && mMyBearingTrackingMode != MyBearingTracking.COMPASS) {
                long ageInNanos;
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                    ageInNanos = SystemClock.elapsedRealtimeNanos() -
                            location.getElapsedRealtimeNanos();
                } else {
                    ageInNanos = (System.currentTimeMillis() - location.getTime()) * 1000 * 1000;
                }
                final long oneMinuteInNanos = 60L * 1000 * 1000 * 1000;
                return ageInNanos > oneMinuteInNanos;
            } else {
                return false;
            }
        }
  3. added
    good first issue
    on Oct 20, 2016
  4. tobrun commented on Aug 14, 2017

    @tobrun
    MemberAuthor

    This is happening for MyLocationLayer in mapbox/mapbox-plugins-android#58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidfeaturegood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions