Compare commits

...

26 Commits

Author SHA1 Message Date
6db307c681 Client library 0.3
i2p.i2p tag: i2p-0.9.16
2014-11-02 01:46:33 +00:00
cdec6d2f98 Updated README 2014-11-02 01:36:11 +00:00
18a6dc9719 Use mavenLocal() repository instead of a local file repo 2014-11-02 01:35:55 +00:00
fb92d7858a Upgraded build tools to 21.0.2 2014-10-30 23:10:36 +00:00
b8e005bdd5 Copy tasks can only have one destination directory 2014-10-30 23:10:00 +00:00
6568489b27 Upgraded gradle wrapper and build tools 2014-10-30 12:15:49 +00:00
3ff3e14fc2 New Gradle Witness build
Includes a fix for Gradle 2.+ that is not yet pulled in:
https://github.com/WhisperSystems/gradle-witness/pull/3
2014-10-30 12:15:04 +00:00
092591f4ec Material theme: toolbar
Navigation tabs have all been replaced with spinners, because there are no nice
tab libraries for API 9+.
2014-10-29 11:47:53 +00:00
895a3a1dcc Fix deprecation 2014-10-27 21:37:52 +00:00
dc4ce3f8c7 Updated translations 2014-10-27 07:31:36 +00:00
7e3b9d5065 Updated translations 2014-10-22 21:15:55 +00:00
e58ffc9fd4 Material theme: nav drawer 2014-10-19 06:48:33 +00:00
0d029988c3 Material theme color definitions 2014-10-19 06:05:08 +00:00
6f01989a4b Nav drawer icon changed 2014-10-19 06:04:07 +00:00
19aeaec406 New material theme menu icons 2014-10-19 06:03:14 +00:00
b4d1241a9e Implement material styles properly with appcompat 2014-10-18 21:08:33 +00:00
fef4aa0e86 Initial migration to API 21 2014-10-18 06:11:39 +00:00
766266b147 Updated translations 2014-10-18 02:36:53 +00:00
93410c07bb Updated ignores 2014-10-17 08:02:24 +00:00
dc27a782b0 Fixed NPE in client library with State unparceling
This only fixes the symptom, but the crash log on Google Play doesn't shed light
on what the problem is.
2014-10-17 06:54:26 +00:00
zzz
b633df73c0 Update imports for move of router data structures 2014-10-16 23:10:32 +00:00
41d1200df7 0.9.15.1 2014-10-16 10:47:27 +00:00
c9a62fba9a Drop interface that isn't in source yet 2014-10-16 10:25:12 +00:00
c9598fa831 Update default subscriptions 2014-10-16 10:16:06 +00:00
9965c31b2d Pass dir and file to Util.mergeResourceToFile() in the correct order 2014-10-16 10:15:13 +00:00
43de6425b2 New translations for client library 2014-10-16 10:13:56 +00:00
109 changed files with 732 additions and 537 deletions

View File

@ -39,9 +39,13 @@ signing.properties
build
# I2P-specific ignores
^res/raw/blocklist_txt
^res/raw/certificates_zip
^res/raw/hosts_txt
^res/raw/license_
^app/src/main/res/drawable/i2plogo.png
^app/src/main/res/raw/blocklist_txt
^app/src/main/res/raw/hosts_txt
^app/src/main/res/raw/license_
^app/src/main/res/raw/certificates_zip
^app/src/main/assets/themes/console/images
^app/src/main/assets/themes/console/light/console.css
^app/src/main/assets/themes/console/light/images/header.png
^scripts/build.number
^scripts/version.properties

View File

@ -7,9 +7,10 @@
- Java SDK (preferably Oracle/Sun or OpenJDK) 1.6.0 or higher
- Apache Ant 1.8.0 or higher
- I2P source
- Android SDK (tested with Rev 22.6.4 and platform-tools version 19.1)
- Android SDK for API 21
- Android Build Tools 21.0.2
- Android Support Repository
- Gradle 1.12
- Gradle 2.1
### Gradle
@ -86,24 +87,15 @@ systemProp.socksProxyPort=9150
## Client library
### "Uploading" to a local file repository (to use a local build of the library in a project)
### "Uploading" to the local Maven repository (to use a local build of the library in a project)
1. Add the following line to your `~/.gradle/gradle.properties`:
1. `gradle :client:installArchives`
```
localFileRepoDir=/path/to/local/file/repo
```
2. `gradle :client:uploadArchives`
3. Add the resulting directory to your project as a repository. For Gradle projects, add the following above any existing repositories (so it is checked first):
2. Add the local Maven repository to your project. For Gradle projects, add the following above any existing repositories (so it is checked first):
```
repositories {
flatDir {
name 'fileRepo'
dirs file('/path/to/local/file/repo')
}
mavenLocal()
}
```

View File

