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

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

Added About dialog

parent 4e57f789
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/about_version"
android:textStyle="bold" />
<TextView
android:id="@+id/about_version"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/about_bugs"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/url_android_forum"
android:autoLink="web" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/about_helpwanted"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/about_volunteer" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/url_android_forum"
android:autoLink="web" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/about_donate" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/url_donate"
android:autoLink="web" />
</LinearLayout>
</ScrollView>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:i2pandroid="http://schemas.android.com/apk/res-auto">
<item android:title="@string/menu_settings"
android:id="@+id/menu_settings"
android:icon="@android:drawable/ic_menu_preferences"
i2pandroid:showAsAction="never" >
</item>
<item android:title="@string/menu_help"
android:id="@+id/menu_help"
i2pandroid:showAsAction="never" >
</item>
</menu>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:i2pandroid="http://schemas.android.com/apk/res-auto">
<item android:title="@string/menu_settings"
android:id="@+id/menu_settings"
android:icon="@android:drawable/ic_menu_preferences"
i2pandroid:showAsAction="never" >
</item>
<item android:title="@string/menu_help"
android:id="@+id/menu_help"
<item android:title="@string/menu_about"
android:id="@+id/menu_about"
i2pandroid:showAsAction="never" >
</item>
</menu>
......@@ -103,6 +103,15 @@
<string name="settings_summ_expl_backupQuantity">%s tunnels</string>
<string name="settings_desc_expl_backupQuantity">How many tunnel backups</string>
<string name="menu_about">About</string>
<string name="about_version">Version</string>
<string name="about_bugs">Bugs and Support</string>
<string name="url_android_forum">http://zzz.i2p/</string>
<string name="about_helpwanted">Help Wanted!</string>
<string name="about_volunteer">Want to help make the app better? Volunteer on the Android forum:</string>
<string name="about_donate">Want to donate money or bitcoins to buy more Android devices for development and testing? Go to:</string>
<string name="url_donate">https://geti2p.net/en/donate</string>
<string name="menu_help">Help</string>
<string name="addressbook_search_header">%s found</string>
......
package net.i2p.android.router;
import net.i2p.android.router.R;
import net.i2p.android.router.util.Util;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
public class AboutDialog extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle SavedInstanceState) {
LayoutInflater li = LayoutInflater.from(getActivity());
View view = li.inflate(R.layout.fragment_about, null);
final String currentVersion = Util.getOurVersion(getActivity());
TextView tv = (TextView)view.findViewById(R.id.about_version);
tv.setText(currentVersion);
AlertDialog.Builder b = new AlertDialog.Builder(getActivity());
b.setTitle(R.string.menu_about)
.setView(view);
return b.create();
}
}
......@@ -70,6 +70,7 @@ public class MainActivity extends I2PActivityBase implements
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.activity_main_actions, menu);
inflater.inflate(R.menu.activity_base_actions, menu);
return super.onCreateOptionsMenu(menu);
}
......@@ -81,6 +82,11 @@ public class MainActivity extends I2PActivityBase implements
startActivity(intent);
return true;
case R.id.menu_about:
AboutDialog dialog = new AboutDialog();
dialog.show(getSupportFragmentManager(), "about");
return true;
case R.id.menu_help:
Intent hi = new Intent(MainActivity.this, HelpActivity.class);
hi.putExtra(HelpActivity.REFERRER, "main");
......
......@@ -22,7 +22,6 @@ public class MainFragment extends I2PFragmentBase {
private Runnable _updater;
private Runnable _oneShotUpdate;
private String _savedStatus;
private String _ourVersion;
private boolean _keep = true;
private boolean _startPressed = false;
protected static final String PROP_NEW_INSTALL = "i2p.newInstall";
......@@ -65,7 +64,6 @@ public class MainFragment extends I2PFragmentBase {
_savedStatus = saved;
}
}
_ourVersion = Util.getOurVersion(getActivity());
_keep = true;
......@@ -243,7 +241,7 @@ public class MainFragment extends I2PFragmentBase {
if(!Util.isConnected(getActivity())) {
// Manually set state, RouterService won't be running
updateState("WAITING");
tv.setText("Router version: " + _ourVersion + "\nNo Internet connection is available");
tv.setText("No Internet connection is available");
tv.setVisibility(View.VISIBLE);
} else if(ctx != null) {
if(_startPressed) {
......@@ -304,8 +302,7 @@ public class MainFragment extends I2PFragmentBase {
}
String status =
"ROUTER STATUS"
+ "\nNetwork: " + netstatus
"Network: " + netstatus
+ "\nPeers active/known: " + active + " / " + known
+ "\nExploratory Tunnels in/out: " + inEx + " / " + outEx
+ "\nClient Tunnels in/out: " + inCl + " / " + outCl;
......@@ -325,12 +322,12 @@ public class MainFragment extends I2PFragmentBase {
+ "\nMsg Delay: " + msgDelay
+ "\nUptime: " + uptime;
_savedStatus = "Router version: " + _ourVersion + "\n" + status + participate + details;
_savedStatus = status + participate + details;
tv.setText(_savedStatus);
tv.setVisibility(View.VISIBLE);
} else {
// network but no router context
tv.setText("Router version: " + _ourVersion + "\n");
tv.setText("Not running");
//tv.setVisibility(View.INVISIBLE);
/**
* **
......
......@@ -76,7 +76,7 @@ public class LogActivity extends I2PActivityBase implements
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.activity_main_actions, menu);
inflater.inflate(R.menu.activity_base_actions, menu);
// Help menu not needed (yet), hide
menu.findItem(R.id.menu_help).setVisible(false);
return super.onCreateOptionsMenu(menu);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment