From 96fdfd1040b34c0bad07526c2418eeb3928af3af Mon Sep 17 00:00:00 2001 From: adam1929 <103995671+adam1929@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:45:18 +0200 Subject: [PATCH] Scrolable InApp CB screen in example app --- .../fragments/InAppContentBlocksFragment.kt | 5 + .../layout/fragment_inapp_content_blocks.xml | 143 +++++++++--------- 2 files changed, 80 insertions(+), 68 deletions(-) diff --git a/app/src/main/java/com/exponea/example/view/fragments/InAppContentBlocksFragment.kt b/app/src/main/java/com/exponea/example/view/fragments/InAppContentBlocksFragment.kt index b2cae217..31c175fe 100644 --- a/app/src/main/java/com/exponea/example/view/fragments/InAppContentBlocksFragment.kt +++ b/app/src/main/java/com/exponea/example/view/fragments/InAppContentBlocksFragment.kt @@ -2,6 +2,7 @@ package com.exponea.example.view.fragments import android.content.ActivityNotFoundException import android.content.Intent +import android.content.res.Resources import android.net.Uri import android.os.Bundle import android.view.LayoutInflater @@ -126,6 +127,10 @@ class InAppContentBlocksFragment : BaseFragment() { private fun prepareExampleListCbPlaceholder() { content_blocks_list?.layoutManager = LinearLayoutManager(requireContext()) + content_blocks_list?.layoutParams?.apply { + height = Resources.getSystem().getDisplayMetrics().heightPixels / 2 + } + content_blocks_list?.layoutParams = content_blocks_list?.layoutParams val data = ArrayList() for (i in 1..1000) { val icon = listOf( diff --git a/app/src/main/res/layout/fragment_inapp_content_blocks.xml b/app/src/main/res/layout/fragment_inapp_content_blocks.xml index a3b6fcd2..a08820cb 100644 --- a/app/src/main/res/layout/fragment_inapp_content_blocks.xml +++ b/app/src/main/res/layout/fragment_inapp_content_blocks.xml @@ -1,86 +1,93 @@ - + tools:context=".view.MainActivity"> - + android:padding="12dp"> - + - + - + - + - + - + - + - + - + - - \ No newline at end of file + + + + + + + \ No newline at end of file