Просмотр исходного кода

Merge branch 'master' of ssh://10.10.100.21/source/uu-android

# Conflicts:
#	WeiChat/version.properties
#	app_core/common/src/main/java/com/core/utils/CommonUtil.java
#	app_modular/apputils/src/main/java/com/modular/apputils/activity/BillInputActivity.java
#	app_modular/apputils/src/main/java/com/modular/apputils/adapter/BillAdapter.java
#	app_modular/apputils/src/main/java/com/modular/apputils/presenter/BillPresenter.java
#	app_modular/appworks/src/main/java/com/uas/appworks/activity/DeviceQueryActivity.java
RaoMeng 6 лет назад
Родитель
Сommit
c4f4d63414

+ 22 - 3
WeiChat/src/main/java/com/xzjmyk/pm/activity/CustomCrashActivity.java

@@ -8,6 +8,10 @@ import android.widget.Button;
 import android.widget.ImageView;
 
 import com.afollestad.materialdialogs.MaterialDialog;
+import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.Method;
+import com.me.network.app.http.rx.ResultListener;
+import com.me.network.app.http.rx.ResultSubscriber;
 
 import cat.ereza.customactivityoncrash.CustomActivityOnCrash;
 
@@ -30,10 +34,25 @@ public class CustomCrashActivity extends Activity {
         mErrorIv = (ImageView) findViewById(R.id.error_image);
         intent = getIntent();
         stackTraceString = CustomActivityOnCrash.getAllErrorDetailsFromIntent(this, intent);
-//        if (stackTraceString != null && !CommonUtil.isReleaseVersion()) {
-            new MaterialDialog.Builder(this).content(stackTraceString)
+
+        new MaterialDialog.Builder(this).content(stackTraceString)
                     .build().show();
-//        }
+
+        HttpClient httpClient = new HttpClient.Builder("http://10.1.80.56:8085/")
+                .isDebug(true)
+                .build(true);
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mail/errorInfo")
+                .add("message", stackTraceString)
+                .method(Method.GET)
+                .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+               
+               
+            }
+        }));
+        
         final Class<? extends Activity> activityClassFromIntent = CustomActivityOnCrash.getRestartActivityClassFromIntent(intent);
         final CustomActivityOnCrash.EventListener listenerFromIntent = CustomActivityOnCrash.getEventListenerFromIntent(intent);
 

+ 21 - 13
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java

@@ -342,6 +342,21 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
         LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
         headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
         ViewUtil.httpSendRequest(ct, url, params, mUserCheckHander, headers, 0x12312, message, null, "get");
+
+//       new Thread(()->{
+//           while (true){
+//               try {
+//                   Thread.sleep(1000);
+//               } catch (InterruptedException e) {
+//                   e.printStackTrace();
+//               }
+//               LogUtil.d(TAG,"执行一次网络请求..."+DateFormatUtil.getStrDate4Date(new Date(),DateFormatUtil.YMD_HMS));
+//               ViewUtil.AutoLoginErp(this);
+//    
+//               com.core.utils.CommonUtil.displayBriefMemory();
+//           }
+//       }).start();
+
     }
 
     private void delay() {
@@ -665,19 +680,7 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
             }
         });
 
-
-        //查询数据库,取出中文名:
-//        DBManager  dbManager = new DBManager(ct);
-//        List<EmployeesEntity> db = dbManager.select_getEmployee(
-//                new String[]{CommonUtil.getSharedPreferences(ct, "erp_master"),
-//                        CommonUtil.getSharedPreferences(ct, "erp_username")}
-//                , "whichsys=? and em_code=? ");
-//        if (!ListUtils.isEmpty(db)){
-//            if (!StringUtil.isEmpty(db.get(0).getEM_NAME())){
-//                CommonUtil.setSharedPreferences(ct,"erp_emname",db.get(0).getEM_NAME());
-//            }
-//        }
-//        dbManager.closeDB();
+        
         doHiTask();
         autoPresenter = AutoPresenter.onCreate();
         SchedulePresenter.getInstance().startSchedule();
