添加了动态修改背景图和首页按钮

修改了飘屏功能
This commit is contained in:
2025-08-13 17:31:52 +08:00
parent bd4e7912f1
commit 96e3c86cd4
38 changed files with 1507 additions and 165 deletions

View File

@@ -156,9 +156,17 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
return "";
}
private void playNextFromQueue() {
// 检查特效是否开启
if (SpUtil.getOpenEffect() != 1) {
clearQueue();
return;
}
PlayItem item = playQueue.poll();
if (item != null) {
isPlaying = false;
isPlaying = true;
Logger.d("AvatarFrameView", "Playing item, remaining queue size: " + playQueue.size());
RenderType type = null;
String ext = getFileExtension(item.url);
if ("svga".equalsIgnoreCase(ext)) {
@@ -190,43 +198,63 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
}
} else {
isPlaying = false;
Logger.d("AvatarFrameView", "Queue is empty, stop playing");
}
}
public void setSource(String url, int type2) {
// 检查特效是否开启
if (SpUtil.getOpenEffect() != 1) {
// 特效关闭时清空队列并停止播放
clearQueue();
return;
}
// 添加到播放队列
// playQueue.offer(new PlayItem(url, type2));
playQueue.add(new PlayItem(url, type2));
Logger.d("AvatarFrameView", "Added to queue, queue size: " + playQueue.size() + ", url: " + url);
// 如果当前没有在播放,则开始播放
if (!isPlaying) {
playNextFromQueue();
}
}
public void setSource(String url, int type2) {
if (SpUtil.getOpenEffect()==1) {
playQueue.offer(new PlayItem(url, type2));
if (!isPlaying) {
playNextFromQueue();
}
}else {
playQueue.clear();
isPlaying = false;
}
// RenderType type = null;
// if ("svga".equalsIgnoreCase(getFileExtension(url))){
// type = RenderType.SVGA;
// }else if ("mp4".equalsIgnoreCase(getFileExtension(url))){
// type = RenderType.MP4;
// public void setSource(String url, int type2) {
// if (SpUtil.getOpenEffect()==1) {
// playQueue.offer(new PlayItem(url, type2));
// if (!isPlaying) {
// playNextFromQueue();
// }
// }else {
// playQueue.clear();
// isPlaying = false;
// }
//
// clearPrevious();
// renderType = type;
// mType = type2;
// switch (type) {
// case SVGA:
// mBinding.playView.stopPlay();
// mBinding.playView.setVisibility(View.GONE);
// loadSVGA(url);
// break;
// case MP4:
//// loadMP4(url);
// mBinding.playView.setVisibility(View.VISIBLE);
// downloadAndPlayMp4(url);
// break;
// }
}
//// RenderType type = null;
//// if ("svga".equalsIgnoreCase(getFileExtension(url))){
//// type = RenderType.SVGA;
//// }else if ("mp4".equalsIgnoreCase(getFileExtension(url))){
//// type = RenderType.MP4;
//// }
////
//// clearPrevious();
//// renderType = type;
//// mType = type2;
//// switch (type) {
//// case SVGA:
//// mBinding.playView.stopPlay();
//// mBinding.playView.setVisibility(View.GONE);
//// loadSVGA(url);
//// break;
//// case MP4:
////// loadMP4(url);
//// mBinding.playView.setVisibility(View.VISIBLE);
//// downloadAndPlayMp4(url);
//// break;
//// }
// }
private void downloadAndPlayMp4(String url) {
String filePath = PathUtils.getInternalAppCachePath() + Md5Utils.getStringMD5(url) + ".mp4";