فهرست منبع

1.修改部分天猫逻辑
2.修改部分小度音响逻辑
3.增加义方渠道后台/锁屏重开就重新加载首页

FailedToRead 3 سال پیش
والد
کامیت
5ed90cb73a
22فایلهای تغییر یافته به همراه422 افزوده شده و 125 حذف شده
  1. 8 0
      .idea/misc.xml
  2. 2 2
      app/build.gradle
  3. 16 2
      app/src/main/AndroidManifest.xml
  4. 44 0
      app/src/main/java/com/edufound/reader/activity/MainActivity.java
  5. 10 0
      app/src/main/java/com/edufound/reader/activity/MessageActivity.java
  6. 3 0
      app/src/main/java/com/edufound/reader/activity/RecordActivity.java
  7. 11 0
      app/src/main/java/com/edufound/reader/activity/SmallFullVideoActivity.java
  8. 36 0
      app/src/main/java/com/edufound/reader/activity/TextActivity.java
  9. 2 1
      app/src/main/java/com/edufound/reader/adapter/SlideVideoAdapter.java
  10. 5 3
      app/src/main/java/com/edufound/reader/application/EApplication.java
  11. 30 3
      app/src/main/java/com/edufound/reader/base/BaseActivity.java
  12. 2 0
      app/src/main/java/com/edufound/reader/base/BaseFragment.java
  13. 2 0
      app/src/main/java/com/edufound/reader/contract/MainContract.java
  14. 33 33
      app/src/main/java/com/edufound/reader/popwindow/PopWindowUtil.java
  15. 35 4
      app/src/main/java/com/edufound/reader/presenter/MainPresenter.java
  16. 4 0
      app/src/main/java/com/edufound/reader/presenter/PopWindowPresneter.java
  17. 5 10
      app/src/main/java/com/edufound/reader/presenter/RecordPresenter.java
  18. 94 0
      app/src/main/java/com/edufound/reader/receiver/ScreenListener.java
  19. 1 0
      app/src/main/java/com/edufound/reader/util/EfunboxUtil.java
  20. 2 2
      app/src/main/java/com/edufound/reader/util/OkHttpClient.java
  21. 70 65
      app/src/main/res/layout/activity_main.xml
  22. 7 0
      app/src/main/res/layout/activity_test.xml

+ 8 - 0
.idea/misc.xml

@@ -118,13 +118,21 @@
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/fragmentUser/layout/popupwindow_exit_login.xml" value="0.2384428223844282" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/fragmentUser/layout/popupwindow_select_grade.xml" value="0.1922141119221411" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/drawable/activity_comment_item_divier.xml" value="0.2005" />
+        <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_comment.xml" value="0.1873479318734793" />
+        <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_main.xml" value="0.2" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_pay.xml" value="0.33" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_pay_item.xml" value="0.21897810218978103" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_pay_tmail.xml" value="0.33" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_pay_tmail_item.xml" value="0.67" />
+        <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_record.xml" value="0.30231143552311435" />
+        <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_saffloer.xml" value="0.26034063260340634" />
+        <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_test.xml" value="0.24452554744525548" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/activity_userinfo_setting.xml" value="0.5" />
+        <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/adapter_item_slidevideo.xml" value="0.33" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/fragment_main_character.xml" value="0.2615571776155718" />
         <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/fragment_main_user.xml" value="0.67" />
+        <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/popupwindow_exit_app.xml" value="0.2402676399026764" />
+        <entry key="..\:/Work_Space/Android_Space/efunboxReader/efunboxReader-android-master/app/src/main/res/layout/popupwindow_record_status.xml" value="0.2451338199513382" />
       </map>
     </option>
   </component>

+ 2 - 2
app/build.gradle