@@ -688,7 +691,12 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
         //初始化面部识别
         com.baidu.aip.excep.utils.FaceConfig.initFace(ct);
         Login();
+        
+          
+        
     }
+    
+ 
 
     private AutoPresenter autoPresenter;
     private Handler handler = new Handler();

+ 10 - 10
app_core/common/src/main/java/com/core/app/MyApplication.java

@@ -1,7 +1,6 @@
 package com.core.app;
 
 import android.app.Activity;
-import android.app.Application;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.os.Build;
@@ -25,7 +24,6 @@ import com.core.net.ssl.AuthImageDownloader;
 import com.core.net.utils.NetUtils;
 import com.core.net.volley.FastVolley;
 import com.core.service.InitializeService;
-import com.core.utils.CommonUtil;
 import com.hss01248.notifyutil.NotifyUtil;
 import com.lidroid.xutils.HttpUtils;
 import com.nostra13.universalimageloader.cache.disc.impl.TotalSizeLimitedDiscCache;
@@ -50,6 +48,7 @@ import org.apache.http.cookie.Cookie;
 
 import java.io.File;
 
+
 /**
  * Created by Arison on 2017/8/25.
  */
@@ -97,20 +96,21 @@ public class MyApplication extends BaseApplication {
      * 提供网络全局监听
      ************************/
     private NetWorkObservable mNetWorkObservable;
-
+    private final static int CWJ_HEAP_SIZE = 6* 1024* 1024 ;
+    
+    
 
     @Override
     public void initConfig() throws Exception {
         //后台服务初始化application
         InitializeService.initApplication(this);
-
-//        LeakCanary.install(this);
-
         INSTANCE = this;
+        
+        
         mRequestQueue = Volley.newRequestQueue(this);
         mHttpUtils = new HttpUtils();
         configHttpUtils();
-
+        initUmengStatistics() ;
         new Handler().postDelayed(new Runnable() {
             @Override
             public void run() {
@@ -121,6 +121,7 @@ public class MyApplication extends BaseApplication {
                 // 初始化图片加载
                 initImageLoader();
                 NotifyUtil.init(getInstance());
+                
 
             }
         }, 1);
@@ -208,9 +209,8 @@ public class MyApplication extends BaseApplication {
         MobclickAgent.UMAnalyticsConfig config = new MobclickAgent.UMAnalyticsConfig(this, "57ea27bb67e58e088c003bbf",
                 "baidu", MobclickAgent.EScenarioType.E_UM_NORMAL);
         MobclickAgent.startWithConfigure(config);
-        if (!CommonUtil.isReleaseVersion()) {//当前为开发版本时候不需要上传友盟
-            MobclickAgent.setCatchUncaughtExceptions(false);
-        }
+       // MobclickAgent.setCatchUncaughtExceptions(false);
+      
     }
 
     private void configHttpUtils() {

+ 8 - 2
app_core/common/src/main/java/com/core/net/http/HttpUtil.java

@@ -89,7 +89,7 @@ public class HttpUtil {
             response = httpClient.execute(httpGet);
             return Response.getResponse(response);
         } finally {
-
+            httpClient.getConnectionManager().shutdown();
         }
     }
 
@@ -136,6 +136,8 @@ public class HttpUtil {
             response = httpClient.execute(httpPost);
             return Response.getResponse(response);
         } finally {
+            // 关闭连接,释放资源
+            httpClient.getConnectionManager().shutdown();
         }
     }
 
@@ -181,7 +183,11 @@ public class HttpUtil {
             response = httpClient.execute(httpPost);
             return Response.getResponse(response);
         } finally {
-
+            // 关闭连接,释放资源
+            httpClient.getConnectionManager().shutdown();
+            /*if (httpClient!=null){
+                httpClient.getConnectionManager().shutdown();
+            }*/
         }
     }
 

+ 5 - 4
app_core/common/src/main/java/com/core/service/InitializeService.java

@@ -9,6 +9,7 @@ import android.support.annotation.Nullable;
 import android.util.Log;
 
 import com.baidu.mapapi.SDKInitializer;
+import com.common.LogUtil;
 import com.common.preferences.PreferenceUtils;
 import com.common.preferences.SharedUtil;
 import com.core.app.AppConfig;
@@ -16,7 +17,6 @@ import com.core.app.Constants;
 import com.core.db.DBOpenHelper;
 import com.core.db.DatabaseManager;
 import com.core.db.SQLiteHelper;
-import com.core.utils.CommonUtil;
 import com.facebook.stetho.Stetho;
 import com.iflytek.cloud.SpeechConstant;
 import com.iflytek.cloud.SpeechUtility;
@@ -144,8 +144,9 @@ public class InitializeService extends IntentService {
         MobclickAgent.UMAnalyticsConfig config = new MobclickAgent.UMAnalyticsConfig(mContext, "57ea27bb67e58e088c003bbf",
                 "baidu", MobclickAgent.EScenarioType.E_UM_NORMAL);
         MobclickAgent.startWithConfigure(config);
-        if (!CommonUtil.isReleaseVersion()) {//当前为开发版本时候不需要上传友盟
-            MobclickAgent.setCatchUncaughtExceptions(false);
-        }
+        LogUtil.d("initUmengStatistics()");
+//        if (!CommonUtil.isReleaseVersion()) {//当前为开发版本时候不需要上传友盟
+           // MobclickAgent.setCatchUncaughtExceptions(false);
+//        }
     }
 }

