Skip to content

Commit

Permalink
refactor: use lambda instead of Runnable
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Jun 28, 2024
1 parent 066d2bc commit e545c08
Showing 1 changed file with 3 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,29 +123,12 @@ public void configure(PluginCall call) {

@PluginMethod
public void preload(final PluginCall call) {
new Thread(
new Runnable() {
@Override
public void run() {
preloadAsset(call);
}
}
)
.start();
new Thread(() -> preloadAsset(call)).start();
}

@PluginMethod
public void play(final PluginCall call) {
getBridge()
.getActivity()
.runOnUiThread(
new Runnable() {
@Override
public void run() {
playOrLoop("play", call);
}
}
);
getBridge().getActivity().runOnUiThread(() -> playOrLoop("play", call));
}

@PluginMethod
Expand Down Expand Up @@ -200,16 +183,7 @@ public void getDuration(final PluginCall call) {

@PluginMethod
public void loop(final PluginCall call) {
getBridge()
.getActivity()
.runOnUiThread(
new Runnable() {
@Override
public void run() {
playOrLoop("loop", call);
}
}
);
getBridge().getActivity().runOnUiThread(() -> playOrLoop("loop", call));
}

@PluginMethod
Expand Down

0 comments on commit e545c08

Please sign in to comment.