fix [修复]

This commit is contained in:
hch 2024-04-07 17:29:08 +08:00
parent 7072aadcb6
commit 1e91f4c716
23 changed files with 107 additions and 35 deletions

View File

@ -295,3 +295,7 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
-keep class com.shayu.lib_google.**{*;} -keep class com.shayu.lib_google.**{*;}
-keep class com.shayu.lib_huawei.**{*;} -keep class com.shayu.lib_huawei.**{*;}
-keep class com.qiniu.**{*;}
-keep class com.qiniu.**{public <init>();}
-ignorewarnings

View File

@ -23,3 +23,6 @@
# If you keep the line number information, uncomment this to # If you keep the line number information, uncomment this to
# hide the original source file name. # hide the original source file name.
#-renamesourcefileattribute SourceFile #-renamesourcefileattribute SourceFile
-keep class com.qiniu.**{*;}
-keep class com.qiniu.**{public <init>();}
-ignorewarnings

View File

@ -89,4 +89,17 @@ public class UploadBean {
public void setTag(Object tag) { public void setTag(Object tag) {
mTag = tag; mTag = tag;
} }
@Override
public String toString() {
return "UploadBean{" +
"mOriginFile=" + mOriginFile +
", mCompressFile=" + mCompressFile +
", mRemoteFileName='" + mRemoteFileName + '\'' +
", mRemoteAccessUrl='" + mRemoteAccessUrl + '\'' +
", mSuccess=" + mSuccess +
", mType=" + mType +
", mTag=" + mTag +
'}';
}
} }

View File

@ -50,7 +50,8 @@ public class UploadQnImpl implements UploadStrategy {
mCompletionHandler = new UpCompletionHandler() { mCompletionHandler = new UpCompletionHandler() {
@Override @Override
public void complete(String key, ResponseInfo info, JSONObject response) { public void complete(String key, ResponseInfo info, JSONObject response) {
L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null)); System.out.println("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
//L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
try { try {
assert response != null; assert response != null;
mList.get(mIndex).setRemoteAccessUrl(response.getString("key")); mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
@ -93,6 +94,7 @@ public class UploadQnImpl implements UploadStrategy {
@Override @Override
public void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback, boolean isImg) { public void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback, boolean isImg) {
System.err.println("-------upload------>" + list.size());
if (callback == null) { if (callback == null) {
return; return;
} }
@ -122,6 +124,7 @@ public class UploadQnImpl implements UploadStrategy {
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) { if (code == 0 && info.length > 0) {
mToken = info[0]; mToken = info[0];
System.err.println("-------上传的token------>" + mToken);
L.e(TAG, "-------上传的token------>" + mToken); L.e(TAG, "-------上传的token------>" + mToken);
uploadNext(); uploadNext();
} }
@ -145,10 +148,13 @@ public class UploadQnImpl implements UploadStrategy {
while (mIndex < mList.size() && (bean = mList.get(mIndex)).getOriginFile() == null) { while (mIndex < mList.size() && (bean = mList.get(mIndex)).getOriginFile() == null) {
mIndex++; mIndex++;
} }
System.err.println("-------mIndex >= mList.size() mIndex------>" + mIndex);
if (mIndex >= mList.size()) { if (mIndex >= mList.size()) {
System.err.println("-------mIndex >= mList.size()------>" + mList.size());
if (mUploadCallback != null) { if (mUploadCallback != null) {
mUploadCallback.onFinish(mList, true); mUploadCallback.onFinish(mList, true);
} }
System.err.println("-------mIndex >= mList.returnreturnreturnreturn------>" + mList.size());
return; return;
} }
if (bean.getType() == UploadBean.IMG) { if (bean.getType() == UploadBean.IMG) {
@ -158,7 +164,10 @@ public class UploadQnImpl implements UploadStrategy {
} else if (bean.getType() == UploadBean.VOICE) { } else if (bean.getType() == UploadBean.VOICE) {
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".m4a")); bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".m4a"));
} }
if (bean.getType() == UploadBean.IMG && mNeedCompress) { System.err.println("-------mIndex >= bean.getType() == UploadBean.IMG------>" + bean);
upload(bean);
/*if (bean.getType() == UploadBean.IMG && mNeedCompress) {
System.err.println("-------UploadBean.IMG && mNeedCompress------>" + bean + "UploadBean.IMG:" + UploadBean.IMG + "__mNeedCompress" + mNeedCompress);
if (mLubanBuilder == null) { if (mLubanBuilder == null) {
mLubanBuilder = Luban.with(mContext).ignoreBy(8)//8k以下不压缩 mLubanBuilder = Luban.with(mContext).ignoreBy(8)//8k以下不压缩
.setTargetDir(CommonAppConfig.INNER_PATH).setRenameListener(new OnRenameListener() { .setTargetDir(CommonAppConfig.INNER_PATH).setRenameListener(new OnRenameListener() {
@ -186,12 +195,15 @@ public class UploadQnImpl implements UploadStrategy {
} }
mLubanBuilder.load(bean.getOriginFile()).launch(); mLubanBuilder.load(bean.getOriginFile()).launch();
} else { } else {
System.err.println("-------bean.getType() == UploadBean.IMG && mNeedCompress else");
upload(bean); upload(bean);
} }*/
} }
private void upload(UploadBean bean) { private void upload(UploadBean bean) {
System.err.println("-------upload(UploadBean bean)------>" + bean);
if (bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null) { if (bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null) {
System.err.println("bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
if (mUploadManager == null) { if (mUploadManager == null) {
Zone zone = new Zone(new ServiceAddress("http://upload-z0.qiniup.com"), new ServiceAddress("http://up-z0.qiniup.com")); Zone zone = new Zone(new ServiceAddress("http://upload-z0.qiniup.com"), new ServiceAddress("http://up-z0.qiniup.com"));
Configuration configuration = new Configuration.Builder().zone(zone).build(); Configuration configuration = new Configuration.Builder().zone(zone).build();
@ -206,6 +218,7 @@ public class UploadQnImpl implements UploadStrategy {
} }
mUploadManager.put(uploadFile, bean.getRemoteFileName(), mToken, mCompletionHandler, null); mUploadManager.put(uploadFile, bean.getRemoteFileName(), mToken, mCompletionHandler, null);
} else { } else {
System.err.println("else bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
if (mUploadCallback != null) { if (mUploadCallback != null) {
mUploadCallback.onFinish(mList, false); mUploadCallback.onFinish(mList, false);
} }

View File

@ -0,0 +1,18 @@
package com.yunbao.common.views;
public class GradientDrawable extends android.graphics.drawable.GradientDrawable {
private int startColor;
private int endColor;
public GradientDrawable(int startColor, int endColor) {
super(Orientation.TOP_BOTTOM, new int[]{startColor, endColor});
this.startColor = startColor;
this.endColor = endColor;
}
public void setColors(int startColor, int endColor) {
this.startColor = startColor;
this.endColor = endColor;
setColors(new int[]{startColor, endColor});
}
}

View File

@ -43,6 +43,13 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop" /> android:scaleType="centerCrop" />
<View
android:id="@+id/top_bg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:alpha="0.1" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"

View File

@ -71,7 +71,6 @@
android:id="@+id/del" android:id="@+id/del"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp" android:padding="10dp"
android:text="@string/delete" android:text="@string/delete"
android:textColor="#777777" android:textColor="#777777"
@ -82,8 +81,7 @@
android:id="@+id/replyTextView" android:id="@+id/replyTextView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:padding="9dp"
android:padding="10dp"
android:text="@string/dialog_message_chat_notify_btn" android:text="@string/dialog_message_chat_notify_btn"
android:textColor="#777777" android:textColor="#777777"
android:textSize="11dp" /> android:textSize="11dp" />
@ -92,9 +90,8 @@
android:id="@+id/report" android:id="@+id/report"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:padding="10dp" android:padding="9dp"
android:text="@string/chat_report" android:text="@string/chat_report"
android:textColor="#333333" android:textColor="#333333"
android:textSize="11dp" android:textSize="11dp"

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -35,4 +35,5 @@
<string name="uploading">Uploading...</string> <string name="uploading">Uploading...</string>
<string name="upload_fail">Upload failed</string> <string name="upload_fail">Upload failed</string>
<string name="please_input_content">Please fill in the publication content</string> <string name="please_input_content">Please fill in the publication content</string>
<string name="comm_details">Details</string>
</resources> </resources>

View File

@ -1500,4 +1500,5 @@
<string name="uploading">上傳中...</string> <string name="uploading">上傳中...</string>
<string name="upload_fail">上傳失敗</string> <string name="upload_fail">上傳失敗</string>
<string name="please_input_content">請填寫發佈內容</string> <string name="please_input_content">請填寫發佈內容</string>
<string name="comm_details">詳情</string>
</resources> </resources>

View File

@ -1500,4 +1500,5 @@
<string name="uploading">上傳中...</string> <string name="uploading">上傳中...</string>
<string name="upload_fail">上傳失敗</string> <string name="upload_fail">上傳失敗</string>
<string name="please_input_content">請填寫發佈內容</string> <string name="please_input_content">請填寫發佈內容</string>
<string name="comm_details">詳情</string>
</resources> </resources>

View File

@ -1498,4 +1498,5 @@
<string name="uploading">上傳中...</string> <string name="uploading">上傳中...</string>
<string name="upload_fail">上傳失敗</string> <string name="upload_fail">上傳失敗</string>
<string name="please_input_content">請填寫發佈內容</string> <string name="please_input_content">請填寫發佈內容</string>
<string name="comm_details">詳情</string>
</resources> </resources>

View File

@ -1520,5 +1520,6 @@ Limited ride And limited avatar frame</string>
<string name="uploading">上傳中...</string> <string name="uploading">上傳中...</string>
<string name="upload_fail">上傳失敗</string> <string name="upload_fail">上傳失敗</string>
<string name="please_input_content">請填寫發佈內容</string> <string name="please_input_content">請填寫發佈內容</string>
<string name="comm_details">詳情</string>
</resources> </resources>

View File

@ -7,7 +7,8 @@
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
app:cardBackgroundColor="@color/white" app:cardBackgroundColor="@color/white"
app:cardCornerRadius="15dp"> app:cardCornerRadius="15dp"
app:cardElevation="0dp">
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -22,7 +23,8 @@
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:cardCornerRadius="15dp"> app:cardCornerRadius="15dp"
app:cardElevation="0dp">
<ImageView <ImageView
android:id="@+id/img" android:id="@+id/img"
@ -105,4 +107,5 @@
</RelativeLayout> </RelativeLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View File

@ -114,6 +114,7 @@ public class CommunityDetailsActivity extends AbsActivity {
} }
private void initView() { private void initView() {
setTitle(getResources().getString(com.yunbao.main.R.string.comm_details));
liveStatus = findViewById(R.id.liveStatus); liveStatus = findViewById(R.id.liveStatus);
videoLayout = findViewById(R.id.videoLayout); videoLayout = findViewById(R.id.videoLayout);
send = findViewById(R.id.send); send = findViewById(R.id.send);

View File

@ -69,6 +69,7 @@ import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.GradientDrawable;
import com.yunbao.common.views.UserHomeImgsViewHolder; import com.yunbao.common.views.UserHomeImgsViewHolder;
import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.dialog.GiftWallDialog; import com.yunbao.live.dialog.GiftWallDialog;
@ -163,6 +164,7 @@ public class UserHomeActivity extends AbsActivity {
private Map<String, String> gotoRoomKey = new HashMap<>(); private Map<String, String> gotoRoomKey = new HashMap<>();
private TextView authorNum; private TextView authorNum;
private TextView levelNum; private TextView levelNum;
private View top_bg;
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
@ -496,6 +498,9 @@ public class UserHomeActivity extends AbsActivity {
} }
private void initView() { private void initView() {
top_bg = findViewById(R.id.top_bg);
GradientDrawable gradientDrawable = new GradientDrawable(Color.TRANSPARENT, Color.GRAY);
top_bg.setBackground(gradientDrawable);
authorNum = findViewById(R.id.authorlNum); authorNum = findViewById(R.id.authorlNum);
levelNum = findViewById(R.id.levelNum); levelNum = findViewById(R.id.levelNum);
fanName = findViewById(R.id.fanName); fanName = findViewById(R.id.fanName);

View File

@ -63,10 +63,10 @@ public abstract class AbsMainHomeParentComViewHolder extends AbsMainViewHolder {
for (int i = 0; i < simplePagerTitleViewList.size(); i++) { for (int i = 0; i < simplePagerTitleViewList.size(); i++) {
if (index == i) { if (index == i) {
simplePagerTitleViewList.get(i).setVisibility(View.VISIBLE); simplePagerTitleViewList.get(i).setVisibility(View.VISIBLE);
textViewList.get(i).setTextSize(20); textViewList.get(i).setTextSize(22);
} else { } else {
simplePagerTitleViewList.get(i).setVisibility(View.INVISIBLE); simplePagerTitleViewList.get(i).setVisibility(View.INVISIBLE);
textViewList.get(i).setTextSize(18); textViewList.get(i).setTextSize(16);
} }
} }
} }
@ -168,7 +168,7 @@ public abstract class AbsMainHomeParentComViewHolder extends AbsMainViewHolder {
if (index == 3) { if (index == 3) {
return; return;
} }
titleText.setTextSize(20); titleText.setTextSize(22);
} }
@Override @Override
@ -176,7 +176,7 @@ public abstract class AbsMainHomeParentComViewHolder extends AbsMainViewHolder {
if (index == 3) { if (index == 3) {
return; return;
} }
titleText.setTextSize(18); titleText.setTextSize(16);
} }
@Override @Override

View File

@ -5,7 +5,7 @@
android:id="@+id/mainSlideMenu" android:id="@+id/mainSlideMenu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="#F7F7F7"
app:contentAlpha="0.5" app:contentAlpha="0.5"
app:contentToggle="true" app:contentToggle="true"
app:slideMode="left" app:slideMode="left"

View File

@ -8,6 +8,7 @@
<com.yunbao.common.custom.MyViewPager <com.yunbao.common.custom.MyViewPager
android:id="@+id/viewPager" android:id="@+id/viewPager"
android:background="@mipmap/bg_main_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:canScroll="false" /> app:canScroll="false" />
@ -47,7 +48,7 @@
android:layout_weight="1" android:layout_weight="1"
app:tbn_checked="true" app:tbn_checked="true"
app:tbn_icon_array_id="@array/main_tab_home" app:tbn_icon_array_id="@array/main_tab_home"
app:tbn_icon_size="28dp" app:tbn_icon_size="25dp"
app:tbn_text_color_checked="@color/colorMainTab" app:tbn_text_color_checked="@color/colorMainTab"
app:tbn_text_color_unchecked="@color/gray1" app:tbn_text_color_unchecked="@color/gray1"
app:tbn_text_size="11sp" app:tbn_text_size="11sp"
@ -59,7 +60,7 @@
android:layout_marginRight="60dp" android:layout_marginRight="60dp"
android:layout_weight="1" android:layout_weight="1"
app:tbn_icon_array_id="@array/main_tab_video" app:tbn_icon_array_id="@array/main_tab_video"
app:tbn_icon_size="28dp" app:tbn_icon_size="25dp"
app:tbn_text_color_checked="@color/colorMainTab" app:tbn_text_color_checked="@color/colorMainTab"
app:tbn_text_color_unchecked="@color/gray1" app:tbn_text_color_unchecked="@color/gray1"
app:tbn_text_size="11sp" app:tbn_text_size="11sp"
@ -70,7 +71,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
app:tbn_icon_array_id="@array/main_tab_list" app:tbn_icon_array_id="@array/main_tab_list"
app:tbn_icon_size="28dp" app:tbn_icon_size="25dp"
app:tbn_text_color_checked="@color/colorMainTab" app:tbn_text_color_checked="@color/colorMainTab"
app:tbn_text_color_unchecked="@color/gray1" app:tbn_text_color_unchecked="@color/gray1"
app:tbn_text_size="11sp" app:tbn_text_size="11sp"
@ -81,7 +82,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
app:tbn_icon_array_id="@array/main_tab_chat" app:tbn_icon_array_id="@array/main_tab_chat"
app:tbn_icon_size="28dp" app:tbn_icon_size="25dp"
app:tbn_text_color_checked="@color/colorMainTab" app:tbn_text_color_checked="@color/colorMainTab"
app:tbn_text_color_unchecked="@color/gray1" app:tbn_text_color_unchecked="@color/gray1"
app:tbn_text_size="11sp" app:tbn_text_size="11sp"

View File

@ -43,13 +43,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="5dp" android:layout_marginTop="6dp"
android:layout_toRightOf="@+id/indicator" android:layout_toRightOf="@+id/indicator"
android:gravity="center" android:gravity="center"
android:paddingTop="1dp" android:paddingTop="1dp"
android:text="@string/main_type_theater" android:text="@string/main_type_theater"
android:textColor="@color/black1" android:textColor="@color/black1"
android:textSize="18dp" android:textSize="16dp"
android:textStyle="bold" /> android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>

View File

@ -58,11 +58,15 @@ public class VideoPlayViewHolder extends AbsViewHolder implements View.OnClickLi
} }
private void intiPlayView() { private void intiPlayView() {
DefaultLoadControl control = new DefaultLoadControl.Builder().setPrioritizeTimeOverSizeThresholds(false).setBackBuffer(10_000, true).setBufferDurationsMs(500, 5_000, 150, 200).build(); DefaultLoadControl control = new DefaultLoadControl.Builder()
.setPrioritizeTimeOverSizeThresholds(false)
.setBackBuffer(10_000, true)
.setBufferDurationsMs(500, 5_000, 150, 200)
.build();
mPlayer = new ExoPlayer.Builder(mContext).setLoadControl(control).build(); mPlayer = new ExoPlayer.Builder(mContext).setLoadControl(control).build();
placeholderView = findViewById(com.yunbao.live.R.id.placeholderView); placeholderView = findViewById(com.yunbao.live.R.id.placeholderView);
mPlayer = new ExoPlayer.Builder(mContext).setLoadControl(control).build(); mPlayer = new ExoPlayer.Builder(mContext).setLoadControl(control).build();
mPlayer.setVideoScalingMode(C.VIDEO_SCALING_MODE_DEFAULT); mPlayer.setVideoScalingMode(C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);
mPlayer.addListener(new Player.Listener() { mPlayer.addListener(new Player.Listener() {
@Override @Override
@ -106,7 +110,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements View.OnClickLi
} }
}); });
//placeholderView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIXED_WIDTH); //placeholderView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIXED_WIDTH);
placeholderView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FILL); placeholderView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIXED_WIDTH);//设置为自适应宽度
placeholderView.requestLayout(); placeholderView.requestLayout();
placeholderView.setKeepContentOnPlayerReset(false); placeholderView.setKeepContentOnPlayerReset(false);
placeholderView.setPlayer(mPlayer); placeholderView.setPlayer(mPlayer);
@ -149,7 +153,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements View.OnClickLi
if (mPlayer.isPlaying()) { if (mPlayer.isPlaying()) {
mPlayer.stop(); mPlayer.stop();
} }
L.e("播放视频--->" + videoBean); L.e("播放视频--->" + videoBean.getVideo());
mPlayer.setMediaItem(createMediaItem(videoBean.getVideo())); mPlayer.setMediaItem(createMediaItem(videoBean.getVideo()));
mPlayer.prepare(); mPlayer.prepare();
mPlayer.play(); mPlayer.play();

View File

@ -11,14 +11,12 @@
<ImageView <ImageView
android:id="@+id/btn_back" android:id="@+id/btn_back"
android:layout_width="40dp" android:layout_width="30dp"
android:layout_height="40dp" android:layout_height="30dp"
android:layout_marginLeft="6dp" android:layout_marginLeft="16dp"
android:layout_marginTop="30dp" android:layout_marginTop="35dp"
android:onClick="backClick" android:onClick="backClick"
android:padding="9dp" android:src="@mipmap/icon_back_new01"
android:src="@mipmap/icon_video_music_back"
android:tint="@color/white"
android:visibility="visible" /> android:visibility="visible" />
<View <View