Stipop.connect
This method connects Stipop with the activity you want to use. It has to be called after configuration is complete and requested before calling the UI popup method.
Stipop.connect(activity, userId, delegate)
Parameter | Type | Description |
---|---|---|
activity | Activity | This is necessary for Stipop to detect changes to your app's layout and dynamically trigger it according to its lifecycle. |
userId | String | Users can manage downloaded and used stickers according to their user ID. |
delegate | StipopDelegate | Interface which receives the selected sticker or sticker package. |
stipopButton | (Optional) StipopImageView | When used with StipopImageView, the button UI changes depending on whether the Stipop UI is showing or dismissing. |
StickerPickerFragment | (Optional) StickerPickerFragment | If you use custom layout picker view, at here, picker view will be shown. |
locale | (Optional) Locale | Displayed and recommended stickers vary depending on the Locale you set. The default is Locale.getDefault(). |
taskCallBack | (Optional) ((isSuccess: Boolean) -> Unit) | When the connection is finished, the success or failure of the operation is returned as a boolean. |
Fragment
Kotlin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class MyFirstFragment : Fragment(), StipopDelegate {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
// If you want to custom your PickerView's position, add StickerPickerFragment. or not, set StickerPickerFragment to null.
val fragment = supportFragmentManager.findFragmentById(R.id.picker_view_fragment) as StickerPickerFragment
Stipop.connect(
activity = requireActivity(),
userId = "userID",
delegate = this,
stipopButton = stipopPickerImageView,
StickerPickerFragment = fragment,
locale = Locale.KOREA,
taskCallBack = { isConnected ->
when(isConnected){
true -> TODO()
false -> TODO()
}
})
}
}
Was this page helpful?
We’re here to help. Contact us.