mirror of https://github.com/PurpleI2P/i2pd.git
user
4 years ago
5 changed files with 55 additions and 16 deletions
@ -1,12 +1,14 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
<LinearLayout android:id="@+id/layout_prompt" |
<LinearLayout android:id="@+id/layout_prompt" |
||||||
xmlns:android="http://schemas.android.com/apk/res/android" |
xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
xmlns:tools="http://schemas.android.com/tools" |
xmlns:tools="http://schemas.android.com/tools" |
||||||
android:layout_width="fill_parent" |
android:layout_width="fill_parent" |
||||||
android:layout_height="fill_parent" |
android:layout_height="fill_parent" |
||||||
tools:context=".I2PDActivity"> |
tools:context=".WebConsoleActivity"> |
||||||
|
|
||||||
<WebView |
<WebView |
||||||
android:id="@+id/webview1" |
android:id="@+id/webview1" |
||||||
android:layout_width="fill_parent" |
android:layout_width="fill_parent" |
||||||
android:layout_height="fill_parent" /> |
android:layout_height="fill_parent" /> |
||||||
</LinearLayout> |
</LinearLayout> |
||||||
|
|
@ -0,0 +1,41 @@ |
|||||||
|
package org.purplei2p.i2pd; |
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity; |
||||||
|
|
||||||
|
import android.app.Activity; |
||||||
|
import android.os.Bundle; |
||||||
|
import android.view.MenuItem; |
||||||
|
import android.webkit.WebSettings; |
||||||
|
import android.webkit.WebView; |
||||||
|
import android.webkit.WebViewClient; |
||||||
|
|
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
public class WebConsoleActivity extends Activity { |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void onCreate(Bundle savedInstanceState) { |
||||||
|
super.onCreate(savedInstanceState); |
||||||
|
setContentView(R.layout.activity_web_console); |
||||||
|
|
||||||
|
Objects.requireNonNull(getActionBar()).setDisplayHomeAsUpEnabled(true); |
||||||
|
|
||||||
|
final WebView webView = findViewById(R.id.webview1); |
||||||
|
webView.setWebViewClient(new WebViewClient()); |
||||||
|
|
||||||
|
final WebSettings webSettings = webView.getSettings(); |
||||||
|
webSettings.setBuiltInZoomControls(true); |
||||||
|
webSettings.setJavaScriptEnabled(false); |
||||||
|
webView.loadUrl("http://127.0.0.1:7070"); // TODO: instead 7070 I2Pd....HttpPort
|
||||||
|
} |
||||||
|
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) { |
||||||
|
int id = item.getItemId(); |
||||||
|
|
||||||
|
if (id==android.R.id.home) { |
||||||
|
finish(); |
||||||
|
return true; |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue