Skip to content

Commit b62b9a5

Browse files
committed
[Gradle] Update library source and target compatibility to Java 8 and add lambda + method reference usage
PiperOrigin-RevId: 443370295
1 parent 431e291 commit b62b9a5

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ subprojects {
202202
// This disables the builds tools automatic vector -> PNG generation
203203
defaultConfig.generatedDensities = []
204204

205-
compileOptions.sourceCompatibility JavaVersion.VERSION_1_7
206-
compileOptions.targetCompatibility JavaVersion.VERSION_1_7
205+
compileOptions.sourceCompatibility JavaVersion.VERSION_1_8
206+
compileOptions.targetCompatibility JavaVersion.VERSION_1_8
207207

208208
aaptOptions.additionalParameters "--no-version-vectors"
209209

lib/java/com/google/android/material/snackbar/Snackbar.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,10 @@ public Snackbar setAction(
343343
tv.setVisibility(View.VISIBLE);
344344
tv.setText(text);
345345
tv.setOnClickListener(
346-
new View.OnClickListener() {
347-
@Override
348-
public void onClick(View view) {
349-
listener.onClick(view);
350-
// Now dismiss the Snackbar
351-
dispatchDismiss(BaseCallback.DISMISS_EVENT_ACTION);
352-
}
346+
view -> {
347+
listener.onClick(view);
348+
// Now dismiss the Snackbar
349+
dispatchDismiss(BaseCallback.DISMISS_EVENT_ACTION);
353350
});
354351
}
355352
return this;

lib/java/com/google/android/material/timepicker/RadialViewGroup.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,7 @@ public RadialViewGroup(@NonNull Context context, @Nullable AttributeSet attrs, i
6767
TypedArray a =
6868
context.obtainStyledAttributes(attrs, R.styleable.RadialViewGroup, defStyleAttr, 0);
6969
radius = a.getDimensionPixelSize(R.styleable.RadialViewGroup_materialCircleRadius, 0);
70-
updateLayoutParametersRunnable = new Runnable() {
71-
@Override
72-
public void run() {
73-
updateLayoutParams();
74-
}
75-
};
70+
updateLayoutParametersRunnable = this::updateLayoutParams;
7671
a.recycle();
7772
}
7873

0 commit comments

Comments
 (0)