Skip to content

Commit 5222840

Browse files
Merge remote-tracking branch 'origin/develop-7.0' into develop
Clean merge, apart from the files listed in 'Conflicts' Conflicts: engine/src/stackview.cpp
2 parents ab9f772 + ffe74ce commit 5222840

6 files changed

Lines changed: 44 additions & 14 deletions

File tree

docs/notes/bugfix-16368.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Hiding a mobile player does not automatically hide the controller on Android

docs/notes/bugfix-16391.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Going to a card forces a stack onscreen

engine/src/java/com/runrev/android/nativecontrol/ExtVideoView.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,17 @@ else if (mFdWithOffset)
308308
return;
309309
}
310310
}
311+
312+
// PM-2015-11-05: [[ Bug 16368 ]] Toggling the visibility of the android player should show/hide the controller (if any)
313+
public void setControllerVisible(boolean p_visible)
314+
{
315+
if (mMediaController != null ){
316+
if (p_visible)
317+
mMediaController.show(0);
318+
else
319+
mMediaController.hide();
320+
}
321+
}
311322

312323
public void setMediaController(MediaController controller) {
313324
if (mMediaController != null) {

engine/src/java/com/runrev/android/nativecontrol/VideoControl.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,15 @@ public void setShowController(boolean show)
163163
else
164164
m_video_view.setMediaController(null);
165165
}
166-
166+
167+
// PM-2015-11-05: [[ Bug 16368 ]] Toggling the visibility of the android player should show/hide the controller (if any)
168+
// Override setVisible() of NativeControl
169+
public void setVisible(boolean p_visible)
170+
{
171+
m_video_view.setControllerVisible(p_visible);
172+
super.setVisible(p_visible);
173+
}
174+
167175
public void setCurrentTime(int msec)
168176
{
169177
m_video_view.seekTo(msec);

engine/src/stack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ class MCStack : public MCObject
406406

407407
// IM-2014-01-16: [[ StackScale ]] Ensure the view rect & transform are in sync with the configured view properties
408408
// (stack viewport, fullscreen mode, fullscreen, scale factor)
409-
void view_update_transform(void);
409+
void view_update_transform(bool p_ensure_onscreen = false);
410410

411411
// IM-2014-01-16: [[ StackScale ]] Calculate the new view rect, transform, and adjusted stack rect for the given stack rect
412412
void view_calculate_viewports(const MCRectangle &p_stack_rect, MCRectangle &r_adjusted_stack_rect, MCRectangle &r_view_rect, MCGAffineTransform &r_transform);

engine/src/stackview.cpp

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void MCStack::view_set_content_scale(MCGFloat p_scale)
214214
m_view_content_scale = p_scale;
215215

216216
// IM-2014-01-16: [[ StackScale ]] Update view transform after changing view property
217-
view_update_transform();
217+
view_update_transform(true);
218218
// IM-2014-10-22: [[ Bug 13746 ]] Update window mask when stack scale changes
219219
loadwindowshape();
220220
}
@@ -427,7 +427,7 @@ void MCStack::view_calculate_viewports(const MCRectangle &p_stack_rect, MCRectan
427427
r_transform = MCGAffineTransformConcat(view_get_stack_transform(t_mode, MCGRectangleGetIntegerBounds(t_scaled_rect), t_view_rect), t_transform);
428428
}
429429

430-
void MCStack::view_update_transform(void)
430+
void MCStack::view_update_transform(bool p_ensure_onscreen)
431431
{
432432
MCRectangle t_view_rect;
433433
MCGAffineTransform t_transform;
@@ -452,21 +452,30 @@ void MCStack::view_update_transform(void)
452452
}
453453

454454
// PM-2015-07-17: [[ Bug 13754 ]] Make sure stack does not disappear off screen when changing the scalefactor
455-
MCRectangle t_bounded_rect, t_screen_rect;
456-
457-
// AL-2015-10-01: [[ Bug 16017 ]] Remember location of stacks on a second monitor
458-
const MCDisplay* t_nearest_display = MCscreen -> getnearestdisplay(t_view_rect);
459-
if (t_nearest_display != NULL)
455+
MCRectangle t_bounded_rect;
456+
if (p_ensure_onscreen)
460457
{
461-
t_screen_rect = t_nearest_display -> viewport;
462-
t_bounded_rect = MCU_bound_rect(t_view_rect, t_screen_rect . x, t_screen_rect . y, t_screen_rect . width, t_screen_rect . height);
458+
// AL-2015-10-01: [[ Bug 16017 ]] Remember location of stacks on a second monitor
459+
const MCDisplay* t_nearest_display;
460+
t_nearest_display = MCscreen -> getnearestdisplay(t_view_rect);
461+
462+
if (t_nearest_display != nil)
463+
{
464+
MCRectangle t_screen_rect;
465+
t_screen_rect = t_nearest_display -> viewport;
466+
t_bounded_rect = MCU_bound_rect(t_view_rect, t_screen_rect . x, t_screen_rect . y, t_screen_rect . width, t_screen_rect . height);
467+
}
468+
else
469+
{
470+
// In noUI mode, we don't have a nearest display.
471+
t_bounded_rect = MCU_bound_rect(t_view_rect, 0, 0, MCscreen -> getwidth(), MCscreen -> getheight());
472+
}
463473
}
464474
else
465475
{
466-
// In noUI mode, we don't have a nearest display.
467-
t_bounded_rect = MCU_bound_rect(t_view_rect, 0, 0, MCscreen -> getwidth(), MCscreen -> getheight());
476+
t_bounded_rect = t_view_rect;
468477
}
469-
478+
470479
// IM-2014-01-16: [[ StackScale ]] Update view rect if needed
471480
view_setrect(t_bounded_rect);
472481
}

0 commit comments

Comments
 (0)