diff --git a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java index 970872ac1..0807642a7 100644 --- a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java @@ -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 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(); diff --git a/common/src/main/java/com/yunbao/common/manager/imrongcloud/RongcloudIMManager.java b/common/src/main/java/com/yunbao/common/manager/imrongcloud/RongcloudIMManager.java index 4494d6149..d7f055a1e 100644 --- a/common/src/main/java/com/yunbao/common/manager/imrongcloud/RongcloudIMManager.java +++ b/common/src/main/java/com/yunbao/common/manager/imrongcloud/RongcloudIMManager.java @@ -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"; diff --git a/live/src/main/java/com/yunbao/live/views/LoadingView.java b/live/src/main/java/com/yunbao/live/views/LoadingView.java index 6f8d7209c..6cfbf8cd1 100644 --- a/live/src/main/java/com/yunbao/live/views/LoadingView.java +++ b/live/src/main/java/com/yunbao/live/views/LoadingView.java @@ -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); } diff --git a/live/src/main/res/layout/layout_portrait_comm_item.xml b/live/src/main/res/layout/layout_portrait_comm_item.xml new file mode 100644 index 000000000..2194219a7 --- /dev/null +++ b/live/src/main/res/layout/layout_portrait_comm_item.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/activity/MsgSettActivity.java b/main/src/main/java/com/yunbao/main/activity/MsgSettActivity.java index 8e9230b92..05c52cbb8 100644 --- a/main/src/main/java/com/yunbao/main/activity/MsgSettActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MsgSettActivity.java @@ -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() { @Override public void onSuccess(MsgSwitchDetailModel data) { + if(data.getDynamic_msg_switch().equals("2")){ dt_switch.setImageResource(R.mipmap.special_icon_off); }else{ diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java index 40a728f60..82e3b5758 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -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); } }