Skip to content

Commit

Permalink
Add closeWebView
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed May 11, 2023
1 parent 8cb4f69 commit e81b468
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.getlantern.lantern.activity

import android.app.ProgressDialog
import android.view.KeyEvent
import android.view.View
import android.webkit.WebSettings.PluginState
import android.webkit.WebView
import android.webkit.WebViewClient
Expand Down Expand Up @@ -77,6 +78,10 @@ open class WebViewActivity : BaseFragmentActivity() {
webView.loadUrl(url)
}

public fun closeWebView(view: View) {
finish()
}

companion object {
private val TAG = WebViewActivity::class.java.simpleName
}
Expand Down
10 changes: 3 additions & 7 deletions lib/account/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Settings extends StatelessWidget {

void checkForUpdates() async => await sessionModel.checkForUpdates();

void openWebview(String url) => sessionModel.openWebview(url);
void openWebview(String url) async => await sessionModel.openWebview(url);

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -142,9 +142,7 @@ class Settings extends StatelessWidget {
ListItemFactory.settingsItem(
header: 'about'.i18n,
content: 'privacy_policy'.i18n,
onTap: () {
openWebview("https://lantern.io/privacy");
},
onTap: () => openWebview("https://lantern.io/privacy"),
trailingArray: [
mirrorLTR(
context: context,
Expand All @@ -169,9 +167,7 @@ class Settings extends StatelessWidget {
),
)
],
onTap: () {
openWebview("https://lantern.io/terms");
},
onTap: () => openWebview("https://lantern.io/terms"),
),
//* Build version
FutureBuilder<PackageInfo>(
Expand Down

0 comments on commit e81b468

Please # to comment.