forked from organicmaps/organicmaps-tmp
commit
adb5442e5e
14 changed files with 96 additions and 58 deletions
|
@ -197,17 +197,18 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) {
|
|||
self.routingInfoPageControl.currentPage =
|
||||
(self.routingInfoPageControl.currentPage + 1) % self.routingInfoPageControl.numberOfPages;
|
||||
[self updateNavigationInfo:self.navigationInfo];
|
||||
[self refreshRoutingDiminishTimer];
|
||||
}
|
||||
|
||||
- (IBAction)routingStartTouchUpInside { [[MWMRouter router] start]; }
|
||||
- (IBAction)routingStopTouchUpInside { [[MWMRouter router] stop]; }
|
||||
- (IBAction)soundTouchUpInside:(MWMButton *)sender
|
||||
{
|
||||
BOOL const isEnable = !sender.selected;
|
||||
BOOL const isEnable = sender.selected;
|
||||
[Statistics logEvent:kStatEventName(kStatNavigationDashboard, isEnable ? kStatOn : kStatOff)];
|
||||
sender.coloring = isEnable ? MWMButtonColoringGray : MWMButtonColoringBlue;
|
||||
sender.coloring = isEnable ? MWMButtonColoringBlue : MWMButtonColoringGray;
|
||||
[MWMTextToSpeech tts].active = isEnable;
|
||||
sender.selected = isEnable;
|
||||
[self refreshRoutingDiminishTimer];
|
||||
}
|
||||
|
||||
#pragma mark - Refresh Collection View layout
|
||||
|
@ -253,7 +254,7 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) {
|
|||
MWMButton * ttsButton = self.ttsSoundButton;
|
||||
ttsButton.hidden = isPedestrianRouting || ![MWMTextToSpeech isTTSEnabled];
|
||||
if (!ttsButton.hidden)
|
||||
ttsButton.selected = [MWMTextToSpeech tts].active;
|
||||
ttsButton.selected = ![MWMTextToSpeech tts].active;
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDataSource
|
||||
|
@ -619,6 +620,7 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) {
|
|||
[_ttsSoundButton setImage:[UIImage imageNamed:@"ic_voice_off"] forState:UIControlStateSelected];
|
||||
[_ttsSoundButton setImage:[UIImage imageNamed:@"ic_voice_off"]
|
||||
forState:UIControlStateSelected | UIControlStateHighlighted];
|
||||
[self ttsButtonStatusChanged:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@interface MWMTextToSpeech : NSObject
|
||||
|
||||
+ (instancetype)tts;
|
||||
+ (MWMTextToSpeech *)tts;
|
||||
+ (BOOL)isTTSEnabled;
|
||||
+ (void)setTTSEnabled:(BOOL)enabled;
|
||||
+ (NSString *)savedLanguage;
|
||||
|
|
|
@ -56,7 +56,7 @@ vector<pair<string, string>> availableLanguages()
|
|||
|
||||
@implementation MWMTextToSpeech
|
||||
|
||||
+ (instancetype)tts
|
||||
+ (MWMTextToSpeech *)tts
|
||||
{
|
||||
static dispatch_once_t onceToken;
|
||||
static MWMTextToSpeech * tts = nil;
|
||||
|
@ -106,6 +106,7 @@ vector<pair<string, string>> availableLanguages()
|
|||
{
|
||||
LOG(LWARNING, ("[ setCategory]] error.", [err localizedDescription]));
|
||||
}
|
||||
self.active = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -145,10 +146,12 @@ vector<pair<string, string>> availableLanguages()
|
|||
if (active && ![self isValid])
|
||||
[self createSynthesizer];
|
||||
GetFramework().EnableTurnNotifications(active ? true : false);
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName:[MWMTextToSpeech ttsStatusNotificationKey]
|
||||
object:nil
|
||||
userInfo:nil];
|
||||
runAsyncOnMainQueue(^{
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName:[MWMTextToSpeech ttsStatusNotificationKey]
|
||||
object:nil
|
||||
userInfo:nil];
|
||||
});
|
||||
}
|
||||
|
||||
- (BOOL)active
|
||||
|
|
|
@ -19,5 +19,8 @@
|
|||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -2,22 +2,25 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "round_then.png"
|
||||
"filename" : "round_then.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "round_then@2x.png"
|
||||
"filename" : "round_then@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "round_then@3x.png"
|
||||
"filename" : "round_then@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -2,22 +2,25 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "sharp_left_then.png"
|
||||
"filename" : "sharp_left_then.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "sharp_left_then@2x.png"
|
||||
"filename" : "sharp_left_then@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "sharp_left_then@3x.png"
|
||||
"filename" : "sharp_left_then@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -2,22 +2,25 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "sharp_right_then.png"
|
||||
"filename" : "sharp_right_then.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "sharp_right_then@2x.png"
|
||||
"filename" : "sharp_right_then@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "sharp_right_then@3x.png"
|
||||
"filename" : "sharp_right_then@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -2,22 +2,25 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "simple_left_then.png"
|
||||
"filename" : "simple_left_then.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "simple_left_then@2x.png"
|
||||
"filename" : "simple_left_then@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "simple_left_then@3x.png"
|
||||
"filename" : "simple_left_then@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -2,22 +2,25 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "simple_right_then.png"
|
||||
"filename" : "simple_right_then.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "simple_right_then@2x.png"
|
||||
"filename" : "simple_right_then@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "simple_right_then@3x.png"
|
||||
"filename" : "simple_right_then@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -2,22 +2,25 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "slight_left_then.png"
|
||||
"filename" : "slight_left_then.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "slight_left_then@2x.png"
|
||||
"filename" : "slight_left_then@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "slight_left_then@3x.png"
|
||||
"filename" : "slight_left_then@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -2,22 +2,25 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "slight_right_then.png"
|
||||
"filename" : "slight_right_then.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "slight_right_then@2x.png"
|
||||
"filename" : "slight_right_then@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "slight_right_then@3x.png"
|
||||
"filename" : "slight_right_then@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -2,22 +2,25 @@
|
|||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "straight_then.png"
|
||||
"filename" : "straight_then.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "straight_then@2x.png"
|
||||
"filename" : "straight_then@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "straight_then@3x.png"
|
||||
"filename" : "straight_then@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -19,5 +19,8 @@
|
|||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
|
@ -19,5 +19,8 @@
|
|||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue