# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1635181621 0 # Node ID 856d3c8b559ffb0145c059f139ef1529ff120900 # Parent c1482518b6434c60c2086bd6d30c45b03ecc6577 Android: Fix an exception when displaying a notebook with a placeholder. Before a page is packed, I put in a placeholder... the placeholder needs to be MATCH_PARENT to be in a ViewPager2.. create the placeholder MATCH_PARENT. diff -r c1482518b643 -r 856d3c8b559f android/DWindows.kt --- a/android/DWindows.kt Mon Oct 25 11:29:34 2021 +0000 +++ b/android/DWindows.kt Mon Oct 25 17:07:01 2021 +0000 @@ -2172,12 +2172,17 @@ } while (adapter.currentPageID == 0L || adapter.pageList.contains(adapter.currentPageID)) pageID = adapter.currentPageID // Temporarily add a black tab with an empty layout/box + val placeholder = LinearLayout(this) + placeholder.layoutParams = LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT + ) if (front != 0) { - adapter.viewList.add(0, LinearLayout(this)) + adapter.viewList.add(0, placeholder) adapter.pageList.add(0, pageID) tabs.addTab(tab, 0) } else { - adapter.viewList.add(LinearLayout(this)) + adapter.viewList.add(placeholder) adapter.pageList.add(pageID) tabs.addTab(tab) }