我的页面,菜单全部改为webView跳转
This commit is contained in:
parent
d0ae3c49d4
commit
292dcaa9e4
@ -17,6 +17,8 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.shayu.onetoone.bean.UserItemBean;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
@ -31,9 +33,9 @@ import com.opensource.svgaplayer.SVGAParser;
|
|||||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||||
import com.shayu.onetoone.R;
|
import com.shayu.onetoone.R;
|
||||||
import com.shayu.onetoone.activity.setting.SettingActivity;
|
import com.shayu.onetoone.activity.setting.SettingActivity;
|
||||||
import com.shayu.onetoone.activity.setting.WebViewActivity;
|
|
||||||
import com.shayu.onetoone.adapter.MainMeAdapter;
|
import com.shayu.onetoone.adapter.MainMeAdapter;
|
||||||
import com.shayu.onetoone.bean.SlideBean;
|
import com.shayu.onetoone.bean.SlideBean;
|
||||||
|
import com.shayu.onetoone.manager.OTONetManager;
|
||||||
import com.shayu.onetoone.manager.RouteManager;
|
import com.shayu.onetoone.manager.RouteManager;
|
||||||
import com.shayu.onetoone.utils.MainHttpConsts;
|
import com.shayu.onetoone.utils.MainHttpConsts;
|
||||||
import com.shayu.onetoone.utils.MainHttpUtil;
|
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||||
@ -44,7 +46,6 @@ import com.yunbao.common.Constants;
|
|||||||
import com.yunbao.common.bean.GoogleBean;
|
import com.yunbao.common.bean.GoogleBean;
|
||||||
import com.yunbao.common.bean.LevelBean;
|
import com.yunbao.common.bean.LevelBean;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.bean.UserItemBean;
|
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
@ -95,8 +96,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
private View redPoint;
|
private View redPoint;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle
|
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
savedInstanceState) {
|
|
||||||
return inflater.inflate(R.layout.fragment_my, container, false);
|
return inflater.inflate(R.layout.fragment_my, container, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,6 +205,17 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
public void loadData() {
|
public void loadData() {
|
||||||
MainHttpUtil.getGoogle(mCallback1);
|
MainHttpUtil.getGoogle(mCallback1);
|
||||||
MainHttpUtil.getBaseInfo(mCallback);
|
MainHttpUtil.getBaseInfo(mCallback);
|
||||||
|
OTONetManager.getInstance(mContext).getMenu(new com.yunbao.common.http.base.HttpCallback<List<UserItemBean>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<UserItemBean> data) {
|
||||||
|
initMenu(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
MainHttpUtil.getBalance(new HttpCallback() {
|
MainHttpUtil.getBalance(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
@ -242,6 +253,33 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载菜单
|
||||||
|
*
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
private void initMenu(List<UserItemBean> list) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
List<UserItemBean> listNow = new ArrayList<>();
|
||||||
|
for (UserItemBean userItemBean : list) {
|
||||||
|
if (userItemBean.getId() != 21 && userItemBean.getId() != 13) {
|
||||||
|
listNow.add(userItemBean);
|
||||||
|
} else if (userItemBean.getId() == 21) {
|
||||||
|
beanKefu = userItemBean;
|
||||||
|
} else if (userItemBean.getId() == 13) {
|
||||||
|
beanStetting = userItemBean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mAdapter == null) {
|
||||||
|
mAdapter = new MainMeAdapter(mContext, listNow);
|
||||||
|
mAdapter.setOnItemClickListener(this);
|
||||||
|
mRecyclerView.setAdapter(mAdapter);
|
||||||
|
} else {
|
||||||
|
mAdapter.setList(listNow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取谷歌
|
//获取谷歌
|
||||||
//谷歌支付是否打开 1是打开 0 关闭
|
//谷歌支付是否打开 1是打开 0 关闭
|
||||||
@ -258,16 +296,18 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
private CommonCallback<UserBean> mCallback = new CommonCallback<UserBean>() {
|
private CommonCallback<UserBean> mCallback = new CommonCallback<UserBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void callback(UserBean bean) {
|
public void callback(UserBean bean) {
|
||||||
List<UserItemBean> list = CommonAppConfig.getInstance().getUserItemList();
|
/*List<UserItemBean> list = CommonAppConfig.getInstance().getUserItemList();
|
||||||
if (bean != null) {
|
if (bean != null) {
|
||||||
showData(bean, list);
|
showData(bean, list);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
showData(bean);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private List<SlideBean> mBannerListNew = new ArrayList<>();
|
private List<SlideBean> mBannerListNew = new ArrayList<>();
|
||||||
|
|
||||||
private void showData(UserBean u, List<UserItemBean> list) {
|
private void showData(UserBean u) {
|
||||||
mBannerList.clear();
|
mBannerList.clear();
|
||||||
mBannerListNew.clear();
|
mBannerListNew.clear();
|
||||||
if (!StringUtil.isEmpty(u.getSlide())) {
|
if (!StringUtil.isEmpty(u.getSlide())) {
|
||||||
@ -372,25 +412,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
good_nub_ico.setVisibility(View.GONE);
|
good_nub_ico.setVisibility(View.GONE);
|
||||||
mID.setText(u.getLiangNameTip());
|
mID.setText(u.getLiangNameTip());
|
||||||
}
|
}
|
||||||
if (list != null && list.size() > 0) {
|
|
||||||
List<UserItemBean> listNow = new ArrayList<>();
|
|
||||||
for (UserItemBean userItemBean : list) {
|
|
||||||
if (userItemBean.getId() != 21 && userItemBean.getId() != 13) {
|
|
||||||
listNow.add(userItemBean);
|
|
||||||
} else if (userItemBean.getId() == 21) {
|
|
||||||
beanKefu = userItemBean;
|
|
||||||
} else if (userItemBean.getId() == 13) {
|
|
||||||
beanStetting = userItemBean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mAdapter == null) {
|
|
||||||
mAdapter = new MainMeAdapter(mContext, listNow);
|
|
||||||
mAdapter.setOnItemClickListener(this);
|
|
||||||
mRecyclerView.setAdapter(mAdapter);
|
|
||||||
} else {
|
|
||||||
mAdapter.setList(listNow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (beanKefu != null) {
|
if (beanKefu != null) {
|
||||||
}
|
}
|
||||||
if (beanStetting != null) {
|
if (beanStetting != null) {
|
||||||
@ -411,7 +433,12 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(UserItemBean bean, int position) {
|
public void onItemClick(UserItemBean bean, int position) {
|
||||||
String url = bean.getHref();
|
if (!StringUtil.isEmpty(bean.getHref())) {
|
||||||
|
RouteManager.forwardWebViewActivity(bean.getName(), bean.getHref());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*String url = bean.getHref();
|
||||||
if (TextUtils.isEmpty(url)) {
|
if (TextUtils.isEmpty(url)) {
|
||||||
switch (bean.getId()) {
|
switch (bean.getId()) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -458,7 +485,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -479,7 +506,9 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index";
|
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index";
|
||||||
// RewardActivity.forward(mContext, url);
|
// RewardActivity.forward(mContext, url);
|
||||||
} else if (i == R.id.rt_kefu) {
|
} else if (i == R.id.rt_kefu) {
|
||||||
WebViewActivity.forward(mContext, beanKefu.getHref(), false);
|
//WebViewActivity.forward(mContext, beanKefu.getHref(), false);
|
||||||
|
RouteManager.forwardWebViewActivity(beanKefu.getName(), beanKefu.getHref());
|
||||||
|
|
||||||
} else if (i == R.id.rt_setting) {
|
} else if (i == R.id.rt_setting) {
|
||||||
forwardSetting();
|
forwardSetting();
|
||||||
} else if (i == R.id.lt_noble) {
|
} else if (i == R.id.lt_noble) {
|
||||||
@ -566,52 +595,43 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
}
|
}
|
||||||
lt_advertisement.setVisibility(View.VISIBLE);
|
lt_advertisement.setVisibility(View.VISIBLE);
|
||||||
if (mBannerList.size() == 1) {
|
if (mBannerList.size() == 1) {
|
||||||
banner_me.setAutoPlay(false)
|
banner_me.setAutoPlay(false).setPages(mBannerList, new CustomMyViewHolder()).setDelayTime(3000).setBannerStyle(BannerConfig.NOT_INDICATOR).setOnBannerClickListener(new OnBannerClickListener() {
|
||||||
.setPages(mBannerList, new CustomMyViewHolder())
|
@Override
|
||||||
.setDelayTime(3000)
|
public void onBannerClick(List datas, int p) {
|
||||||
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
if (mBannerList != null) {
|
||||||
.setOnBannerClickListener(new OnBannerClickListener() {
|
if (p >= 0 && p < mBannerList.size()) {
|
||||||
@Override
|
SlideBean bean = mBannerList.get(p);
|
||||||
public void onBannerClick(List datas, int p) {
|
if (!bean.getSlide_url().equals("")) {
|
||||||
if (mBannerList != null) {
|
Constants.isTitle = true;
|
||||||
if (p >= 0 && p < mBannerList.size()) {
|
String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||||
SlideBean bean = mBannerList.get(p);
|
//WebViewActivity.forward(mContext, url, false, false);
|
||||||
if (!bean.getSlide_url().equals("")) {
|
RouteManager.forwardWebViewActivity("", url);
|
||||||
Constants.isTitle = true;
|
|
||||||
String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
|
||||||
WebViewActivity.forward(mContext, url, false, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
.start();
|
}
|
||||||
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
banner_me.setAutoPlay(true)
|
banner_me.setAutoPlay(true).setPages(mBannerList, new CustomMyViewHolder()).setDelayTime(3000).setBannerStyle(BannerConfig.NOT_INDICATOR).setOnBannerClickListener(new OnBannerClickListener() {
|
||||||
.setPages(mBannerList, new CustomMyViewHolder())
|
@Override
|
||||||
.setDelayTime(3000)
|
public void onBannerClick(List datas, int p) {
|
||||||
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
if (mBannerList != null) {
|
||||||
.setOnBannerClickListener(new OnBannerClickListener() {
|
if (p >= 0 && p < mBannerList.size()) {
|
||||||
@Override
|
SlideBean bean = mBannerList.get(p);
|
||||||
public void onBannerClick(List datas, int p) {
|
if (!bean.getSlide_url().equals("")) {
|
||||||
if (mBannerList != null) {
|
Constants.isTitle = true;
|
||||||
if (p >= 0 && p < mBannerList.size()) {
|
String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||||
SlideBean bean = mBannerList.get(p);
|
RouteUtil.forwardCustomerService(url);
|
||||||
if (!bean.getSlide_url().equals("")) {
|
|
||||||
Constants.isTitle = true;
|
|
||||||
String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
|
||||||
RouteUtil.forwardCustomerService(url);
|
|
||||||
/*if(bean.getSlide_id().equals("95")){
|
/*if(bean.getSlide_id().equals("95")){
|
||||||
RouteUtil.forwardCustomerService(url);
|
RouteUtil.forwardCustomerService(url);
|
||||||
}else {
|
}else {
|
||||||
ZhuangBanActivity.forward(mContext, url, false);
|
ZhuangBanActivity.forward(mContext, url, false);
|
||||||
}*/
|
}*/
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
.start();
|
}
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,443 +0,0 @@
|
|||||||
package com.shayu.onetoone.activity.setting;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.ClipData;
|
|
||||||
import android.content.ClipboardManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.provider.MediaStore;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.webkit.ValueCallback;
|
|
||||||
import android.webkit.WebChromeClient;
|
|
||||||
import android.webkit.WebSettings;
|
|
||||||
import android.webkit.WebView;
|
|
||||||
import android.webkit.WebViewClient;
|
|
||||||
import android.widget.FrameLayout;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
|
|
||||||
import androidx.annotation.RequiresApi;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.lxj.xpopup.XPopup;
|
|
||||||
import com.shayu.onetoone.R;
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.CommonAppContext;
|
|
||||||
import com.yunbao.common.Constants;
|
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
|
||||||
import com.yunbao.common.bean.LiveBean;
|
|
||||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
|
||||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
|
||||||
import com.yunbao.common.http.LiveHttpUtil;
|
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
|
||||||
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
|
||||||
import com.yunbao.common.utils.AppManager;
|
|
||||||
import com.yunbao.common.utils.Bus;
|
|
||||||
import com.yunbao.common.utils.DeviceUtils;
|
|
||||||
import com.yunbao.common.utils.DpUtil;
|
|
||||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
|
||||||
import com.yunbao.common.utils.L;
|
|
||||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
|
||||||
import com.yunbao.common.utils.MicStatusManager;
|
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
import com.yunbao.common.views.HintCustomPopup;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Stack;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2018/9/25.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class WebViewActivity extends AbsActivity {
|
|
||||||
|
|
||||||
private FrameLayout ft_title;
|
|
||||||
private ImageView btnEdit;
|
|
||||||
private ProgressBar mProgressBar;
|
|
||||||
private WebView mWebView;
|
|
||||||
private final int CHOOSE = 100;//Android 5.0以下的
|
|
||||||
private final int CHOOSE_ANDROID_5 = 200;//Android 5.0以上的
|
|
||||||
private ValueCallback<Uri> mValueCallback;
|
|
||||||
private ValueCallback<Uri[]> mValueCallback2;
|
|
||||||
private int indexInto = 0;
|
|
||||||
private View v_spacing;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getLayoutId() {
|
|
||||||
return R.layout.activity_webview;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
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);
|
|
||||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
|
||||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
|
||||||
mWebView = findViewById(R.id.webView);
|
|
||||||
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
|
||||||
params.topMargin = DpUtil.dp2px(1);
|
|
||||||
// mWebView.setLayoutParams(params);
|
|
||||||
//mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
|
||||||
mWebView.setWebViewClient(new WebViewClient() {
|
|
||||||
@Override
|
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
||||||
L.e("H5-------->" + url);
|
|
||||||
if (url.startsWith(Constants.COPY_PREFIX)) {
|
|
||||||
String content = url.substring(Constants.COPY_PREFIX.length());
|
|
||||||
if (!TextUtils.isEmpty(content)) {
|
|
||||||
copy(content);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
view.loadUrl(url);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPageFinished(WebView view, String url) {
|
|
||||||
setTitle(view.getTitle());
|
|
||||||
if (url.contains("for")) {
|
|
||||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
|
||||||
}
|
|
||||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
|
||||||
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
|
||||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
|
||||||
if (!navigationGestureEnabled(mContext)) {
|
|
||||||
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mWebView.setWebChromeClient(new WebChromeClient() {
|
|
||||||
@Override
|
|
||||||
public void onProgressChanged(WebView view, int newProgress) {
|
|
||||||
if (mProgressBar != null) {
|
|
||||||
if (newProgress == 100) {
|
|
||||||
mProgressBar.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
mProgressBar.setProgress(newProgress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//以下是在各个Android版本中 WebView调用文件选择器的方法
|
|
||||||
// For Android < 3.0
|
|
||||||
public void openFileChooser(ValueCallback<Uri> valueCallback) {
|
|
||||||
openImageChooserActivity(valueCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
// For Android >= 3.0
|
|
||||||
public void openFileChooser(ValueCallback valueCallback, String acceptType) {
|
|
||||||
openImageChooserActivity(valueCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
//For Android >= 4.1
|
|
||||||
public void openFileChooser(ValueCallback<Uri> valueCallback,
|
|
||||||
String acceptType, String capture) {
|
|
||||||
openImageChooserActivity(valueCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
// For Android >= 5.0
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
@Override
|
|
||||||
public boolean onShowFileChooser(WebView webView,
|
|
||||||
ValueCallback<Uri[]> filePathCallback,
|
|
||||||
FileChooserParams fileChooserParams) {
|
|
||||||
mValueCallback2 = filePathCallback;
|
|
||||||
Intent intent = fileChooserParams.createIntent();
|
|
||||||
startActivityForResult(intent, CHOOSE_ANDROID_5);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
|
||||||
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
|
||||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
|
||||||
mWebView.getSettings().setDomStorageEnabled(true);
|
|
||||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
|
||||||
// mWebView.getSettings().setAppCachePath(appCachePath);
|
|
||||||
mWebView.getSettings().setAllowFileAccess(true);
|
|
||||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
|
||||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
|
||||||
}
|
|
||||||
mWebView.loadUrl(url);
|
|
||||||
AndroidBug5497Workaround.assistActivity(this);
|
|
||||||
|
|
||||||
|
|
||||||
if (btnEdit != null) {
|
|
||||||
if (Constants.myIntoIndex == 2) {
|
|
||||||
ft_title.setVisibility(View.GONE);
|
|
||||||
btnEdit.setVisibility(View.GONE);
|
|
||||||
v_spacing.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
} else if (Constants.myIntoIndex == 1) {
|
|
||||||
v_spacing.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
btnEdit.setVisibility(View.GONE);
|
|
||||||
ft_title.setVisibility(View.VISIBLE);
|
|
||||||
v_spacing.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {
|
|
||||||
mValueCallback = valueCallback;
|
|
||||||
Intent intent = new Intent();
|
|
||||||
if (Build.VERSION.SDK_INT < 19) {
|
|
||||||
intent.setAction(Intent.ACTION_GET_CONTENT);
|
|
||||||
} else {
|
|
||||||
intent.setAction(Intent.ACTION_PICK);
|
|
||||||
intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
|
||||||
}
|
|
||||||
intent.setType("image/*");
|
|
||||||
startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
@Override
|
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, intent);
|
|
||||||
switch (requestCode) {
|
|
||||||
case CHOOSE://5.0以下选择图片后的回调
|
|
||||||
processResult(resultCode, intent);
|
|
||||||
break;
|
|
||||||
case CHOOSE_ANDROID_5://5.0以上选择图片后的回调
|
|
||||||
processResultAndroid5(resultCode, intent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void processResult(int resultCode, Intent intent) {
|
|
||||||
if (mValueCallback == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (resultCode == RESULT_OK && intent != null) {
|
|
||||||
Uri result = intent.getData();
|
|
||||||
mValueCallback.onReceiveValue(result);
|
|
||||||
} else {
|
|
||||||
mValueCallback.onReceiveValue(null);
|
|
||||||
}
|
|
||||||
mValueCallback = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
private void processResultAndroid5(int resultCode, Intent intent) {
|
|
||||||
if (mValueCallback2 == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (resultCode == RESULT_OK && intent != null) {
|
|
||||||
mValueCallback2.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
|
|
||||||
} else {
|
|
||||||
mValueCallback2.onReceiveValue(null);
|
|
||||||
}
|
|
||||||
mValueCallback2 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean mIsLive = false;
|
|
||||||
|
|
||||||
public static void forward(Context context, String url, boolean addArgs, boolean isLive) {
|
|
||||||
mIsLive = isLive;
|
|
||||||
if (Constants.LoginKefu) {
|
|
||||||
if (addArgs) {
|
|
||||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Intent intent = new Intent(context, WebViewActivity.class);
|
|
||||||
intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void forward(Context context, String url, boolean isLive) {
|
|
||||||
forward(context, url, true, isLive);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
if (mWebView != null) {
|
|
||||||
ViewGroup parent = (ViewGroup) mWebView.getParent();
|
|
||||||
if (parent != null) {
|
|
||||||
parent.removeView(mWebView);
|
|
||||||
}
|
|
||||||
mWebView.destroy();
|
|
||||||
}
|
|
||||||
Constants.myIntoIndex = 0;
|
|
||||||
indexInto = 0;
|
|
||||||
Constants.LoginKefu = true;
|
|
||||||
Bus.getOff(this);
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 复制到剪贴板
|
|
||||||
*/
|
|
||||||
private void copy(String content) {
|
|
||||||
ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
|
||||||
ClipData clipData = ClipData.newPlainText("text", content);
|
|
||||||
cm.setPrimaryClip(clipData);
|
|
||||||
ToastUtil.show(getString(R.string.copy_success));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
if (Constants.myIntoIndex == 2 && mWebView != null && indexInto == 1) {
|
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
|
||||||
mWebView.post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
String method = "reload()";//拼接参数,就可以把数据传递给js
|
|
||||||
mWebView.evaluateJavascript(method, new ValueCallback<String>() {
|
|
||||||
@Override
|
|
||||||
public void onReceiveValue(String value) {
|
|
||||||
// Log.i("qcl0228", "js返回的数据" + value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
mWebView.post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mWebView.setWebViewClient(new WebViewClient() {
|
|
||||||
@Override
|
|
||||||
public void onPageFinished(WebView view, String url) {
|
|
||||||
super.onPageFinished(view, url);
|
|
||||||
mWebView.loadUrl("javascript:reload()");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
indexInto = 0;
|
|
||||||
}
|
|
||||||
if (Constants.isShowPage != -1) {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@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);
|
|
||||||
}
|
|
||||||
} else if (TextUtils.equals(event.getMethod(), "clickLogOffAccount")) {
|
|
||||||
new XPopup.Builder(mContext)
|
|
||||||
.asCustom(new HintCustomPopup(mContext,
|
|
||||||
mContext.getString(R.string.delete_account1),
|
|
||||||
mContext.getString(R.string.delete_account2))
|
|
||||||
.setLiveOpenOk(mContext.getString(R.string.delete_account3))
|
|
||||||
.setLiveOpenCancel(mContext.getString(R.string.cancel))
|
|
||||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSure() {
|
|
||||||
LiveNetManager.get(mContext).
|
|
||||||
setLogOff(new HttpCallback<String>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(String data) {
|
|
||||||
Stack<Activity> allActivityStacks = AppManager.getInstance().getAllActivityStacks();
|
|
||||||
for (int i = 0; i < allActivityStacks.size(); i++) {
|
|
||||||
if (!(allActivityStacks.get(i) instanceof WebViewActivity)) {
|
|
||||||
allActivityStacks.get(i).finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IMLoginManager.get(mContext).logout(mContext);
|
|
||||||
CommonAppConfig.getInstance().clearLoginInfo();
|
|
||||||
mContext.finish();
|
|
||||||
RouteUtil.forwardLoginActivity();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCancel() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
.show();
|
|
||||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
|
||||||
//看直播
|
|
||||||
gotoLive(event.getLiveId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void gotoLive(final String live_id) {
|
|
||||||
|
|
||||||
LiveHttpUtil.getLiveInfo(live_id, new com.yunbao.common.http.HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0 && info.length > 0) {
|
|
||||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
|
||||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
|
||||||
@Override
|
|
||||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
|
||||||
if (liveBean == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
|
||||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mIsLive) {
|
|
||||||
finish();
|
|
||||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
|
||||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
|
||||||
} else {
|
|
||||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
|
||||||
}
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCheckError(String contextError) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
RouteUtil.forwardUserHome(mContext, live_id, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
package com.shayu.onetoone.adapter;
|
package com.shayu.onetoone.adapter;
|
||||||
|
|
||||||
import static android.os.Build.VERSION_CODES.R;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -12,8 +11,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.shayu.onetoone.R;
|
import com.shayu.onetoone.bean.UserItemBean;
|
||||||
import com.yunbao.common.bean.UserItemBean;
|
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
@ -48,13 +46,14 @@ public class MainMeAdapter extends RecyclerView.Adapter<MainMeAdapter.Vh> {
|
|||||||
@Override
|
@Override
|
||||||
public int getItemViewType(int position) {
|
public int getItemViewType(int position) {
|
||||||
UserItemBean bean = mList.get(position);
|
UserItemBean bean = mList.get(position);
|
||||||
if (bean.isGroupLast()) {
|
/*if (bean.isGroupLast()) {
|
||||||
return GROUP_LAST;
|
return GROUP_LAST;
|
||||||
} else if (bean.isAllLast()) {
|
} else if (bean.isAllLast()) {
|
||||||
return ALL_LAST;
|
return ALL_LAST;
|
||||||
} else {
|
} else {
|
||||||
return NORMAL;
|
return NORMAL;
|
||||||
}
|
}*/
|
||||||
|
return NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,24 +1,18 @@
|
|||||||
package com.shayu.onetoone.bean;
|
package com.shayu.onetoone.bean;
|
||||||
|
|
||||||
import com.yunbao.common.bean.BaseModel;
|
/**
|
||||||
|
* Created by cxf on 2018/9/28.
|
||||||
|
* 我的 页面的item
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class UserItemBean {
|
||||||
|
|
||||||
public class UserItemBean extends BaseModel {
|
|
||||||
private int id;
|
private int id;
|
||||||
private int uid;
|
private String name;
|
||||||
private int prop_id;
|
private String thumb;
|
||||||
private String cn_title;
|
private String href;
|
||||||
private String en_title;
|
private boolean mGroupLast;
|
||||||
private String icon;
|
private boolean mAllLast;
|
||||||
private int status;
|
|
||||||
private int type;
|
|
||||||
private long create_time;
|
|
||||||
private long update_time;
|
|
||||||
private String callback;
|
|
||||||
private long ex_time;
|
|
||||||
private long use_time;
|
|
||||||
|
|
||||||
public UserItemBean() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
@ -28,99 +22,66 @@ public class UserItemBean extends BaseModel {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUid() {
|
public String getName() {
|
||||||
return uid;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUid(int uid) {
|
public void setName(String name) {
|
||||||
this.uid = uid;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getProp_id() {
|
public String getThumb() {
|
||||||
return prop_id;
|
return thumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProp_id(int prop_id) {
|
public void setThumb(String thumb) {
|
||||||
this.prop_id = prop_id;
|
this.thumb = thumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCn_title() {
|
public String getHref() {
|
||||||
return cn_title;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCn_title(String cn_title) {
|
public void setHref(String href) {
|
||||||
this.cn_title = cn_title;
|
this.href = href;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getEn_title() {
|
public boolean isGroupLast() {
|
||||||
return en_title;
|
return mGroupLast;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEn_title(String en_title) {
|
public void setGroupLast(boolean groupLast) {
|
||||||
this.en_title = en_title;
|
mGroupLast = groupLast;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIcon() {
|
public boolean isAllLast() {
|
||||||
return icon;
|
return mAllLast;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIcon(String icon) {
|
public void setAllLast(boolean allLast) {
|
||||||
this.icon = icon;
|
mAllLast = allLast;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStatus() {
|
@Override
|
||||||
return status;
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
UserItemBean bean = (UserItemBean) o;
|
||||||
|
|
||||||
|
if (id != bean.id) return false;
|
||||||
|
if (name != null ? !name.equals(bean.name) : bean.name != null) return false;
|
||||||
|
if (thumb != null ? !thumb.equals(bean.thumb) : bean.thumb != null) return false;
|
||||||
|
return href != null ? href.equals(bean.href) : bean.href == null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(int status) {
|
@Override
|
||||||
this.status = status;
|
public int hashCode() {
|
||||||
}
|
int result = id;
|
||||||
|
result = 31 * result + (name != null ? name.hashCode() : 0);
|
||||||
public int getType() {
|
result = 31 * result + (thumb != null ? thumb.hashCode() : 0);
|
||||||
return type;
|
result = 31 * result + (href != null ? href.hashCode() : 0);
|
||||||
}
|
return result;
|
||||||
|
|
||||||
public void setType(int type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getCreate_time() {
|
|
||||||
return create_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreate_time(long create_time) {
|
|
||||||
this.create_time = create_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getUpdate_time() {
|
|
||||||
return update_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUpdate_time(long update_time) {
|
|
||||||
this.update_time = update_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCallback() {
|
|
||||||
return callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCallback(String callback) {
|
|
||||||
this.callback = callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getEx_time() {
|
|
||||||
return ex_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEx_time(long ex_time) {
|
|
||||||
this.ex_time = ex_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getUse_time() {
|
|
||||||
return use_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUse_time(long use_time) {
|
|
||||||
this.use_time = use_time;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1303,4 +1303,31 @@ public class OTONetManager {
|
|||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void getMenu( HttpCallback<List<UserItemBean>> callback) {
|
||||||
|
API.get().otoApi(mContext).
|
||||||
|
getMenu()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<UserItemBean>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<UserItemBean>> listResponseModel) throws Exception {
|
||||||
|
if (listResponseModel.getData().getCode() == 0) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
} else {
|
||||||
|
callback.onError(listResponseModel.getData().getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -246,6 +246,7 @@ public interface OneToOneApi {
|
|||||||
Observable<ResponseModel<List<ExchangeModel>>> getExchangeList(
|
Observable<ResponseModel<List<ExchangeModel>>> getExchangeList(
|
||||||
@Query("type") String type
|
@Query("type") String type
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置基本信息
|
* 设置基本信息
|
||||||
*/
|
*/
|
||||||
@ -283,6 +284,7 @@ public interface OneToOneApi {
|
|||||||
|
|
||||||
@GET("/api/public/?service=Friendappmsg.getTips")
|
@GET("/api/public/?service=Friendappmsg.getTips")
|
||||||
Observable<ResponseModel<BaseModel>> getChatTips(@Query("tuid") String tuid);
|
Observable<ResponseModel<BaseModel>> getChatTips(@Query("tuid") String tuid);
|
||||||
|
|
||||||
@GET("/api/public/?service=Friendappmsg.setTips")
|
@GET("/api/public/?service=Friendappmsg.setTips")
|
||||||
Observable<ResponseModel<BaseModel>> updateChatTips(@Query("tuid") String tuid);
|
Observable<ResponseModel<BaseModel>> updateChatTips(@Query("tuid") String tuid);
|
||||||
|
|
||||||
@ -307,6 +309,7 @@ public interface OneToOneApi {
|
|||||||
@GET("/api/public/?service=Friendappinfos.getSage")
|
@GET("/api/public/?service=Friendappinfos.getSage")
|
||||||
Observable<ResponseModel<AuthBloggerBean>> getBloggerInfo(
|
Observable<ResponseModel<AuthBloggerBean>> getBloggerInfo(
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收益转换星币或砖石
|
* 收益转换星币或砖石
|
||||||
*/
|
*/
|
||||||
@ -329,6 +332,7 @@ public interface OneToOneApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改密码
|
* 修改密码
|
||||||
|
*
|
||||||
* @param oldpass
|
* @param oldpass
|
||||||
* @param pass
|
* @param pass
|
||||||
* @param pass2
|
* @param pass2
|
||||||
@ -341,9 +345,17 @@ public interface OneToOneApi {
|
|||||||
@Query("pass2") String pass2);
|
@Query("pass2") String pass2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GET("/api/public/?service=Friendappuser.friend")
|
@GET("/api/public/?service=Friendappuser.friend")
|
||||||
Observable<ResponseModel<List<HomeItemBean>>> getFriends(@Query("p")String p);
|
Observable<ResponseModel<List<HomeItemBean>>> getFriends(@Query("p") String p);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取我的菜单
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Friendappinfos.getMenu")
|
||||||
|
Observable<ResponseModel<List<UserItemBean>>> getMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user