Browse Source

1.提交代码

FailedToRead 2 years ago
parent
commit
c6e58f3b2d

+ 22 - 1
app/src/main/AndroidManifest.xml

@@ -30,6 +30,7 @@
         android:maxAspectRatio="2.4"
         android:roundIcon="${icon}"
         android:supportsRtl="true"
+        android:theme="@style/AppStartTheme"
         android:usesCleartextTraffic="true">
         <meta-data
             android:name="android.max_aspect"
@@ -52,7 +53,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
-            android:theme="@style/AppStartTheme"
+            android:splitMotionEvents="false"
             android:windowSoftInputMode="adjustNothing|stateHidden">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -86,6 +87,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/FullScreen"
             android:windowSoftInputMode="adjustNothing|stateHidden">
 
@@ -99,6 +101,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/FullScreen"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <!-- 登录界面 -->
@@ -109,6 +112,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/FullScreen"
             android:windowSoftInputMode="adjustNothing|stateHidden">
 
@@ -122,6 +126,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
 
@@ -133,6 +138,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
 
@@ -144,6 +150,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <!-- 我的关注界面 -->
@@ -154,6 +161,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <!-- 消息通知界面 -->
@@ -164,6 +172,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <!-- 联系我们界面 -->
@@ -174,6 +183,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <!-- 支付界面 -->
@@ -184,6 +194,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
 
@@ -195,6 +206,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
 
@@ -205,6 +217,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
 
@@ -217,6 +230,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
 
@@ -229,6 +243,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustPan|stateHidden" /> <!-- web界面 -->
         <activity
@@ -239,6 +254,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <activity
@@ -248,6 +264,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <activity
@@ -258,6 +275,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <activity
@@ -268,6 +286,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
         <activity
@@ -278,6 +297,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden" />
 
@@ -290,6 +310,7 @@
             android:maxAspectRatio="2.1"
             android:resizeableActivity="false"
             android:screenOrientation="landscape"
+            android:splitMotionEvents="false"
             android:theme="@style/efunboxTransparentLoginAlert"
             android:windowSoftInputMode="adjustNothing|stateHidden"></activity>
 

+ 11 - 10
app/src/main/java/com/edufound/reader/application/EApplication.java

@@ -199,7 +199,7 @@ public class EApplication extends Application {
         RxJavaPlugins.setErrorHandler(new Consumer<Throwable>() {
             @Override
             public void accept(Throwable throwable) throws Exception {
-                throwable.printStackTrace();//这里处理所有的Rxjava异常
+//                throwable.printStackTrace();//这里处理所有的Rxjava异常
                 CrashLog.saveCrashLog(getApplicationContext(), throwable);
             }
         });
@@ -233,15 +233,16 @@ public class EApplication extends Application {
 //                Toast.makeText(Consts.getmApplicAtion(), getResources().getString(tips), Toast.LENGTH_LONG).show();
 //                DebugSafeModeUI.showSafeModeUI();
 
-                if (Consts.isIsDebug()) {
-                    Intent intent = new Intent(Consts.getmApplicAtion(), DebugSafeModeTipActivity.class);
-                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
-                    startActivity(intent);
-                } else {
-                    Intent intent = new Intent(Consts.getmApplicAtion(), CrashDialogActivity.class);
-                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
-                    startActivity(intent);
-                }
+//                if (Consts.isIsDebug()) {
+//                    Intent intent = new Intent(Consts.getmApplicAtion(), DebugSafeModeTipActivity.class);
+//                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
+//                    startActivity(intent);
+//                } else {
+//                    Intent intent = new Intent(Consts.getmApplicAtion(), CrashDialogActivity.class);
+//                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
+//                    startActivity(intent);
+//                }
+                reloadApp(-1);
             }
 
             @RequiresApi(api = Build.VERSION_CODES.N)

+ 0 - 1
app/src/main/java/com/edufound/reader/base/BaseActivity.java

@@ -270,7 +270,6 @@ public abstract class BaseActivity extends AppCompatActivity {
         }
     }
 
-
     @SuppressLint("AutoDispose")
     public void addUiClickListener(View view, Consumer onNext) {
         addDisposable(RxView.clicks(view).throttleFirst(2, TimeUnit.SECONDS).subscribe(onNext));

+ 3 - 0
app/src/main/java/com/edufound/reader/fragment/RecommendFragment.java

@@ -318,6 +318,9 @@ public class RecommendFragment extends BaseMvpFragment<RecommendFragmentPresente
     public void setTopStatus(UserRecordBean bean) {
 
 
+        if (getActivity() == null) {
+            return;
+        }
         //设置信息和点赞数等
         if (bean.getUser().getAvatar() == null || bean.getUser().getAvatar().equals("")) {
             if (bean.getUser().getGender().equals("1")) {

+ 30 - 18
app/src/main/java/com/edufound/reader/presenter/MainPresenter.java

@@ -452,28 +452,40 @@ public class MainPresenter extends BasePresenter<MainContract.View> implements M
 
     @Override
     public void refRecordById(String id) {
-        switch (mRadioCheckIndex) {
-            case 2:
-                if (mRecommendFragment != null) {
-                    mRecommendFragment.getPresenter().getRecordInfoById(id);
-                }
-                break;
+        try {
+            switch (mRadioCheckIndex) {
+                case 2:
+                    if (mRecommendFragment != null) {
+                        if (mRecommendFragment.getPresenter() != null) {
+                            mRecommendFragment.getPresenter().getRecordInfoById(id);
+                        }
+                    }
+                    break;
 
-            case 3:
-                if (mFollowFragment != null) {
-                    mFollowFragment.getPresenter().getRecordInfoById(id);
-                }
-                break;
+                case 3:
+                    if (mFollowFragment != null) {
+                        if (mFollowFragment.getPresenter() != null) {
+                            mFollowFragment.getPresenter().getRecordInfoById(id);
+                        }
+                    }
+                    break;
 
-            case 4:
-                if (mCharacterFragment != null) {
-                    Logger.e("mRecommendFragment!=null,下面调用方法");
-                    mCharacterFragment.getPresenter().getRecordInfoByIdSetCharacter3(id);
-                    Logger.e("mRecommendFragment!=null,上面调用方法");
-                }
-                break;
+                case 4:
+                    if (mCharacterFragment != null) {
+                        Logger.e("mRecommendFragment!=null,下面调用方法");
+                        if (mCharacterFragment.getPresenter() != null) {
+                            mCharacterFragment.getPresenter().getRecordInfoByIdSetCharacter3(id);
+                        }
+                        Logger.e("mRecommendFragment!=null,上面调用方法");
+                    }
+                    break;
+            }
+        } catch (Exception e) {
+            Logger.e("error:" + e.getMessage());
+//            e.printStackTrace();
         }
 
+
     }
 
     @Override

+ 2 - 1
app/src/main/java/com/edufound/reader/support/DebugSafeModeTipActivity.java

@@ -8,11 +8,12 @@ import com.edufound.reader.R;
 
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.fragment.app.Fragment;
+
 import io.reactivex.rxjava3.annotations.Nullable;
 
 
 /**
- * Created by wanjian on 2018/5/21.
+ *
  */
 
 public class DebugSafeModeTipActivity extends AppCompatActivity {

+ 12 - 0
app/src/main/res/values/themes.xml

@@ -14,6 +14,18 @@
 
     </style>
 
+
+    <style name="ApplicationTheme" parent="@style/Theme.AppCompat.Light">
+        <item name="windowNoTitle">true</item>
+        <item name="android:windowFullscreen">true</item>
+        <item name="android:windowIsTranslucent">false</item>
+        <item name="android:background">@drawable/splash_bg</item>
+        <item name="android:windowEnableSplitTouch">false</item>
+        <item name="android:splitMotionEvents">false</item>
+
+    </style>
+
+
     <style name="AppStartTheme" parent="@style/Theme.AppCompat.Light">
         <item name="windowNoTitle">true</item>
         <item name="android:windowFullscreen">true</item>