Compare commits
7 Commits
master
...
dev_memory
Author | SHA1 | Date | |
---|---|---|---|
b184d5255f | |||
4d9dbadea5 | |||
0294296ada | |||
af00538101 | |||
13c53644a2 | |||
0f9bd6aa3c | |||
33ee465a43 |
@ -17,6 +17,8 @@ import com.yunbao.common.http.CommonHttpUtil;
|
|||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import io.rong.imlib.RongIMClient;
|
import io.rong.imlib.RongIMClient;
|
||||||
@ -33,6 +35,7 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
|
|
||||||
public static CommonAppContext sInstance;
|
public static CommonAppContext sInstance;
|
||||||
public static WeakReference<Activity> activityWeakReference;
|
public static WeakReference<Activity> activityWeakReference;
|
||||||
|
public static List<WeakReference<Activity>> activityList=new ArrayList<>();
|
||||||
private int mCount;
|
private int mCount;
|
||||||
private boolean mFront;//是否前台
|
private boolean mFront;//是否前台
|
||||||
public static int jpushMsgNum;
|
public static int jpushMsgNum;
|
||||||
@ -111,6 +114,7 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
jpushMsgNum = 0;
|
jpushMsgNum = 0;
|
||||||
CommonAppConfig.getInstance().setFrontGround(true);
|
CommonAppConfig.getInstance().setFrontGround(true);
|
||||||
}
|
}
|
||||||
|
activityList.add(activityWeakReference);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -131,6 +135,12 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
L.e("AppContext------->处于后台");
|
L.e("AppContext------->处于后台");
|
||||||
CommonAppConfig.getInstance().setFrontGround(false);
|
CommonAppConfig.getInstance().setFrontGround(false);
|
||||||
}
|
}
|
||||||
|
for (WeakReference<Activity> reference : activityList) {
|
||||||
|
if (reference.get() == activity) {
|
||||||
|
activityList.remove(reference);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,6 +75,9 @@ public class TabButtonGroup extends LinearLayout implements View.OnClickListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getCurPosition() {
|
||||||
|
return mCurPosition;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -40,7 +40,7 @@ public class JavascriptInterfaceUtils {
|
|||||||
private boolean dialogClose = false;
|
private boolean dialogClose = false;
|
||||||
//同名activity跳转问题
|
//同名activity跳转问题
|
||||||
private boolean LiveZhuangBana = true;
|
private boolean LiveZhuangBana = true;
|
||||||
private static JavascriptInterfaceUtils sInstance;
|
//private static JavascriptInterfaceUtils sInstance;
|
||||||
|
|
||||||
public JavascriptInterfaceUtils setPageClose(boolean pageClose) {
|
public JavascriptInterfaceUtils setPageClose(boolean pageClose) {
|
||||||
this.pageClose = pageClose;
|
this.pageClose = pageClose;
|
||||||
@ -67,9 +67,9 @@ public class JavascriptInterfaceUtils {
|
|||||||
|
|
||||||
synchronized (JavascriptInterfaceUtils.class) {
|
synchronized (JavascriptInterfaceUtils.class) {
|
||||||
|
|
||||||
sInstance = new JavascriptInterfaceUtils();
|
// sInstance = new JavascriptInterfaceUtils();
|
||||||
|
|
||||||
return sInstance;
|
return new JavascriptInterfaceUtils();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#Thu Feb 04 00:05:45 CST 2021
|
#Thu Feb 04 00:05:45 CST 2021
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
org.gradle.configureondemand=true
|
org.gradle.configureondemand=true
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
|
||||||
|
|
||||||
|
@ -118,7 +118,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
private static final String TAG = "LiveAudienceActivity";
|
private static final String TAG = "LiveAudienceActivity";
|
||||||
public static String anyway;
|
public static String anyway;
|
||||||
public JSONObject pkInfo;
|
public JSONObject pkInfo;
|
||||||
public static LiveAudienceActivity liveAudienceActivity;
|
|
||||||
|
|
||||||
// 竖直滑动 ViewPager
|
// 竖直滑动 ViewPager
|
||||||
private VerticalViewPager verticalViewPager;
|
private VerticalViewPager verticalViewPager;
|
||||||
@ -167,7 +166,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
protected void main() {
|
protected void main() {
|
||||||
Bus.getOn(this);
|
Bus.getOn(this);
|
||||||
super.main();
|
super.main();
|
||||||
liveAudienceActivity = this;
|
|
||||||
CrashSaveBean.getInstance().addEnterRoom();
|
CrashSaveBean.getInstance().addEnterRoom();
|
||||||
mProcessResultUtil = new ProcessResultUtil(this);
|
mProcessResultUtil = new ProcessResultUtil(this);
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
|
@ -60,7 +60,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
private String roomId;
|
private String roomId;
|
||||||
private DialogInterface.OnShowListener listener;
|
private DialogInterface.OnShowListener listener;
|
||||||
private TextView htmlError;
|
private TextView htmlError;
|
||||||
private boolean isSetHeight =false;
|
private boolean isSetHeight = false;
|
||||||
|
|
||||||
public LiveHDDialogFragment() {
|
public LiveHDDialogFragment() {
|
||||||
|
|
||||||
@ -100,6 +100,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||||
WindowManager.LayoutParams params = window.getAttributes();
|
WindowManager.LayoutParams params = window.getAttributes();
|
||||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
|
isFullWindow = false;
|
||||||
if (isFullWindow) {
|
if (isFullWindow) {
|
||||||
Display display = null;
|
Display display = null;
|
||||||
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
@ -129,19 +130,26 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onDetach() {
|
public void onDetach() {
|
||||||
super.onDetach();
|
super.onDetach();
|
||||||
Bus.getOff(this);
|
Bus.getOff(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Bus.getOn(this);
|
Bus.getOn(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LinearLayout layout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
mWebView = (WebView) findViewById(R.id.rlWebview);
|
|
||||||
|
layout = (LinearLayout) findViewById(R.id.layout);
|
||||||
|
mWebView = new WebView(mContext);
|
||||||
|
ViewGroup.LayoutParams _params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
|
mWebView.setLayoutParams(_params);
|
||||||
|
layout.addView(mWebView);
|
||||||
htmlError = (TextView) findViewById(R.id.html_error);
|
htmlError = (TextView) findViewById(R.id.html_error);
|
||||||
findViewById(R.id.btn_back).setOnClickListener(v -> dismiss());
|
findViewById(R.id.btn_back).setOnClickListener(v -> dismiss());
|
||||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(getActivity(), mWebView)
|
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(getActivity(), mWebView)
|
||||||
@ -174,7 +182,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
findViewById(R.id.title_laout).setVisibility(View.VISIBLE);
|
findViewById(R.id.title_laout).setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (bundle.getInt("height", -1) != -1) {
|
if (bundle.getInt("height", -1) != -1) {
|
||||||
isSetHeight =true;
|
isSetHeight = true;
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1));
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1));
|
||||||
mWebView.setLayoutParams(params);
|
mWebView.setLayoutParams(params);
|
||||||
}
|
}
|
||||||
@ -195,7 +203,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
if(!isSetHeight) {
|
if (!isSetHeight) {
|
||||||
view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)");
|
view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)");
|
||||||
}
|
}
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
@ -230,7 +238,6 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void gotoLive(final String live_id) {
|
private void gotoLive(final String live_id) {
|
||||||
if (!TextUtils.equals(roomId, live_id)) {
|
if (!TextUtils.equals(roomId, live_id)) {
|
||||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||||
@ -244,7 +251,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
if (liveBean == null) {
|
if (liveBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -306,7 +313,10 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
//结束webview的加载
|
//结束webview的加载
|
||||||
|
mWebView.loadUrl("about:blank");
|
||||||
|
layout.removeView(mWebView);
|
||||||
mWebView.destroy();
|
mWebView.destroy();
|
||||||
|
mWebView = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
@ -37,6 +37,10 @@ public class CustomViewHolder implements BannerViewHolder<BannerBean> {
|
|||||||
TextView targetAssist = contextView.findViewById(R.id.target_assist_num);
|
TextView targetAssist = contextView.findViewById(R.id.target_assist_num);
|
||||||
TextView currentAssist = contextView.findViewById(R.id.current_assist_num);
|
TextView currentAssist = contextView.findViewById(R.id.current_assist_num);
|
||||||
TextView title = contextView.findViewById(R.id.title);
|
TextView title = contextView.findViewById(R.id.title);
|
||||||
|
|
||||||
|
bannerBack.setImageResource(R.mipmap.start_level);
|
||||||
|
iconStart.setImageResource(R.mipmap.icon_start);
|
||||||
|
iconStartNumber.setImageResource(R.mipmap.icon_start_number);
|
||||||
if (data.isStart()) {
|
if (data.isStart()) {
|
||||||
startContext.setVisibility(View.VISIBLE);
|
startContext.setVisibility(View.VISIBLE);
|
||||||
Glide.with(context).load(R.mipmap.start_level).into(bannerBack);
|
Glide.with(context).load(R.mipmap.start_level).into(bannerBack);
|
||||||
|
@ -66,6 +66,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import pl.droidsonroids.gif.GifImageView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/10/9.
|
* Created by cxf on 2018/10/9.
|
||||||
@ -198,12 +199,23 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
super.init();
|
super.init();
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
findViewById(R.id.btn_close).setOnClickListener(this);
|
findViewById(R.id.btn_close).setOnClickListener(this);
|
||||||
findViewById(R.id.btn_share).setOnClickListener(this);
|
GifImageView btn_share = (GifImageView) findViewById(R.id.btn_share);
|
||||||
|
btn_share.setImageResource(R.mipmap.zan_gif);
|
||||||
|
btn_share.setOnClickListener(this);
|
||||||
findViewById(R.id.btn_red_pack).setOnClickListener(this);
|
findViewById(R.id.btn_red_pack).setOnClickListener(this);
|
||||||
findViewById(R.id.btn_gift).setOnClickListener(this);
|
GifImageView btn_gift = (GifImageView) findViewById(R.id.btn_gift);
|
||||||
findViewById(R.id.btn_zg).setOnClickListener(this);
|
btn_gift.setImageResource(R.mipmap.live_lw);
|
||||||
|
btn_gift.setOnClickListener(this);
|
||||||
|
GifImageView btn_zg = (GifImageView) findViewById(R.id.btn_zg);
|
||||||
|
btn_zg.setImageResource(R.mipmap.zg);
|
||||||
|
btn_zg.setOnClickListener(this);
|
||||||
|
|
||||||
|
GifImageView onecz = (GifImageView) findViewById(R.id.img_onecz);
|
||||||
|
onecz.setImageResource(R.mipmap.onecz);
|
||||||
|
|
||||||
voiceButton = (LinearLayout) findViewById(R.id.voice_button);
|
voiceButton = (LinearLayout) findViewById(R.id.voice_button);
|
||||||
giftImage = (ImageView) findViewById(R.id.gift_image);
|
giftImage = (ImageView) findViewById(R.id.gift_image);
|
||||||
|
giftImage.setImageResource(R.mipmap.live_lw);
|
||||||
liveNewPeople = (ImageView) findViewById(R.id.live_new_people);
|
liveNewPeople = (ImageView) findViewById(R.id.live_new_people);
|
||||||
svga_new_user_gif = (SVGAImageView) findViewById(R.id.svga_new_user_gif);
|
svga_new_user_gif = (SVGAImageView) findViewById(R.id.svga_new_user_gif);
|
||||||
svga_new_user_double = (SVGAImageView) findViewById(R.id.svga_new_user_double);
|
svga_new_user_double = (SVGAImageView) findViewById(R.id.svga_new_user_double);
|
||||||
@ -249,7 +261,9 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
findViewById(R.id.btn_hd).setOnClickListener(new View.OnClickListener() {//游戏,活动按钮
|
GifImageView btn_hd = (GifImageView) findViewById(R.id.btn_hd);
|
||||||
|
btn_hd.setImageResource(R.mipmap.play);
|
||||||
|
btn_hd.setOnClickListener(new View.OnClickListener() {//游戏,活动按钮
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
LivePromotionDialogFragment fragment = new LivePromotionDialogFragment();
|
LivePromotionDialogFragment fragment = new LivePromotionDialogFragment();
|
||||||
|
@ -154,6 +154,7 @@ import org.greenrobot.eventbus.Subscribe;
|
|||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -469,6 +470,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
|
|
||||||
public void endDRGif() {
|
public void endDRGif() {
|
||||||
if (dr_pk_end_gif.getVisibility() == View.GONE) {
|
if (dr_pk_end_gif.getVisibility() == View.GONE) {
|
||||||
|
dr_pk_end_gif.setImageResource(R.mipmap.drpkend);
|
||||||
dr_pk_end_gif.setVisibility(View.VISIBLE);
|
dr_pk_end_gif.setVisibility(View.VISIBLE);
|
||||||
RequestOptions options = new RequestOptions().skipMemoryCache(true);//配置
|
RequestOptions options = new RequestOptions().skipMemoryCache(true);//配置
|
||||||
Glide.with(mContext).asGif()
|
Glide.with(mContext).asGif()
|
||||||
@ -3693,6 +3695,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST);
|
LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST);
|
||||||
LiveHttpUtil.cancel(LiveHttpConsts.TIME_CHARGE);
|
LiveHttpUtil.cancel(LiveHttpConsts.TIME_CHARGE);
|
||||||
CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION);
|
CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION);
|
||||||
|
clearImageView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
@ -4009,4 +4012,22 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private void clearImageView() {
|
||||||
|
try {
|
||||||
|
Field[] fields = getClass().getFields();
|
||||||
|
int i = 0;
|
||||||
|
for (Field field : fields) {
|
||||||
|
field.setAccessible(true);
|
||||||
|
if (field.get(this) instanceof ImageView) {
|
||||||
|
((ImageView) field.get(this)).setImageDrawable(null);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.i("清理图片缓存", "clearImageView: "+i);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -9,6 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -36,7 +38,7 @@
|
|||||||
android:onClick="backClick"
|
android:onClick="backClick"
|
||||||
android:padding="9dp"
|
android:padding="9dp"
|
||||||
android:src="@mipmap/icon_back"
|
android:src="@mipmap/icon_back"
|
||||||
android:tint="@color/textColor" />
|
app:tint="@color/textColor" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/img_more"
|
android:id="@+id/img_more"
|
||||||
@ -46,21 +48,21 @@
|
|||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:padding="9dp"
|
android:padding="9dp"
|
||||||
android:src="@mipmap/btn_more_black"
|
android:src="@mipmap/btn_more_black"
|
||||||
android:tint="@color/textColor"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
app:tint="@color/textColor" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/html_error"
|
android:id="@+id/html_error"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<WebView
|
<!-- <WebView
|
||||||
android:id="@+id/rlWebview"
|
android:id="@+id/rlWebview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />-->
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,8 +52,7 @@
|
|||||||
android:id="@+id/img_onecz"
|
android:id="@+id/img_onecz"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true" />
|
||||||
android:src="@mipmap/onecz" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -144,7 +143,6 @@
|
|||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:background="@mipmap/img_bg"
|
android:background="@mipmap/img_bg"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:src="@mipmap/zg"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
@ -166,7 +164,7 @@
|
|||||||
android:layout_width="33dp"
|
android:layout_width="33dp"
|
||||||
android:layout_height="33dp"
|
android:layout_height="33dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@mipmap/play" />
|
/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -181,7 +179,6 @@
|
|||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:background="@mipmap/img_bg"
|
android:background="@mipmap/img_bg"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:src="@mipmap/zan_gif"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<pl.droidsonroids.gif.GifImageView
|
<pl.droidsonroids.gif.GifImageView
|
||||||
@ -194,7 +191,6 @@
|
|||||||
android:layout_toLeftOf="@id/btn_close"
|
android:layout_toLeftOf="@id/btn_close"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:background="@mipmap/img_bg"
|
android:background="@mipmap/img_bg"
|
||||||
android:src="@mipmap/live_lw"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -394,8 +390,7 @@
|
|||||||
android:id="@+id/gift_image"
|
android:id="@+id/gift_image"
|
||||||
android:layout_width="38dp"
|
android:layout_width="38dp"
|
||||||
android:layout_height="38dp"
|
android:layout_height="38dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp" />
|
||||||
android:src="@mipmap/live_lw" />
|
|
||||||
<!--普通工具合集-->
|
<!--普通工具合集-->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/total_image"
|
android:id="@+id/total_image"
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -654,7 +653,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -1265,7 +1263,6 @@
|
|||||||
android:layout_alignTop="@+id/live_video"
|
android:layout_alignTop="@+id/live_video"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:src="@mipmap/icon_rank_top_box"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
@ -1533,7 +1530,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/live_top"
|
android:layout_marginTop="@dimen/live_top"
|
||||||
android:visibility="gone">
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/time"
|
android:id="@+id/time"
|
||||||
@ -1656,7 +1654,6 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -1710,7 +1707,7 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -1764,7 +1761,7 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -1820,7 +1817,7 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -1876,7 +1873,6 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -2041,7 +2037,7 @@
|
|||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
android:layout_marginBottom="11dp"
|
android:layout_marginBottom="11dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -2075,7 +2071,7 @@
|
|||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
android:layout_marginBottom="11dp"
|
android:layout_marginBottom="11dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -2109,7 +2105,7 @@
|
|||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
android:layout_marginBottom="11dp"
|
android:layout_marginBottom="11dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -2293,7 +2289,6 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="false"
|
android:layout_centerVertical="false"
|
||||||
android:layout_marginTop="160dp"
|
android:layout_marginTop="160dp"
|
||||||
android:src="@mipmap/drpkend"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@mipmap/start_level" />
|
/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/start_context"
|
android:id="@+id/start_context"
|
||||||
@ -51,7 +51,7 @@
|
|||||||
android:id="@+id/icon_start"
|
android:id="@+id/icon_start"
|
||||||
android:layout_width="12dp"
|
android:layout_width="12dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
android:src="@mipmap/icon_start" />
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/total_star_value"
|
android:id="@+id/total_star_value"
|
||||||
@ -118,7 +118,7 @@
|
|||||||
android:id="@+id/icon_start_number"
|
android:id="@+id/icon_start_number"
|
||||||
android:layout_width="12dp"
|
android:layout_width="12dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
android:src="@mipmap/icon_start_number" />
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/number_of_people_assisted"
|
android:id="@+id/number_of_people_assisted"
|
||||||
|
@ -7,6 +7,7 @@ import android.animation.Animator;
|
|||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Application;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
@ -312,6 +313,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(int position) {
|
public void onPageSelected(int position) {
|
||||||
|
if (mTabButtonGroup.getCurPosition() != position) {
|
||||||
|
System.err.println("重新初始化IM");
|
||||||
|
RongcloudIMManager.connectIM(mContext.getApplication());
|
||||||
|
position = 0;
|
||||||
|
mTabButtonGroup.setCurPosition(0);
|
||||||
|
}
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
loadPageData(position, true);
|
loadPageData(position, true);
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,28 @@
|
|||||||
package com.yunbao.main.views;
|
package com.yunbao.main.views;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.View;
|
import android.graphics.Color;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
|
import com.lzf.easyfloat.enums.ShowPattern;
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.utils.DeviceUtils;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.live.dialog.LiveRobotSettingDialogFragment;
|
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/9/22.
|
* Created by cxf on 2018/9/22.
|
||||||
@ -33,20 +45,54 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
|||||||
return R.layout.view_main_home;
|
return R.layout.view_main_home;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TextView debugView;
|
||||||
|
private TimerTask task;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
img_trophy = (ImageView) findViewById(R.id.img_trophy);
|
img_trophy = (ImageView) findViewById(R.id.img_trophy);
|
||||||
img_trophy.setOnLongClickListener(v -> {
|
|
||||||
if(true){
|
|
||||||
throw new NullPointerException("test");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
|
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
|
||||||
|
|
||||||
|
}
|
||||||
|
private void showDebugFloatView(){
|
||||||
|
img_trophy.setOnClickListener(v -> {
|
||||||
|
if (EasyFloat.isShow("Debug")) {
|
||||||
|
EasyFloat.dismiss("Debug");
|
||||||
|
task.cancel();
|
||||||
|
task = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (debugView == null) {
|
||||||
|
debugView = new TextView(mContext);
|
||||||
|
debugView.setBackgroundColor(Color.WHITE);
|
||||||
|
}
|
||||||
|
EasyFloat.with(mContext)
|
||||||
|
.setDragEnable(true)
|
||||||
|
.setTag("Debug")
|
||||||
|
.setShowPattern(ShowPattern.ALL_TIME)
|
||||||
|
.setLayout(debugView)
|
||||||
|
.show();
|
||||||
|
if (task == null) {
|
||||||
|
task = new TimerTask() {
|
||||||
|
Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (WeakReference<Activity> reference : CommonAppContext.activityList) {
|
||||||
|
builder.append(reference.get().getClass().getSimpleName()).append("\n");
|
||||||
|
}
|
||||||
|
builder.append("内存:").append(DeviceUtils.getMemoryToFormat(mContext));
|
||||||
|
if (debugView != null) {
|
||||||
|
handler.post(() -> debugView.setText(builder.toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
new Timer().schedule(task, 0, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user