Shoplive SDK에서 제공하는 ShopLivePreview
를 이용하여 기본 In App 미리보기를 직접 구현할 수 있습니다.
// If only one of width or height is written, it is flexible.
<cloud.shoplive.sdk.ShopLivePreview
android:id="@+id/preview"
android:layout_width="width"
android:layout_height="height">
<com.example.someChildView
android:layout_width="width"
android:layout_height="height"/>
</cloud.shoplive.sdk.ShopLivePreview>
preview.start(“{accessKey}”, “{campaignKey}”)
preview.setOnClickListener {
// Preview transition animation
ShopLive.setPreviewTransitionAnimation(requireActivity(), binding.preview)
ShopLive.play(requireActivity(), campaignKey)
preview.release()
}
// For lifecycle observing preview
preview.setLifecycleObserver(this.viewLifecycleOwner)