@@ -14,8 +14,8 @@ android {
         applicationId "com.edufound.reader"
         minSdkVersion 21
         targetSdkVersion 30
-        versionCode 1
-        versionName "1.0"
+        versionCode 2
+        versionName "1.2"
         flavorDimensions "versionCode"
         manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
         testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

+ 16 - 2
app/src/main/AndroidManifest.xml

@@ -56,6 +56,10 @@
                 <action android:name="com.edufound.reader.MAIN"></action>
 
                 <category android:name="android.intent.category.BROWSABLE" />
+
+                <!-- 天猫精灵要加一句这个(百度不加)-->
+                <category android:name="android.intent.category.DEFAULT" />
+                <!-- 天猫精灵要加一句这个-->
                 <data
                     android:host="com.edufound.reader"
                     android:path="/main"
@@ -72,7 +76,8 @@
             android:resizeableActivity="true"
             android:screenOrientation="landscape"
             android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
-            android:windowSoftInputMode="adjustNothing|stateHidden" /> <!-- 登录界面 -->
+            android:windowSoftInputMode="adjustNothing|stateHidden" />
+        <!-- 登录界面 -->
         <activity
             android:name=".activity.CrashDialogActivity"
             android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
@@ -229,7 +234,16 @@
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
 
-
+        <activity
+            android:name=".activity.TextActivity"
+            android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
+            android:label=""
+            android:launchMode="singleTask"
+            android:maxAspectRatio="2.1"
+            android:resizeableActivity="true"
+            android:screenOrientation="landscape"
+            android:theme="@style/efunboxTransparentLoginAlert"
+            android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
         <!-- 友盟start -->
         <meta-data
             android:name="UMENG_APPKEY"

+ 44 - 0
app/src/main/java/com/edufound/reader/activity/MainActivity.java

@@ -6,9 +6,11 @@ import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.res.Configuration;
 import android.net.Uri;
 import android.os.Bundle;
 import android.view.KeyEvent;
+import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.RadioButton;
@@ -21,6 +23,7 @@ import com.baidu.duer.membersdk.MemberSdkManager;
 import com.baidu.duer.membersdk.constant.MemberSdkConstants;
 import com.edufound.reader.R;
 import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.application.EApplication;
 import com.edufound.reader.base.BaseActivity;
 import com.edufound.reader.base.BaseMvpActivity;
 import com.edufound.reader.bean.ChannelCodeEnum;
@@ -49,6 +52,9 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
     @BindView(id = R.id.activity_main_exitapp_icon)
     ImageView mExitApp;
 
+    @BindView(id = R.id.testbg)
+    ImageView testBg;
+
     @Override
     public int getLayoutId() {
         return R.layout.activity_main;
@@ -61,6 +67,7 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
         mPresenter.attachView(this);
         mActivity = this;
 //        mRadioGroupTab = null;
+        testBg.setVisibility(View.GONE);
         mRadioGroupTab.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(RadioGroup radioGroup, int id) {
@@ -174,8 +181,11 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
         intentFilter.addAction(BackPageReceiver.BACK_HOME_REF_MY_FRAGMENT);
         intentFilter.addAction(BackPageReceiver.BACK_HOME_REF_VIDEO_ITEM);
         registerReceiver(receiver, intentFilter);
+
+
     }
 
+
     @Override
     protected void onDestroy() {
         super.onDestroy();
@@ -253,4 +263,38 @@ public class MainActivity extends BaseMvpActivity<MainPresenter> implements Main
     protected void botOnBuyStatusUpdated(@NonNull String purchaseResult, @NonNull String productId, @NonNull String baiduOrderId, @NonNull String sellerOrderId, @Nullable String msg, String token) {
         super.botOnBuyStatusUpdated(purchaseResult, productId, baiduOrderId, sellerOrderId, msg, token);
     }
+
+    @Override
+    protected void onScreenUserPresent() {
+        super.onScreenUserPresent();
+        if (Consts.getUmengChannel().equals(ChannelCodeEnum.YIFANG.getChannelCode())) {
+            //义方渠道在手机
+            Intent intent = new Intent(mActivity, TextActivity.class);
+            startActivity(intent);
+
+            for (int i = 0; i < EApplication.mActivityList.size(); i++) {
+                EApplication.mActivityList.get(i).finish();
+            }
+
+        }
+
+//        Intent intent = new Intent(getActivity(), MainActivity.class);
+//        intent.putExtra("defaultIndex", 1);
+//        startActivity(intent);
+    }
+
+    @Override
+    protected void onAppScreenOff() {
+        if (Consts.getUmengChannel().equals(ChannelCodeEnum.YIFANG.getChannelCode())) {
+            //义方渠道在手机
+            testBg.setVisibility(View.VISIBLE);
+        }
+        super.onAppScreenOff();
+    }
+
+    @Override
+    public void onConfigurationChanged(@NonNull Configuration newConfig) {
+        super.onConfigurationChanged(newConfig);
+        Logger.e("onConfigurationChanged:");
+    }
 }

+ 10 - 0
app/src/main/java/com/edufound/reader/activity/MessageActivity.java

@@ -19,6 +19,7 @@ import java.util.HashMap;
 
 import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.RecyclerView;
+
 import io.reactivex.rxjava3.annotations.Nullable;
 
 public class MessageActivity extends BaseMvpActivity<MessagePresenter> implements MessageContract.View {
@@ -89,6 +90,15 @@ public class MessageActivity extends BaseMvpActivity<MessagePresenter> implement
     }
 
     @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        mPresenter.attachView(this);
+        mPresenter = null;
+        getRootView().removeAllViews();
+
+    }
+
+    @Override
     public Activity getActivity() {
         return mActivity;
     }

+ 3 - 0
app/src/main/java/com/edufound/reader/activity/RecordActivity.java

@@ -187,6 +187,8 @@ public class RecordActivity extends BaseMvpActivity<RecordPresenter> implements
     @Override
     protected void onDestroy() {
         mPresenter.activityDestroy();
+        mPresenter.attachView(this);
+        getRootView().removeAllViews();
         mJzVideoViwe = null;
         super.onDestroy();
     }
@@ -220,6 +222,7 @@ public class RecordActivity extends BaseMvpActivity<RecordPresenter> implements
         isRecordNow = false;
         mRecordStatus.setText("开始朗读");
         mPresenter.stopRecord();
+        Logger.e("重新刷新录音状态,停止之前的录音,并且显示弹窗");
     }
 
     @Override

+ 11 - 0
app/src/main/java/com/edufound/reader/activity/SmallFullVideoActivity.java

@@ -8,6 +8,7 @@ import android.widget.ImageView;
 
 import com.edufound.reader.R;
 import com.edufound.reader.annotation.BindView;
+import com.edufound.reader.application.EApplication;
 import com.edufound.reader.base.BaseMvpActivity;
 import com.edufound.reader.contract.SmallFullVideoContract;
 import com.edufound.reader.model.MyCollectionModel;
@@ -123,4 +124,14 @@ public class SmallFullVideoActivity extends BaseMvpActivity<SmallFullVideoPresen
         }
     };
 
+    @Override
+    protected void onScreenUserPresent() {
+        super.onScreenUserPresent();
+        for (int i = 0; i < EApplication.mActivityList.size(); i++) {
+            EApplication.mActivityList.get(i).finish();
+        }
+        Intent intent = new Intent(getActivity(), MainActivity.class);
+        intent.putExtra("defaultIndex", 1);
+        startActivity(intent);
+    }
 }

+ 36 - 0
app/src/main/java/com/edufound/reader/activity/TextActivity.java