+ 2 - 2
app_core/common/src/main/res/drawable/tab_job_bg.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <item android:drawable="@drawable/icon_massage_selected" android:state_checked="true" android:state_enabled="true"/>
-    <item android:drawable="@drawable/icon_massage_nor"/>
+<item android:drawable="@drawable/icon_massage_selected" android:state_checked="true" android:state_enabled="true" />
+<item android:drawable="@drawable/icon_massage_nor" />
 
 </selector>

+ 5 - 4
app_core/common/src/main/res/layout/activity_setting.xml

@@ -1,9 +1,9 @@
 <?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="@color/oa_bg"
-              android:orientation="vertical">
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/oa_bg"
+    android:orientation="vertical">
 
     <ScrollView
         android:layout_width="match_parent"
@@ -566,6 +566,7 @@
                     android:background="@drawable/oa_next"
                     android:contentDescription="@string/app_name" />
             </RelativeLayout>
+
             <RelativeLayout
                 android:id="@+id/language_us_rl"
                 style="@style/commonSettingItem"

+ 1 - 1
app_modular/applogin/src/main/java/com/modular/login/activity/PersonalRegActivity.java

@@ -51,7 +51,7 @@ public class PersonalRegActivity extends SupportToolBarActivity {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.personal_reg_activity);
-     setTitle(getString(R.string.person_register));
+         setTitle(getString(R.string.person_register));
 
         initView();
     }

+ 3 - 3
app_modular/appmusic/src/main/java/com/usoftchina/music/MusicService.java

@@ -40,9 +40,9 @@ public class MusicService extends Service {
     private void initMusic() {
         Log.i(TAG, "onStartCommand");
         try {
-            mediaPlayer =  MediaPlayer.create(this, R.raw.yingtang);
-            mediaPlayer.prepare();
-            mediaPlayer.setLooping(true);
+//            mediaPlayer =  MediaPlayer.create(this, R.raw.yingtang);
+//            mediaPlayer.prepare();
+//            mediaPlayer.setLooping(true);
         } catch (Exception e) {
             e.printStackTrace();
         }

BIN
app_modular/appmusic/src/main/res/raw/yingtang.mp3