From 3ab2447e800cd85c0433b65befc3c831c9db4a86 Mon Sep 17 00:00:00 2001 From: doregon Date: Tue, 27 Jul 2021 22:06:25 -0400 Subject: [PATCH] Fix version issue :fr: --- Makefile | 2 +- Natives/CustomControlsViewController.m | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b7a8fa5f..53e09282 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ else ifneq ($(filter 0,$(IOS)),) endif -all: clean version native java extras package +all: clean native java extras package version: @echo 'Starting build task - version change' diff --git a/Natives/CustomControlsViewController.m b/Natives/CustomControlsViewController.m index 206a580a..af1c91db 100644 --- a/Natives/CustomControlsViewController.m +++ b/Natives/CustomControlsViewController.m @@ -52,6 +52,9 @@ int notchOffset; width = width - notchOffset * 2; CGFloat buttonScale = ((NSNumber *) getPreference(@"button_scale")).floatValue / 100.0; + UIPanGestureRecognizer *panRecognizer; + panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(wasDragged:)]; + UILongPressGestureRecognizer *longpressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(showControlPopover:)]; longpressGesture.minimumPressDuration = 0.5; [self.view addGestureRecognizer:longpressGesture]; @@ -136,6 +139,14 @@ int notchOffset; return NO; } +- (void)wasDragged:(UIPanGestureRecognizer *)recognizer { + UIButton *button = (UIButton *)recognizer.view; + CGPoint translation = [recognizer translationInView:button]; + + button.center = CGPointMake(button.center.x + translation.x, button.center.y + translation.y); + [recognizer setTranslation:CGPointZero inView:button]; +} + -(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { if(@available(iOS 13.0, *)) { if (UITraitCollection.currentTraitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {