Quellcode durchsuchen

overdraw optimize

hanjing vor 7 Jahren
Ursprung
Commit
1994602e84

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/absBase/BaseActivity.java

@@ -3,6 +3,7 @@ package com.sheep.gamegroup.absBase;
 import android.graphics.Color;
 import android.os.Build;
 import android.os.Bundle;
+import android.os.StrictMode;
 import android.support.annotation.Nullable;
 import android.support.v7.app.ActionBar;
 import android.support.v7.widget.Toolbar;
@@ -13,6 +14,7 @@ import android.view.inputmethod.InputMethodManager;
 
 import com.sheep.gamegroup.util.ActionUtil;
 import com.sheep.gamegroup.view.dialog.DialogLoading;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
 
@@ -46,6 +48,20 @@ public abstract class BaseActivity extends RxAppCompatActivity {
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
+//        if (BuildConfig.DEBUG) {
+//            StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
+//                    .detectDiskReads()
+//                    .detectDiskWrites()
+//                    .detectNetwork()
+//                    .penaltyLog()
+//                    .build());
+//            StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
+//                    .detectLeakedSqlLiteObjects()
+////                    .detectLeakedClosableObjects()
+//                    .penaltyLog()
+//                    .penaltyDeath()
+//                    .build());
+//        }
         super.onCreate(savedInstanceState);
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
             Window win = getWindow();

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtArticleComment.java

@@ -85,7 +85,7 @@ public class FgtArticleComment extends BaseListFragment3<UserComment> implements
 
     @Override
     public boolean useSelfEmpty() {
-        return true;
+        return false;
     }
 
     @Override

+ 2 - 3
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -154,7 +154,7 @@ public class SheepApp extends MultiDexApplication {
 
     @Override
     public void onCreate() {
-        configStrictMode();
+//        configStrictMode();
         super.onCreate();
         if (AppUtil.isMainProcess(this)) {
             mSheepApp = this;
@@ -162,7 +162,6 @@ public class SheepApp extends MultiDexApplication {
             registerActivityLifecycleCallbacks(activityLifecycleCallbacks);
             initNet();
             initUtils();
-            configStrictMode();
             ChannelContent.getInstance().initChannelContent(this);
             refWatcher = LeakCanary.install(this);
         }
@@ -206,7 +205,7 @@ public class SheepApp extends MultiDexApplication {
             StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                     .detectDiskReads()
                     .detectDiskWrites()
-                    .detectNetwork()   // or .detectAll() for all detectable problems
+                    .detectNetwork()
                     .penaltyLog()
                     .build());
             StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()

+ 1 - 18
app/src/main/res/drawable/x_shap_shadow_bg_rectgangle_white.xml

@@ -3,7 +3,7 @@
     <!--第一层-->
     <item>
         <shape>
-            <solid android:color="@color/white_ededed" />
+            <solid android:color="@android:color/white" />
             <!--描边-->
             <stroke
                 android:width="1px"
@@ -13,21 +13,4 @@
             <corners android:radius="10dp" />
         </shape>
     </item>
-    <!--第二层-->
-    <item
-        android:left="1px"
-        android:top="1px"
-        android:bottom="1px"
-        android:right="1px">
-        <shape>
-            <solid android:color="@color/white" />
-            <!--描边-->
-            <stroke
-                android:width="0.33dp"
-                android:color="@color/white" />
-
-            <corners android:radius="10dp" />
-        </shape>
-    </item>
-
 </layer-list>

+ 84 - 87
app/src/main/res/layout/act_main.xml

@@ -4,109 +4,106 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <include layout="@layout/main_frame_layout"
+    <include
+        layout="@layout/main_frame_layout"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_marginBottom="@dimen/bottom_height"/>
+        android:layout_marginBottom="@dimen/bottom_height" />
 
-    <RelativeLayout
+    <LinearLayout
+        android:id="@+id/tab_container"
         android:layout_width="match_parent"
         android:layout_height="@dimen/bottom_height"
         android:layout_alignParentBottom="true"
-        android:background="@color/white">
+        android:background="@color/white"
+        android:orientation="horizontal"
+        android:paddingTop="4dp">
 
-        <LinearLayout
-            android:id="@+id/tab_container"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:paddingTop="4dp">
-
-            <View
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"
-                android:layout_weight="1" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_task"
-                android:gravity="center"
-                android:minWidth="@dimen/tab_width"
-                android:text="@string/tab_viewpager_gamestore"
-                android:textColor="@color/selector_color_main_tab"
-                android:textSize="10sp" />
+        <View
+            android:layout_width="0dp"
+            android:layout_height="@dimen/tab_height"
+            android:layout_weight="1" />
 
-            <View
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"
-                android:layout_weight="2" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="@dimen/tab_height"
+            android:drawableTop="@drawable/drawable_selector_task"
+            android:gravity="center"
+            android:minWidth="@dimen/tab_width"
+            android:text="@string/tab_viewpager_gamestore"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
 
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_task"
-                android:gravity="center"
-                android:minWidth="@dimen/tab_width"
-                android:text="@string/tab_viewpager_classification"
-                android:textColor="@color/selector_color_main_tab"
-                android:textSize="10sp" />
+        <View
+            android:layout_width="0dp"
+            android:layout_height="@dimen/tab_height"
+            android:layout_weight="2" />
 
-            <View
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"
-                android:layout_weight="2" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="@dimen/tab_height"
+            android:drawableTop="@drawable/drawable_selector_task"
+            android:gravity="center"
+            android:minWidth="@dimen/tab_width"
+            android:text="@string/tab_viewpager_classification"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
 
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_task"
-                android:gravity="center"
-                android:minWidth="@dimen/tab_width"
-                android:text="@string/mine_hoggerel"
-                android:textColor="@color/selector_color_main_tab"
-                android:textSize="10sp" />
+        <View
+            android:layout_width="0dp"
+            android:layout_height="@dimen/tab_height"
+            android:layout_weight="2" />
 
-            <View
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"
-                android:layout_weight="2" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="@dimen/tab_height"
+            android:drawableTop="@drawable/drawable_selector_task"
+            android:gravity="center"
+            android:minWidth="@dimen/tab_width"
+            android:text="@string/mine_hoggerel"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
 
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_task"
-                android:gravity="center"
-                android:minWidth="@dimen/tab_width"
-                android:text="@string/tab_viewpager_borrowplay"
-                android:textColor="@color/selector_color_main_tab"
-                android:textSize="10sp" />
+        <View
+            android:layout_width="0dp"
+            android:layout_height="@dimen/tab_height"
+            android:layout_weight="2" />
 
-            <View
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"
-                android:layout_weight="2" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="@dimen/tab_height"
+            android:drawableTop="@drawable/drawable_selector_task"
+            android:gravity="center"
+            android:minWidth="@dimen/tab_width"
+            android:text="@string/tab_viewpager_borrowplay"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
 
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_task"
-                android:gravity="center"
-                android:minWidth="@dimen/tab_width"
-                android:text="@string/tab_viewpager_borrowplay"
-                android:textColor="@color/selector_color_main_tab"
-                android:textSize="10sp" />
+        <View
+            android:layout_width="0dp"
+            android:layout_height="@dimen/tab_height"
+            android:layout_weight="2" />
 
-            <View
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"
-                android:layout_weight="1" />
-        </LinearLayout>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="@dimen/tab_height"
+            android:drawableTop="@drawable/drawable_selector_task"
+            android:gravity="center"
+            android:minWidth="@dimen/tab_width"
+            android:text="@string/tab_viewpager_borrowplay"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
 
         <View
-            android:id="@+id/tab_line"
-            android:layout_width="match_parent"
-            android:layout_height="1px"
-            android:background="#AAe2e2e2" />
-    </RelativeLayout>
+            android:layout_width="0dp"
+            android:layout_height="@dimen/tab_height"
+            android:layout_weight="1" />
+    </LinearLayout>
+
+    <View
+        android:id="@+id/tab_line"
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:layout_above="@+id/tab_container"
+        android:background="#AAe2e2e2" />
 </RelativeLayout>

+ 1 - 0
app/src/main/res/layout/act_setting.xml

@@ -3,6 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/white_light"
+    android:fitsSystemWindows="true"
     android:orientation="vertical">
 
     <LinearLayout

+ 1 - 3
app/src/main/res/layout/empty_view.xml

@@ -2,8 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/empty_view"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@color/white">
+    android:layout_height="match_parent">
 
     <ImageView
         android:id="@+id/empty_view_img"
@@ -11,7 +10,6 @@
         android:layout_height="wrap_content"
         android:layout_centerHorizontal="true"
         android:layout_marginTop="80dp"
-        android:background="@color/white"
         android:gravity="center"
         android:scaleType="centerInside"
         android:src="@drawable/loading_01"

+ 2 - 2
app/src/main/res/layout/fgt_personacenter_item_top.xml

@@ -7,7 +7,7 @@
 
     <android.support.constraint.ConstraintLayout
         android:layout_width="match_parent"
-        android:layout_height="150dp"
+        android:layout_height="125dp"
         android:background="@mipmap/home_blue_bg">
 
         <RelativeLayout
@@ -110,7 +110,7 @@
     <LinearLayout
         android:id="@+id/personalcenter_price_layout"
         style="@style/style_item_container"
-        android:layout_marginTop="-25dp"
+
         android:background="@color/white">
         <!--  android:background="@drawable/x_shap_shadow_bg_rectgangle_white"-->
 

+ 6 - 7
app/src/main/res/layout/fgt_personalcenter_layout.xml

@@ -3,7 +3,6 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/bg_gray"
     android:scrollbars="none">
 
     <LinearLayout
@@ -14,11 +13,11 @@
 
         <include layout="@layout/fgt_personacenter_item_top" />
 
-        <View
+        <include
+            layout="@layout/fgt_personalcenter_item_audit"
             android:layout_width="match_parent"
-            android:layout_height="13dp" />
-
-        <include layout="@layout/fgt_personalcenter_item_audit" />
+            android:layout_height="wrap_content"
+            android:layout_marginTop="13dp" />
 
         <LinearLayout
             android:id="@+id/my_module_layout"
@@ -36,8 +35,8 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:background="@color/white"
-                android:paddingStart="5dp"
                 android:paddingEnd="5dp"
+                android:paddingStart="5dp"
                 tools:layoutManager="android.support.v7.widget.GridLayoutManager"
                 tools:listitem="@layout/item_my_list_but"
                 tools:spanCount="4" />
@@ -57,8 +56,8 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal"
-            android:layout_marginTop="20dp"
             android:layout_marginBottom="30dp"
+            android:layout_marginTop="20dp"
             android:src="@mipmap/invition_redpackage"
             android:visibility="invisible" />
     </LinearLayout>

+ 1 - 2
app/src/main/res/layout/fgt_play_game.xml

@@ -2,8 +2,7 @@
 <com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/refresh"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@color/white">
+    android:layout_height="match_parent">
 
     <android.support.v4.widget.NestedScrollView
         android:id="@+id/scrollView"

+ 1 - 2
app/src/main/res/layout/fgt_welfare_center.xml

@@ -2,8 +2,7 @@
 <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/refresh"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@color/white">
+    android:layout_height="match_parent">
 
     <android.support.v4.widget.NestedScrollView
         android:layout_width="match_parent"

+ 0 - 1
app/src/main/res/layout/header_act_article.xml

@@ -4,7 +4,6 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@color/white"
     android:padding="@dimen/content_padding">
 
     <TextView

+ 1 - 2
app/src/main/res/layout/include_input_comment.xml

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:background="@color/white">
+    android:layout_height="wrap_content">
 
     <View
         android:layout_width="match_parent"

+ 2 - 2
app/src/main/res/layout/net_empty_rv.xml

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@color/white">
+    android:layout_height="match_parent">
 
     <include
         android:id="@+id/check_net_ll"
@@ -14,6 +13,7 @@
     <include
         android:id="@+id/empty_view"
         layout="@layout/empty_view"
+        android:visibility="gone"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_below="@+id/check_net_ll" />

+ 1 - 0
app/src/main/res/layout/net_empty_smart_refresh_rv.xml

@@ -17,6 +17,7 @@
         layout="@layout/empty_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:visibility="gone"
         android:layout_below="@+id/check_net_ll" />
 
     <RelativeLayout

+ 1 - 2
app/src/main/res/layout/net_empty_xrecycler.xml

@@ -2,8 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:fitsSystemWindows="true"
-    android:background="@color/white">
+    android:fitsSystemWindows="true">
 
     <include
         android:id="@+id/check_net_ll"

+ 1 - 1
app/src/main/res/layout/task_detail_layout.xml

@@ -4,7 +4,6 @@
     android:layout_height="match_parent"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:fitsSystemWindows="true"
-    android:background="@color/white"
     android:orientation="vertical">
 
     <include
@@ -16,6 +15,7 @@
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:background="@color/white"
         android:orientation="vertical">
         <android.support.v4.widget.NestedScrollView
             android:layout_width="match_parent"

+ 6 - 6
app/src/main/res/layout/xpersion_info_act_layout.xml

@@ -2,13 +2,12 @@
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/bg_gray"
     android:fitsSystemWindows="true"
     android:scrollbars="none">
+
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="@color/white_light"
         android:orientation="vertical">
 
         <LinearLayout
@@ -103,14 +102,15 @@
                 <TextView
                     android:id="@+id/tv_sex"
                     style="@style/style_item_end_next"
-                    android:layout_width="150dp"/>
+                    android:layout_width="150dp" />
 
             </LinearLayout>
 
             <View style="@style/style_item_line_3_0" />
 
-            <LinearLayout style="@style/style_item_container"
-                android:id="@+id/llayout_birthday">
+            <LinearLayout
+                android:id="@+id/llayout_birthday"
+                style="@style/style_item_container">
 
                 <TextView
                     style="@style/style_item_label"
@@ -212,6 +212,7 @@
                     android:id="@+id/personal_info_bind_qq"
                     style="@style/style_item_end_next" />
             </LinearLayout>
+
             <View style="@style/style_item_line_3_0" />
 
             <LinearLayout
@@ -251,5 +252,4 @@
     </LinearLayout>
 
 
-
 </ScrollView>

+ 1 - 1
app/src/main/res/values/styles.xml

@@ -35,7 +35,7 @@
 
 
     <style name="Theme.Light.NoTitle.Dialog" parent="@android:style/Theme.Dialog">
-        <item name="android:windowBackground">@android:color/transparent</item>
+        <item name="android:windowBackground">@null</item>
         <item name="android:windowNoTitle">true</item>
         <item name="android:windowIsFloating">true</item>
         <item name="android:windowFrame">@null</item>