fix [修复]
This commit is contained in:
3
common/proguard-rules.pro
vendored
3
common/proguard-rules.pro
vendored
@@ -23,3 +23,6 @@
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
-keep class com.qiniu.**{*;}
|
||||
-keep class com.qiniu.**{public <init>();}
|
||||
-ignorewarnings
|
||||
@@ -89,4 +89,17 @@ public class UploadBean {
|
||||
public void setTag(Object tag) {
|
||||
mTag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UploadBean{" +
|
||||
"mOriginFile=" + mOriginFile +
|
||||
", mCompressFile=" + mCompressFile +
|
||||
", mRemoteFileName='" + mRemoteFileName + '\'' +
|
||||
", mRemoteAccessUrl='" + mRemoteAccessUrl + '\'' +
|
||||
", mSuccess=" + mSuccess +
|
||||
", mType=" + mType +
|
||||
", mTag=" + mTag +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
mCompletionHandler = new UpCompletionHandler() {
|
||||
@Override
|
||||
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 {
|
||||
assert response != null;
|
||||
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
|
||||
@@ -93,6 +94,7 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
|
||||
@Override
|
||||
public void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback, boolean isImg) {
|
||||
System.err.println("-------upload------>" + list.size());
|
||||
if (callback == null) {
|
||||
return;
|
||||
}
|
||||
@@ -122,6 +124,7 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
mToken = info[0];
|
||||
System.err.println("-------上传的token------>" + mToken);
|
||||
L.e(TAG, "-------上传的token------>" + mToken);
|
||||
uploadNext();
|
||||
}
|
||||
@@ -145,10 +148,13 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
while (mIndex < mList.size() && (bean = mList.get(mIndex)).getOriginFile() == null) {
|
||||
mIndex++;
|
||||
}
|
||||
System.err.println("-------mIndex >= mList.size() mIndex------>" + mIndex);
|
||||
if (mIndex >= mList.size()) {
|
||||
System.err.println("-------mIndex >= mList.size()------>" + mList.size());
|
||||
if (mUploadCallback != null) {
|
||||
mUploadCallback.onFinish(mList, true);
|
||||
}
|
||||
System.err.println("-------mIndex >= mList.returnreturnreturnreturn------>" + mList.size());
|
||||
return;
|
||||
}
|
||||
if (bean.getType() == UploadBean.IMG) {
|
||||
@@ -158,7 +164,10 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
} else if (bean.getType() == UploadBean.VOICE) {
|
||||
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) {
|
||||
mLubanBuilder = Luban.with(mContext).ignoreBy(8)//8k以下不压缩
|
||||
.setTargetDir(CommonAppConfig.INNER_PATH).setRenameListener(new OnRenameListener() {
|
||||
@@ -186,12 +195,15 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
}
|
||||
mLubanBuilder.load(bean.getOriginFile()).launch();
|
||||
} else {
|
||||
System.err.println("-------bean.getType() == UploadBean.IMG && mNeedCompress else");
|
||||
upload(bean);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private void upload(UploadBean bean) {
|
||||
System.err.println("-------upload(UploadBean bean)------>" + bean);
|
||||
if (bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null) {
|
||||
System.err.println("bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
|
||||
if (mUploadManager == null) {
|
||||
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();
|
||||
@@ -206,6 +218,7 @@ public class UploadQnImpl implements UploadStrategy {
|
||||
}
|
||||
mUploadManager.put(uploadFile, bean.getRemoteFileName(), mToken, mCompletionHandler, null);
|
||||
} else {
|
||||
System.err.println("else bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
|
||||
if (mUploadCallback != null) {
|
||||
mUploadCallback.onFinish(mList, false);
|
||||
}
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,13 @@
|
||||
android:layout_height="match_parent"
|
||||
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
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
android:id="@+id/del"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="10dp"
|
||||
android:text="@string/delete"
|
||||
android:textColor="#777777"
|
||||
@@ -82,8 +81,7 @@
|
||||
android:id="@+id/replyTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="10dp"
|
||||
android:padding="9dp"
|
||||
android:text="@string/dialog_message_chat_notify_btn"
|
||||
android:textColor="#777777"
|
||||
android:textSize="11dp" />
|
||||
@@ -92,9 +90,8 @@
|
||||
android:id="@+id/report"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:padding="10dp"
|
||||
android:padding="9dp"
|
||||
android:text="@string/chat_report"
|
||||
android:textColor="#333333"
|
||||
android:textSize="11dp"
|
||||
|
||||
BIN
common/src/main/res/mipmap-xxhdpi/bg_main_bg.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/bg_main_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 865 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_back_new01.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/icon_back_new01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -35,4 +35,5 @@
|
||||
<string name="uploading">Uploading...</string>
|
||||
<string name="upload_fail">Upload failed</string>
|
||||
<string name="please_input_content">Please fill in the publication content</string>
|
||||
<string name="comm_details">Details</string>
|
||||
</resources>
|
||||
@@ -1500,4 +1500,5 @@
|
||||
<string name="uploading">上傳中...</string>
|
||||
<string name="upload_fail">上傳失敗</string>
|
||||
<string name="please_input_content">請填寫發佈內容</string>
|
||||
<string name="comm_details">詳情</string>
|
||||
</resources>
|
||||
|
||||
@@ -1500,4 +1500,5 @@
|
||||
<string name="uploading">上傳中...</string>
|
||||
<string name="upload_fail">上傳失敗</string>
|
||||
<string name="please_input_content">請填寫發佈內容</string>
|
||||
<string name="comm_details">詳情</string>
|
||||
</resources>
|
||||
|
||||
@@ -1498,4 +1498,5 @@
|
||||
<string name="uploading">上傳中...</string>
|
||||
<string name="upload_fail">上傳失敗</string>
|
||||
<string name="please_input_content">請填寫發佈內容</string>
|
||||
<string name="comm_details">詳情</string>
|
||||
</resources>
|
||||
|
||||
@@ -1520,5 +1520,6 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="uploading">上傳中...</string>
|
||||
<string name="upload_fail">上傳失敗</string>
|
||||
<string name="please_input_content">請填寫發佈內容</string>
|
||||
<string name="comm_details">詳情</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user