From eb401e3f9581956bda382877150e196f92e5cceb Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Tue, 16 Feb 2021 13:58:46 +0000 Subject: [PATCH 1/2] [[ Android ]] Use AbsoluteLayout class to position native layers This patch modifies the Android native layer code to replace the current implementation based on RelativeLayout to one based on AbsouteLayout. This fixes an issue where native layers would be resized if their bounds exceed the group that contains them. --- engine/src/java/com/runrev/android/Engine.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/engine/src/java/com/runrev/android/Engine.java b/engine/src/java/com/runrev/android/Engine.java index 1eafd06ce7d..2198f5ae86c 100644 --- a/engine/src/java/com/runrev/android/Engine.java +++ b/engine/src/java/com/runrev/android/Engine.java @@ -131,7 +131,7 @@ public interface LifecycleListener private SoundModule m_sound_module; private NotificationModule m_notification_module; private NFCModule m_nfc_module; - private RelativeLayout m_view_layout; + private AbsoluteLayout m_view_layout; private PowerManager.WakeLock m_wake_lock; @@ -1095,7 +1095,7 @@ Object getNativeLayerContainer() FrameLayout t_main_view; t_main_view = ((LiveCodeActivity)getContext()).s_main_layout; - m_view_layout = new RelativeLayout(getContext()); + m_view_layout = new AbsoluteLayout(getContext()); t_main_view.addView(m_view_layout, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT)); t_main_view.bringChildToFront(m_view_layout); } @@ -1105,7 +1105,7 @@ Object getNativeLayerContainer() Object createNativeLayerContainer() { - return new RelativeLayout(getContext()); + return new AbsoluteLayout(getContext()); } // insert the view into the container, layered below p_view_above if not null. @@ -1120,7 +1120,7 @@ void addNativeViewToContainer(Object p_view, Object p_view_above, Object p_conta else t_index = t_container.getChildCount(); - t_container.addView((View)p_view, t_index, new RelativeLayout.LayoutParams(0, 0)); + t_container.addView((View)p_view, t_index, new AbsoluteLayout.LayoutParams(0, 0, 0, 0)); } void removeNativeViewFromContainer(Object p_view) @@ -1137,11 +1137,7 @@ void removeNativeViewFromContainer(Object p_view) void setNativeViewRect(Object p_view, int left, int top, int width, int height) { - RelativeLayout.LayoutParams t_layout = new RelativeLayout.LayoutParams(width, height); - t_layout.leftMargin = left; - t_layout.topMargin = top; - t_layout.addRule(RelativeLayout.ALIGN_PARENT_LEFT); - t_layout.addRule(RelativeLayout.ALIGN_PARENT_TOP); + AbsoluteLayout.LayoutParams t_layout = new AbsoluteLayout.LayoutParams(width, height, left, top); View t_view = (View)p_view; From 2689ad6a82e3549e0fe555d8613d497d74d1772c Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Tue, 16 Feb 2021 14:56:04 +0000 Subject: [PATCH 2/2] [[ Bug 23089 ]] Add release note for bug 23089 This patch adds a release note for bug 23089, where native layers would be resized to fit within a group's bounds rather than clipped --- docs/notes/bugfix-23089.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-23089.md diff --git a/docs/notes/bugfix-23089.md b/docs/notes/bugfix-23089.md new file mode 100644 index 00000000000..135cb4d3575 --- /dev/null +++ b/docs/notes/bugfix-23089.md @@ -0,0 +1 @@ +# Fix Browser Widget being resized to fit group instead of being clipped