File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
src/main/java/io/github/gfx/java8androidexample Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 11apply plugin : ' com.android.application'
2+ apply plugin : ' io.github.retropiler'
23
34android {
45 compileSdkVersion 25
@@ -17,10 +18,14 @@ android {
1718 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
1819 }
1920 }
21+ compileOptions {
22+ sourceCompatibility JavaVersion . VERSION_1_8
23+ targetCompatibility JavaVersion . VERSION_1_8
24+ }
2025}
2126
2227dependencies {
23- compile fileTree(dir : ' libs ' , include : [' *.jar' ])
28+ compile fileTree(include : [' *.jar' ], dir : ' libs ' )
2429 androidTestCompile(' com.android.support.test.espresso:espresso-core:2.2.2' , {
2530 exclude group : ' com.android.support' , module : ' support-annotations'
2631 })
Original file line number Diff line number Diff line change 11package io .github .gfx .java8androidexample ;
22
3- import android .support . v7 . app . AppCompatActivity ;
3+ import android .annotation . SuppressLint ;
44import android .os .Bundle ;
5+ import android .support .v7 .app .AppCompatActivity ;
6+ import android .widget .TextView ;
7+
8+ import java .util .Optional ;
59
10+ @ SuppressLint ("NewApi" )
611public class MainActivity extends AppCompatActivity {
712
813 @ Override
914 protected void onCreate (Bundle savedInstanceState ) {
1015 super .onCreate (savedInstanceState );
1116 setContentView (R .layout .activity_main );
17+
18+ TextView textView = (TextView ) findViewById (R .id .text );
19+
20+ Optional .of ("foo" ).map (String ::toUpperCase ).ifPresent (textView ::setText );
1221 }
1322}
Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ buildscript {
66 }
77 dependencies {
88 classpath ' com.android.tools.build:gradle:2.3.1'
9-
10- // NOTE: Do not place your application dependencies here; they belong
11- // in the individual module build.gradle files
9+ classpath ' io.github.retropiler:retropiler-gradle-plugin:0.0.2'
1210 }
1311}
1412
You can’t perform that action at this time.
0 commit comments