@@ -0,0 +1,36 @@
+package com.edufound.reader.activity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.edufound.reader.R;
+import com.orhanobut.logger.Logger;
+
+public class TextActivity extends Activity {
+
+    //手机端锁屏返回之后重新加载用
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        Logger.e("测试activity");
+        setContentView(R.layout.activity_test);
+        handler.sendEmptyMessageDelayed(1, 2000);
+    }
+
+    Handler handler = new Handler(new Handler.Callback() {
+        @Override
+        public boolean handleMessage(@NonNull Message msg) {
+            Intent intent = new Intent(TextActivity.this, MainActivity.class);
+            startActivity(intent);
+            finish();
+            return false;
+        }
+    });
+}

+ 2 - 1
app/src/main/java/com/edufound/reader/adapter/SlideVideoAdapter.java

@@ -31,6 +31,7 @@ import java.util.List;
 import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
+
 import cn.jzvd.JZDataSource;
 import cn.jzvd.Jzvd;
 import cn.jzvd.JzvdStd;
@@ -63,7 +64,7 @@ public class SlideVideoAdapter extends RecyclerView.Adapter<VideoHolder> {
 //        holder.mVideo.setUp(new JZDataSource(mListData.get(position).getUserRead().getVideoPath()), JzvdStd.SCREEN_FULLSCREEN);
         holder.mVideo.setUp(new JZDataSource(mListData.get(position).getUserRead().getVideoPath()), JzvdStd.SCREEN_FULLSCREEN, JZMediaIjk.class, mListData.get(position).getUserRead().getId());
         GlideUtils.loadImageSizeKipMemoryCache(mContext, mListData.get(position).getUserRead().getCoverImg(), holder.mVideo.posterImageView);
-//        holder.initDanMu(mListData.get(position).getUserRead().getId());
+        holder.initDanMu(mListData.get(position).getUserRead().getId());
         holder.mVideo.startPreloading();
         holder.mSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override

+ 5 - 3
app/src/main/java/com/edufound/reader/application/EApplication.java

@@ -102,7 +102,7 @@ public class EApplication extends Application {
             Consts.setUID("test");
             Logger.e("Consts.uid:" + Consts.getUID());
             //初始化activity监听
-//            registerActivityLifecycleCallbacks(activityLifecycleCallbacks);
+            registerActivityLifecycleCallbacks(activityLifecycleCallbacks);
             if (Consts.getUmengChannel().equals(ChannelCodeEnum.BAIDU.getChannelCode())) {
                 /** 接入益智乐园的App,需要删掉下面这一行。保证益智乐园的付费等逻辑正常执行,不知道益智乐园是啥的,不要删掉这一行 */
                 HeartBeatReporter.getInstance().setShouldUploadHeartBeatByApp(false);
@@ -112,7 +112,7 @@ public class EApplication extends Application {
 //                BotSdk.enableLog(BuildConfig.DEBUG);
                 String random1 = BotConstants.RANDOM1_PREFIX + Math.random();
                 String random2 = BotConstants.RANDOM2_PREFIX + Math.random();
-                // 在线校验示例
+                // 在线校验示例3
                 BotSdk.getInstance().register(BotMessageListener.getInstance(), BotConstants.BOTID,
                         random1, BotSDKUtils.sign(random1), random2, BotSDKUtils.sign(random2));
 
@@ -172,7 +172,9 @@ public class EApplication extends Application {
                 isForeground = false;
 //                ToastUtil.showToast("app后台了");
                 Logger.e("app后台了");
-                killAppProcess(Consts.getmApplicAtion());
+                if (Consts.getUmengChannel().equals(ChannelCodeEnum.YIFANG.getChannelCode())) {
+                    killAppProcess(Consts.getmApplicAtion());
+                }
             }
         }
 

+ 30 - 3
app/src/main/java/com/edufound/reader/base/BaseActivity.java

@@ -39,6 +39,7 @@ import com.baidu.duer.botsdk.IAccountChargeMsgListener;
 import com.baidu.duer.membersdk.MemberSdkManager;
 import com.baidu.duer.membersdk.view.FloatingView;
 import com.edufound.reader.R;
+import com.edufound.reader.activity.TextActivity;
 import com.edufound.reader.annotation.BindView;
 import com.edufound.reader.apiserver.UserApiServerImpl;
 import com.edufound.reader.application.EApplication;
@@ -52,6 +53,7 @@ import com.edufound.reader.botsdk.IBotIntentCallback;
 import com.edufound.reader.cusview.CusToast;
 import com.edufound.reader.receiver.HomeKeyEventReceiver;
 import com.edufound.reader.receiver.NetworkChangeReceiver;
+import com.edufound.reader.receiver.ScreenListener;
 import com.edufound.reader.receiver.ShowFollowReceiver;
 import com.edufound.reader.receiver.ShowPageLoadingReceiver;
 import com.edufound.reader.tmailsdk.TMailSDKUtil;
@@ -101,6 +103,7 @@ public abstract class BaseActivity extends AppCompatActivity {
     //百度浮窗
     private FloatingView mFloating;
     private boolean hasResume = false;
+    ScreenListener screenListener;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -151,6 +154,26 @@ public abstract class BaseActivity extends AppCompatActivity {
         ShowFollowReceiver.registerObserver(showFollow);
         ShowPageLoadingReceiver.registerReceiver(this);
         ShowPageLoadingReceiver.registerObserver(pageLoadingReceiver);
+        screenListener = new ScreenListener(this);
+        screenListener.begin(new ScreenListener.ScreenStateListener() {
+            @Override
+            public void onScreenOn() {
+                Logger.e("onScreenOn");
+
+            }
+
+            @Override
+            public void onScreenOff() {
+                Logger.e("onScreenOff");
+                onAppScreenOff();
+
+            }
+
+            @Override
+            public void onUserPresent() {
+                onScreenUserPresent();
+            }
+        });
 
     }
 
@@ -493,6 +516,7 @@ public abstract class BaseActivity extends AppCompatActivity {
         }
     }
 
+
     @Override
     protected void onResume() {
         super.onResume();
@@ -507,13 +531,11 @@ public abstract class BaseActivity extends AppCompatActivity {
                 e.printStackTrace();
             }
         } else if (Consts.getUmengChannel().equals(ChannelCodeEnum.BAIDU.getChannelCode())) {
-            Logger.e("显示弹窗");
             hasResume = true;
             if (mFloating != null) {
                 mFloating.dismissFloatView();
             }
             mFloating = MemberSdkManager.getInstance().showFloatView(this);
-            Logger.e("显示弹窗mFloating");
         }
     }
 
@@ -763,8 +785,10 @@ public abstract class BaseActivity extends AppCompatActivity {
             Logger.e("token:" + token);
             if (purchaseResult.equals("SUCCESS")) {
                 //成功
+                BotRegisterListener.getBaiDuVipInfo();
             } else if (purchaseResult.equals("ERROR")) {
                 //支付失败
+
             }
             botOnBuyStatusUpdated(purchaseResult, productId, baiduOrderId, sellerOrderId, msg, token);
 
@@ -833,9 +857,12 @@ public abstract class BaseActivity extends AppCompatActivity {
     //endregion
 
 
+    protected void onScreenUserPresent() {
 
+    }
 
+    protected void onAppScreenOff(){}
 
 
+}
 
-}

+ 2 - 0
app/src/main/java/com/edufound/reader/base/BaseFragment.java

@@ -236,6 +236,7 @@ public abstract class BaseFragment extends Fragment {
                                 map.put("channel", Consts.getUmengChannel());
                                 map.put("mobileNo", phone);
                                 map.put("nickName", EfunboxUtil.setPhoneMiddle(phone));
+                                Logger.e("Consts.getmConstsBaiDuUserBean().getUserInfo().getUserId():"+Consts.getmConstsBaiDuUserBean().getUserInfo().getUserId());
                                 map.put("userId", Consts.getmConstsBaiDuUserBean().getUserInfo().getUserId());
                                 if (MMKVUtil.getInstance().decodeString(MMKVEncodeKey.USER_GRADE).equals("") || MMKVUtil.getInstance().decodeString(MMKVEncodeKey.USER_GRADE) == null) {
                                     //如果没有,默认给一年级
@@ -248,6 +249,7 @@ public abstract class BaseFragment extends Fragment {
                                 userApiServer.registerUserId(topActivity, json, new Callback() {
                                     @Override
                                     public void onSuccess(HttpInfo info) throws IOException {
+                                        Logger.e("注册用户:"+info.getRetDetail());
                                         HttpResultBean<UserBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<UserBean>>() {
                                         }.getType());
                                         Consts.setUID(bean.getData().getUid());

+ 2 - 0
app/src/main/java/com/edufound/reader/contract/MainContract.java

@@ -47,5 +47,7 @@ public interface MainContract {
         void refRecordById(String id);
 
         void refMyFragment();
+
+        void resumeFragment();
     }
 }

+ 33 - 33
app/src/main/java/com/edufound/reader/popwindow/PopWindowUtil.java

@@ -38,6 +38,7 @@ import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 import androidx.annotation.Nullable;
+
 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
 import io.reactivex.rxjava3.annotations.NonNull;
 import io.reactivex.rxjava3.core.Observable;
@@ -51,6 +52,7 @@ import static com.trello.rxlifecycle4.RxLifecycle.bindUntilEvent;
 public class PopWindowUtil {
     private static PopWindowPresneter mPresenter;
     private static PopupWindow mPopupWindow;
+    private static FrameLayout dialog_view;
 
 
     private static void initPresenter() {
@@ -77,9 +79,8 @@ public class PopWindowUtil {
         if (checkWindowShoing()) {
             return;
         }
-        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_exit_app, null);
+        dialog_view = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.popupwindow_exit_app, null);
         dialog_view.setFocusable(true);
-
         ImageView image = dialog_view.findViewById(R.id.popupwindow_exit_app_image);
         GlideUtils.loadImageSizeKipMemoryCache(context, "http://reader-apk.ai160.com/reader-apk/res/exit_app.png", image);
         FrameLayout exit = dialog_view.findViewById(R.id.popupwindow_exit_app_ok);
@@ -97,9 +98,8 @@ public class PopWindowUtil {
             showDeviceInfo(context);
         });
 
-        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
-        mPopupWindow.setFocusable(true);
-        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+
+        newPopupWindow(parent, true);
     }
 
     public static void showSelectGradeWindow(Context context, View parent, int checked, PopUtilClickListener listener) {
@@ -107,7 +107,7 @@ public class PopWindowUtil {
         if (checkWindowShoing()) {
             return;
         }
-        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_select_grade, null);
+        dialog_view = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.popupwindow_select_grade, null);
         dialog_view.setFocusable(true);
         FrameLayout btn_ok = dialog_view.findViewById(R.id.popupwindow_select_ok);
         GridRadioGroup gridRadioGroup = dialog_view.findViewById(R.id.popupwindow_select_grade_gridgroup);
@@ -171,9 +171,7 @@ public class PopWindowUtil {
             mPopupWindow.dismiss();
             listener.clickSubmit(checkText[0]);
         });
-        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
-        mPopupWindow.setFocusable(true);
-        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        newPopupWindow(parent, true);
     }
 
 
@@ -182,7 +180,7 @@ public class PopWindowUtil {
         if (checkWindowShoing()) {
             return;
         }
-        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_exit_login, null);
+        dialog_view = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.popupwindow_exit_login, null);
         dialog_view.setFocusable(true);
         ImageView image = dialog_view.findViewById(R.id.popupwindow_exit_login_image);
         GlideUtils.loadImageSizeKipMemoryCache(context, "http://reader-apk.ai160.com/reader-apk/res/exit_login.png", image);
@@ -196,9 +194,7 @@ public class PopWindowUtil {
             mPopupWindow.dismiss();
             listener.clickCancel();
         });
-        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
-        mPopupWindow.setFocusable(true);
-        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        newPopupWindow(parent, true);
     }
 
     public static void showCancellationAccountWindow(Context context, View parent, PopUtilClickListener listener) {
@@ -206,7 +202,7 @@ public class PopWindowUtil {
         if (checkWindowShoing()) {
             return;
         }
-        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_cancellation_account, null);
+        dialog_view = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.popupwindow_cancellation_account, null);
         dialog_view.setFocusable(true);
         FrameLayout exit = dialog_view.findViewById(R.id.popupwindow_cancellation_account_ok);
         FrameLayout cancel = dialog_view.findViewById(R.id.popupwindow_cancellation_account_cancel);
@@ -218,9 +214,7 @@ public class PopWindowUtil {
             mPopupWindow.dismiss();
             listener.clickCancel();
         });
-        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
-        mPopupWindow.setFocusable(true);
-        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        newPopupWindow(parent, true);
     }
 
 
@@ -229,7 +223,7 @@ public class PopWindowUtil {
         if (checkWindowShoing()) {
             return;
         }
-        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_bind_wechat, null);
+        dialog_view = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.popupwindow_bind_wechat, null);
         dialog_view.setFocusable(true);
         ImageView back = dialog_view.findViewById(R.id.popupwindow_bindwechat_back);
         ImageView image = dialog_view.findViewById(R.id.popupwindow_bind_wechat_image);
@@ -243,9 +237,7 @@ public class PopWindowUtil {
         });
         mPresenter.getBindWeChatPath(context, image);
         mPresenter.getMyInfo(context, text);
-        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
-        mPopupWindow.setFocusable(true);
-        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        newPopupWindow(parent, false);
     }
 
 
@@ -254,7 +246,7 @@ public class PopWindowUtil {
         if (checkWindowShoing()) {
             return;
         }
-        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_record_status, null);
+        dialog_view = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.popupwindow_record_status, null);
         dialog_view.setFocusable(true);
         dialog_view.setOnKeyListener(new View.OnKeyListener() {
             @Override
@@ -270,9 +262,7 @@ public class PopWindowUtil {
             mPopupWindow.dismiss();
         });
         mPresenter.initRecordStatusWindow(context, dialog_view, bean, userread, listener);
-        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
-        mPopupWindow.setFocusable(false);
-        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        newPopupWindow(parent, false);
     }
 
 
