Closed vinaykumar2197 closed 1 year ago
Card.isDismissibleByUser = false
I am using braze's fragment view to render the content card like :
<fragment
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.braze.ui.contentcards.ContentCardsFragment"
android:id="@+id/braze_content_feed" />
class ContentFeedFragment : BaseFragment() {
@Inject
lateinit var analytics: ContentFeedScreenAnalytics
@Inject
lateinit var toolbarHandlerListener: ToolbarHandlerListener
@Inject
lateinit var statusBarHelper: StatusBarHelper
@Inject
lateinit var toggler: Toggler
@Inject
lateinit var messagingRefreshable: IPushMessagingRefreshable
val rootView: View by bindView(R.id.fragment_content_feed_root_view)
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_content_feed, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
messagingRefreshable.fetchContentCardFromRemote()
initView()
statusBarHelper.ensureStatusBarTransparent(view)
}
private fun initView() {
view?.let {
statusBarHelper.updateFitSystemWindow(rootView, true)
}
}
}
where can I put Card.isDismissibleByUser = false in the above code and what is Card object here ?
From your ContentCardFragment
, you can set an IContentCardUpdateHandler
via setContentCardUpdateHandler
. This will give you a chance to do whatever you need on the Card.
Thanks @bryanlogan. I hope copying the DefaultContentCardsUpdateHandler class file directly from above link would not result in crashes in the production. Is it properly tested?
Hi @vinaykumar2197 ,
Yes, we have extensive testing for all of the Content Card methods and classes.
Braze Android SDK Version
24.2.0
Steps To Reproduce
I don't want my users to swipe the content card to left or right. How can I disable this swiping feature?
Expected Behavior
NA
Actual Incorrect Behavior
NA
Verbose Logs
Additional Information