@ -1,4 +1,4 @@
apply plugin: 'android'
apply plugin: 'com.android.application'
apply plugin: 'witness'
android {
@ -37,15 +37,19 @@ android {
dependencies {
compile project(':routerjars')
compile project(':client')
compile 'com.android.support:support-v4:20.0.0'
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile files('libs/androidplot-core-0.6.1.jar')
}
dependencyVerification {
verify = [
'com.android.support:support-v4:81f2b1c2c94efd5a4ec7fcd97b6cdcd00e87a933905c5c86103c7319eb024572',
'com.android.support:appcompat-v7:736f576ab0b68d27bdf18b1e7931566e6d8254b73965175313e87f8866b91547',
'com.android.support:support-v4:199ef7bb169386c80b4836354df6747ce2ae3d24434db923c22439e47106a1e2',
'com.android.support:appcompat-v7:45e999dda55fe81d9cc1c7342b7b70480ff3f307baa8da0df767f92fc5c52cd1',
'com.android.support:recyclerview-v7:ab2390d688601b65e2f3a0718b3d25487e61546c4e20f81eb0b033f30ca15b31',
'com.android.support:cardview-v7:7b724eb46efc98eee70c333cd0e9c34ca89b1a4456c3e40cfcc33501c43570bf',
]
}
@ -66,16 +70,15 @@ if (propFile.canRead()) {
println 'local.properties not found'
}
task copyDrawableResources(type: Copy) {
from file(i2pbase + '/installer/resources/themes/console/images/i2plogo.png')
into 'src/main/res/drawable'
}
task certificatesZip(type: Zip) {
archiveName = 'certificates_zip'
from files('' + i2pbase + '/installer/resources/certificates')
}
task copyI2PResources(type: Copy) {
into 'src/main'
into('res/drawable') {
from file(i2pbase + '/installer/resources/themes/console/images/i2plogo.png')
}
into('res/raw') {
task copyRawResources(type:Copy) {
from(i2pbase + '/installer/resources/blocklist.txt') { rename { 'blocklist_txt' } }
from(i2pbase + '/installer/resources/hosts.txt') { rename { 'hosts_txt' } }
from('../LICENSE.txt') { rename { 'license_app_txt' } }
@ -104,20 +107,35 @@ task copyI2PResources(type: Copy) {
}
}
from certificatesZip
into 'src/main/res/raw'
}
task copyI2PResources
copyI2PResources.dependsOn copyDrawableResources
copyI2PResources.dependsOn copyRawResources
// For peers WebView
into('assets/themes/console/images') {
task copyConsoleImagesAssets(type: Copy) {
from file(i2pbase + '/installer/resources/themes/console/images/i2plogo.png')
from file(i2pbase + '/installer/resources/themes/console/images/inbound.png')
from file(i2pbase + '/installer/resources/themes/console/images/outbound.png')
into 'src/main/assets/themes/console/images'
}
into ('assets/themes/console/light') {
task copyConsoleLightAssets(type: Copy) {
from file(i2pbase + '/installer/resources/themes/console/light/console.css')
into 'src/main/assets/themes/console/light'
}
into('assets/themes/console/light/images') {
task copyConsoleLightImagesAssets(type: Copy) {
from file(i2pbase + '/installer/resources/themes/console/light/images/header.png')
into 'src/main/assets/themes/console/light/images'
}
}
task copyI2PAssets
copyI2PAssets.dependsOn copyConsoleImagesAssets
copyI2PAssets.dependsOn copyConsoleLightAssets
copyI2PAssets.dependsOn copyConsoleLightImagesAssets
preBuild.dependsOn copyI2PResources
preBuild.dependsOn copyI2PAssets
task cleanI2PResources(type: Delete) {
delete file('src/main/res/drawable/i2plogo.png')
delete fileTree('src/main/res/raw') {
@ -126,12 +144,15 @@ task cleanI2PResources(type: Delete) {
include 'license_*'
include 'certificates_zip'
}
}
task cleanI2PAssets(type: Delete) {
delete fileTree('src/main/assets/themes/console/images')
delete file('src/main/assets/themes/console/light/console.css')
delete file('src/main/assets/themes/console/light/images/header.png')
}
preBuild.dependsOn copyI2PResources
clean.dependsOn cleanI2PResources
clean.dependsOn cleanI2PAssets
props = new Properties()
propFile = new File(project.rootDir, 'signing.properties')

View File

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.i2p.android.router"
android:installLocation="auto"
android:versionCode="4745221"
android:versionName="0.9.15">
android:versionCode="4745222"
android:versionName="0.9.15.1">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@ -15,7 +15,7 @@
<application
android:icon="@drawable/ic_launcher_itoopie"
android:label="@string/app_name"
android:theme="@style/I2PAndroid">
android:theme="@style/Theme.I2P">
<service
android:name=".service.RouterService"
android:icon="@drawable/ic_launcher_itoopie"

View File

@ -22,8 +22,7 @@ import net.i2p.android.router.dialog.TextResourceDialog;
import org.sufficientlysecure.htmltextview.HtmlTextView;
public class HelpActivity extends ActionBarActivity implements
BrowserConfigFragment.OnBrowserSelectedListener {
public class HelpActivity extends ActionBarActivity {
public static final String CATEGORY = "help_category";
public static final int CAT_MAIN = 0;
public static final int CAT_CONFIGURE_BROWSER = 1;
@ -154,11 +153,4 @@ public class HelpActivity extends ActionBarActivity implements
return super.onOptionsItemSelected(item);
}
}
// BrowserConfigFragment.OnBrowserSelectedListener
@Override
public void onBrowserSelected(String browserPackage) {
// TODO
}
}

View File

@ -1,11 +1,14 @@
package net.i2p.android.i2ptunnel;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import net.i2p.android.router.I2PActivityBase;
import net.i2p.android.router.R;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBar.Tab;
public class TunnelListActivity extends I2PActivityBase implements
TunnelListFragment.OnTunnelSelectedListener,
@ -16,7 +19,10 @@ public class TunnelListActivity extends I2PActivityBase implements
*/
private boolean mTwoPane;
private static final String SELECTED_TAB = "selected_tab";
private static final String SELECTED_PAGE = "selected_page";
private static final int PAGE_CLIENT = 0;
private Spinner mSpinner;
@Override
protected boolean canUseTwoPanes() {
@ -27,54 +33,57 @@ public class TunnelListActivity extends I2PActivityBase implements
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set up action bar for tabs
ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
mSpinner = (Spinner) findViewById(R.id.main_spinner);
mSpinner.setVisibility(View.VISIBLE);
// Client tunnels tab
TunnelListFragment cf = new TunnelListFragment();
Bundle args = new Bundle();
args.putBoolean(TunnelListFragment.SHOW_CLIENT_TUNNELS, true);
cf.setArguments(args);
Tab tab = actionBar.newTab()
.setText(R.string.label_i2ptunnel_client)
.setTabListener(new TabListener(cf));
actionBar.addTab(tab);
mSpinner.setAdapter(ArrayAdapter.createFromResource(this,
R.array.i2ptunnel_pages, android.R.layout.simple_spinner_dropdown_item));
// Server tunnels tab
TunnelListFragment sf = new TunnelListFragment();
args = new Bundle();
args.putBoolean(TunnelListFragment.SHOW_CLIENT_TUNNELS, false);
sf.setArguments(args);
tab = actionBar.newTab()
.setText(R.string.label_i2ptunnel_server)
.setTabListener(new TabListener(sf));
actionBar.addTab(tab);
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_TAB);
actionBar.setSelectedNavigationItem(selected);
mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
selectPage(i);
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
if (findViewById(R.id.detail_fragment) != null) {
// The detail container view will be present only in the
// large-screen layouts (res/values-large and
// res/values-sw600dp). If this view is present, then the
// activity should be in two-pane mode.
mTwoPane = true;
// In two-pane mode, list items should be given the
// 'activated' state when touched.
cf.setActivateOnItemClick(true);
sf.setActivateOnItemClick(true);
}
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_PAGE);
mSpinner.setSelection(selected);
} else
selectPage(PAGE_CLIENT);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(SELECTED_TAB,
getSupportActionBar().getSelectedNavigationIndex());
outState.putInt(SELECTED_PAGE, mSpinner.getSelectedItemPosition());
}
private void selectPage(int page) {
TunnelListFragment f = new TunnelListFragment();
Bundle args = new Bundle();
args.putBoolean(TunnelListFragment.SHOW_CLIENT_TUNNELS, page == PAGE_CLIENT);
f.setArguments(args);
// In two-pane mode, list items should be given the
// 'activated' state when touched.
if (mTwoPane)
f.setActivateOnItemClick(true);
getSupportFragmentManager().beginTransaction()
.replace(R.id.main_fragment, f).commit();
}
// TunnelListFragment.OnTunnelSelectedListener

View File

@ -8,7 +8,6 @@ import android.content.res.Configuration;
import android.os.Bundle;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
@ -16,6 +15,8 @@ import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBar.Tab;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@ -60,13 +61,16 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
private static final String SHARED_PREFS = "net.i2p.android.router";
protected static final String PREF_AUTO_START = "autoStart";
/** true leads to a poor install experience, very slow to paint the screen */
/**
* true leads to a poor install experience, very slow to paint the screen
*/
protected static final boolean DEFAULT_AUTO_START = false;
protected static final String PREF_NAV_DRAWER_OPENED = "navDrawerOpened";
/**
* Override this in subclasses that need a ViewPager, such as a
* category view.
*
* @return whether this Activity needs a ViewPager.
*/
protected boolean useViewPager() {
@ -76,16 +80,18 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
/**
* Override this in subclasses that can use two panes, such as a
* list/detail class.
*
* @return whether this Activity can use a two-pane layout.
*/
protected boolean canUseTwoPanes() {
return false;
}
/** Called when the activity is first created. */
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState)
{
public void onCreate(Bundle savedInstanceState) {
Util.d(this + " onCreate called");
super.onCreate(savedInstanceState);
_sharedPrefs = getSharedPreferences(SHARED_PREFS, 0);
@ -102,6 +108,10 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
else
setContentView(R.layout.activity_navdrawer_onepane);
// Set the action bar
Toolbar toolbar = (Toolbar) findViewById(R.id.main_toolbar);
setSupportActionBar(toolbar);
mTitle = mDrawerTitle = getTitle();
String[] activityTitles = getResources().getStringArray(R.array.navdrawer_activity_titles);
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("i2pandroid.main.showStats", false)) {
@ -119,16 +129,12 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
mDrawerList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
// Set the adapter for the list view
mDrawerList.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, activityTitles));
R.layout.listitem_navdrawer, activityTitles));
// Set the list's click listener
mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
// Enable ActionBar app icon to behave as action to toggle nav drawer
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) {
R.string.drawer_open, R.string.drawer_close) {
private boolean wasDragged = false;
/** Called when a drawer has settled in a completely closed state. */
@ -209,15 +215,13 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
}
@Override
public void onRestart()
{
public void onRestart() {
Util.d(this + " onRestart called");
super.onRestart();
}
@Override
public void onStart()
{
public void onStart() {
Util.d(this + " onStart called");
super.onStart();
if (_sharedPrefs.getBoolean(PREF_AUTO_START, DEFAULT_AUTO_START))
@ -226,24 +230,32 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
bindRouter(false);
}
/** @param def default */
/**
* @param def default
*/
public boolean getPref(String pref, boolean def) {
return _sharedPrefs.getBoolean(pref, def);
}
/** @param def default */
/**
* @param def default
*/
public String getPref(String pref, String def) {
return _sharedPrefs.getString(pref, def);
}
/** @return success */
/**
* @return success
*/
public boolean setPref(String pref, boolean val) {
SharedPreferences.Editor edit = _sharedPrefs.edit();
edit.putBoolean(pref, val);
return edit.commit();
}
/** @return success */
/**
* @return success
*/
public boolean setPref(String pref, String val) {
SharedPreferences.Editor edit = _sharedPrefs.edit();
edit.putString(pref, val);
@ -251,37 +263,32 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
}
@Override
public void onResume()
{
public void onResume() {
Util.d(this + " onResume called");
super.onResume();
}
@Override
public void onPause()
{
public void onPause() {
Util.d(this + " onPause called");
super.onPause();
}
@Override
public void onSaveInstanceState(Bundle outState)
{
public void onSaveInstanceState(Bundle outState) {
Util.d(this + " onSaveInstanceState called");
super.onSaveInstanceState(outState);
}
@Override
public void onStop()
{
public void onStop() {
Util.d(this + " onStop called");
unbindRouter();
super.onStop();
}
@Override
public void onDestroy()
{
public void onDestroy() {
Util.d(this + " onDestroy called");
super.onDestroy();
}
@ -301,6 +308,7 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
/**
* Override in subclass with e.g.
* menu.findItem(R.id.action_add_to_addressbook).setVisible(!drawerOpen);
*
* @param drawerOpen true if the drawer is open
*/
protected void onDrawerChange(boolean drawerOpen) {
@ -424,7 +432,9 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
}
}
/** callback from ServiceConnection, override as necessary */
/**
* callback from ServiceConnection, override as necessary
*/
protected void onRouterBind(RouterService svc) {
Fragment f = getSupportFragmentManager().findFragmentById(R.id.main_fragment);
if (f instanceof I2PFragmentBase)
@ -441,8 +451,11 @@ public abstract class I2PActivityBase extends ActionBarActivity implements
}
}
/** callback from ServiceConnection, override as necessary */
protected void onRouterUnbind() {}
/**
* callback from ServiceConnection, override as necessary
*/
protected void onRouterUnbind() {
}
// I2PFragmentBase.RouterContextProvider

View File

@ -233,7 +233,7 @@ class InitActivities {
* @param overrides local overrides or null
*/
private void mergeResourceToFile(int resID, String f, Properties overrides) {
Util.mergeResourceToFile(ctx, f, myDir, resID, overrides);
Util.mergeResourceToFile(ctx, myDir, f, resID, overrides);
}
/**

View File

@ -1,9 +1,5 @@
package net.i2p.android.router.addressbook;
import net.i2p.android.router.I2PActivityBase;
import net.i2p.android.router.R;
import net.i2p.android.router.web.WebActivity;
import net.i2p.android.router.web.WebFragment;
import android.app.Activity;
import android.app.SearchManager;
import android.content.Context;
@ -12,11 +8,18 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBar.Tab;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import net.i2p.android.router.I2PActivityBase;
import net.i2p.android.router.R;
import net.i2p.android.router.web.WebActivity;
import net.i2p.android.router.web.WebFragment;
public class AddressbookActivity extends I2PActivityBase
implements AddressbookFragment.OnAddressSelectedListener,
@ -27,7 +30,10 @@ public class AddressbookActivity extends I2PActivityBase
*/
private boolean mTwoPane;
private static final String SELECTED_TAB = "selected_tab";
private static final String SELECTED_PAGE = "selected_page";
private static final int PAGE_ROUTER = 0;
private Spinner mSpinner;
@Override
protected boolean canUseTwoPanes() {
@ -38,37 +44,23 @@ public class AddressbookActivity extends I2PActivityBase
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set up action bar for tabs
ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
mSpinner = (Spinner) findViewById(R.id.main_spinner);
mSpinner.setVisibility(View.VISIBLE);
// Router book tab
AddressbookFragment rf = new AddressbookFragment();
Bundle args = new Bundle();
args.putString(AddressbookFragment.BOOK_NAME,
AddressbookFragment.ROUTER_BOOK);
rf.setArguments(args);
Tab tab = actionBar.newTab()
.setText("Router")
.setTabListener(new TabListener(rf));
actionBar.addTab(tab);
mSpinner.setAdapter(ArrayAdapter.createFromResource(this,
R.array.addressbook_pages, android.R.layout.simple_spinner_dropdown_item));
// Private book tab
AddressbookFragment pf = new AddressbookFragment();
args = new Bundle();
args.putString(AddressbookFragment.BOOK_NAME,
AddressbookFragment.PRIVATE_BOOK);
pf.setArguments(args);
tab = actionBar.newTab()
.setText("Private")
.setTabListener(new TabListener(pf));
actionBar.addTab(tab);
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_TAB);
actionBar.setSelectedNavigationItem(selected);
mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
selectPage(i);
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
if (findViewById(R.id.detail_fragment) != null) {
// The detail container view will be present only in the
// large-screen layouts (res/values-large and
@ -76,13 +68,30 @@ public class AddressbookActivity extends I2PActivityBase
// activity should be in two-pane mode.
mTwoPane = true;
}
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_PAGE);
mSpinner.setSelection(selected);
} else
selectPage(PAGE_ROUTER);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(SELECTED_TAB,
getSupportActionBar().getSelectedNavigationIndex());
outState.putInt(SELECTED_PAGE, mSpinner.getSelectedItemPosition());
}
private void selectPage(int page) {
AddressbookFragment f = new AddressbookFragment();
Bundle args = new Bundle();
args.putString(AddressbookFragment.BOOK_NAME,
page == PAGE_ROUTER ?
AddressbookFragment.ROUTER_BOOK :
AddressbookFragment.PRIVATE_BOOK);
f.setArguments(args);
getSupportFragmentManager().beginTransaction()
.replace(R.id.main_fragment, f).commit();
}
@Override

View File

@ -1,17 +1,19 @@
package net.i2p.android.router.log;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import net.i2p.android.router.I2PActivityBase;
import net.i2p.android.router.R;
import net.i2p.android.router.SettingsActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.SpinnerAdapter;
public class LogActivity extends I2PActivityBase implements
LogFragment.OnEntrySelectedListener {
@ -23,6 +25,9 @@ public class LogActivity extends I2PActivityBase implements
private static final String SELECTED_LEVEL = "selected_level";
private String[] mLevels;
private Spinner mSpinner;
@Override
protected boolean canUseTwoPanes() {
return true;
@ -32,9 +37,10 @@ public class LogActivity extends I2PActivityBase implements
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set up action bar for drop-down list
ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
mLevels = getResources().getStringArray(R.array.log_level_list);
mSpinner = (Spinner) findViewById(R.id.main_spinner);
mSpinner.setVisibility(View.VISIBLE);
mDrawerToggle.setDrawerIndicatorEnabled(false);
@ -46,31 +52,36 @@ public class LogActivity extends I2PActivityBase implements
mTwoPane = true;
}
SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this,
R.array.log_level_list, android.R.layout.simple_spinner_dropdown_item);
mSpinner.setAdapter(ArrayAdapter.createFromResource(this,
R.array.log_level_list, android.R.layout.simple_spinner_dropdown_item));
ActionBar.OnNavigationListener mNavigationListener = new ActionBar.OnNavigationListener() {
String[] levels = getResources().getStringArray(R.array.log_level_list);
mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
selectLevel(i);
}
public boolean onNavigationItemSelected(int position, long itemId) {
String level = levels[position];
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_LEVEL);
mSpinner.setSelection(selected);
} else
selectLevel(0);
}
private void selectLevel(int i) {
String level = mLevels[i];
LogFragment f = LogFragment.newInstance(level);
// In two-pane mode, list items should be given the
// 'activated' state when touched.
if (mTwoPane)
f.setActivateOnItemClick(true);
getSupportFragmentManager().beginTransaction()
.replace(R.id.main_fragment, f, levels[position]).commit();
return true;
}
};
actionBar.setListNavigationCallbacks(mSpinnerAdapter, mNavigationListener);
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_LEVEL);
actionBar.setSelectedNavigationItem(selected);
}
.replace(R.id.main_fragment, f, level).commit();
}
@Override
@ -106,8 +117,7 @@ public class LogActivity extends I2PActivityBase implements
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(SELECTED_LEVEL,
getSupportActionBar().getSelectedNavigationIndex());
outState.putInt(SELECTED_LEVEL, mSpinner.getSelectedItemPosition());
}
// LogFragment.OnEntrySelectedListener

