1:添加cp进场动画效果
2:修改cp礼物弹框 3:添加组成cp后进入心动空间跳转
This commit is contained in:
@@ -6,6 +6,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.utils.roomview.RoomCPView;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -20,6 +21,8 @@ public class QXGiftPlayerManager {
|
||||
|
||||
private GiftAnimView fullEffectView;
|
||||
private GiftAnimView chatEffectView;
|
||||
|
||||
private RoomCPView roomCPView;
|
||||
private Context context;
|
||||
|
||||
private QXGiftPlayerManager(Context context) {
|
||||
@@ -39,6 +42,15 @@ public class QXGiftPlayerManager {
|
||||
return bgEffectView;
|
||||
}
|
||||
|
||||
public RoomCPView getRoomCPView(){
|
||||
if (roomCPView==null){
|
||||
initRoomCPView();
|
||||
}
|
||||
return roomCPView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public GiftAnimView getDefaultFullEffectView() {
|
||||
if (fullEffectView == null) {
|
||||
initFullEffectView();
|
||||
@@ -62,10 +74,25 @@ public class QXGiftPlayerManager {
|
||||
bgEffectView.setBackgroundColor(0x00000000);
|
||||
bgEffectView.setClickable(false); // userInteractionEnabled = NO
|
||||
|
||||
// 添加全屏特效视图和聊天特效视图
|
||||
// 添加全屏特效视图、聊天特效视图和CP视图
|
||||
((ViewGroup) bgEffectView).addView(getDefaultFullEffectView());
|
||||
((ViewGroup) bgEffectView).addView(getDefaultChatEffectView());
|
||||
((ViewGroup) bgEffectView).addView(getRoomCPView());
|
||||
}
|
||||
|
||||
private void initRoomCPView() {
|
||||
roomCPView=new RoomCPView(context);
|
||||
roomCPView.setLayoutParams(new ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
));
|
||||
// 创建专用线程池替代GCD队列
|
||||
ExecutorService queue = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS,
|
||||
new LinkedBlockingQueue<Runnable>(),
|
||||
Executors.defaultThreadFactory());
|
||||
roomCPView.setQueue(queue);
|
||||
}
|
||||
|
||||
public void displayFullEffectView(String gift) {
|
||||
getDefaultFullEffectView().displayEffectView(gift);
|
||||
}
|
||||
@@ -78,6 +105,31 @@ public class QXGiftPlayerManager {
|
||||
getDefaultChatEffectView().displayEffectView(gift);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示CP动画
|
||||
* @param room_head1 头像1的URL
|
||||
* @param room_head2 头像2的URL
|
||||
* @param room_cp_name1 名称1
|
||||
* @param room_cp_name2 名称2
|
||||
* @param mp4Path MP4动画文件路径
|
||||
*/
|
||||
public void displayCPView(String room_head1, String room_head2, String room_cp_name1, String room_cp_name2, String mp4Path) {
|
||||
getRoomCPView().displayEffectView(room_head1, room_head2, room_cp_name1, room_cp_name2, mp4Path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启或关闭CP动画
|
||||
* @param isShow 是否显示
|
||||
*/
|
||||
public void openOrCloseCPViewWith(boolean isShow) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止CP动画
|
||||
*/
|
||||
public void stopCPPlay() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void openOrCloseEffectViewWith(boolean isShow) {
|
||||
@@ -101,6 +153,12 @@ public class QXGiftPlayerManager {
|
||||
}
|
||||
chatEffectView = null;
|
||||
}
|
||||
|
||||
if (roomCPView != null) {
|
||||
// 先调用destroyEffectView方法,它会自动从父视图中移除
|
||||
roomCPView.destroyEffectView();
|
||||
roomCPView = null;
|
||||
}
|
||||
|
||||
if (bgEffectView != null) {
|
||||
bgEffectView = null;
|
||||
@@ -114,6 +172,8 @@ public class QXGiftPlayerManager {
|
||||
if (chatEffectView != null) {
|
||||
chatEffectView.stopPlay();
|
||||
}
|
||||
if (roomCPView != null) {
|
||||
}
|
||||
}
|
||||
|
||||
private void initFullEffectView() {
|
||||
|
||||
Reference in New Issue
Block a user