Skip to content

IterableEmbeddedView LayoutParms have 0 Height #997

@nseidman-play2pay

Description

@nseidman-play2pay

✍️ Issue Description

Please provide a clear and concise description of the issue you are experiencing.

📋 Steps to Reproduce

  1. Use IterableEmbeddedView and configure Media Url in a campaign

👤 Iterable orgId: play2pay

📦 Iterable SDK version: 3.6.5

📲 Android OS version: all


Observe that the height of the IterableEmbeddedView is 0.
Image

A workaround is to manually set WRAP_CONTENT on the layoutparams of com.iterable.iterableapi.ui.R.id.embedded_message_image, therefore it's proven that the IterableEmbeddedView requires correction to it's xml implementation to match the preview displayed in a campaign. When fixing this issue please also set or allow configuration of a proper scaleType so we can achieve display in the app equivalent to the campaign preview.

Currently the workaround for this defect is the following, which is not optimal:

fragment.childFragmentManager.registerFragmentLifecycleCallbacks(object : FragmentManager.FragmentLifecycleCallbacks() { override fun onFragmentViewCreated(fm: FragmentManager, fragment: Fragment, v: View, savedInstanceState: Bundle?) { if(fragment is IterableEmbeddedView) { val embeddedMessageImageView: ImageView? = fragment.view?.findViewById(com.iterable.iterableapi.ui.R.id.embedded_message_image) embeddedMessageImageView?.layoutParams = ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, fragment.requireActivity().dpToPx(200)) embeddedMessageImageView?.scaleType = ImageView.ScaleType.CENTER_INSIDE embeddedMessageImageView?.adjustViewBounds = true } }}, false )

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions