Sfoglia il codice sorgente

added support for java8 features

Daniel Zlotin 6 anni fa
parent
commit
46d06d4047

+ 5
- 0
lib/android/app/build.gradle Vedi File

@@ -5,6 +5,11 @@ android {
5 5
     compileSdkVersion 25
6 6
     buildToolsVersion "27.0.1"
7 7
 
8
+    compileOptions {
9
+        sourceCompatibility JavaVersion.VERSION_1_8
10
+        targetCompatibility JavaVersion.VERSION_1_8
11
+    }
12
+
8 13
     defaultConfig {
9 14
         minSdkVersion 16
10 15
         targetSdkVersion 25

+ 11
- 11
lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java Vedi File

@@ -1,13 +1,13 @@
1 1
 package com.reactnativenavigation;
2 2
 
3
-import android.os.Bundle;
4
-import android.support.annotation.Nullable;
5
-import android.support.v7.app.AppCompatActivity;
6
-import android.view.KeyEvent;
7
-import android.widget.Toast;
3
+import android.os.*;
4
+import android.support.annotation.*;
5
+import android.support.v7.app.*;
6
+import android.view.*;
7
+import android.widget.*;
8 8
 
9
-import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
10
-import com.reactnativenavigation.viewcontrollers.Navigator;
9
+import com.facebook.react.modules.core.*;
10
+import com.reactnativenavigation.viewcontrollers.*;
11 11
 
12 12
 public class NavigationActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler {
13 13
 	private Navigator navigator;
@@ -41,14 +41,14 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
41 41
 
42 42
 	@Override
43 43
 	public void invokeDefaultOnBackPressed() {
44
-        if (!navigator.handleBack()) {
45
-		    super.onBackPressed();
46
-        }
44
+		if (!navigator.handleBack()) {
45
+			super.onBackPressed();
46
+		}
47 47
 	}
48 48
 
49 49
 	@Override
50 50
 	public void onBackPressed() {
51
-        app().getReactGateway().onBackPressed();
51
+		app().getReactGateway().onBackPressed();
52 52
 	}
53 53
 
54 54
 	@Override

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/TestApplication.java Vedi File

@@ -1,6 +1,6 @@
1 1
 package com.reactnativenavigation;
2 2
 
3
-import android.app.Application;
3
+import android.app.*;
4 4
 
5 5
 public class TestApplication extends Application {
6 6
 	@Override

+ 5
- 0
playground/android/app/build.gradle Vedi File

@@ -11,6 +11,11 @@ android {
11 11
     compileSdkVersion 25
12 12
     buildToolsVersion "27.0.1"
13 13
 
14
+    compileOptions {
15
+        sourceCompatibility JavaVersion.VERSION_1_8
16
+        targetCompatibility JavaVersion.VERSION_1_8
17
+    }
18
+
14 19
     defaultConfig {
15 20
         applicationId "com.reactnativenavigation.playground"
16 21
         minSdkVersion 16