Authored by Justin R. Miller

fix tint adjustment dimming

... ... @@ -48,6 +48,7 @@
#import "RMLoadingTileView.h"
#import "RMUserLocation.h"
#import "RMUserTrackingBarButtonItem.h"
#import "RMAttributionViewController.h"
... ... @@ -119,6 +120,14 @@
#pragma mark -
@interface RMUserTrackingBarButtonItem (PrivateMethods)
@property (nonatomic, assign) UIViewTintAdjustmentMode tintAdjustmentMode;
@end
#pragma mark -
@implementation RMMapView
{
id <RMMapViewDelegate> _delegate;
... ... @@ -188,6 +197,8 @@
UIImageView *_userHeadingTrackingView;
UIImageView *_userHaloTrackingView;
RMUserTrackingBarButtonItem *_userTrackingBarButtonItem;
UIViewController *_viewControllerPresentingAttribution;
UIButton *_attributionButton;
UIPopoverController *_attributionPopover;
... ... @@ -2645,6 +2656,15 @@
//
((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [self.tintColor colorWithAlphaComponent:0.1];
}
if (_userTrackingBarButtonItem)
{
if (self.tintAdjustmentMode == UIViewTintAdjustmentModeDimmed || _userTrackingBarButtonItem.tintAdjustmentMode == UIViewTintAdjustmentModeDimmed)
{
_userTrackingBarButtonItem.tintAdjustmentMode = self.tintAdjustmentMode;
_userTrackingBarButtonItem.tintColor = self.tintColor;
}
}
}
#pragma mark -
... ... @@ -3726,6 +3746,11 @@
}
}
- (void)setUserTrackingBarButtonItem:(RMUserTrackingBarButtonItem *)userTrackingBarButtonItem
{
_userTrackingBarButtonItem = userTrackingBarButtonItem;
}
#pragma mark -
#pragma mark Attribution
... ...
... ... @@ -38,12 +38,21 @@ typedef enum {
RMUserTrackingButtonStateHeading = 3
} RMUserTrackingButtonState;
@interface RMMapView (PrivateMethods)
@property (nonatomic, weak) RMUserTrackingBarButtonItem *userTrackingBarButtonItem;
@end
#pragma mark -
@interface RMUserTrackingBarButtonItem ()
@property (nonatomic, strong) UISegmentedControl *segmentedControl;
@property (nonatomic, strong) UIImageView *buttonImageView;
@property (nonatomic, strong) UIActivityIndicatorView *activityView;
@property (nonatomic, assign) RMUserTrackingButtonState state;
@property (nonatomic, assign) UIViewTintAdjustmentMode tintAdjustmentMode;
- (void)createBarButtonItem;
- (void)updateState;
... ... @@ -139,6 +148,8 @@ typedef enum {
[_mapView addObserver:self forKeyPath:@"userTrackingMode" options:NSKeyValueObservingOptionNew context:nil];
[_mapView addObserver:self forKeyPath:@"userLocation.location" options:NSKeyValueObservingOptionNew context:nil];
_mapView.userTrackingBarButtonItem = self;
[self updateState];
}
}
... ...