aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2008-11-16 13:45:08 +0000
committerKenny Root <kenny@the-b.org>2008-11-16 13:45:08 +0000
commit047edeadfc88bd9d7add4d6383f7cfce253a1f9a (patch)
treef12b0c15554741f5850b0173bf48a61cdad5c407
parentf4e0616cd657d85e7045a78832db91405dc9a6af (diff)
downloadconnectbot-047edeadfc88bd9d7add4d6383f7cfce253a1f9a.tar.gz
connectbot-047edeadfc88bd9d7add4d6383f7cfce253a1f9a.tar.bz2
connectbot-047edeadfc88bd9d7add4d6383f7cfce253a1f9a.zip
* Add rudimentary help system.
-rw-r--r--AndroidManifest.xml2
-rw-r--r--assets/help/Hints.html13
-rw-r--r--assets/help/Keyboard.html39
-rw-r--r--assets/help/i/keyboard.jpg (renamed from res/drawable/keyboard.jpg)bin20844 -> 20844 bytes
-rw-r--r--res/layout/act_help.xml45
-rw-r--r--res/layout/act_help_topic.xml32
-rw-r--r--res/layout/wiz_features.xml68
-rw-r--r--res/layout/wiz_keyboard.xml89
-rw-r--r--res/values/arrays.xml4
-rw-r--r--res/values/strings.xml13
-rw-r--r--src/org/connectbot/HelpActivity.java77
-rw-r--r--src/org/connectbot/HelpTopicActivity.java49
-rw-r--r--src/org/connectbot/HostListActivity.java7
-rw-r--r--src/org/connectbot/WizardActivity.java27
-rw-r--r--src/org/connectbot/util/HelpTopicView.java56
15 files changed, 340 insertions, 181 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1d5f06d..ba8d5a1 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -26,6 +26,8 @@
<activity android:name=".PortForwardListActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".SettingsActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".WizardActivity" android:configChanges="keyboardHidden|orientation" />
+ <activity android:name=".HelpActivity" android:configChanges="keyboardHidden|orientation" />
+ <activity android:name=".HelpTopicActivity" android:configChanges="keyboardHidden|orientation" />
<service android:name="org.connectbot.service.TerminalManager" android:configChanges="keyboardHidden|orientation" />
diff --git a/assets/help/Hints.html b/assets/help/Hints.html
new file mode 100644
index 0000000..37583db
--- /dev/null
+++ b/assets/help/Hints.html
@@ -0,0 +1,13 @@
+<html>
+<body style="background-color: #000; color: #fff">
+
+<h2>Helpful hints</h2>
+
+<p>When you have multiple sessions open, you can 'pan' between them by swiping your finger left-to-right or right-to-left over the screen.</p>
+
+<p>Long-press on your Android desktop to create direct shortcuts to frequently-used SSH hosts.</p>
+
+<p>Slide your finger up/down on the right-half of the terminal screen to look at the scrollback history. Slide up/down on the left-half to send the page up/down keys.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/assets/help/Keyboard.html b/assets/help/Keyboard.html
new file mode 100644
index 0000000..94f2f67
--- /dev/null
+++ b/assets/help/Keyboard.html
@@ -0,0 +1,39 @@
+<html>
+<body style="background-color: #000; color: #fff">
+
+<h2>Keyboard magic</h2>
+<img src="i/keyboard.jpg" width="100%" />
+<table style="width: 100%">
+ <tr>
+ <th>Volume&nbsp;key</th>
+ <td>Tap up/down to change font size in console</td>
+ </tr>
+
+ <tr>
+ <th>Right&nbsp;alt</th>
+ <td>Tap for '/'</td>
+ </tr>
+
+ <tr>
+ <th>Right&nbsp;shift</th>
+ <td>Tap for 'TAB' key</td>
+ </tr>
+
+ <tr>
+ <th>Trackball</th>
+ <td>Tap once to toggle CTRL on, twice to send Esc</td>
+ </tr>
+
+ <tr>
+ <th>Left shift</th>
+ <td>Hold left shift and tap number for F1, F2, etc</td>
+ </tr>
+
+ <tr>
+ <th>Picture&nbsp;key</th>
+ <td>Tap to send Ctrl+A Space (for 'screen' users)</td>
+ </tr>
+</table>
+
+</body>
+</html>
diff --git a/res/drawable/keyboard.jpg b/assets/help/i/keyboard.jpg
index 4083577..4083577 100644
--- a/res/drawable/keyboard.jpg
+++ b/assets/help/i/keyboard.jpg
Binary files differ
diff --git a/res/layout/act_help.xml b/res/layout/act_help.xml
new file mode 100644
index 0000000..4a61200
--- /dev/null
+++ b/res/layout/act_help.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ConnectBot: simple, powerful, open-source SSH client for Android
+ Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ >
+
+ <LinearLayout
+ android:id="@+id/topics"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:gravity="center_horizontal"
+ >
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/help_intro"
+ android:paddingTop="10dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:gravity="center_horizontal"
+ />
+
+ </LinearLayout>
+</ScrollView> \ No newline at end of file
diff --git a/res/layout/act_help_topic.xml b/res/layout/act_help_topic.xml
new file mode 100644
index 0000000..1b59589
--- /dev/null
+++ b/res/layout/act_help_topic.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ConnectBot: simple, powerful, open-source SSH client for Android
+ Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+ <HelpTopicView
+ android:id="@+id/topic_text"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ />
+
+</LinearLayout>
diff --git a/res/layout/wiz_features.xml b/res/layout/wiz_features.xml
deleted file mode 100644
index c372010..0000000
--- a/res/layout/wiz_features.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ConnectBot: simple, powerful, open-source SSH client for Android
- Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
--->
-<ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- >
-
-<LinearLayout
- android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="10dip"
- >
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Helpful hints"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:paddingBottom="10dip"
- android:textStyle="bold"
- />
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="When you have multiple sessions open, you can 'pan' between them by swiping your finger left-to-right or right-to-left over the screen."
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingBottom="15dip"
- />
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Long-press on your Android desktop to create direct shortcuts to frequently-used SSH hosts."
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingBottom="15dip"
- />
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Slide your finger up/down on the right-half of the terminal screen to look at the scrollback history. Slide up/down on the left-half to send the page up/down keys."
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingBottom="15dip"
- />
-
-</LinearLayout>
-
-</ScrollView> \ No newline at end of file
diff --git a/res/layout/wiz_keyboard.xml b/res/layout/wiz_keyboard.xml
deleted file mode 100644
index b51bb62..0000000
--- a/res/layout/wiz_keyboard.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ConnectBot: simple, powerful, open-source SSH client for Android
- Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
--->
-<ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- >
-
-<LinearLayout
- android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="10dip"
- >
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Keyboard magic"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:paddingBottom="10dip"
- android:textStyle="bold"
- />
-
- <ImageView
- android:layout_width="fill_parent"
- android:layout_height="150dip"
- android:src="@drawable/keyboard"
- android:paddingBottom="10dip"
- />
-
-
- <TableLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
-
- <TableRow>
- <TextView android:text="Volume key" android:paddingRight="10dip" android:gravity="right|center_vertical" android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold" />
- <TextView android:text="Tap up/down to\nchange font size\nin console" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingBottom="10dip" />
- </TableRow>
-
- <TableRow>
- <TextView android:text="Right alt" android:paddingRight="10dip" android:gravity="right|center_vertical" android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold" />
- <TextView android:text="Tap for '/'" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingBottom="10dip" />
- </TableRow>
-
- <TableRow>
- <TextView android:text="Right shift" android:paddingRight="10dip" android:gravity="right|center_vertical" android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold" />
- <TextView android:text="Tap for 'TAB' key" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingBottom="10dip" />
- </TableRow>
-
- <TableRow>
- <TextView android:text="Trackball" android:paddingRight="10dip" android:gravity="right|center_vertical" android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold" />
- <TextView android:text="Tap once to toggle\nCTRL on, twice\nto send Esc" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingBottom="10dip" />
- </TableRow>
-
- <TableRow>
- <TextView android:text="Left shift" android:paddingRight="10dip" android:gravity="right|center_vertical" android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold" />
- <TextView android:text="Hold left shift and\ntap number for\nF1, F2, etc" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingBottom="10dip" />
- </TableRow>
-
- <TableRow>
- <TextView android:text="Picture key" android:paddingRight="10dip" android:gravity="right|center_vertical" android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold" />
- <TextView android:text="Tap to send Ctrl+A\nSpace (for 'screen'\nusers)" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingBottom="10dip" />
- </TableRow>
-
- </TableLayout>
-
-</LinearLayout>
-
-</ScrollView> \ No newline at end of file
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index fd550f9..4ebe58c 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -50,4 +50,8 @@
<item value="dynamic">@string/portforward_dynamic</item>
</string-array>
+ <string-array name="list_wizard_topics">
+ <item>Hints</item>
+ <item>Keyboard</item>
+ </string-array>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bdaa957..f08d7a5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7,6 +7,7 @@
<string name="title_pubkey_list">Pubkeys</string>
<string name="title_port_forwards_list">Port forwards</string>
<string name="title_host_editor">Edit Host</string>
+ <string name="title_help">Help</string>
<string name="title_password">Input Password</string>
<string name="title_entropy">Gathering Entropy</string>
@@ -18,8 +19,13 @@
<string name="menu_insert">Add Host</string>
<string name="menu_delete">Delete Host</string>
<string name="menu_preferences">Preferences</string>
+ <string name="menu_help">Help</string>
- <string name="menu_about">About</string>
+ <string name="help_intro">Please select a topic below for more information on a particular subject.</string>
+ <string name="help_about">About ConnectBot</string>
+ <string name="help_keyboard">Keyboard</string>
+ <string name="help_pubkeys">Pubkeys</string>
+ <string name="help_portforwards">Port Forwards</string>
<string name="pubkey_generate">Generate</string>
<string name="pubkey_import">Import</string>
@@ -126,7 +132,7 @@
<string name="list_menu_sortcolor">Sort by color</string>
<string name="list_menu_sortname">Sort by name</string>
<string name="list_menu_settings">Settings</string>
- <string name="list_menu_about">About</string>
+ <string name="list_menu_help">Help</string>
<string name="list_host_disconnect">Disconnect</string>
<string name="list_host_edit">Edit host</string>
@@ -172,7 +178,4 @@
<string name="upgrade_pos">Yes, upgrade</string>
<string name="upgrade_neg">Not right now</string>
-
-
-
</resources>
diff --git a/src/org/connectbot/HelpActivity.java b/src/org/connectbot/HelpActivity.java
new file mode 100644
index 0000000..c04127f
--- /dev/null
+++ b/src/org/connectbot/HelpActivity.java
@@ -0,0 +1,77 @@
+/*
+ ConnectBot: simple, powerful, open-source SSH client for Android
+ Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+package org.connectbot;
+
+import java.io.IOException;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.content.res.AssetManager;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.LinearLayout;
+
+/**
+ * @author Kenny Root
+ *
+ */
+public class HelpActivity extends Activity {
+ public final static String TAG = HelpActivity.class.toString();
+
+ public final static String HELPDIR = "help";
+ public final static String SUFFIX = ".html";
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.act_help);
+
+ this.setTitle(String.format("%s: %s",
+ getResources().getText(R.string.app_name),
+ getResources().getText(R.string.title_help)));
+
+ AssetManager am = this.getAssets();
+ LinearLayout content = (LinearLayout)this.findViewById(R.id.topics);
+
+ try {
+ for (String name : am.list(HELPDIR)) {
+ if (name.endsWith(SUFFIX)) {
+ Button button = new Button(this);
+ final String topic = name.substring(0, name.length() - SUFFIX.length());
+ button.setText(topic);
+
+ button.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ Intent intent = new Intent(HelpActivity.this, HelpTopicActivity.class);
+ intent.putExtra(Intent.EXTRA_TITLE, topic);
+ HelpActivity.this.startActivity(intent);
+ }
+ });
+
+ content.addView(button);
+ }
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ Log.e(TAG, "couldn't get list of help assets", e);
+ }
+ }
+}
diff --git a/src/org/connectbot/HelpTopicActivity.java b/src/org/connectbot/HelpTopicActivity.java
new file mode 100644
index 0000000..35e23f5
--- /dev/null
+++ b/src/org/connectbot/HelpTopicActivity.java
@@ -0,0 +1,49 @@
+/*
+ ConnectBot: simple, powerful, open-source SSH client for Android
+ Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+package org.connectbot;
+
+import org.connectbot.util.HelpTopicView;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+
+/**
+ * @author Kenny Root
+ *
+ */
+public class HelpTopicActivity extends Activity {
+ public final static String TAG = HelpActivity.class.toString();
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.act_help_topic);
+
+ String topic = getIntent().getStringExtra(Intent.EXTRA_TITLE);
+
+ this.setTitle(String.format("%s: %s - %s",
+ getResources().getText(R.string.app_name),
+ getResources().getText(R.string.title_help),
+ topic));
+
+ HelpTopicView helpTopic = (HelpTopicView) findViewById(R.id.topic_text);
+
+ helpTopic.setTopic(topic);
+ }
+}
diff --git a/src/org/connectbot/HostListActivity.java b/src/org/connectbot/HostListActivity.java
index 86769b4..d7b6372 100644
--- a/src/org/connectbot/HostListActivity.java
+++ b/src/org/connectbot/HostListActivity.java
@@ -331,9 +331,9 @@ public class HostListActivity extends ListActivity {
settings.setIcon(android.R.drawable.ic_menu_preferences);
settings.setIntent(new Intent(HostListActivity.this, SettingsActivity.class));
- MenuItem about = menu.add(R.string.list_menu_about);
- about.setIcon(android.R.drawable.ic_menu_help);
- about.setIntent(new Intent(HostListActivity.this, WizardActivity.class));
+ MenuItem help = menu.add(R.string.list_menu_help);
+ help.setIcon(android.R.drawable.ic_menu_help);
+ help.setIntent(new Intent(HostListActivity.this, HelpActivity.class));
return true;
@@ -472,7 +472,6 @@ public class HostListActivity extends ListActivity {
TextView caption = (TextView)view.findViewById(android.R.id.text2);
ImageView icon = (ImageView)view.findViewById(android.R.id.icon);
- Log.d("HostAdapter", String.format("Checking position %d", position));
HostBean host = hosts.get(position);
if (host == null) {
Log.e("HostAdapter", "What the fuck, host bean is null!");
diff --git a/src/org/connectbot/WizardActivity.java b/src/org/connectbot/WizardActivity.java
index 4758fb5..12941e6 100644
--- a/src/org/connectbot/WizardActivity.java
+++ b/src/org/connectbot/WizardActivity.java
@@ -18,6 +18,8 @@
package org.connectbot;
+import org.connectbot.util.HelpTopicView;
+
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
@@ -34,12 +36,6 @@ import android.widget.ViewFlipper;
* @author jsharkey
*/
public class WizardActivity extends Activity {
-
- /**
- * In-order list of wizard steps to present to user. These are layout resource ids.
- */
- public final static int[] STEPS = new int[] { R.layout.wiz_eula, R.layout.wiz_features, R.layout.wiz_keyboard };
-
protected ViewFlipper flipper = null;
protected Button next, prev;
@@ -48,13 +44,17 @@ public class WizardActivity extends Activity {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_wizard);
- this.flipper = (ViewFlipper)this.findViewById(R.id.wizard_flipper);
+ this.flipper = (ViewFlipper) findViewById(R.id.wizard_flipper);
- // inflate the layouts for each step
+ // inflate the layout for EULA step
LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- for(int layout : STEPS) {
- View step = inflater.inflate(layout, this.flipper, false);
- this.flipper.addView(step);
+ this.flipper.addView(inflater.inflate(R.layout.wiz_eula, this.flipper, false));
+
+ // Add a view for each help topic we want the user to see.
+ String[] topics = getResources().getStringArray(R.array.list_wizard_topics);
+ for (String topic : topics) {
+ View step = new HelpTopicView(this, topic);
+ flipper.addView(step);
}
next = (Button)this.findViewById(R.id.action_next);
@@ -87,8 +87,7 @@ public class WizardActivity extends Activity {
}
});
- this.updateButtons();
-
+ this.updateButtons();
}
protected boolean isFirstDisplayed() {
@@ -104,7 +103,5 @@ public class WizardActivity extends Activity {
next.setText(eula ? getString(R.string.wizard_agree) : getString(R.string.wizard_next));
prev.setText(eula ? getString(R.string.wizard_cancel) : getString(R.string.wizard_back));
-
}
-
}
diff --git a/src/org/connectbot/util/HelpTopicView.java b/src/org/connectbot/util/HelpTopicView.java
new file mode 100644
index 0000000..2a163cc
--- /dev/null
+++ b/src/org/connectbot/util/HelpTopicView.java
@@ -0,0 +1,56 @@
+/*
+ ConnectBot: simple, powerful, open-source SSH client for Android
+ Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+package org.connectbot.util;
+
+import org.connectbot.HelpActivity;
+
+import android.content.Context;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+
+/**
+ * @author Kenny Root
+ *
+ */
+public class HelpTopicView extends WebView {
+
+ /**
+ * @param context
+ */
+ public HelpTopicView(Context context) {
+ super(context);
+
+ WebSettings wSet = getSettings();
+ wSet.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
+ wSet.setUseWideViewPort(false);
+ }
+
+ public HelpTopicView(Context context, String topic) {
+ this(context);
+
+ this.setTopic(topic);
+ }
+
+ public void setTopic(String topic) {
+ String path = String.format("file:///android_asset/%s/%s%s",
+ HelpActivity.HELPDIR, topic, HelpActivity.SUFFIX);
+ loadUrl(path);
+
+ computeScroll();
+ }
+}