@@ -281,7 +271,7 @@ public class PopWindowUtil {
         if (checkWindowShoing()) {
             return;
         }
-        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_myorder, null);
+        dialog_view = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.popupwindow_myorder, null);
         dialog_view.setFocusable(true);
         dialog_view.setOnKeyListener(new View.OnKeyListener() {
             @Override
@@ -297,9 +287,7 @@ public class PopWindowUtil {
             mPopupWindow.dismiss();
         });
         mPresenter.myOrderWindowInit(context, dialog_view);
-        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
-        mPopupWindow.setFocusable(false);
-        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        newPopupWindow(parent, false);
     }
 
 
@@ -308,7 +296,7 @@ public class PopWindowUtil {
         if (checkWindowShoing()) {
             return;
         }
-        View dialog_view = LayoutInflater.from(context).inflate(R.layout.popupwindow_record_remove, null);
+        dialog_view = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.popupwindow_record_remove, null);
         dialog_view.setFocusable(true);
         FrameLayout ok = dialog_view.findViewById(R.id.popupwindow_record_remove_ok);
         FrameLayout cancel = dialog_view.findViewById(R.id.popupwindow_record_remove_cancel);
@@ -321,9 +309,7 @@ public class PopWindowUtil {
             mPopupWindow.dismiss();
             listener.clickCancel();
         });
-        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
-        mPopupWindow.setFocusable(true);
-        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        newPopupWindow(parent, true);
     }
 
 
@@ -366,6 +352,20 @@ public class PopWindowUtil {
     private static void setClickListener(View view, Consumer onNext) {
         RxView.clicks(view).throttleFirst(2, TimeUnit.SECONDS).subscribe(onNext);
     }
+
+    private static void newPopupWindow(View parent, boolean nedFocus) {
+        mPopupWindow = new PopupWindow(dialog_view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
+        mPopupWindow.setFocusable(nedFocus);
+        mPopupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
+        mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                dialog_view.removeAllViews();
+                dialog_view = null;
+                mPopupWindow = null;
+            }
+        });
+    }
 }
 
 

+ 35 - 4
app/src/main/java/com/edufound/reader/presenter/MainPresenter.java

@@ -68,10 +68,7 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
         mUserApi = new UserApiServerImpl();
         mOrderApi = new OrderApiServerImpl();
         mFragmentManager = fragmentManager;
-        mUserFragment = new MyTabFragment();
-        mRecommendFragment = new RecommendFragment(0);
-        mFollowFragment = new RecommendFragment(1);
-        mCharacterFragment = new CharacterFragment();
+        resumeFragment();
 
     }
 
