I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit bf47b901 authored by str4d's avatar str4d
Browse files

Restored reload action (needed to update webpage if cached), fixed back nav

parent 54a446eb
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:i2pandroid="http://schemas.android.com/apk/res-auto" >
<item android:title="@string/action_reload"
android:id="@+id/menu_reload"
android:icon="@drawable/ic_navigation_refresh"
i2pandroid:showAsAction="ifRoom" >
</item>
</menu>
......@@ -28,4 +28,11 @@ public class PeersActivity extends I2PActivityBase {
PeersFragment f = (PeersFragment) getSupportFragmentManager().findFragmentById(R.id.main_fragment);
f.update();
}
@Override
public void onBackPressed() {
PeersFragment f = (PeersFragment) getSupportFragmentManager().findFragmentById(R.id.main_fragment);
if (!f.onBackPressed())
super.onBackPressed();
}
}
......@@ -16,4 +16,11 @@ public class WebActivity extends I2PActivityBase {
.add(R.id.main_fragment, f).commit();
}
}
@Override
public void onBackPressed() {
WebFragment f = (WebFragment) getSupportFragmentManager().findFragmentById(R.id.main_fragment);
if (!f.onBackPressed())
super.onBackPressed();
}
}
......@@ -2,6 +2,8 @@ package net.i2p.android.router.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
......@@ -19,6 +21,12 @@ public class PeersFragment extends I2PFragmentBase {
private static final String HEADER = "<html><head></head><body>";
private static final String FOOTER = "</body></html>";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
......@@ -82,15 +90,18 @@ public class PeersFragment extends I2PFragmentBase {
return false;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.fragment_web_actions, menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
WebView wv = (WebView) getActivity().findViewById(R.id.peers_webview);
switch (item.getItemId()) {
/*
case R.id.menu_reload:
update();
return true;
*/
default:
return super.onOptionsItemSelected(item);
......
......@@ -4,6 +4,8 @@ import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
......@@ -25,6 +27,12 @@ public class WebFragment extends I2PFragmentBase {
"any non-I2P links visited in this window are fetched over the regular internet and are " +
"not anonymous. I2P pages may not load images or CSS.";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
......@@ -92,11 +100,15 @@ public class WebFragment extends I2PFragmentBase {
return false;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.fragment_web_actions, menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
WebView wv = (WebView) getActivity().findViewById(R.id.browser_webview);
switch (item.getItemId()) {
/*
case R.id.menu_reload:
_wvClient.cancelAll();
wv.stopLoading();
......@@ -111,7 +123,6 @@ public class WebFragment extends I2PFragmentBase {
_wvClient.shouldOverrideUrlLoading(wv, url);
}
return true;
*/
default:
return super.onOptionsItemSelected(item);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment