4_6-带货场景-互动
Updated: 2023-04-17 15:27:57
1 Feature Overview
The interactive features include quizzes, surveys, announcements, lucky draws, and check-ins. These features are highly encapsulated and easy to integrate. For specific implementation details, refer to the Core Common - Interaction page.
2 Usage Demo
To use the interactive features in a livestream shopping scenario, simply add Activity to the PLVInteractLayout layout and call its initialization method to complete the integration.
When the host initiates features such as lucky draws, the interactive application interface will automatically appear.
The example code below demonstrates only the most basic usage. For advanced usage, refer to the Core Common - Interaction page.
// PLVECLiveHomeFragment.java
private void setupInteractLayout(){
if(interactLayout == null) {
// 互动应用布局 这里使用了ViewStub
ViewStub interactLayoutViewStub = findViewById(R.id.plvec_ppt_interact_layout);
interactLayout = (IPLVInteractLayout) interactLayoutViewStub.inflate();
// 调用init()方法,完成初始化
interactLayout.init();
}
}
