调整头像相关

This commit is contained in:
zlzw 2023-08-18 14:48:33 +08:00
parent 8f9d558043
commit d4549793d1
3 changed files with 14 additions and 2 deletions

View File

@ -4,7 +4,6 @@ import android.content.Context;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.util.Log; import android.util.Log;
import android.view.ViewGroup;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@ -130,6 +129,7 @@ public class LiveExoPlayerManager {
@Override @Override
public void onPlaybackStateChanged(int playbackState) { public void onPlaybackStateChanged(int playbackState) {
Player.Listener.super.onPlaybackStateChanged(playbackState); Player.Listener.super.onPlaybackStateChanged(playbackState);
listener.onPlaybackStateChanged(playbackState);
Log.i(TAG, "onPlaybackStateChanged 1: " + playbackState); Log.i(TAG, "onPlaybackStateChanged 1: " + playbackState);
if (playbackState == Player.STATE_READY && !player1.isPlaying()) { if (playbackState == Player.STATE_READY && !player1.isPlaying()) {
player2.stop(); player2.stop();
@ -188,6 +188,9 @@ public class LiveExoPlayerManager {
public void onIsLoadingChanged(boolean isLoading) { public void onIsLoadingChanged(boolean isLoading) {
Player.Listener.super.onIsLoadingChanged(isLoading); Player.Listener.super.onIsLoadingChanged(isLoading);
Log.i(TAG, "onIsLoadingChanged: 1 " + isLoading); Log.i(TAG, "onIsLoadingChanged: 1 " + isLoading);
if (listener != null) {
listener.onIsLoadingChanged(isLoading);
}
} }
@Override @Override

View File

@ -1243,9 +1243,11 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
Player.Listener.super.onPlaybackStateChanged(playbackState); Player.Listener.super.onPlaybackStateChanged(playbackState);
if (playbackState == Player.STATE_BUFFERING) { if (playbackState == Player.STATE_BUFFERING) {
//showLoadingDialog(); //showLoadingDialog();
//mLoading.setVisibility(View.VISIBLE);
OkDownload.getInstance().pauseAll(); OkDownload.getInstance().pauseAll();
Log.i(TAG, "onPlaybackStateChanged: 缓存中"); Log.i(TAG, "onPlaybackStateChanged: 缓存中");
} else { } else {
//mLoading.setVisibility(View.INVISIBLE);
Log.i(TAG, "onPlaybackStateChanged: 播放中"); Log.i(TAG, "onPlaybackStateChanged: 播放中");
} }
} }

View File

@ -128,10 +128,12 @@ public class EditProfileActivity extends AbsActivity {
@Override @Override
public void onSuccess(File file) { public void onSuccess(File file) {
if (file != null) { if (file != null) {
System.err.println("头像---->收到头像文件 file = "+file.getAbsolutePath()+" | length = "+file.length());
ImgLoader.display(mContext, file, mAvatar); ImgLoader.display(mContext, file, mAvatar);
MainHttpUtil.updateAvatar(file, new HttpCallback() { MainHttpUtil.updateAvatar(file, new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
System.err.println("头像---->上传头像文件成功");
Log.e("updateAvatar", "code:" + code + " msg:" + msg + " info[0]:" + info[0].toString()); Log.e("updateAvatar", "code:" + code + " msg:" + msg + " info[0]:" + info[0].toString());
if (code == 0 && info.length > 0) { if (code == 0 && info.length > 0) {
ToastUtil.show(R.string.edit_profile_update_avatar_success); ToastUtil.show(R.string.edit_profile_update_avatar_success);
@ -140,6 +142,9 @@ public class EditProfileActivity extends AbsActivity {
JSONObject obj = JSON.parseObject(info[0]); JSONObject obj = JSON.parseObject(info[0]);
bean.setAvatar(obj.getString("avatar")); bean.setAvatar(obj.getString("avatar"));
bean.setAvatarThumb(obj.getString("avatarThumb")); bean.setAvatarThumb(obj.getString("avatarThumb"));
mUserBean.setAvatar(obj.getString("avatar"));
mUserBean.setAvatarThumb(obj.getString("avatarThumb"));
V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo(); V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo();
v2TIMUserFullInfo.setFaceUrl(obj.getString("avatarThumb")); v2TIMUserFullInfo.setFaceUrl(obj.getString("avatarThumb"));
V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() { V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() {
@ -418,7 +423,9 @@ public class EditProfileActivity extends AbsActivity {
R.string.camera, R.string.alumb, R.string.me_edit_avatar_system}, new DialogUitl.StringArrayDialogCallback() { R.string.camera, R.string.alumb, R.string.me_edit_avatar_system}, new DialogUitl.StringArrayDialogCallback() {
@Override @Override
public void onItemClick(String text, int tag) { public void onItemClick(String text, int tag) {
if (Integer.parseInt(IMLoginManager.get(mContext).getUserInfo().getLevel()) < 5 && tag != R.string.me_edit_avatar_system) { if ((Integer.parseInt(IMLoginManager.get(mContext).getUserInfo().getLevel()) < 5 && tag != R.string.me_edit_avatar_system)//等级小于5并且不是选择系统头像
&& !IMLoginManager.get(mContext).getUserInfo().anchorUserType()//非主播
) {
ToastUtil.show(R.string.me_edit_avatar_system_tip); ToastUtil.show(R.string.me_edit_avatar_system_tip);
return; return;
} }