View File

@ -1,14 +1,16 @@
package net.i2p.android.router.netdb;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import net.i2p.android.router.I2PActivityBase;
import net.i2p.android.router.R;
import net.i2p.data.Hash;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBar.Tab;
public class NetDbActivity extends I2PActivityBase implements
NetDbListFragment.OnEntrySelectedListener {
@ -18,7 +20,11 @@ public class NetDbActivity extends I2PActivityBase implements
*/
private boolean mTwoPane;
private static final String SELECTED_TAB = "selected_tab";
private static final String SELECTED_PAGE = "selected_page";
private static final int PAGE_STATS = 0;
private static final int PAGE_ROUTERS = 1;
private Spinner mSpinner;
@Override
protected boolean canUseTwoPanes() {
@ -29,80 +35,60 @@ public class NetDbActivity extends I2PActivityBase implements
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set up action bar for tabs
ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
mSpinner = (Spinner) findViewById(R.id.main_spinner);
mSpinner.setVisibility(View.VISIBLE);
// Statistics tab
NetDbSummaryPagerFragment sf = new NetDbSummaryPagerFragment();
actionBar.addTab(
actionBar.newTab()
.setText("Statistics")
.setTabListener(new NetDbSummaryPagerTabListener(sf)));
mSpinner.setAdapter(ArrayAdapter.createFromResource(this,
R.array.netdb_pages, android.R.layout.simple_spinner_dropdown_item));
// Routers tab
NetDbListFragment rf = new NetDbListFragment();
Bundle args = new Bundle();
args.putBoolean(NetDbListFragment.SHOW_ROUTERS, true);
rf.setArguments(args);
actionBar.addTab(
actionBar.newTab()
.setText("Routers")
.setTabListener(new TabListener(rf)));
// LeaseSets tab
NetDbListFragment lf = new NetDbListFragment();
args = new Bundle();
args.putBoolean(NetDbListFragment.SHOW_ROUTERS, false);
lf.setArguments(args);
actionBar.addTab(
actionBar.newTab()
.setText("LeaseSets")
.setTabListener(new TabListener(lf)));
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_TAB);
actionBar.setSelectedNavigationItem(selected);
mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
selectPage(i);
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
if (findViewById(R.id.detail_fragment) != null) {
// The detail container view will be present only in the
// large-screen layouts (res/values-large and
// res/values-sw600dp). If this view is present, then the
// activity should be in two-pane mode.
mTwoPane = true;
// In two-pane mode, list items should be given the
// 'activated' state when touched.
rf.setActivateOnItemClick(true);
lf.setActivateOnItemClick(true);
}
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_PAGE);
mSpinner.setSelection(selected);
} else
selectPage(PAGE_STATS);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(SELECTED_TAB,
getSupportActionBar().getSelectedNavigationIndex());
outState.putInt(SELECTED_PAGE, mSpinner.getSelectedItemPosition());
}
public static class NetDbSummaryPagerTabListener extends TabListener {
public NetDbSummaryPagerTabListener(Fragment fragment) {
super(fragment);
}
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
/**
* This is a work-around for Issue 42601
* https://code.google.com/p/android/issues/detail?id=42601
*
* The method getChildFragmentManager() does not clear up
* when the Fragment is detached.
*/
mFragment = new NetDbSummaryPagerFragment();
super.onTabSelected(tab, ft);
private void selectPage(int page) {
Fragment f;
if (page == PAGE_STATS)
f = new NetDbSummaryPagerFragment();
else {
f = new NetDbListFragment();
Bundle args = new Bundle();
args.putBoolean(NetDbListFragment.SHOW_ROUTERS, page == PAGE_ROUTERS);
f.setArguments(args);
// In two-pane mode, list items should be given the
// 'activated' state when touched.
if (mTwoPane)
((NetDbListFragment) f).setActivateOnItemClick(true);
}
getSupportFragmentManager().beginTransaction()
.replace(R.id.main_fragment, f).commit();
}
// NetDbListFragment.OnEntrySelectedListener
@ -118,9 +104,9 @@ public class NetDbActivity extends I2PActivityBase implements
.replace(R.id.detail_fragment, detailFrag).commit();
// If we are coming from a LS to a RI, change the tab
int currentTab = getSupportActionBar().getSelectedNavigationIndex();
if (isRouterInfo && currentTab !=1)
getSupportActionBar().setSelectedNavigationItem(1);
int currentTab = mSpinner.getSelectedItemPosition();
if (isRouterInfo && currentTab != PAGE_ROUTERS)
selectPage(PAGE_ROUTERS);
} else {
// In single-pane mode, simply start the detail activity
// for the selected item ID.

View File

@ -21,8 +21,8 @@ import net.i2p.data.DataHelper;
import net.i2p.data.Hash;
import net.i2p.data.Lease;
import net.i2p.data.LeaseSet;
import net.i2p.data.RouterAddress;
import net.i2p.data.RouterInfo;
import net.i2p.data.router.RouterAddress;
import net.i2p.data.router.RouterInfo;
import java.util.Map;

View File

@ -7,7 +7,7 @@ import net.i2p.data.DatabaseEntry;
import net.i2p.data.Destination;
import net.i2p.data.Hash;
import net.i2p.data.LeaseSet;
import net.i2p.data.RouterInfo;
import net.i2p.data.router.RouterInfo;
import net.i2p.router.RouterContext;
import net.i2p.router.TunnelPoolSettings;

View File

@ -8,7 +8,7 @@ import java.util.TreeSet;
import net.i2p.data.Destination;
import net.i2p.data.LeaseSet;
import net.i2p.data.RouterInfo;
import net.i2p.data.router.RouterInfo;
import net.i2p.router.RouterContext;
import android.content.Context;
import android.support.v4.content.AsyncTaskLoader;

View File

@ -7,8 +7,8 @@ import java.util.Set;
import java.util.TreeSet;
import net.i2p.data.Hash;
import net.i2p.data.RouterAddress;
import net.i2p.data.RouterInfo;
import net.i2p.data.router.RouterAddress;
import net.i2p.data.router.RouterInfo;
import net.i2p.router.RouterContext;
import net.i2p.util.ObjectCounter;
import android.content.Context;

View File

@ -1,15 +1,5 @@
package net.i2p.android.router.stats;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;
import net.i2p.android.router.I2PActivityBase;
import net.i2p.android.router.R;
import net.i2p.android.router.SettingsActivity;
import net.i2p.android.router.service.StatSummarizer;
import net.i2p.android.router.service.SummaryListener;
import net.i2p.stat.Rate;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
@ -17,13 +7,28 @@ import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.ActionBar;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.SpinnerAdapter;
import android.widget.Spinner;
import net.i2p.android.router.I2PActivityBase;
import net.i2p.android.router.R;
import net.i2p.android.router.SettingsActivity;
import net.i2p.android.router.service.StatSummarizer;
import net.i2p.android.router.service.SummaryListener;
import net.i2p.stat.Rate;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;
public class RateGraphActivity extends I2PActivityBase {
private static final String SELECTED_RATE = "selected_rate";
private String[] mRates;
private long[] mPeriods;
private Spinner mSpinner;
private boolean mFinishOnResume;
@Override
@ -40,8 +45,8 @@ public class RateGraphActivity extends I2PActivityBase {
if (ordered.size() > 0) {
// Extract the rates and periods
final String[] mRates = new String[ordered.size()];
final long[] mPeriods = new long[ordered.size()];
mRates = new String[ordered.size()];
mPeriods = new long[ordered.size()];
int i = 0;
for (SummaryListener listener : ordered) {
Rate r = listener.getRate();
@ -50,33 +55,28 @@ public class RateGraphActivity extends I2PActivityBase {
i++;
}
// Set up action bar for drop-down list
ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
mSpinner = (Spinner) findViewById(R.id.main_spinner);
mSpinner.setVisibility(View.VISIBLE);
SpinnerAdapter mSpinnerAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_dropdown_item, mRates);
mSpinner.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_dropdown_item, mRates));
ActionBar.OnNavigationListener mNavigationListener = new ActionBar.OnNavigationListener() {
String[] rates = mRates;
long[] periods = mPeriods;
public boolean onNavigationItemSelected(int position, long itemId) {
String rateName = rates[position];
long period = periods[position];
RateGraphFragment f = RateGraphFragment.newInstance(rateName, period);
getSupportFragmentManager().beginTransaction()
.replace(R.id.main_fragment, f, rates[position]).commit();
return true;
mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
selectRate(i);
}
};
actionBar.setListNavigationCallbacks(mSpinnerAdapter, mNavigationListener);
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_RATE);
actionBar.setSelectedNavigationItem(selected);
}
mSpinner.setSelection(selected);
} else
selectRate(0);
} else {
DialogFragment df = new DialogFragment() {
@Override
@ -130,6 +130,14 @@ public class RateGraphActivity extends I2PActivityBase {
}
}
private void selectRate(int position) {
String rateName = mRates[position];
long period = mPeriods[position];
RateGraphFragment f = RateGraphFragment.newInstance(rateName, period);
getSupportFragmentManager().beginTransaction()
.replace(R.id.main_fragment, f, rateName).commit();
}
@Override
public void onResume() {
super.onResume();
@ -142,8 +150,8 @@ public class RateGraphActivity extends I2PActivityBase {
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(SELECTED_RATE,
getSupportActionBar().getSelectedNavigationIndex());
if (mSpinner != null)
outState.putInt(SELECTED_RATE, mSpinner.getSelectedItemPosition());
}
private static class AlphaComparator implements Comparator<SummaryListener> {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

View File

@ -1,7 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.ActionBar">
<Spinner
android:id="@+id/main_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -19,9 +39,10 @@
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
android:dividerHeight="0dp" />
</android.support.v4.widget.DrawerLayout>
</LinearLayout>

View File

@ -1,7 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.ActionBar">
<Spinner
android:id="@+id/main_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -43,9 +63,10 @@
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
android:dividerHeight="0dp" />
</android.support.v4.widget.DrawerLayout>
</LinearLayout>

View File

@ -1,7 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.ActionBar" />
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -12,6 +25,7 @@
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.PagerTitleStrip
android:id="@+id/pager_title_strip"
android:layout_width="match_parent"
@ -25,9 +39,10 @@
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
android:dividerHeight="0dp" />
</android.support.v4.widget.DrawerLayout>
</LinearLayout>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_entry_height"
android:paddingLeft="@dimen/nav_horizontal_margin"
android:paddingStart="@dimen/nav_horizontal_margin"
android:paddingRight="@dimen/nav_horizontal_margin"
android:paddingEnd="@dimen/nav_horizontal_margin"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:gravity="center_vertical"/>

View File

@ -4,7 +4,7 @@
<!-- Search, should appear as action buttons -->
<item android:id="@+id/action_search_addressbook"
android:title="@string/action_search"
android:icon="@drawable/ic_action_search"
android:icon="@drawable/ic_search_white_24dp"
i2pandroid:showAsAction="ifRoom|collapseActionView"
i2pandroid:actionViewClass="android.support.v7.widget.SearchView" />
</menu>

View File

@ -4,7 +4,7 @@
<!-- Add, should appear as action buttons -->
<item android:id="@+id/action_add_to_addressbook"
android:title="@string/action_add"
android:icon="@drawable/ic_content_new"
android:icon="@drawable/ic_add_white_24dp"
i2pandroid:showAsAction="ifRoom" />
<!-- Settings, Help, should always be in the overflow -->
<item android:id="@+id/action_reload_subscriptions"

View File

@ -3,19 +3,19 @@
xmlns:i2pandroid="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/action_start_tunnel"
android:title="@string/action_i2ptunnel_start"
android:icon="@drawable/ic_av_play"
android:icon="@drawable/ic_play_arrow_white_24dp"
i2pandroid:showAsAction="ifRoom" />
<item android:id="@+id/action_stop_tunnel"
android:title="@string/action_i2ptunnel_stop"
android:icon="@drawable/ic_av_stop"
android:icon="@drawable/ic_stop_white_24dp"
i2pandroid:showAsAction="ifRoom" />
<item android:id="@+id/action_edit_tunnel"
android:title="@string/action_edit"
android:icon="@drawable/ic_content_edit"
android:icon="@drawable/ic_create_white_24dp"
i2pandroid:showAsAction="ifRoom" />
<item android:id="@+id/action_delete_tunnel"
android:title="@string/action_delete"
android:icon="@drawable/ic_content_discard"
android:icon="@drawable/ic_delete_white_24dp"
i2pandroid:showAsAction="ifRoom" />
</menu>

View File

@ -3,7 +3,7 @@
xmlns:i2pandroid="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/action_add_tunnel"
android:title="@string/action_add"
android:icon="@drawable/ic_content_new"
android:icon="@drawable/ic_add_white_24dp"
i2pandroid:showAsAction="ifRoom" />
<item android:id="@+id/action_start_all_tunnels"
android:title="@string/action_i2ptunnel_start_all"

View File

@ -3,6 +3,6 @@
xmlns:i2pandroid="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/action_copy_logs"
android:title="@string/copy_logs"
android:icon="@drawable/ic_content_copy"
android:icon="@drawable/ic_content_copy_white_24dp"
i2pandroid:showAsAction="ifRoom" />
</menu>

View File

@ -3,7 +3,7 @@
xmlns:i2pandroid="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/action_refresh"
android:title="@string/action_refresh"
android:icon="@drawable/ic_navigation_refresh"
android:icon="@drawable/ic_refresh_white_24dp"
i2pandroid:showAsAction="ifRoom" />
</menu>

View File

@ -3,7 +3,7 @@
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"
android:icon="@drawable/ic_refresh_white_24dp"
i2pandroid:showAsAction="ifRoom" >
</item>
</menu>

View File

@ -1,3 +1,3 @@
http://www.i2p2.i2p/hosts.txt
http://i2p-projekt.i2p/hosts.txt
http://i2host.i2p/cgi-bin/i2hostetag
http://stats.i2p/cgi-bin/newhosts.txt

View File

@ -30,6 +30,7 @@
<string name="char_server_tunnel">S</string>
<string name="no_client_tunnels_running">Keine Kliententunnel laufen noch.</string>
<string name="configure_browser_title">Browser konfigurieren?</string>
<string name="configure_browser_for_i2p">Möchten Sie einen Browser zum Betrachten von I2P Seiten einrichten ? (Sie können dieses auch später noch im Hilfe Menu erledigen).</string>
<string name="first_start_title">Herzlichen Glückwunsch, du hast I2P installiert!</string>
<string name="first_start_welcome"><b>Willkommen im I2P</b> Bitte <b>hab Geduld</b>, während I2P startet und Teilnehmer findet.</string>
<string name="first_start_read">Während du wartest, lies bitte die Veröffentlichungshinweise und die Startseite.</string>

View File

@ -26,6 +26,9 @@
<string name="button_router_on">I2P est en marche (presser longtemps pour arrêter)</string>
<!--Character to indicate a client tunnel. Usually first letter of the word "client".-->
<!--Character to indicate a server tunnel. Usually first letter of the word "server".-->
<string name="no_client_tunnels_running">Aucun tunnel de client n\'est encore en marche.</string>
<string name="configure_browser_title">Configurer le navigateur ?</string>
<string name="configure_browser_for_i2p">Voudriez-vous configurer un navigateur pour voir les sites d\'I2P ? (vous pouvez aussi faire cela plus tard depuis le menu d\'aide).</string>
<string name="first_start_title">Félicitations pour avoir installé I2P !</string>
<string name="first_start_welcome"><b>Bienvenue sur I2P !</b> Veuillez <b>patienter</b> pendant qu\'I2P démarre et trouve des pairs.</string>
<string name="first_start_read">Pendant que vous patientez, vous pouvez lire les informations de mise à jour et la page d\'accueil.</string>
@ -104,6 +107,7 @@
<string name="settings_label_expl_backupQuantity">Quantité secours</string>
<string name="settings_summ_expl_backupQuantity">%s tunnels</string>
<string name="settings_desc_expl_backupQuantity">Combien de tunnels de secours</string>
<string name="settings_router_restart_required">Veuillez redémarrer I2P afin d\'appliquer les changements</string>
<string name="menu_about">À propos</string>
<string name="about_version">Version :</string>
<string name="about_project">Page d\'accueil du projet :</string>
@ -176,4 +180,10 @@
<string name="i2ptunnel_view_target">Cible :</string>
<string name="i2ptunnel_view_access_point">Point d\'accès :</string>
<string name="i2ptunnel_view_autostart">Démarrage automatique</string>
<string name="copy_logs">Copier les historiques (logs)</string>
<string name="i2p_android_error_logs">Historiques des erreurs d\'I2P Android</string>
<string name="i2p_android_logs">Historiques d\'I2P Android</string>
<string name="error_logs_copied_to_clipboard">Les historiques des erreurs ont été copiés dans le presse-papier</string>
<string name="logs_copied_to_clipboard">Les historiques ont été copiés dans le presse-papier</string>
<string name="label_browser_configuration">Configuration du navigateur</string>
</resources>

View File

@ -25,7 +25,12 @@
<string name="button_router_off">길게 눌러 I2P 시작</string>
<string name="button_router_on">I2P가 실행중입니다 (길게 눌러 정지)</string>
<!--Character to indicate a client tunnel. Usually first letter of the word "client".-->
<string name="char_client_tunnel"></string>
<!--Character to indicate a server tunnel. Usually first letter of the word "server".-->
<string name="char_server_tunnel"></string>
<string name="no_client_tunnels_running">동작중인 클라이언트 터널이 아직 없습니다.</string>
<string name="configure_browser_title">브라우저를 설정할까요?</string>
<string name="configure_browser_for_i2p">브라우저가 I2P 사이트들을 볼 수 있게 설정할까요? (추후 도움말 메뉴에서 할 수도 있습니다.)</string>
<string name="first_start_title">I2P가 설치 된것을 환영합니다!</string>
<string name="first_start_welcome"><b>I2P에 환영합니다!</b> I2P가 시작되고 피어들을 찾을때까지 <b>기다려주세요</b>.</string>
<string name="first_start_read">기다리는 동안, 릴리즈 노트와 환영 페이지를 읽어보세요.</string>
@ -104,6 +109,7 @@
<string name="settings_label_expl_backupQuantity">백업된 수량</string>
<string name="settings_summ_expl_backupQuantity">%s 터널들</string>
<string name="settings_desc_expl_backupQuantity">터널 백업의 수</string>
<string name="settings_router_restart_required">변경사항을 적용하기 위해서 I2P를 다시 시작해주세요</string>
<string name="menu_about">알아보기</string>
<string name="about_version">버전:</string>
<string name="about_project">프로젝트 홈:</string>
@ -173,4 +179,10 @@
<string name="i2ptunnel_view_target">목표:</string>
<string name="i2ptunnel_view_access_point">엑세스 포인트:</string>
<string name="i2ptunnel_view_autostart">자동 시작</string>
<string name="copy_logs">로그 복사</string>
<string name="i2p_android_error_logs">I2P 안드로이드 오류 로그</string>
<string name="i2p_android_logs">I2P 안드로이드 로그</string>
<string name="error_logs_copied_to_clipboard">클립보드에 오류 로그 복사됨</string>
<string name="logs_copied_to_clipboard">클립보드에 로그 복사됨</string>
<string name="label_browser_configuration">브라우저 설정</string>
</resources>

View File

@ -6,6 +6,7 @@
<string name="welcome_new_version">Nova versão instalada. Por favor leia as notas de revisão. Versão:</string>
<string name="label_home">Controle e status</string>
<string name="label_tunnels">Tuneis</string>
<string name="label_status">Estado</string>
<string name="label_addressbook">Livro de endereços</string>
<string name="label_i2ptunnel">TunelI2P</string>
<string name="label_i2ptunnel_client">Túneis clientes</string>
@ -22,7 +23,12 @@
<string name="label_browse">Navegador</string>
<string name="label_graphs">Gráficos</string>
<!--Character to indicate a client tunnel. Usually first letter of the word "client".-->
<string name="char_client_tunnel">C</string>
<!--Character to indicate a server tunnel. Usually first letter of the word "server".-->
<string name="char_server_tunnel">S</string>
<string name="no_client_tunnels_running">Por enquanto, nenhum túnel de cliente em execução.</string>
<string name="configure_browser_title">Configurar o navegador?</string>
<string name="configure_browser_for_i2p">Gostaria de configurar um navegador para visualizar sites da I2P? (Você pode também fazer isso depois a partir do menu ajuda.)</string>
<string name="first_start_title">Parabéns em instalar o I2P!</string>
<string name="first_start_welcome"><b>Bem-Vindo ao I2P!</b> Por favor <b> tenha paciência </b> enquanto o I2P inicia e procura por peers.</string>
<string name="first_start_read">Enquanto você está esperando, por favor leia as notas de lançamento e a página de boas vindas.</string>
@ -82,11 +88,15 @@
<string name="settings_label_expl_inbound">Túneis entrantes</string>
<string name="settings_label_expl_outbound">Tuneis de saída</string>
<string name="settings_label_expl_length">Comprimento</string>
<string name="settings_summ_expl_length">%s saltos</string>
<string name="settings_desc_expl_length">Quantos saltos usar</string>
<string name="settings_summ_expl_lengthVariance">%s</string>
<string name="settings_label_expl_quantity">Quantidade</string>
<string name="settings_summ_expl_quantity">%s tunéis</string>
<string name="settings_desc_expl_quantity">Quantos túneis</string>
<string name="settings_summ_expl_backupQuantity">%s tuneis</string>
<string name="settings_desc_expl_backupQuantity">Quantos backups de túneis</string>
<string name="settings_router_restart_required">Por favor, reinicialize o software I2P para aplicar as alterações</string>
<string name="menu_about">Sobre</string>
<string name="about_version">Versão:</string>
<string name="about_project">Lar do projeto:</string>

View File

@ -4,7 +4,7 @@
<string name="desc_i2p_logo">Логотип I2P</string>
<string name="welcome_new_install">Добро пожаловать в I2P! Это приложение является альфа-версией и оно не обеспечивает сильной анонимности. Пожалуйста, прочтите примечания к выпуску и информацию о лицензии.</string>
<string name="welcome_new_version">Новая версия установлена. Пожалуйста, прочтите примечания к выпуску. Версия:</string>
<string name="label_home">Управление и Статус</string>
<string name="label_home">Управление и cтатус</string>
<string name="label_tunnels">Туннели</string>
<string name="label_status">Статус</string>
<string name="label_addressbook">Адресная книга</string>
@ -25,7 +25,12 @@
<string name="button_router_off">Долгое нажатие для запуска I2P</string>
<string name="button_router_on">I2P работает (долгое нажатие для остановки)</string>
<!--Character to indicate a client tunnel. Usually first letter of the word "client".-->
<string name="char_client_tunnel">K</string>
<!--Character to indicate a server tunnel. Usually first letter of the word "server".-->
<string name="char_server_tunnel">С</string>
<string name="no_client_tunnels_running">Ещё нет работающих клиентских туннелей.</string>
<string name="configure_browser_title">Настроить браузер?</string>
<string name="configure_browser_for_i2p">Настроить браузер для просмотра I2P сайтов? (Вы сможете сделать это позже из меню \"Справка\")</string>
<string name="first_start_title">Поздравляем с установкой I2P!</string>
<string name="first_start_welcome"><b>Добро пожаловать в I2P!</b> Пожалуйста, <b>дождитесь</b> пока I2P загрузится и найдет узлы.</string>
<string name="first_start_read">Пока вы ждете, пожалуйста, прочтите информацию о релизе и страницу приветствия.</string>
@ -104,6 +109,7 @@
<string name="settings_label_expl_backupQuantity">Резервное количество</string>
<string name="settings_summ_expl_backupQuantity">%s туннелей</string>
<string name="settings_desc_expl_backupQuantity"> Сколько туннелей резервировать</string>
<string name="settings_router_restart_required">Пожалуйста, перезапустите I2P, чтобы изменения вступили в силу</string>
<string name="menu_about">О приложении</string>
<string name="about_version">Версия:</string>
<string name="about_project">Сайт проекта:</string>
@ -176,4 +182,10 @@
<string name="i2ptunnel_view_target">Назначение:</string>
<string name="i2ptunnel_view_access_point">Точка доступа:</string>
<string name="i2ptunnel_view_autostart">Авто-запуск</string>
<string name="copy_logs">Копировать журналы</string>
<string name="i2p_android_error_logs">Журнал ошибок I2P Android</string>
<string name="i2p_android_logs">Журналы I2P Android</string>
<string name="error_logs_copied_to_clipboard">Журнал ошибок скопирован в буфер</string>
<string name="logs_copied_to_clipboard">Журналы скопированы в буфер</string>
<string name="label_browser_configuration">Настройки браузера</string>
</resources>

View File

@ -13,6 +13,14 @@
<item>@string/label_peers_status</item>
<item>NetDB</item>
</string-array>
<string-array name="addressbook_pages">
<item>Router</item>
<item>Private</item>
</string-array>
<string-array name="i2ptunnel_pages">
<item>@string/label_i2ptunnel_client</item>
<item>@string/label_i2ptunnel_server</item>
</string-array>
<string-array name="log_level_list">
<item>ERROR</item>
<item>All</item>
@ -24,6 +32,11 @@
<item>INFO</item>
<item>DEBUG</item>
</string-array>
<string-array name="netdb_pages">
<item>Statistics</item>
<item>Routers</item>
<item>LeaseSets</item>
</string-array>
<string-array name="setting0to3">
<item>0</item>
<item>1</item>

View File

@ -1,4 +1,8 @@
<resources>
<color name="primary">#673ab7</color>
<color name="primary_dark">#512da8</color>
<color name="accent">#ff6e40</color>
<color name="indicator_red">#ffff0000</color>
<color name="indicator_yellow">#ffffff00</color>
<color name="indicator_green">#ff00ff00</color>

View File

@ -3,6 +3,9 @@
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_horizontal_margin">16dp</dimen>
<dimen name="nav_entry_height">48dp</dimen>
<dimen name="tunnel_indicator">20dp</dimen>
<dimen name="step_pager_tab_width">32dp</dimen>

View File

@ -1,5 +1,23 @@
<resources>
<style name="I2PAndroid" parent="Theme.AppCompat" />
<style name="Theme.I2P" parent="Theme.AppCompat.NoActionBar">
<!-- Here we setting appcompats actionBarStyle -->
<!--<item name="actionBarStyle">@style/MyActionBarStyle</item>-->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/primary</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/primary_dark</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/accent</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight & colorSwitchThumbNormal. -->
<!-- The rest of your attributes -->
</style>
<style name="WizardPageContainer">
<item name="android:layout_width">match_parent</item>

Some files were not shown because too many files have changed in this diff Show More