Moved licenses and release notes into menu of new HelpActivity
This commit is contained in:
@ -94,13 +94,6 @@
|
||||
android:text="@string/label_news"
|
||||
android:drawableLeft="@drawable/information_icon" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/releasenotes_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_release_notes"
|
||||
android:drawableLeft="@drawable/information_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="wrap_content"
|
||||
|
11
res/menu/activity_help_actions.xml
Normal file
11
res/menu/activity_help_actions.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?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:id="@+id/menu_help_licenses"
|
||||
android:title="@string/label_licenses"
|
||||
i2pandroid:showAsAction="never" />
|
||||
<item android:id="@+id/menu_help_release_notes"
|
||||
android:title="@string/label_release_notes"
|
||||
i2pandroid:showAsAction="never" />
|
||||
|
||||
</menu>
|
@ -20,4 +20,8 @@
|
||||
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>
|
||||
|
@ -6,8 +6,11 @@
|
||||
android:title="@string/action_add"
|
||||
android:icon="@drawable/ic_content_new"
|
||||
i2pandroid:showAsAction="ifRoom" />
|
||||
<!-- Settings, should always be in the overflow -->
|
||||
<!-- Settings, Help, should always be in the overflow -->
|
||||
<item android:id="@+id/action_addressbook_settings"
|
||||
android:title="@string/menu_settings"
|
||||
i2pandroid:showAsAction="never" />
|
||||
<item android:id="@+id/action_addressbook_help"
|
||||
android:title="@string/menu_help"
|
||||
i2pandroid:showAsAction="never" />
|
||||
</menu>
|
||||
|
@ -6,7 +6,6 @@
|
||||
<item>@string/label_i2ptunnel</item>
|
||||
<item>@string/label_logs</item>
|
||||
<item>@string/label_error_logs</item>
|
||||
<item>@string/label_licenses</item>
|
||||
</string-array>
|
||||
<string-array name="setting0to3">
|
||||
<item>0</item>
|
||||
|
@ -72,6 +72,8 @@
|
||||
<string name="settings_label_expl_backupQuantity">Backup quantity</string>
|
||||
<string name="settings_desc_expl_backupQuantity">How many tunnel backups</string>
|
||||
|
||||
<string name="menu_help">Help</string>
|
||||
|
||||
<string name="i2ptunnel_type_client">Standard client</string>
|
||||
<string name="i2ptunnel_type_httpclient">HTTP client</string>
|
||||
<string name="i2ptunnel_type_ircclient">IRC client</string>
|
||||
|
45
src/net/i2p/android/router/activity/HelpActivity.java
Normal file
45
src/net/i2p/android/router/activity/HelpActivity.java
Normal file
@ -0,0 +1,45 @@
|
||||
package net.i2p.android.router.activity;
|
||||
|
||||
import net.i2p.android.router.R;
|
||||
import net.i2p.android.router.fragment.TextResourceDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
public class HelpActivity extends I2PActivityBase {
|
||||
public static final String REFERRER = "help_referrer";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mDrawerToggle.setDrawerIndicatorEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.activity_help_actions, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_help_licenses:
|
||||
Intent lic = new Intent(HelpActivity.this, LicenseActivity.class);
|
||||
startActivity(lic);
|
||||
return true;
|
||||
case R.id.menu_help_release_notes:
|
||||
TextResourceDialog dialog = new TextResourceDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(TextResourceDialog.TEXT_DIALOG_TITLE,
|
||||
getResources().getString(R.string.label_release_notes));
|
||||
args.putInt(TextResourceDialog.TEXT_RESOURCE_ID, R.raw.releasenotes_txt);
|
||||
dialog.setArguments(args);
|
||||
dialog.show(getSupportFragmentManager(), "release_notes");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
}
|
@ -124,10 +124,6 @@ public class I2PActivityBase extends ActionBarActivity {
|
||||
err.putExtra(LogActivity.ERRORS_ONLY, true);
|
||||
startActivity(err);
|
||||
break;
|
||||
case 5:
|
||||
Intent lic = new Intent(I2PActivityBase.this, LicenseActivity.class);
|
||||
startActivity(lic);
|
||||
break;
|
||||
default:
|
||||
Intent main = new Intent(I2PActivityBase.this, MainActivity.class);
|
||||
startActivity(main);
|
||||
|
@ -22,6 +22,7 @@ import java.util.Set;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.android.router.R;
|
||||
import net.i2p.android.router.activity.AddressbookSettingsActivity;
|
||||
import net.i2p.android.router.activity.HelpActivity;
|
||||
import net.i2p.client.naming.NamingService;
|
||||
|
||||
public class AddressbookFragment extends ListFragment {
|
||||
@ -110,12 +111,17 @@ public class AddressbookFragment extends ListFragment {
|
||||
switch (item.getItemId()) {
|
||||
//case R.id.action_add_to_addressbook:
|
||||
// return true;
|
||||
case R.id.action_addressbook_settings:
|
||||
Intent intent = new Intent(getActivity(), AddressbookSettingsActivity.class);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
case R.id.action_addressbook_settings:
|
||||
Intent si = new Intent(getActivity(), AddressbookSettingsActivity.class);
|
||||
startActivity(si);
|
||||
return true;
|
||||
case R.id.action_addressbook_help:
|
||||
Intent hi = new Intent(getActivity(), HelpActivity.class);
|
||||
hi.putExtra(HelpActivity.REFERRER, "addressbook");
|
||||
startActivity(hi);
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import net.i2p.android.router.R;
|
||||
import net.i2p.android.router.activity.HelpActivity;
|
||||
import net.i2p.android.router.activity.SettingsActivity;
|
||||
import net.i2p.android.router.binder.RouterBinder;
|
||||
import net.i2p.android.router.service.RouterService;
|
||||
@ -159,6 +160,12 @@ public abstract class I2PFragmentBase extends Fragment {
|
||||
startActivity(intent);
|
||||
return true;
|
||||
|
||||
case R.id.menu_help:
|
||||
Intent hi = new Intent(getActivity(), HelpActivity.class);
|
||||
hi.putExtra(HelpActivity.REFERRER, "main");
|
||||
startActivity(hi);
|
||||
return true;
|
||||
|
||||
case R.id.menu_start:
|
||||
RouterService svc = _routerService;
|
||||
if (svc != null && _isBound && svc.canManualStart()) {
|
||||
|
@ -67,22 +67,6 @@ public class MainFragment extends I2PFragmentBase {
|
||||
}
|
||||
});
|
||||
|
||||
b = (Button) v.findViewById(R.id.releasenotes_button);
|
||||
b.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
public void onClick(View view) {
|
||||
TextResourceDialog f = new TextResourceDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(TextResourceDialog.TEXT_RESOURCE_ID, R.raw.releasenotes_txt);
|
||||
f.setArguments(args);
|
||||
getActivity().getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.main_content, f)
|
||||
.addToBackStack(null)
|
||||
.commit();
|
||||
}
|
||||
});
|
||||
|
||||
b = (Button) v.findViewById(R.id.website_button);
|
||||
b.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
|
Reference in New Issue
Block a user