@@ -84,6 +81,12 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
                 //我的
                 if (EfunboxUtil.checkLogin(mView.getActivity())) {
                     mRadioCheckIndex = 0;
+                    mRecommendFragment = null;
+                    mFollowFragment = null;
+                    mCharacterFragment = null;
+                    if (mUserFragment == null) {
+                        mUserFragment = new MyTabFragment();
+                    }
                     changeFragmentLayout(mUserFragment);
                     mUserApi.postUserEvent(mView.getActivity(), UserEventEnum.EVENT_MY.getEvent());
                 } else {
@@ -94,6 +97,12 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
                 //推荐
                 mRadioCheckIndex = 1;
                 ((RadioButton) radioGroup.getChildAt(mRadioCheckIndex)).setChecked(true);
+                mUserFragment = null;
+                mFollowFragment = null;
+                mCharacterFragment = null;
+                if (mRecommendFragment == null) {
+                    mRecommendFragment = new RecommendFragment(0);
+                }
                 changeFragmentLayout(mRecommendFragment);
                 mUserApi.postUserEvent(mView.getActivity(), UserEventEnum.EVENT_RECOMMEND.getEvent());
                 break;
@@ -101,6 +110,12 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
                 //关注
                 if (EfunboxUtil.checkLogin(mView.getActivity())) {
                     mRadioCheckIndex = 2;
+                    mUserFragment = null;
+                    mCharacterFragment = null;
+                    mRecommendFragment = null;
+                    if (mFollowFragment == null) {
+                        mFollowFragment = new RecommendFragment(1);
+                    }
                     changeFragmentLayout(mFollowFragment);
                     mUserApi.postUserEvent(mView.getActivity(), UserEventEnum.EVENT_SUBSCRIBE.getEvent());
                 } else {
@@ -111,6 +126,12 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
                 //任务
                 mRadioCheckIndex = 3;
                 ((RadioButton) radioGroup.getChildAt(mRadioCheckIndex)).setChecked(true);
+                mUserFragment = null;
+                mFollowFragment = null;
+                mRecommendFragment = null;
+                if (mCharacterFragment == null) {
+                    mCharacterFragment = new CharacterFragment();
+                }
                 changeFragmentLayout(mCharacterFragment);
                 mUserApi.postUserEvent(mView.getActivity(), UserEventEnum.EVENT_RESOURCES.getEvent());
                 break;
@@ -184,6 +205,7 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
         mUserApi.isLogin(mView.getActivity(), DeviceUuidFactory.getUuid(), new Callback() {
             @Override
             public void onSuccess(HttpInfo info) throws IOException {
+                Logger.e("info.get:" + info.getRetDetail());
                 try {
                     JSONObject object = new JSONObject(info.getRetDetail());
                     if (object.getString("code").equals("300") || object.getInt("code") == 300) {
@@ -332,6 +354,15 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
         }
     }
 
+    @Override
+    public void resumeFragment() {
+
+        mUserFragment = new MyTabFragment();
+        mRecommendFragment = new RecommendFragment(0);
+        mFollowFragment = new RecommendFragment(1);
+        mCharacterFragment = new CharacterFragment();
+    }
+
 
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         switch (keyCode) {

+ 4 - 0
app/src/main/java/com/edufound/reader/presenter/PopWindowPresneter.java

@@ -259,6 +259,10 @@ public class PopWindowPresneter {
                                 @Override
                                 public void onClick(View view) {
 //                                    Toast.makeText(context, "重新上传", Toast.LENGTH_SHORT).show();
+                                    Logger.e("重新上传");
+                                    mUploadingErrorFrame.setVisibility(View.GONE);
+                                    mUploadingFrame.setVisibility(View.VISIBLE);
+                                    userApi.postUserEvent(activity, UserEventEnum.EVENT_UPLOAD.getEvent());
                                     mModel.upLoadRecord(activity, Consts.getRecordUpLoadFileUrl(), mUploadProgressBack);
                                 }
                             });

+ 5 - 10
app/src/main/java/com/edufound/reader/presenter/RecordPresenter.java

@@ -4,18 +4,15 @@ import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
 import android.content.ServiceConnection;
-import android.media.MediaPlayer;
 import android.os.Bundle;
 import android.os.IBinder;
 import android.util.Log;
 import android.view.View;
-import android.view.ViewGroup;
 import android.widget.FrameLayout;
 import android.widget.Toast;
 
 import com.chivox.aiengine.EvalResult;
 import com.edufound.reader.apiserver.UserApiServerImpl;
-import com.edufound.reader.base.BaseActivity;
 import com.edufound.reader.base.BasePresenter;
 import com.edufound.reader.bean.ChannelCodeEnum;
 import com.edufound.reader.bean.HttpResultBean;
@@ -24,20 +21,15 @@ import com.edufound.reader.bean.UserEventEnum;
 import com.edufound.reader.bean.UserRecordBean;
 import com.edufound.reader.botsdk.BotRegisterListener;
 import com.edufound.reader.contract.RecordContract;
-import com.edufound.reader.cusview.CusToast;
-import com.edufound.reader.cusview.FullScreenVideoController;
 import com.edufound.reader.cusview.RvListJzvdStd;
 import com.edufound.reader.listener.PopupRecordStatusListener;
 import com.edufound.reader.model.RecordModel;
 import com.edufound.reader.popwindow.PopWindowUtil;
-import com.edufound.reader.receiver.BackPageReceiver;
 import com.edufound.reader.services.RecordServices;
 import com.edufound.reader.util.Consts;
 import com.edufound.reader.util.DataCleanManager;
-import com.edufound.reader.util.EfunboxCallBack;
 import com.edufound.reader.util.GlideUtils;
 import com.edufound.reader.videoutil.JZMediaIjk;
-import com.google.gson.JsonObject;
 import com.google.gson.reflect.TypeToken;
 import com.okhttplib.HttpInfo;
 import com.okhttplib.callback.Callback;
@@ -47,8 +39,6 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
 
 import cn.jzvd.JZDataSource;
 import cn.jzvd.Jzvd;
@@ -248,8 +238,10 @@ public class RecordPresenter extends BasePresenter<RecordContract.View> implemen
 //        Intent intent = new Intent(BackPageReceiver.BACK_HOME_REF_VIDEO_ITEM);
 ////        intent.putExtra("recordId", );
 //        mView.getActivity().sendBroadcast(intent);
+        mView.getJZVideoView().removeAllViews();
         recordServicesConn = null;
         mRecordServices = null;
+        System.gc();
     }
 
     @Override
@@ -264,6 +256,7 @@ public class RecordPresenter extends BasePresenter<RecordContract.View> implemen
 
     @Override
     public void showRecordStatusWindow(RecordResultBean bean, UserRecordBean.UserRead userread) {
+        Logger.e("显示录音之后的弹窗");
         PopWindowUtil.showRecordStatusWindow(mView.getActivity(), mView.getRootView(), bean, userread, new PopupRecordStatusListener() {
             @Override
             public void clickReRecord() {
@@ -321,6 +314,7 @@ public class RecordPresenter extends BasePresenter<RecordContract.View> implemen
                         mView.getJZVideoView().post(new Runnable() {
                             @Override
                             public void run() {
+                                Logger.e("----------------录音返回请求了-------------------------");
                                 showRecordStatusWindow(new RecordResultBean(overall, speed, tone, integrity, accuracy), mRecordUserRead);
                             }
                         });
@@ -340,6 +334,7 @@ public class RecordPresenter extends BasePresenter<RecordContract.View> implemen
                 public void onRecordError(String tokenId, EvalResult result) {
                     //Toast.makeText(mView.getActivity(), "录音失败:" + result.text(), Toast.LENGTH_SHORT).show();
 //                    CusToast.getInstance(mView.getActivity()).show("录音失败", 2000);
+                    Logger.e("----------------录音失败了-------------------------");
                     Toast.makeText(Consts.getmApplicAtion(), "录音失败", Toast.LENGTH_SHORT).show();
                 }
 

+ 94 - 0
app/src/main/java/com/edufound/reader/receiver/ScreenListener.java

@@ -0,0 +1,94 @@
+package com.edufound.reader.receiver;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.PowerManager;
+
+import com.orhanobut.logger.Logger;
+
+public class ScreenListener {
+    private Context mContext;
+    private ScreenBroadcastReceiver mScreenReceiver;
+    private ScreenStateListener mScreenStateListener;
+
+    public ScreenListener(Context context) {
+        mContext = context;
+        mScreenReceiver = new ScreenBroadcastReceiver();
+    }
+
+    /**
+     * screen状态广播接收者
+     */
+    private class ScreenBroadcastReceiver extends BroadcastReceiver {
+        private String action = null;
+
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            action = intent.getAction();
+            if (Intent.ACTION_SCREEN_ON.equals(action)) { // 开屏
+                mScreenStateListener.onScreenOn();
+            } else if (Intent.ACTION_SCREEN_OFF.equals(action)) { // 锁屏
+                mScreenStateListener.onScreenOff();
+            } else if (Intent.ACTION_USER_PRESENT.equals(action)) { // 解锁
+                mScreenStateListener.onUserPresent();
+            }
+        }
+    }
+
+    /**
+     * 开始监听screen状态
+     *
+     * @param listener
+     */
+    public void begin(ScreenStateListener listener) {
+        mScreenStateListener = listener;
+        registerListener();
+        getScreenState();
+    }
+
+    /**
+     * 获取screen状态
+     */
+    private void getScreenState() {
+        PowerManager manager = (PowerManager) mContext
+                .getSystemService(Context.POWER_SERVICE);
+        if (manager.isScreenOn()) {
+            if (mScreenStateListener != null) {
+                mScreenStateListener.onScreenOn();
+            }
+        } else {
+            if (mScreenStateListener != null) {
+                mScreenStateListener.onScreenOff();
+            }
+        }
+    }
+
+    /**
+     * 停止screen状态监听
+     */
+    public void unregisterListener() {
+        mContext.unregisterReceiver(mScreenReceiver);
+    }
+
+    /**
+     * 启动screen状态广播接收器
+     */
+    private void registerListener() {
+        IntentFilter filter = new IntentFilter();
+        filter.addAction(Intent.ACTION_SCREEN_ON);
+        filter.addAction(Intent.ACTION_SCREEN_OFF);
+        filter.addAction(Intent.ACTION_USER_PRESENT);
+        mContext.registerReceiver(mScreenReceiver, filter);
+    }
+
+    public interface ScreenStateListener {// 返回给调用者屏幕状态信息
+
+        public void onScreenOn();
+
+        public void onScreenOff();
+
+        public void onUserPresent();
+    }
+}

+ 1 - 0
app/src/main/java/com/edufound/reader/util/EfunboxUtil.java

@@ -22,6 +22,7 @@ public class EfunboxUtil {
      * 得到宽高缩放比
      */
     public static void initDesignSize(Context context) {
+        Logger.e("修改DIP适配问题");
         final DisplayMetrics appDisplayMetrics = context.getResources().getDisplayMetrics();
         int designWidth = 1280;
         int designHeight = 720;

+ 2 - 2
app/src/main/java/com/edufound/reader/util/OkHttpClient.java

@@ -34,8 +34,8 @@ public class OkHttpClient {
     public static void initOkHttpUtil(Context context) {
         OkHttpUtil.init(context)
                 .setConnectTimeout(10)//连接超时时间
-                .setWriteTimeout(15)//写超时时间
-                .setReadTimeout(15)//读超时时间
+                .setWriteTimeout(300)//写超时时间
+                .setReadTimeout(300)//读超时时间
                 .setMaxCacheSize(10 * 1024 * 1024)//缓存空间大小
                 .setCacheType(CacheType.FORCE_NETWORK)//缓存类型
                 .setHttpLogTAG("HttpLog")//设置请求日志标识

+ 70 - 65
app/src/main/res/layout/activity_main.xml

@@ -1,104 +1,104 @@
 <?xml version="1.0" encoding="utf-8"?>
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        xmlns:app="http://schemas.android.com/apk/res-auto"
-        xmlns:tools="http://schemas.android.com/tools"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
 
     <FrameLayout
-            android:id="@+id/background"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="@drawable/main_background"></FrameLayout>
+        android:id="@+id/background"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@drawable/main_background"></FrameLayout>
 
     <FrameLayout
+        android:layout_width="1280dp"
+        android:layout_height="720dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintDimensionRatio="h,16:9"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <LinearLayout
             android:layout_width="1280dp"
             android:layout_height="720dp"
+            android:orientation="horizontal"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintDimensionRatio="h,16:9"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent">
 
-        <LinearLayout
-                android:layout_width="1280dp"
-                android:layout_height="720dp"
-                android:orientation="horizontal"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintDimensionRatio="h,16:9"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toTopOf="parent">
-
             <LinearLayout
-                    android:layout_width="0dp"
-                    android:layout_height="match_parent"
-                    android:layout_gravity="left"
-                    android:layout_marginLeft="30dp"
-                    android:layout_weight="1.3"
-                    android:orientation="vertical">
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_gravity="left"
+                android:layout_marginLeft="30dp"
+                android:layout_weight="1.3"
+                android:orientation="vertical">
 
 
                 <RadioGroup
-                        android:id="@+id/main_left_tab_layout"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_gravity="center"
-                        android:gravity="center|top"
-                        android:orientation="vertical"
-                        android:showDividers="middle">
+                    android:id="@+id/main_left_tab_layout"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:gravity="center|top"
+                    android:orientation="vertical"
+                    android:showDividers="middle">
 
                     <RadioButton
-                            android:id="@+id/main_left_tab_layout_myinfo"
-                            android:layout_width="146dp"
-                            android:layout_height="146dp"
-                            android:background="@drawable/main_left_tab_myinfo_selector"
-                            android:button="@null"></RadioButton>
+                        android:id="@+id/main_left_tab_layout_myinfo"
+                        android:layout_width="146dp"
+                        android:layout_height="146dp"
+                        android:background="@drawable/main_left_tab_myinfo_selector"
+                        android:button="@null"></RadioButton>
 
                     <RadioButton
-                            android:id="@+id/main_left_tab_layout_recommend"
-                            android:layout_width="146dp"
-                            android:layout_height="146dp"
-                            android:background="@drawable/main_left_tab_recommend_selector"
-                            android:button="@null"></RadioButton>
+                        android:id="@+id/main_left_tab_layout_recommend"
+                        android:layout_width="146dp"
+                        android:layout_height="146dp"
+                        android:background="@drawable/main_left_tab_recommend_selector"
+                        android:button="@null"></RadioButton>
 
                     <RadioButton
-                            android:id="@+id/main_left_tab_layout_follow"
-                            android:layout_width="146dp"
-                            android:layout_height="146dp"
-                            android:background="@drawable/main_left_tab_follow_selector"
-                            android:button="@null"></RadioButton>
+                        android:id="@+id/main_left_tab_layout_follow"
+                        android:layout_width="146dp"
+                        android:layout_height="146dp"
+                        android:background="@drawable/main_left_tab_follow_selector"
+                        android:button="@null"></RadioButton>
 
                     <RadioButton
-                            android:id="@+id/main_left_tab_layout_character"
-                            android:layout_width="146dp"
-                            android:layout_height="146dp"
-                            android:background="@drawable/main_left_tab_character_selector"
-                            android:button="@null"></RadioButton>
+                        android:id="@+id/main_left_tab_layout_character"
+                        android:layout_width="146dp"
+                        android:layout_height="146dp"
+                        android:background="@drawable/main_left_tab_character_selector"
+                        android:button="@null"></RadioButton>
 
                 </RadioGroup>
 
                 <ImageView
-                        android:id="@+id/activity_main_exitapp_icon"
-                        android:layout_width="80dp"
-                        android:layout_height="80dp"
-                        android:layout_gravity="bottom|center"
-                        android:layout_marginLeft="5dp"
-                        android:layout_marginTop="40dp"
-                        android:src="@drawable/app_exit_icon"></ImageView>
+                    android:id="@+id/activity_main_exitapp_icon"
+                    android:layout_width="80dp"
+                    android:layout_height="80dp"
+                    android:layout_gravity="bottom|center"
+                    android:layout_marginLeft="5dp"
+                    android:layout_marginTop="40dp"
+                    android:src="@drawable/app_exit_icon"></ImageView>
             </LinearLayout>
 
 
             <FrameLayout
-                    android:layout_width="0dp"
-                    android:layout_height="match_parent"
-                    android:layout_weight="9">
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="9">
 
                 <FrameLayout
-                        android:id="@+id/main_fragment_layout"
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent"
-                        android:layout_gravity="left">
+                    android:id="@+id/main_fragment_layout"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_gravity="left">
 
 
                 </FrameLayout>
@@ -109,4 +109,9 @@
 
     </FrameLayout>
 
+    <ImageView
+        android:id="@+id/testbg"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@drawable/splash_bg"></ImageView>
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 7 - 0
app/src/main/res/layout/activity_test.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/splash_bg">
+
+</LinearLayout>