flurry / flurry-android-sdk

Flurry Android SDK API reference documentation
Apache License 2.0
21 stars 3 forks source link

FlurryAdNativeAsset.loadAssetIntoView() should note that videos should be loaded into a RelativeLayout #5

Open davidliu opened 5 years ago

davidliu commented 5 years ago

When using loadAssetIntoView for a video, Flurry will add two views to the viewgroup passed into the method. However, due to an internal behavior, one of these views will overwrite its own layout params with a RelativeLayout.LayoutParams in onConfigurationChanged(). Because of this, if the viewgroup passed in is not a RelativeLayout, it will crash whenever configuration changes (e.g. rotation).

I suggest at the very least documenting this behavior within the loadAssetIntoView documentation, but I additionally suggest either enforce runtime checks telling integrating devs of this requirement or getting rid of this behavior altogether.