Commit e623e60459d45963a5a87591f5ba1afb610b8541

Authored by 朱显松
1 parent 7aa28c8d

repair the wrong configuration Java8 support library causes compilation errors

.idea/modules.xml
... ... @@ -3,8 +3,11 @@
3 3 <component name="ProjectModuleManager">
4 4 <modules>
5 5 <module fileurl="file://$PROJECT_DIR$/CNLiveLibs.iml" filepath="$PROJECT_DIR$/CNLiveLibs.iml" />
  6 + <module fileurl="file://$PROJECT_DIR$/CNLiveLibs.iml" filepath="$PROJECT_DIR$/CNLiveLibs.iml" />
6 7 <module fileurl="file://$PROJECT_DIR$/OPenCNLive_BaseLib.iml" filepath="$PROJECT_DIR$/OPenCNLive_BaseLib.iml" />
7 8 <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
  9 + <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
  10 + <module fileurl="file://$PROJECT_DIR$/cnlive/cnlive.iml" filepath="$PROJECT_DIR$/cnlive/cnlive.iml" />
8 11 <module fileurl="file://$PROJECT_DIR$/cnlive/cnlive.iml" filepath="$PROJECT_DIR$/cnlive/cnlive.iml" />
9 12 </modules>
10 13 </component>
... ...
app/build.gradle
1 1 apply plugin: 'com.android.application'
  2 +apply plugin: 'me.tatarka.retrolambda'
2 3  
3 4 android {
4 5 compileSdkVersion 26
... ... @@ -16,9 +17,7 @@ android {
16 17 versionCode 1
17 18 versionName "1.0"
18 19 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
19   - jackOptions {
20   - enabled true
21   - }
  20 +
22 21 }
23 22 buildTypes {
24 23 release {
... ...
app/src/main/java/com/cnlive/libs/demo/Java8Test.java
... ... @@ -20,7 +20,7 @@ public class Java8Test {
20 20  
21 21 List<String> list = Arrays.asList("1", "2", "3");
22 22  
23   - activity.findViewById(R.id.progressBar).setOnClickListener(view -> Log.e("DemoView", "view " + view.getClass().getName()));
  23 + activity.findViewById(R.id.textView).setOnClickListener(view -> Log.e("DemoView", "view " + view.getClass().getName()));
24 24  
25 25 stream(list).filter(str -> str.startsWith("1")).forEach(item ->Log.e("DemoView","New " + item));
26 26  
... ...
app/src/main/java/com/cnlive/libs/demo/MainActivity.java
... ... @@ -13,5 +13,7 @@ public class MainActivity extends AppCompatActivity {
13 13  
14 14 //Toast 测试
15 15 ToastTest.test(this);
  16 +
  17 + Java8Test.test(this);
16 18 }
17 19 }
... ...
app/src/main/res/layout/activity_main.xml
... ... @@ -6,7 +6,7 @@
6 6 android:layout_height="match_parent"
7 7 tools:context="com.cnlive.libs.demo.MainActivity">
8 8  
9   - <TextView
  9 + <TextView android:id="@+id/textView"
10 10 android:layout_width="wrap_content"
11 11 android:layout_height="wrap_content"
12 12 android:text="Hello World!"
... ...
cnlive/build.gradle
1 1 apply plugin: 'com.android.library'
2 2 apply plugin: 'maven'
3   -apply plugin: 'me.tatarka.retrolambda'
4 3  
5 4 android {
6 5 compileSdkVersion 26
... ... @@ -50,7 +49,6 @@ dependencies {
50 49 compile 'net.sourceforge.streamsupport:streamsupport-atomic:1.5.5'
51 50 compile 'net.sourceforge.streamsupport:streamsupport-flow:1.5.5'
52 51 compile 'net.sourceforge.streamsupport:streamsupport-literal:1.5.5'
53   -
54 52 }
55 53  
56 54 ext {
... ...