FANGLH 8 жил өмнө
parent
commit
680ee7cccc

+ 23 - 18
WeiChat/build.gradle

@@ -1,10 +1,13 @@
 apply plugin: 'com.android.application'
 apply plugin: 'com.getkeepsafe.dexcount'
+apply plugin: 'me.tatarka.retrolambda'
 
 android {
 
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
 
     signingConfigs {
         config {
@@ -14,14 +17,16 @@ android {
             keyPassword '13237658359'
         }
     }
+
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
+
     defaultConfig {
-        applicationId "com.xzjmyk.pm.activity"
-        minSdkVersion 14
-        targetSdkVersion 24
-        compileOptions {
-            sourceCompatibility JavaVersion.VERSION_1_7
-            targetCompatibility JavaVersion.VERSION_1_7
-        }
+        applicationId project.applicationId
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
         multiDexEnabled true
         signingConfig signingConfigs.config
     }
@@ -31,8 +36,6 @@ android {
         abortOnError false
     }
 
-
-
     packagingOptions {
         exclude 'META-INF/LICENSE.txt'
         exclude 'META-INF/NOTICE.txt'
@@ -51,12 +54,11 @@ android {
     productFlavors {
     }
 
-
 }
 
 buildscript {
     repositories {
-        mavenCentral() // or jcenter()
+        mavenCentral()
     }
 
     dependencies {
@@ -77,17 +79,22 @@ dexcount {
 }
 
 dependencies {
+    //工程
     compile project(':imageload')
     compile project(':pullToRefershLibraryMy')
     compile project(':MPAndroidChart')
     compile project(':libedittextformlibrary')
     compile project(':libfloatingactionbutton')
     compile project(':libbdupdatesdk')
+    compile project(':library-swipemenu_lv')
+    compile project(':library-viewpager-indicator')
+    compile project(':lib-zxing')
+    compile project(':library-refreshlayout')
+    //架包
     compile files('libs/android-async-http-1.4.5.jar')
     compile files('libs/asmack.jar')
     compile files('libs/BaiduLBS_Android.jar')
     compile files('libs/cyberplayer-sdk.jar')
-    //    compile files('libs/fastjson-1.1.41.jar')
     compile files('libs/httpmime-4.2.jar')
     compile files('libs/nineoldandroids.jar')
     compile files('libs/org.xbill.dns_2.1.6.jar')
@@ -98,9 +105,6 @@ dependencies {
     compile files('libs/volley.jar')
     compile files('libs/xutils.jar')
     compile files('libs/flexjson-2.1.jar')
-    compile project(':library-swipemenu_lv')
-    compile project(':library-viewpager-indicator')
-    compile project(':lib-zxing')
     compile files('libs/SocialSDK_WeiXin_2.jar')
     compile files('libs/SocialSDK_umengwx.jar')
     compile files('libs/SocialSDK_QQZone_3.jar')
@@ -114,11 +118,12 @@ dependencies {
     compile('com.facebook.stetho:stetho:1.4.1') {
         force = true
     }
-    compile project(':library-refreshlayout')
     compile files('src/main/jniLibs/pushservice-5.3.0.99.jar')
     compile files('libs/lite-orm-1.7.0.jar')
     compile files('libs/Msc.jar')
     compile files('libs/zhy_treeview.jar')
+    compile files('libs/core.jar')
+    //依赖库
     compile 'com.alibaba:fastjson:1.2.24'
     compile 'de.hdodenhof:circleimageview:2.1.0'
     compile 'joda-time:joda-time:2.9.4'

+ 28 - 15
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/contanct/ContactsActivity.java

@@ -248,17 +248,23 @@ public class ContactsActivity extends OABaseActivity implements ContactsAdapter.
             PermissionUtil.requestPermission(this, PermissionUtil.DEFAULT_REQUEST, permissions);
         } else {
             getCaceData(false);
+            LogUtil.d("Test","有权限@....");
         }
     }
-
+  boolean isHasPermiss=false;
     @Override
     public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
         super.onRequestPermissionsResult(requestCode, permissions, grantResults);
         if (requestCode == PermissionUtil.DEFAULT_REQUEST) {
             if (grantResults.length != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
                 ToastUtil.showToast(ct, R.string.not_system_permission);
+                isHasPermiss=false;
+                getCaceData(false);
+                LogUtil.d("Test","没有权限....");
             } else {
+                isHasPermiss=true;
                 getCaceData(false);
+                LogUtil.d("Test","有权限....");
             }
         }
     }
@@ -330,25 +336,32 @@ public class ContactsActivity extends OABaseActivity implements ContactsAdapter.
         ThreadPool.getThreadPool().addTask(new Runnable() {
             @Override
             public void run() {
-                List<Contacts> contacts =
-                        ContactsUtils.getContacts1();
-                if (contacts != null) {
-                    for (Contacts entity : contacts) {
-                        ContactsModel model = new ContactsModel();
-                        model.setImid("0");
-                        model.setName(StringUtils.isEmpty(entity.getName()) ? entity.getNickname() : entity.getName());
-                        model.setType(3);
-                        model.setEmail("");
-                        model.setOwnerId(MyApplication.getInstance().mLoginUser.getUserId());
-                        model.setPhone(entity.getPhone());
-                        model.setWhichsys("");
-                        model.setCompany("");
-                        tmodels.add(model);
+                if ( isHasPermiss){
+                    List<Contacts> contacts =
+                            ContactsUtils.getContacts1();
+                    if (contacts != null) {
+                        for (Contacts entity : contacts) {
+                            ContactsModel model = new ContactsModel();
+                            model.setImid("0");
+                            model.setName(StringUtils.isEmpty(entity.getName()) ? entity.getNickname() : entity.getName());
+                            model.setType(3);
+                            model.setEmail("");
+                            model.setOwnerId(MyApplication.getInstance().mLoginUser.getUserId());
+                            model.setPhone(entity.getPhone());
+                            model.setWhichsys("");
+                            model.setCompany("");
+                            tmodels.add(model);
 
+                        }
+                        contactsDao.save(tmodels);
+                        getCaceData(false);
                     }
+                }else{
+                    //没权限
                     contactsDao.save(tmodels);
                     getCaceData(false);
                 }
+              
             }
         });
 

+ 0 - 1
app_core/commom/.gitignore

@@ -1 +0,0 @@
-/build

+ 0 - 34
app_core/commom/build.gradle

@@ -1,34 +0,0 @@
-apply plugin: 'com.android.library'
-
-
-android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
-
-    defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
-    }
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
-    }
-}
-
-dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
-    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
-
-    compile 'com.android.support:appcompat-v7:24.2.1'
-    testCompile 'junit:junit:4.12'
-}

+ 0 - 25
app_core/commom/proguard-rules.pro

@@ -1,25 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in C:\Android\sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile

+ 0 - 26
app_core/commom/src/androidTest/java/base/android/com/commom/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package base.android.com.commom;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumentation test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() throws Exception {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getTargetContext();
-
-        assertEquals("base.android.com.commom.test", appContext.getPackageName());
-    }
-}

+ 0 - 2
app_core/commom/src/main/AndroidManifest.xml

@@ -1,2 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="base.android.com.commom" />

+ 0 - 3
app_core/commom/src/main/res/values/strings.xml

@@ -1,3 +0,0 @@
-<resources>
-    <string name="app_name">commom</string>
-</resources>

+ 0 - 17
app_core/commom/src/test/java/base/android/com/commom/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package base.android.com.commom;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() throws Exception {
-        assertEquals(4, 2 + 2);
-    }
-}

+ 6 - 12
app_core/imageload/build.gradle

@@ -1,19 +1,13 @@
 apply plugin: 'com.android.library'
 
-
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 11
app_core/network/build.gradle

@@ -2,18 +2,13 @@ apply plugin: 'com.android.library'
 
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/MPAndroidChart/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 10
app_third/lib-zxing/build.gradle

@@ -1,17 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/libbdupdatesdk/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/libedittextformlibrary/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/libfloatingactionbutton/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/library-refreshlayout/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion '25.0.0'
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 8
-        versionName "1.2.3"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7

+ 6 - 7
app_third/library-swipemenu_lv/build.gradle

@@ -1,15 +1,14 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
     resourcePrefix "swipemenulistview"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 5
app_third/library-viewpager-indicator/build.gradle

@@ -1,12 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
 
     buildTypes {

+ 6 - 7
app_third/materialdialogs/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 4
app_third/pullToRefershLibraryMy/build.gradle

@@ -1,10 +1,12 @@
 apply plugin: 'com.android.library'
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
 
     buildTypes {

+ 1 - 3
build.gradle

@@ -10,12 +10,10 @@ buildscript {
         classpath 'com.android.tools.build:gradle:2.3.2'
         classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
         classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
+        classpath 'me.tatarka:gradle-retrolambda:3.2.2'
     }
 }
 
-
-
-
 allprojects {
     repositories {
         jcenter()

+ 3 - 20
gradle.properties

@@ -1,23 +1,6 @@
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-# Default value: -Xmx10248m -XX:MaxPermSize=256m
-# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
-
 android.useDeprecatedNdk=true
 org.gradle.daemon=true
 org.gradle.parallel=true
-org.gradle.jvmargs=-Xmx5120m
+org.gradle.jvmargs=-Xmx5120m
+
+applicationId=com.xzjmyk.pm.activity

+ 4 - 3
settings.gradle

@@ -1,10 +1,10 @@
 //主工程
-include ':WeiChat', ':commontoasts'
+include ':WeiChat'
 
 //核心模块
 include ':network'
 include ':imageload'
-include ':commom'
+include  ':common'
 include ':message'
 
 //第三库模块
@@ -22,9 +22,10 @@ include ':pullToRefershLibraryMy'
 //核心模块
 project(':network').projectDir = new File('app_core/network')
 project(':imageload').projectDir = new File('app_core/imageload')
-project(':commom').projectDir = new File('app_core/commom')
+project(':common').projectDir = new File('app_core/common')
 project(':message').projectDir = new File('app_core/message')
 
+
 //第三库模块
 project(':lib-zxing').projectDir = new File('app_third/lib-zxing')
 project(':libbdupdatesdk').projectDir = new File('app_third/libbdupdatesdk')

+ 3 - 1
version.gradle

@@ -1,5 +1,7 @@
 /*
 Shared gradle properties
+    android:versionCode="111"
+    android:versionName="5.8.9"
 */
 
 ext {
@@ -15,7 +17,7 @@ ext {
 
     depsVersion = [
             junitVersion      : '4.12',
-            supportVersion    : '25.1.1',
+            supportVersion    : '24.2.1',
             butterknifeVersion: '8.2.1',
             fastjsonVersion   : '1.2.24',
             logVersion        : '1.15',