Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use default interface method bytecode optimization for target 1.8 #495

Merged
merged 2 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ subprojects {

if (isKotlinLibrary) {
def extraCompilerArgs = [
"-Xjvm-default=all"
// See https://github.com/bazelbuild/bazel/issues/15144
"-Xjvm-default=enable"
]
if (project.name in moduleFriends.keySet()) {
def friendName = moduleFriends[project.name]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,31 @@ import androidx.annotation.IntRange
*/
interface ActivityDelegate {
/** @see [Activity.onCreate] */
@JvmDefault
fun onCreate(savedInstanceState: Bundle?) {}

/** @see [Activity.onStart] */
@JvmDefault
fun onStart() {}

/** @see [Activity.onResume] */
@JvmDefault
fun onResume() {}

/** @see [Activity.onPause] */
@JvmDefault
fun onPause() {}

/** @see [Activity.onStop] */
@JvmDefault
fun onStop() {}

/** @see [Activity.onDestroy] */
@JvmDefault
fun onDestroy() {}

/** @see [Activity.onActivityResult] */
@JvmDefault
fun onActivityResult(
activity: Activity,
requestCode: Int,
Expand All @@ -53,6 +60,7 @@ interface ActivityDelegate {
) {}

/** @see [Activity.onRequestPermissionsResult] */
@JvmDefault
fun onRequestPermissionsResult(
activity: Activity,
@IntRange(from = 0, to = 255) requestCode: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface RxActivityEvents {
* @param clazz The [ActivityLifecycleEvent] subclass you want.
* @return an observable of this activity's lifecycle events.
*/
@JvmDefault
fun <T : ActivityLifecycleEvent> lifecycle(clazz: Class<T>): Observable<T> {
return lifecycle()
.filter { activityEvent -> clazz.isAssignableFrom(activityEvent.javaClass) }
Expand All @@ -43,6 +44,7 @@ interface RxActivityEvents {
* @param clazz The [ActivityCallbackEvent] subclass you want.
* @return an observable of this activity's callbacks events.
*/
@JvmDefault
fun <T : ActivityCallbackEvent> callbacks(clazz: Class<T>): Observable<T> {
return callbacks()
.filter { activityEvent -> clazz.isAssignableFrom(activityEvent.javaClass) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ interface Worker {
*
* @param lifecycle The lifecycle of the worker to use for subscriptions.
*/
@JvmDefault
fun onStart(lifecycle: WorkerScopeProvider) {}

/** Called when the worker is stopped. */
@JvmDefault
fun onStop() {}
}