Skip to content

Commit 323b574

Browse files
committed
Update Android icon and add camera resolution toast.
1 parent 794fe86 commit 323b574

File tree

7 files changed

+17
-4
lines changed

7 files changed

+17
-4
lines changed
2.95 KB
Loading
1.44 KB
Loading
4 KB
Loading
5.94 KB
Loading
7.52 KB
Loading

calib_camera.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,16 @@ int main(int argc, char *argv[])
636636
}
637637
#endif
638638
if (!gPostVideoSetupDone) {
639-
639+
#ifdef ANDROID
640+
char *toast;
641+
if (asprintf(&toast, "Camera: %dx%d", vs->getVideoWidth(), vs->getVideoHeight()) < 0) {
642+
ARLOGe("asprintf");
643+
} else {
644+
SDL_AndroidShowToast(toast, 1, -1, 0, 0); // int duration = 1 = long, int gravity = -1 = don't care, int xoffset, int yoffset
645+
free(toast);
646+
}
647+
#endif
648+
640649
gCameraIsFrontFacing = false;
641650
AR2VideoParamT *vid = vs->getAR2VideoParam();
642651

iOS/ARViewController.mm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
768768

769769
if (!gPostVideoSetupDone) {
770770

771-
[ARViewController displayToastWithMessage:[NSString stringWithFormat:@"Camera: %dx%d", vs->getVideoWidth(), vs->getVideoHeight()]];
771+
[ARViewController displayToastWithMessage:[NSString stringWithFormat:@"Camera: %dx%d", vs->getVideoWidth(), vs->getVideoHeight()] durationSeconds:5.0f];
772772

773773
gCameraIsFrontFacing = false;
774774
AR2VideoParamT *vid = vs->getAR2VideoParam();
@@ -1382,7 +1382,7 @@ - (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionControl
13821382

13831383
}
13841384

1385-
+ (void)displayToastWithMessage:(NSString *)toastMessage
1385+
+ (void)displayToastWithMessage:(NSString *)toastMessage durationSeconds:(float)durationSeconds
13861386
{
13871387
[[NSOperationQueue mainQueue] addOperationWithBlock:^ {
13881388
UIWindow * keyWindow = [[UIApplication sharedApplication] keyWindow];
@@ -1400,7 +1400,7 @@ + (void)displayToastWithMessage:(NSString *)toastMessage
14001400

14011401
[keyWindow addSubview:toastView];
14021402

1403-
[UIView animateWithDuration: 3.0f
1403+
[UIView animateWithDuration: durationSeconds
14041404
delay: 0.0
14051405
options: UIViewAnimationOptionCurveEaseOut
14061406
animations: ^{
@@ -1413,6 +1413,10 @@ + (void)displayToastWithMessage:(NSString *)toastMessage
14131413
}];
14141414
}
14151415

1416+
+ (void)displayToastWithMessage:(NSString *)toastMessage {
1417+
[ARViewController displayToastWithMessage:toastMessage durationSeconds:3.5f];
1418+
}
1419+
14161420
@end
14171421

14181422
// Save parameters file and index file with info about it, then signal thread that it's ready for upload.

0 commit comments

Comments
 (0)