111
This commit is contained in:
parent
3b8f0466a0
commit
49ef55bfee
@ -13,6 +13,7 @@ import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseData;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -193,12 +194,12 @@ public class MainNetManager {
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(slideInBannerModelResponseModel -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
if (callback != null) {
|
||||
List<SlideInfoModel> slideInfoModels = slideInBannerModelResponseModel.getData().getInfo().get(0).getSlide();
|
||||
callback.onSuccess(slideInfoModels);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
@ -213,12 +214,12 @@ public class MainNetManager {
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(msgSwitchDetailModelResponseModel -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
if (callback != null) {
|
||||
MsgSwitchDetailModel msgSwitchDetailModel = msgSwitchDetailModelResponseModel.getData().getInfo();
|
||||
callback.onSuccess(msgSwitchDetailModel);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
@ -233,12 +234,12 @@ public class MainNetManager {
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseModel -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
if (callback != null) {
|
||||
ResponseData responseData = BaseModel.getData();
|
||||
callback.onSuccess(responseData);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
@ -253,12 +254,12 @@ public class MainNetManager {
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseModel -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
if (callback != null) {
|
||||
ResponseData responseData = BaseModel.getData();
|
||||
callback.onSuccess(responseData);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
|
@ -32,9 +32,9 @@ import static com.yunbao.common.CommonAppContext.isReady;
|
||||
*/
|
||||
public class RongcloudIMManager {
|
||||
//融云开发者平台注册app唯一识别符
|
||||
public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
|
||||
// public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
|
||||
//测试环境
|
||||
// public static final String RONG_IM_KEY = "pvxdm17jpd3hr";
|
||||
public static final String RONG_IM_KEY = "pvxdm17jpd3hr";
|
||||
|
||||
private static final String CLASSNAME = "RongcloudIMManager";
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class LoadingView extends FrameLayout {
|
||||
|
||||
private void init(Context context) {
|
||||
this.mContext = context;
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.layout_portrait_live_item, this, true);
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.layout_portrait_comm_item, this, true);
|
||||
mIvLoading = view.findViewById(R.id.iv_loading);
|
||||
}
|
||||
|
||||
@ -46,7 +46,6 @@ public class LoadingView extends FrameLayout {
|
||||
ImageView ivLoading = mIvLoading.findViewById(R.id.iv_loading);
|
||||
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
||||
frameAnimation.start();
|
||||
|
||||
setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
|
19
live/src/main/res/layout/layout_portrait_comm_item.xml
Normal file
19
live/src/main/res/layout/layout_portrait_comm_item.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_loading"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="188dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/loading_animation" />
|
||||
|
||||
</RelativeLayout>
|
@ -17,6 +17,7 @@ import com.yunbao.common.http.ResponseData;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.main.MainNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.views.LoadingView;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.MainHomeLivesClassAdapter;
|
||||
import com.yunbao.main.adapter.MsgFollowAdapter;
|
||||
@ -43,7 +44,7 @@ public class MsgSettActivity extends AbsActivity {
|
||||
lt_switch = (ImageView) findViewById(R.id.lt_switch);
|
||||
xt_switch= (ImageView) findViewById(R.id.xt_switch);
|
||||
kb_switch= (ImageView) findViewById(R.id.kb_switch);
|
||||
|
||||
getData();
|
||||
dt_switch.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -148,7 +149,7 @@ public class MsgSettActivity extends AbsActivity {
|
||||
follow_list.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
follow_list.setHasFixedSize(true);
|
||||
follow_list.setNestedScrollingEnabled(true);
|
||||
getData();
|
||||
|
||||
}
|
||||
|
||||
public void getData(){
|
||||
@ -156,6 +157,7 @@ public class MsgSettActivity extends AbsActivity {
|
||||
.getMsgSwitchDetail(new HttpCallback<MsgSwitchDetailModel>() {
|
||||
@Override
|
||||
public void onSuccess(MsgSwitchDetailModel data) {
|
||||
|
||||
if(data.getDynamic_msg_switch().equals("2")){
|
||||
dt_switch.setImageResource(R.mipmap.special_icon_off);
|
||||
}else{
|
||||
|
@ -4,6 +4,7 @@ import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
@ -22,6 +23,7 @@ import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
@ -47,6 +49,7 @@ import com.yunbao.live.bean.LiveBean;
|
||||
import com.yunbao.live.bean.ReportCommunityBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.live.views.LoadingView;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.FansActivity;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
@ -106,6 +109,11 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
mWebView.setLayoutParams(params);
|
||||
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
|
||||
LoadingView loadingView = new LoadingView(mContext);
|
||||
loadingView.show();
|
||||
|
||||
rootView.addView(loadingView);
|
||||
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
@ -158,8 +166,10 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
if (newProgress == 100) {
|
||||
loadingView.hide();
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
} else {
|
||||
loadingView.show();
|
||||
mProgressBar.setProgress(newProgress);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user