update 1.01版本及后续追加功能
This commit is contained in:
@@ -39,6 +39,8 @@ public class CommonAppConfig {
|
||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||
//是否为插件包模式
|
||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||
//融云的key
|
||||
public static final String RONG_IM_KEY = getMetaDataString("RONG_KEY");
|
||||
|
||||
//外部sd卡
|
||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||
|
||||
@@ -9,6 +9,11 @@ public class HtmlConfig {
|
||||
//登录即代表同意服务和隐私条款
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=3";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=Portal&m=Page&a=index&id=59";
|
||||
//登录即代表同意服务和隐私条款
|
||||
//675 友聊隱私條款
|
||||
public static final String OTO_LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=675";
|
||||
//674 友聊用戶協議
|
||||
public static final String OTO_LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=Portal&m=Page&a=index&id=674";
|
||||
|
||||
//注册用户协议
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=2";
|
||||
|
||||
@@ -270,6 +270,26 @@ public class IMLoginModel extends BaseModel {
|
||||
private int userInfoComplete;
|
||||
@SerializedName("login_type")
|
||||
private String loginType;
|
||||
@SerializedName("home_banner")
|
||||
private List<String> userAlbum;//用户相册
|
||||
@SerializedName("is_accost")
|
||||
private int isAccost;//是否显示打招呼按钮
|
||||
|
||||
public int getIsAccost() {
|
||||
return isAccost;
|
||||
}
|
||||
|
||||
public void setIsAccost(int isAccost) {
|
||||
this.isAccost = isAccost;
|
||||
}
|
||||
|
||||
public List<String> getUserAlbum() {
|
||||
return userAlbum;
|
||||
}
|
||||
|
||||
public void setUserAlbum(List<String> userAlbum) {
|
||||
this.userAlbum = userAlbum;
|
||||
}
|
||||
|
||||
public String getLoginType() {
|
||||
return loginType;
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.lzy.okgo.callback.StringCallback;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.lzy.okgo.request.PostRequest;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.ErrorActivity;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
@@ -27,6 +28,7 @@ import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.VersionUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -422,7 +424,7 @@ public class CommonHttpUtil {
|
||||
.params("trade_no", tradeNo)
|
||||
.params("allData", allData)
|
||||
.params("gps_adid", gps_adid)
|
||||
.params("package_name", "com.shayu.onetoonenew")
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -431,7 +433,7 @@ public class CommonHttpUtil {
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("package_name", "com.pdlive.shayu")
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@ import com.google.gson.Gson;
|
||||
import com.lzy.okgo.callback.AbsCallback;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.lzy.okgo.request.base.Request;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.event.RongIMConnectionStatusEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@@ -43,7 +46,11 @@ public abstract class HttpCallback extends AbsCallback<JsonBean> {
|
||||
if (data != null) {
|
||||
if (700 == data.getCode()) {
|
||||
//token过期,重新登录
|
||||
RouteUtil.forwardLoginInvalid(data.getMsg());
|
||||
if(CommonAppContext.sInstance.getPackageName().equals("com.pdlive.shayu")) {
|
||||
RouteUtil.forwardLoginInvalid(data.getMsg());
|
||||
}else{
|
||||
Bus.get().post(new RongIMConnectionStatusEvent());
|
||||
}
|
||||
} else {
|
||||
onSuccess(data.getCode(), data.getMsg(), data.getInfo());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
|
||||
public class ReportManager {
|
||||
public static void report(Context mContext,String uid){
|
||||
if(mContext.getPackageName().equals("com.shayu.onetoonenew")){
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("reportUser")
|
||||
.setPostsId(uid));
|
||||
}else{
|
||||
RouteUtil.forwardLiveReportActivity(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,10 @@ public class RongcloudIMManager {
|
||||
} else {
|
||||
RONG_IM_KEY = "uwd1c0sxu1p71"; //正式服key
|
||||
}
|
||||
RONG_IM_KEY="lmxuhwagl7s1d";
|
||||
if(!CommonAppConfig.HOST.contains("yaoulive")) {
|
||||
RONG_IM_KEY = CommonAppConfig.RONG_IM_KEY;
|
||||
}
|
||||
RONG_IM_KEY = CommonAppConfig.RONG_IM_KEY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
/**
|
||||
@@ -15,12 +18,13 @@ public class AndroidBug5497Workaround {
|
||||
// For more information, see https://issuetracker.google.com/issues/36911528
|
||||
// To use this class, simply invoke assistActivity() on an Activity that already has its content view set.
|
||||
|
||||
public static void assistActivity (Activity activity) {
|
||||
public static void assistActivity(Activity activity) {
|
||||
new AndroidBug5497Workaround(activity);
|
||||
}
|
||||
|
||||
private View mChildOfContent;
|
||||
private int usableHeightPrevious;
|
||||
private int defHeight = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
private FrameLayout.LayoutParams frameLayoutParams;
|
||||
|
||||
private AndroidBug5497Workaround(Activity activity) {
|
||||
@@ -29,8 +33,14 @@ public class AndroidBug5497Workaround {
|
||||
mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
public void onGlobalLayout() {
|
||||
possiblyResizeChildOfContent();
|
||||
int heightDiff = mChildOfContent.getRootView().getHeight() - mChildOfContent.getHeight();
|
||||
if (heightDiff < 100) {
|
||||
frameLayoutParams.height = defHeight;
|
||||
mChildOfContent.requestLayout();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();
|
||||
}
|
||||
|
||||
@@ -39,7 +49,7 @@ public class AndroidBug5497Workaround {
|
||||
if (usableHeightNow != usableHeightPrevious) {
|
||||
int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();
|
||||
int heightDifference = usableHeightSansKeyboard - usableHeightNow;
|
||||
if (heightDifference > (usableHeightSansKeyboard/4)) {
|
||||
if (heightDifference > (usableHeightSansKeyboard / 4)) {
|
||||
// keyboard probably just became visible
|
||||
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
|
||||
} else {
|
||||
|
||||
@@ -43,6 +43,7 @@ public class JavascriptInterfaceUtils {
|
||||
private boolean permitSetHigh = true;
|
||||
//同名activity跳转问题
|
||||
private boolean LiveZhuangBana = true;
|
||||
private boolean isPDLive = true;
|
||||
private static JavascriptInterfaceUtils sInstance;
|
||||
|
||||
public JavascriptInterfaceUtils setPageClose(boolean pageClose) {
|
||||
@@ -60,6 +61,11 @@ public class JavascriptInterfaceUtils {
|
||||
return this;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceUtils setPDLive(boolean isPDLive) {
|
||||
this.isPDLive = isPDLive;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 允许js修改webview高度
|
||||
*/
|
||||
@@ -190,12 +196,24 @@ public class JavascriptInterfaceUtils {
|
||||
@JavascriptInterface
|
||||
public void reportCommunity(String info) {
|
||||
ReportCommunityBean reportCommunityBean = JSON.parseObject(info, ReportCommunityBean.class);
|
||||
RouteUtil.forwardLiveReportActivity(reportCommunityBean.getDynamic_id(), 1, reportCommunityBean.getCommunity_type(), reportCommunityBean.getComment_id());
|
||||
if (isPDLive) {
|
||||
RouteUtil.forwardLiveReportActivity(reportCommunityBean.getDynamic_id(), 1, reportCommunityBean.getCommunity_type(), reportCommunityBean.getComment_id());
|
||||
} else {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("reportCommunity")
|
||||
.setData(info));
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void reportUser(String touid) {
|
||||
RouteUtil.forwardLiveReportActivity(touid);
|
||||
if (isPDLive) {
|
||||
RouteUtil.forwardLiveReportActivity(touid);
|
||||
} else {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("reportUser")
|
||||
.setPostsId(touid));
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
@@ -215,8 +233,14 @@ public class JavascriptInterfaceUtils {
|
||||
List<VideoListBean> videoList = JSON.parseArray(videoListString, VideoListBean.class);
|
||||
List<VideoBean> videoBeanList = new ArrayList<>();
|
||||
for (VideoListBean videoListBean : videoList) {
|
||||
JSONObject obj2 = JSON.parseObject(videoListBean.getContent());
|
||||
String msg = obj2.getString("msg");
|
||||
String msg = "";
|
||||
try {
|
||||
JSONObject obj2 = JSON.parseObject(videoListBean.getContent());
|
||||
msg = obj2.getString("msg");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.err.println(videoListBean.getContent());
|
||||
}
|
||||
VideoBean videoBean = new VideoBean();
|
||||
videoBean.setHref(videoListBean.getVideo());
|
||||
videoBean.setCity("");
|
||||
@@ -616,4 +640,15 @@ public class JavascriptInterfaceUtils {
|
||||
.setData(targetId)
|
||||
.setMethod("androidCallChat"));
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void androidHitOn(String targetId){
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setData(targetId)
|
||||
.setMethod("androidHitOn"));
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void androidOTOEditUser() {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("androidOTOEditUser"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,10 +267,10 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
String[] selectionArgs = {id};
|
||||
filePath = getDataColumn(context, MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection, selectionArgs);
|
||||
} else if (isDownloadsDocument(uri)) { // DownloadsProvider
|
||||
Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(documentId));
|
||||
Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.parseLong(documentId));
|
||||
filePath = getDataColumn(context, contentUri, null, null);
|
||||
}
|
||||
} else if ("content".equalsIgnoreCase(uri.getScheme())) {
|
||||
} else if ("content".equals(uri.getScheme())) {
|
||||
// 如果是 content 类型的 Uri
|
||||
filePath = getDataColumn(context, uri, null, null);
|
||||
} else if ("file".equals(uri.getScheme())) {
|
||||
@@ -291,6 +291,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
path = cursor.getString(columnIndex);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user