Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions XBMC Remote/RemoteController.m
Original file line number Diff line number Diff line change
Expand Up @@ -586,13 +586,7 @@ - (IBAction)holdKey:(id)sender {
selector:@selector(longpressKey:)
userInfo:params
repeats:NO];

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
BOOL startVibrate = [userDefaults boolForKey:@"vibrate_preference"];
if (startVibrate) {
[[UIDevice currentDevice] playInputClick];
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}
[Utilities giveHapticFeedback];
}

- (IBAction)stopHoldKey:(id)sender {
Expand Down Expand Up @@ -839,13 +833,7 @@ - (void)processButtonPress:(NSInteger)buttonTag {

- (IBAction)startVibrate:(id)sender {
[self processButtonPress:[sender tag]];

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
BOOL startVibrate = [userDefaults boolForKey:@"vibrate_preference"];
if (startVibrate) {
[[UIDevice currentDevice] playInputClick];
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}
[Utilities giveHapticFeedback];
[[NSNotificationCenter defaultCenter] postNotificationName:@"Input.OnInputFinished" object:nil userInfo:nil];
}

Expand Down Expand Up @@ -929,6 +917,7 @@ - (void)processButtonLongPress:(NSInteger)buttonTag {
- (IBAction)handleButtonLongPress:(UILongPressGestureRecognizer*)gestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
[self processButtonLongPress:gestureRecognizer.view.tag];
[Utilities giveHapticFeedback];
}
}

Expand Down
1 change: 1 addition & 0 deletions XBMC Remote/Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ typedef NS_ENUM(NSInteger, LogoBackgroundType) {
+ (CGFloat)getTopPadding;
+ (CGFloat)getTopPaddingWithNavBar:(UINavigationController*)navCtrl;
+ (void)sendXbmcHttp:(NSString*)command;
+ (void)giveHapticFeedback;
+ (NSString*)getAppVersionString;
+ (void)checkForReviewRequest;
+ (void)checkLocalNetworkAccess;
Expand Down
12 changes: 12 additions & 0 deletions XBMC Remote/Utilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,18 @@ + (void)sendXbmcHttp:(NSString*)command {
[[NSURLSession.sharedSession dataTaskWithURL:[NSURL URLWithString:serverHTTP]] resume];
}

+ (void)giveHapticFeedback {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
BOOL feedbackEnabled = [userDefaults boolForKey:@"vibrate_preference"];
if (feedbackEnabled) {
static UIImpactFeedbackGenerator *generator;
if (!generator) {
generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
}
[generator impactOccurred];
}
}

+ (NSString*)getAppVersionString {
NSDictionary *infoDict = NSBundle.mainBundle.infoDictionary;
NSString *appVersion = [NSString stringWithFormat:@"v%@ (%@)", infoDict[@"CFBundleShortVersionString"], infoDict[(NSString*)kCFBundleVersionKey]];
Expand Down