新增通过后端获取国家地区信息接口
调整送联系方式礼物时,不选择其他礼物 调整联系方式礼物接口 调整在模拟器超大分辨率模式下,信箱ui异常问题
This commit is contained in:
@@ -27,6 +27,7 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
@@ -63,6 +64,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
protected void main() {
|
||||
String url = getIntent().getStringExtra(Constants.URL);
|
||||
L.e("H5--->" + url);
|
||||
Bus.getOn(this);
|
||||
LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
|
||||
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
btnEdit = (ImageView) findViewById(R.id.btn_edit);
|
||||
@@ -254,6 +256,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
Constants.myIntoIndex = 0;
|
||||
indexInto = 0;
|
||||
Constants.LoginKefu = true;
|
||||
Bus.getOff(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@@ -309,5 +312,16 @@ public class WebViewActivity extends AbsActivity {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
indexInto = event.getIndexInto();
|
||||
if (event.getMethod().equals("androidInviteShare")) {
|
||||
try {
|
||||
Class<?> clz = mContext.getClassLoader().loadClass("com.yunbao.share.ui.InvitePopDialog");
|
||||
Object invite = clz.getConstructor(Context.class).newInstance(mContext);
|
||||
invite = invite.getClass().getMethod("setUrl", String.class).invoke(invite, event.getData());
|
||||
assert invite != null;
|
||||
invite.getClass().getMethod("showDialog").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class UserAreaBean extends BaseModel {
|
||||
private String area;
|
||||
|
||||
public UserAreaBean() {
|
||||
}
|
||||
|
||||
public String getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(String area) {
|
||||
this.area = area;
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.SlideInBannerModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.UserAreaBean;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||
import com.yunbao.common.bean.WishListModel;
|
||||
@@ -679,4 +680,10 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<List<DiscountsModel>>> getDiscountInfo(
|
||||
@Query("type") int type
|
||||
);
|
||||
/**
|
||||
* 获取地区
|
||||
*/
|
||||
@GET("/api/public/?service=User.getUserArea")
|
||||
Observable<ResponseModel<UserAreaBean>> getUserArea();
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.yunbao.common.bean.RandomPkUserBean;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.UserAreaBean;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||
import com.yunbao.common.bean.WishListModel;
|
||||
@@ -1379,6 +1380,27 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getUserArea(HttpCallback<UserAreaBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getUserArea()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<UserAreaBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<UserAreaBean> wishListGiftConfModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(wishListGiftConfModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
|
||||
@@ -497,6 +497,12 @@ public class JavascriptInterfaceUtils {
|
||||
mWebView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 社区分享
|
||||
* @param avatar 头像
|
||||
* @param link 分享连接
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void androidCommunityShare(String avatar,String link){
|
||||
JSONObject json=new JSONObject();
|
||||
@@ -506,4 +512,10 @@ public class JavascriptInterfaceUtils {
|
||||
.setMethod("androidCommunityShare")
|
||||
.setData(json.toJSONString()));
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void androidInviteShare(String url){
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("androidInviteShare")
|
||||
.setData(url));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user