Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsChaceD committed Dec 20, 2023
1 parent 6e54faa commit 122ece8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import androidx.annotation.Nullable;

public class BrowserControllerActivity extends Activity {
Expand All @@ -24,19 +23,18 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if(intent.hasExtra("close")) {
if (intent.hasExtra("close")) {
finish();
}
}

@Override
protected void onResume() {
super.onResume();
if(isCustomTabsOpen) {
if (isCustomTabsOpen) {
isCustomTabsOpen = false;
finish();
}
else {
} else {
isCustomTabsOpen = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class BrowserPlugin extends Plugin {

public static void setBrowserControllerListener(BrowserControllerListener listener) {
browserControllerListener = listener;
if(listener == null) {
if (listener == null) {
browserControllerActivityInstance = null;
}
}
Expand Down Expand Up @@ -70,11 +70,13 @@ public void open(PluginCall call) {
getContext().startActivity(intent);

Integer finalToolbarColor = toolbarColor;
setBrowserControllerListener(activity -> {
activity.open(implementation, url, finalToolbarColor);
browserControllerActivityInstance = activity;
call.resolve();
});
setBrowserControllerListener(
activity -> {
activity.open(implementation, url, finalToolbarColor);
browserControllerActivityInstance = activity;
call.resolve();
}
);
} catch (ActivityNotFoundException ex) {
Logger.error(getLogTag(), ex.getLocalizedMessage(), null);
call.reject("Unable to display URL");
Expand All @@ -84,7 +86,7 @@ public void open(PluginCall call) {

@PluginMethod
public void close(PluginCall call) {
if(browserControllerActivityInstance != null) {
if (browserControllerActivityInstance != null) {
browserControllerActivityInstance = null;
Intent intent = new Intent(getContext(), BrowserControllerActivity.class);
intent.putExtra("close", true);
Expand Down

0 comments on commit 122ece8

Please sign in to comment.