aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJoel Blumen <jbcode42@gmail.com>2015-10-07 16:26:32 -0500
committerJoel Blumen <jbcode42@gmail.com>2015-10-07 16:26:32 -0500
commitcb578fe3aed5625fd4d1d31318a9af4ac1c76aff (patch)
tree9341537b725ddde982948109af40f5c2bba87760 /app
parent34c8c09dae068ffbbf59d46e843dc05829dee73b (diff)
parentfde40fdcb62c764df90e889ae95e28b86ac5f746 (diff)
downloadconnectbot-cb578fe3aed5625fd4d1d31318a9af4ac1c76aff.tar.gz
connectbot-cb578fe3aed5625fd4d1d31318a9af4ac1c76aff.tar.bz2
connectbot-cb578fe3aed5625fd4d1d31318a9af4ac1c76aff.zip
Merge branch 'master' into master
Diffstat (limited to 'app')
-rw-r--r--app/src/main/AndroidManifest.xml21
-rw-r--r--app/src/main/assets/help/Hints.html26
-rw-r--r--app/src/main/java/org/connectbot/HelpActivity.java51
-rw-r--r--app/src/main/java/org/connectbot/HelpTopicActivity.java48
-rw-r--r--app/src/main/java/org/connectbot/HintsActivity.java (renamed from app/src/main/res/layout/act_help_topic.xml)27
-rw-r--r--app/src/main/java/org/connectbot/HostEditorFragment.java157
-rw-r--r--app/src/main/java/org/connectbot/HostListActivity.java1
-rw-r--r--app/src/main/java/org/connectbot/PortForwardListActivity.java18
-rw-r--r--app/src/main/java/org/connectbot/util/HelpTopicView.java62
-rw-r--r--app/src/main/res/drawable-mdpi/gesture_hostnext.pngbin0 -> 8161 bytes
-rw-r--r--app/src/main/res/drawable-mdpi/gesture_hostprev.pngbin0 -> 8232 bytes
-rw-r--r--app/src/main/res/drawable-mdpi/gesture_pgdn.pngbin0 -> 8434 bytes
-rw-r--r--app/src/main/res/drawable-mdpi/gesture_pgup.pngbin0 -> 8560 bytes
-rw-r--r--app/src/main/res/drawable-mdpi/gesture_scrollback.pngbin0 -> 9061 bytes
-rw-r--r--app/src/main/res/drawable-mdpi/gesture_scrollforward.pngbin0 -> 8691 bytes
-rw-r--r--app/src/main/res/drawable-mdpi/highlight_disabled_pressed.9.png (renamed from app/src/main/res/drawable/highlight_disabled_pressed.9.png)bin898 -> 898 bytes
-rw-r--r--app/src/main/res/layout-sw500dp/act_hints.xml261
-rw-r--r--app/src/main/res/layout/act_help.xml18
-rw-r--r--app/src/main/res/layout/act_hints.xml189
-rw-r--r--app/src/main/res/layout/dia_keyboard_shortcuts.xml6
-rw-r--r--app/src/main/res/layout/fragment_host_editor.xml524
-rw-r--r--app/src/main/res/values/strings.xml47
22 files changed, 1094 insertions, 362 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index e863b21..dd9db1f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -44,9 +44,9 @@
<activity
android:name=".HostListActivity"
- android:label="@string/title_hosts_list"
+ android:label="@string/app_name"
android:launchMode="singleTop">
- <intent-filter android:label="@string/app_name">
+ <intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
@@ -134,29 +134,28 @@
</activity>
<activity
- android:name=".HelpTopicActivity"
+ android:name=".ColorsActivity"
android:configChanges="keyboardHidden|orientation"
- android:label="@string/title_help">
+ android:label="@string/title_colors">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value="org.connectbot.HelpActivity"/>
+ android:value="org.connectbot.HostListActivity"/>
</activity>
<activity
- android:name=".ColorsActivity"
+ android:name=".EulaActivity"
android:configChanges="keyboardHidden|orientation"
- android:label="@string/title_colors">
+ android:label="@string/terms_and_conditions">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value="org.connectbot.HostListActivity"/>
+ android:value="org.connectbot.HelpActivity"/>
</activity>
<activity
- android:name=".EulaActivity"
- android:configChanges="keyboardHidden|orientation"
- android:label="@string/terms_and_conditions">
+ android:name=".HintsActivity"
+ android:label="@string/hints">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
diff --git a/app/src/main/assets/help/Hints.html b/app/src/main/assets/help/Hints.html
deleted file mode 100644
index 4e07792..0000000
--- a/app/src/main/assets/help/Hints.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<html>
-<body style="background-color: #000; color: #fff">
-
-<h2><a name="Shortcuts" />Host Shortcuts</h2>
-<p>Long-press on your Android desktop to create direct shortcuts to frequently-used SSH hosts.</p>
-
-<h2><a name="Page_Up_/_Page_Down" />Page Up / Page Down</h2>
-<p>Swiping your finger up and down on the left third of the screen
- will send a page up and page down key to the remote host. Many programs
- map this to scrolling back into history such as irssi or tinyfugue.</p>
-<p><img src="http://connectbot.googlecode.com/svn/trunk/www/gesture-pgup.png" />Page Up gesture</p>
-<p><img src="http://connectbot.googlecode.com/svn/trunk/www/gesture-pgdn.png" />Page Down gesture</p>
-
-<h2><a name="Scroll_back_/_Scroll_forward" />Scroll back / Scroll forward</h2>
-<p>Swiping your finger up on the right side of the screen allows you to scroll backward and forward
- in the local terminal buffer history.</p>
-<p><img src="http://connectbot.googlecode.com/svn/trunk/www/gesture-scrollback.png" />Scroll back gesture</p>
-<p><img src="http://connectbot.googlecode.com/svn/trunk/www/gesture-scrollforward.png" />Scroll forward gesture</p>
-
-<h2><a name="Switching_hosts" />Switching hosts</h2>
-<p>Swiping your finger from one side of the screen to the other will switch between currently connected hosts.</p>
-<p><img src="http://connectbot.googlecode.com/svn/trunk/www/gesture-hostprev.png" />Previous host gesture</p>
-<p><img src="http://connectbot.googlecode.com/svn/trunk/www/gesture-hostnext.png" />Next host gesture</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/app/src/main/java/org/connectbot/HelpActivity.java b/app/src/main/java/org/connectbot/HelpActivity.java
index 3df8b2f..2a522dc 100644
--- a/app/src/main/java/org/connectbot/HelpActivity.java
+++ b/app/src/main/java/org/connectbot/HelpActivity.java
@@ -17,30 +17,20 @@
package org.connectbot;
-import java.io.IOException;
-
import android.app.AlertDialog;
import android.content.Intent;
-import android.content.res.AssetManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
-import android.widget.LinearLayout;
/**
* @author Kenny Root
*
*/
public class HelpActivity extends AppCompatActivity {
- public final static String TAG = "CB.HelpActivity";
-
- public final static String HELPDIR = "help";
- public final static String SUFFIX = ".html";
-
private LayoutInflater inflater = null;
@@ -49,54 +39,33 @@ public class HelpActivity extends AppCompatActivity {
super.onCreate(icicle);
setContentView(R.layout.act_help);
- AssetManager am = this.getAssets();
- LinearLayout content = (LinearLayout) 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);
- }
+ Button hintsButton = (Button) findViewById(R.id.hints_button);
+ hintsButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ Intent intent = new Intent(HelpActivity.this, HintsActivity.class);
+ HelpActivity.this.startActivity(intent);
}
- } catch (IOException e) {
- // TODO Auto-generated catch block
- Log.e(TAG, "couldn't get list of help assets", e);
- }
+ });
inflater = LayoutInflater.from(this);
- Button shortcutsButton = new Button(this);
- shortcutsButton.setText(getResources().getString(R.string.keyboard_shortcuts));
+ Button shortcutsButton = (Button) findViewById(R.id.shortcuts_button);
shortcutsButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
- final View shortcuts = inflater.inflate(R.layout.dia_keyboard_shortcuts, null, false);
+ final View shortcuts = inflater.inflate(R.layout.dia_keyboard_shortcuts,
+ null, false);
new AlertDialog.Builder(HelpActivity.this)
.setView(shortcuts)
.setTitle(R.string.keyboard_shortcuts)
.show();
}
});
- content.addView(shortcutsButton);
- Button eulaButton = new Button(this);
- eulaButton.setText(getResources().getString(R.string.terms_and_conditions));
+ Button eulaButton = (Button) findViewById(R.id.eula_button);
eulaButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(HelpActivity.this, EulaActivity.class);
HelpActivity.this.startActivity(intent);
}
});
- content.addView(eulaButton);
}
}
diff --git a/app/src/main/java/org/connectbot/HelpTopicActivity.java b/app/src/main/java/org/connectbot/HelpTopicActivity.java
deleted file mode 100644
index 9f5573a..0000000
--- a/app/src/main/java/org/connectbot/HelpTopicActivity.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * ConnectBot: simple, powerful, open-source SSH client for Android
- * Copyright 2007 Kenny Root, Jeffrey Sharkey
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.connectbot;
-
-import org.connectbot.util.HelpTopicView;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
-
-/**
- * @author Kenny Root
- *
- */
-public class HelpTopicActivity extends AppCompatActivity {
- public final static String TAG = "CB.HelpActivity";
-
- @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",
- getResources().getText(R.string.title_help),
- topic));
-
- HelpTopicView helpTopic = (HelpTopicView) findViewById(R.id.topic_text);
-
- helpTopic.setTopic(topic);
- }
-}
diff --git a/app/src/main/res/layout/act_help_topic.xml b/app/src/main/java/org/connectbot/HintsActivity.java
index f02e35e..25bc691 100644
--- a/app/src/main/res/layout/act_help_topic.xml
+++ b/app/src/main/java/org/connectbot/HintsActivity.java
@@ -1,8 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
/*
* ConnectBot: simple, powerful, open-source SSH client for Android
- * Copyright 2007 Kenny Root, Jeffrey Sharkey
+ * Copyright 2015 Kenny Root, Jeffrey Sharkey
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,18 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- >
+package org.connectbot;
- <org.connectbot.util.HelpTopicView
- android:id="@+id/topic_text"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- />
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
-</LinearLayout>
+public class HintsActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.act_hints);
+ }
+}
diff --git a/app/src/main/java/org/connectbot/HostEditorFragment.java b/app/src/main/java/org/connectbot/HostEditorFragment.java
index f0a8c4f..6646b4a 100644
--- a/app/src/main/java/org/connectbot/HostEditorFragment.java
+++ b/app/src/main/java/org/connectbot/HostEditorFragment.java
@@ -25,6 +25,8 @@ import android.os.Bundle;
import android.os.Parcelable;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.Fragment;
+import android.support.v7.widget.AppCompatCheckBox;
+import android.support.v7.widget.SwitchCompat;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
@@ -32,6 +34,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
+import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.SeekBar;
@@ -76,6 +79,12 @@ public class HostEditorFragment extends Fragment {
// the text in the Spinner because the text is localized while these values are not.
private TypedArray mColorValues;
+ // Likewise, but for SSH auth agent values.
+ private TypedArray mSshAuthValues;
+
+ // Likewise, but for DEL key values.
+ private TypedArray mDelKeyValues;
+
private Spinner mTransportSpinner;
private TextInputLayout mQuickConnectContainer;
private EditText mQuickConnectField;
@@ -91,6 +100,17 @@ public class HostEditorFragment extends Fragment {
private Spinner mColorSelector;
private TextView mFontSizeText;
private SeekBar mFontSizeSeekBar;
+ private Spinner mPubkeySpinner;
+ private View mUseSshConfirmationContainer;
+ private SwitchCompat mUseSshAuthSwitch;
+ private AppCompatCheckBox mSshAuthConfirmationCheckbox;
+ private SwitchCompat mCompressionSwitch;
+ private SwitchCompat mStartShellSwitch;
+ private SwitchCompat mStayConnectedSwitch;
+ private SwitchCompat mCloseOnDisconnectSwitch;
+ private EditText mPostLoginAutomationField;
+ private Spinner mDelKeySpinner;
+ private Spinner mEncodingSpinner;
public static HostEditorFragment newInstance(HostBean existingHost) {
HostEditorFragment fragment = new HostEditorFragment();
@@ -128,12 +148,17 @@ public class HostEditorFragment extends Fragment {
View view = inflater.inflate(R.layout.fragment_host_editor, container, false);
mTransportSpinner = (Spinner) view.findViewById(R.id.transport_selector);
+ String[] transportNames = TransportFactory.getTransportNames();
ArrayAdapter<String> transportSelection = new ArrayAdapter<>(
- getActivity(),
- android.R.layout.simple_spinner_item,
- TransportFactory.getTransportNames());
+ getActivity(), android.R.layout.simple_spinner_item, transportNames);
transportSelection.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mTransportSpinner.setAdapter(transportSelection);
+ for (int i = 0; i < transportNames.length; i++) {
+ if (transportNames.equals(mHost.getProtocol())) {
+ mTransportSpinner.setSelection(i);
+ break;
+ }
+ }
mTransportSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
@@ -240,14 +265,10 @@ public class HostEditorFragment extends Fragment {
new HostTextFieldWatcher(HostDatabase.FIELD_HOST_NICKNAME));
mColorSelector = (Spinner) view.findViewById(R.id.color_selector);
- if (mHost.getColor() != null) {
- // Unfortunately, TypedArray doesn't have an indexOf(String) function, so search through
- // the array for the saved color.
- for (int i = 0; i < mColorValues.getIndexCount(); i++) {
- if (mHost.getColor().equals(mColorValues.getString(i))) {
- mColorSelector.setSelection(i);
- break;
- }
+ for (int i = 0; i < mColorValues.getIndexCount(); i++) {
+ if (mHost.getColor().equals(mColorValues.getString(i))) {
+ mColorSelector.setSelection(i);
+ break;
}
}
mColorSelector.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@@ -281,6 +302,88 @@ public class HostEditorFragment extends Fragment {
});
mFontSizeSeekBar.setProgress(mHost.getFontSize() - MINIMUM_FONT_SIZE);
+ mPubkeySpinner = (Spinner) view.findViewById(R.id.pubkey_spinner);
+ // TODO: Set up spinner. This requires passing pubkey data into the fragment from the
+ // activity and will be part of an upcoming PR.
+
+ mUseSshConfirmationContainer = view.findViewById(R.id.ssh_confirmation_container);
+ mUseSshAuthSwitch = (SwitchCompat) view.findViewById(R.id.use_ssh_auth_switch);
+ mSshAuthConfirmationCheckbox =
+ (AppCompatCheckBox) view.findViewById(R.id.ssh_auth_confirmation_checkbox);
+ CompoundButton.OnCheckedChangeListener authSwitchListener = new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ mUseSshConfirmationContainer.setVisibility(
+ mUseSshAuthSwitch.isChecked() ? View.VISIBLE : View.GONE);
+ if (mUseSshAuthSwitch.isChecked()) {
+ mHost.setUseAuthAgent(
+ mSshAuthConfirmationCheckbox.isChecked() ?
+ /* require confirmation */ mSshAuthValues.getString(1) :
+ /* don't require confirmation */ mSshAuthValues.getString(2));
+ } else {
+ mHost.setUseAuthAgent(/* don't use */ mSshAuthValues.getString(0));
+ }
+ }
+ };
+ mUseSshAuthSwitch.setOnCheckedChangeListener(authSwitchListener);
+ mSshAuthConfirmationCheckbox.setOnCheckedChangeListener(authSwitchListener);
+ if (mHost.getUseAuthAgent() == null ||
+ mHost.getUseAuthAgent().equals(mSshAuthValues.getString(0))) {
+ mUseSshAuthSwitch.setChecked(false);
+ mSshAuthConfirmationCheckbox.setChecked(false);
+ } else {
+ mUseSshAuthSwitch.setChecked(true);
+ mSshAuthConfirmationCheckbox.setChecked(
+ mHost.getUseAuthAgent().equals(mSshAuthValues.getString(1)));
+ }
+
+ mCompressionSwitch = (SwitchCompat) view.findViewById(R.id.compression_switch);
+ mCompressionSwitch.setChecked(mHost.getCompression());
+ mCompressionSwitch.setOnCheckedChangeListener(
+ new HostSwitchWatcher(HostDatabase.FIELD_HOST_COMPRESSION));
+
+ mStartShellSwitch = (SwitchCompat) view.findViewById(R.id.start_shell_switch);
+ mStartShellSwitch.setChecked(mHost.getWantSession());
+ mStartShellSwitch.setOnCheckedChangeListener(
+ new HostSwitchWatcher(HostDatabase.FIELD_HOST_WANTSESSION));
+
+ mStayConnectedSwitch = (SwitchCompat) view.findViewById(R.id.stay_connected_switch);
+ mStayConnectedSwitch.setChecked(mHost.getStayConnected());
+ mStayConnectedSwitch.setOnCheckedChangeListener(
+ new HostSwitchWatcher(HostDatabase.FIELD_HOST_STAYCONNECTED));
+
+ mCloseOnDisconnectSwitch = (SwitchCompat) view.findViewById(R.id.close_on_disconnect_switch);
+ mCloseOnDisconnectSwitch.setChecked(mHost.getQuickDisconnect());
+ mCloseOnDisconnectSwitch.setOnCheckedChangeListener(
+ new HostSwitchWatcher(HostDatabase.FIELD_HOST_QUICKDISCONNECT));
+
+ mPostLoginAutomationField = (EditText) view.findViewById(R.id.post_login_automation_field);
+ mPostLoginAutomationField.setText(mHost.getPostLogin());
+ mPostLoginAutomationField.addTextChangedListener(
+ new HostTextFieldWatcher(HostDatabase.FIELD_HOST_POSTLOGIN));
+
+ mDelKeySpinner = (Spinner) view.findViewById(R.id.del_key_spinner);
+ for (int i = 0; i < mDelKeyValues.getIndexCount(); i++) {
+ if (mHost.getDelKey().equals(mDelKeyValues.getString(i))) {
+ mDelKeySpinner.setSelection(i);
+ break;
+ }
+ }
+ mDelKeySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+ mHost.setDelKey(mDelKeyValues.getString(position));
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView<?> parent) {
+ }
+ });
+
+ mEncodingSpinner = (Spinner) view.findViewById(R.id.encoding_spinner);
+ // TODO: Set up spinner. This requires passing pubkey data into the fragment from the
+ // activity and will be part of an upcoming PR.
+
setUriPartsContainerExpanded(mIsUriEditorExpanded);
return view;
@@ -295,9 +398,11 @@ public class HostEditorFragment extends Fragment {
throw new ClassCastException(context.toString() + " must implement Listener");
}
- // Now that the fragment is attached to an Activity, fetch the array from the attached
+ // Now that the fragment is attached to an Activity, fetch the arrays from the attached
// Activity's resources.
mColorValues = getResources().obtainTypedArray(R.array.list_color_values);
+ mSshAuthValues = getResources().obtainTypedArray(R.array.list_authagent_values);
+ mDelKeyValues = getResources().obtainTypedArray(R.array.list_delkey_values);
}
@Override
@@ -305,6 +410,8 @@ public class HostEditorFragment extends Fragment {
super.onDetach();
mListener = null;
mColorValues.recycle();
+ mSshAuthValues.recycle();
+ mDelKeyValues.recycle();
}
@Override
@@ -392,6 +499,8 @@ public class HostEditorFragment extends Fragment {
}
} else if (HostDatabase.FIELD_HOST_NICKNAME.equals(mFieldType)) {
mHost.setNickname(text);
+ } else if (HostDatabase.FIELD_HOST_POSTLOGIN.equals(mFieldType)) {
+ mHost.setPostLogin(text);
} else {
throw new RuntimeException("Invalid field type.");
}
@@ -414,4 +523,28 @@ public class HostEditorFragment extends Fragment {
HostDatabase.FIELD_HOST_PORT.equals(fieldType);
}
}
+
+ private class HostSwitchWatcher implements CompoundButton.OnCheckedChangeListener {
+
+ private final String mFieldType;
+
+ public HostSwitchWatcher(String fieldType) {
+ mFieldType = fieldType;
+ }
+
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ if (HostDatabase.FIELD_HOST_COMPRESSION.equals(mFieldType)) {
+ mHost.setCompression(isChecked);
+ } else if (HostDatabase.FIELD_HOST_WANTSESSION.equals(mFieldType)) {
+ mHost.setWantSession(isChecked);
+ } else if (HostDatabase.FIELD_HOST_STAYCONNECTED.equals(mFieldType)) {
+ mHost.setStayConnected(isChecked);
+ } else if (HostDatabase.FIELD_HOST_QUICKDISCONNECT.equals(mFieldType)) {
+ mHost.setQuickDisconnect(isChecked);
+ } else {
+ throw new RuntimeException("Invalid field type.");
+ }
+ }
+ }
}
diff --git a/app/src/main/java/org/connectbot/HostListActivity.java b/app/src/main/java/org/connectbot/HostListActivity.java
index d844c50..3ad8c55 100644
--- a/app/src/main/java/org/connectbot/HostListActivity.java
+++ b/app/src/main/java/org/connectbot/HostListActivity.java
@@ -173,6 +173,7 @@ public class HostListActivity extends AppCompatListActivity implements OnHostSta
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.act_hostlist);
+ setTitle(R.string.title_hosts_list);
mListView = (RecyclerView) findViewById(R.id.list);
mListView.setHasFixedSize(true);
diff --git a/app/src/main/java/org/connectbot/PortForwardListActivity.java b/app/src/main/java/org/connectbot/PortForwardListActivity.java
index c7f0e7c..e5d3210 100644
--- a/app/src/main/java/org/connectbot/PortForwardListActivity.java
+++ b/app/src/main/java/org/connectbot/PortForwardListActivity.java
@@ -188,11 +188,23 @@ public class PortForwardListActivity extends AppCompatListActivity {
break;
}
+ // Why length(), not isEmpty(), is used: http://stackoverflow.com/q/10606725
+ String sourcePort = sourcePortEdit.getText().toString();
+ if (sourcePort.length() == 0) {
+ sourcePort = sourcePortEdit.getHint().toString();
+ }
+
+ String destination = destEdit.getText().toString();
+ if (destination.length() == 0) {
+ destination = destEdit.getHint().toString();
+ }
+
PortForwardBean portForward = new PortForwardBean(
host != null ? host.getId() : -1,
- nicknameEdit.getText().toString(), type,
- sourcePortEdit.getText().toString(),
- destEdit.getText().toString());
+ nicknameEdit.getText().toString(),
+ type,
+ sourcePort,
+ destination);
if (hostBridge != null) {
hostBridge.addPortForward(portForward);
diff --git a/app/src/main/java/org/connectbot/util/HelpTopicView.java b/app/src/main/java/org/connectbot/util/HelpTopicView.java
deleted file mode 100644
index 0cbc267..0000000
--- a/app/src/main/java/org/connectbot/util/HelpTopicView.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * ConnectBot: simple, powerful, open-source SSH client for Android
- * Copyright 2007 Kenny Root, Jeffrey Sharkey
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.connectbot.util;
-
-import org.connectbot.HelpActivity;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-
-/**
- * @author Kenny Root
- *
- */
-public class HelpTopicView extends WebView {
- public HelpTopicView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- initialize();
- }
-
- public HelpTopicView(Context context, AttributeSet attrs) {
- super(context, attrs);
- initialize();
- }
-
- public HelpTopicView(Context context) {
- super(context);
- initialize();
- }
-
- private void initialize() {
- WebSettings wSet = getSettings();
- wSet.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
- wSet.setUseWideViewPort(false);
- }
-
- public HelpTopicView setTopic(String topic) {
- String path = String.format("file:///android_asset/%s/%s%s",
- HelpActivity.HELPDIR, topic, HelpActivity.SUFFIX);
- loadUrl(path);
-
- computeScroll();
-
- return this;
- }
-}
diff --git a/app/src/main/res/drawable-mdpi/gesture_hostnext.png b/app/src/main/res/drawable-mdpi/gesture_hostnext.png
new file mode 100644
index 0000000..624223d
--- /dev/null
+++ b/app/src/main/res/drawable-mdpi/gesture_hostnext.png
Binary files differ
diff --git a/app/src/main/res/drawable-mdpi/gesture_hostprev.png b/app/src/main/res/drawable-mdpi/gesture_hostprev.png
new file mode 100644
index 0000000..f99f70c
--- /dev/null
+++ b/app/src/main/res/drawable-mdpi/gesture_hostprev.png
Binary files differ
diff --git a/app/src/main/res/drawable-mdpi/gesture_pgdn.png b/app/src/main/res/drawable-mdpi/gesture_pgdn.png
new file mode 100644
index 0000000..61b769b
--- /dev/null
+++ b/app/src/main/res/drawable-mdpi/gesture_pgdn.png
Binary files differ
diff --git a/app/src/main/res/drawable-mdpi/gesture_pgup.png b/app/src/main/res/drawable-mdpi/gesture_pgup.png
new file mode 100644
index 0000000..0e7f1ca
--- /dev/null
+++ b/app/src/main/res/drawable-mdpi/gesture_pgup.png
Binary files differ
diff --git a/app/src/main/res/drawable-mdpi/gesture_scrollback.png b/app/src/main/res/drawable-mdpi/gesture_scrollback.png
new file mode 100644
index 0000000..714e626
--- /dev/null
+++ b/app/src/main/res/drawable-mdpi/gesture_scrollback.png
Binary files differ
diff --git a/app/src/main/res/drawable-mdpi/gesture_scrollforward.png b/app/src/main/res/drawable-mdpi/gesture_scrollforward.png
new file mode 100644
index 0000000..0172e45
--- /dev/null
+++ b/app/src/main/res/drawable-mdpi/gesture_scrollforward.png
Binary files differ
diff --git a/app/src/main/res/drawable/highlight_disabled_pressed.9.png b/app/src/main/res/drawable-mdpi/highlight_disabled_pressed.9.png
index 807fcb5..807fcb5 100644
--- a/app/src/main/res/drawable/highlight_disabled_pressed.9.png
+++ b/app/src/main/res/drawable-mdpi/highlight_disabled_pressed.9.png
Binary files differ
diff --git a/app/src/main/res/layout-sw500dp/act_hints.xml b/app/src/main/res/layout-sw500dp/act_hints.xml
new file mode 100644
index 0000000..9a32dea
--- /dev/null
+++ b/app/src/main/res/layout-sw500dp/act_hints.xml
@@ -0,0 +1,261 @@
+<!--
+ ~ ConnectBot: simple, powerful, open-source SSH client for Android
+ ~ Copyright 2015 Kenny Root, Jeffrey Sharkey
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="org.connectbot.HintsActivity">
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:padding="10dip"
+ >
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/host_shortcuts_header"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginTop="10dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/host_shortcuts_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/scroll_hints_header"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginTop="10dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/scroll_hints_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"/>
+
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center">
+ <ImageView
+ android:id="@+id/scrollback_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_scrollback"
+ android:contentDescription="@string/scrolling_back"
+ android:layout_marginTop="10dp"
+ android:layout_marginRight="10dp"
+ android:layout_marginEnd="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:id="@+id/scrollback_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@string/scrolling_back"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:layout_alignStart="@id/scrollback_image"
+ android:layout_alignLeft="@id/scrollback_image"
+ android:layout_alignEnd="@id/scrollback_image"
+ android:layout_alignRight="@id/scrollback_image"
+ android:layout_below="@id/scrollback_image"
+ android:gravity="center_horizontal"/>
+
+ <ImageView
+ android:id="@+id/scrollforward_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_scrollforward"
+ android:contentDescription="@string/scrolling_forward"
+ android:layout_marginTop="10dp"
+ android:layout_marginLeft="10dp"
+ android:layout_marginStart="10dp"
+ android:layout_toRightOf="@id/scrollback_image"
+ android:layout_toEndOf="@id/scrollback_image"/>
+
+ <TextView
+ android:id="@+id/scrollforward_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@string/scrolling_forward"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:layout_below="@id/scrollforward_image"
+ android:layout_alignStart="@id/scrollforward_image"
+ android:layout_alignLeft="@id/scrollforward_image"
+ android:layout_alignEnd="@id/scrollforward_image"
+ android:layout_alignRight="@id/scrollforward_image"
+ android:gravity="center_horizontal"/>
+ </RelativeLayout>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/page_updn_header"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginTop="10dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/page_updn_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"/>
+
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center">
+ <ImageView
+ android:id="@+id/pgup_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_pgup"
+ android:contentDescription="@string/page_up"
+ android:layout_marginTop="10dp"
+ android:layout_marginRight="10dp"
+ android:layout_marginEnd="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:id="@+id/pgup_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@string/page_up"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:layout_alignStart="@id/pgup_image"
+ android:layout_alignLeft="@id/pgup_image"
+ android:layout_alignEnd="@id/pgup_image"
+ android:layout_alignRight="@id/pgup_image"
+ android:layout_below="@id/pgup_image"
+ android:gravity="center_horizontal"/>
+
+ <ImageView
+ android:id="@+id/pgdn_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_pgdn"
+ android:contentDescription="@string/page_down"
+ android:layout_marginTop="10dp"
+ android:layout_marginLeft="10dp"
+ android:layout_marginStart="10dp"
+ android:layout_toRightOf="@id/pgup_image"
+ android:layout_toEndOf="@id/pgup_image"/>
+
+ <TextView
+ android:id="@+id/pgdn_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@string/page_down"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:layout_below="@id/pgdn_image"
+ android:layout_alignStart="@id/pgdn_image"
+ android:layout_alignLeft="@id/pgdn_image"
+ android:layout_alignEnd="@id/pgdn_image"
+ android:layout_alignRight="@id/pgdn_image"
+ android:gravity="center_horizontal"/>
+ </RelativeLayout>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/switching_hosts_header"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginTop="10dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/switching_hosts_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"/>
+
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center">
+ <ImageView
+ android:id="@+id/prev_host_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_hostprev"
+ android:contentDescription="@string/prev_host"
+ android:layout_marginTop="10dp"
+ android:layout_marginRight="10dp"
+ android:layout_marginEnd="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:id="@+id/prev_host_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@string/prev_host"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:layout_alignStart="@id/prev_host_image"
+ android:layout_alignLeft="@id/prev_host_image"
+ android:layout_alignEnd="@id/prev_host_image"
+ android:layout_alignRight="@id/prev_host_image"
+ android:layout_below="@id/prev_host_image"
+ android:gravity="center_horizontal"/>
+
+ <ImageView
+ android:id="@+id/next_host_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_hostnext"
+ android:contentDescription="@string/next_host"
+ android:layout_marginTop="10dp"
+ android:layout_marginLeft="10dp"
+ android:layout_marginStart="10dp"
+ android:layout_toRightOf="@id/prev_host_image"
+ android:layout_toEndOf="@id/prev_host_image"/>
+
+ <TextView
+ android:id="@+id/next_host_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@string/next_host"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="10dp"
+ android:layout_below="@id/next_host_image"
+ android:layout_alignStart="@id/next_host_image"
+ android:layout_alignLeft="@id/next_host_image"
+ android:layout_alignEnd="@id/next_host_image"
+ android:layout_alignRight="@id/next_host_image"
+ android:gravity="center_horizontal"/>
+ </RelativeLayout>
+
+ </LinearLayout>
+
+</ScrollView>
diff --git a/app/src/main/res/layout/act_help.xml b/app/src/main/res/layout/act_help.xml
index b4bb808..146eaa1 100644
--- a/app/src/main/res/layout/act_help.xml
+++ b/app/src/main/res/layout/act_help.xml
@@ -52,5 +52,23 @@
android:textAppearance="?android:attr/textAppearanceMedium"
/>
+ <Button
+ android:id="@+id/hints_button"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hints"/>
+
+ <Button
+ android:id="@+id/shortcuts_button"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/keyboard_shortcuts"/>
+
+ <Button
+ android:id="@+id/eula_button"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/terms_and_conditions"/>
+
</LinearLayout>
</ScrollView>
diff --git a/app/src/main/res/layout/act_hints.xml b/app/src/main/res/layout/act_hints.xml
new file mode 100644
index 0000000..2e45c37
--- /dev/null
+++ b/app/src/main/res/layout/act_hints.xml
@@ -0,0 +1,189 @@
+<!--
+ ~ ConnectBot: simple, powerful, open-source SSH client for Android
+ ~ Copyright 2015 Kenny Root, Jeffrey Sharkey
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="org.connectbot.HintsActivity">
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:padding="10dip"
+ >
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/host_shortcuts_header"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginTop="10dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/host_shortcuts_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/scroll_hints_header"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginTop="10dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/scroll_hints_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"/>
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_scrollback"
+ android:contentDescription="@string/scrolling_back"
+ android:layout_marginTop="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/scrolling_back"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_horizontal"/>
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_scrollforward"
+ android:contentDescription="@string/scrolling_forward"
+ android:layout_marginTop="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/scrolling_forward"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_horizontal"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/page_updn_header"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginTop="10dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/page_updn_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"/>
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_pgup"
+ android:contentDescription="@string/page_up"
+ android:layout_marginTop="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/page_up"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_horizontal"/>
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_pgdn"
+ android:contentDescription="@string/page_down"
+ android:layout_marginTop="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/page_down"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_horizontal"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/switching_hosts_header"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginTop="10dp"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/switching_hosts_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"/>
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_hostprev"
+ android:contentDescription="@string/prev_host"
+ android:layout_marginTop="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/prev_host"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_horizontal"/>
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/gesture_hostnext"
+ android:contentDescription="@string/next_host"
+ android:layout_marginTop="10dp"
+ android:layout_gravity="center_horizontal"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/next_host"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_horizontal"/>
+
+ </LinearLayout>
+
+</ScrollView>
diff --git a/app/src/main/res/layout/dia_keyboard_shortcuts.xml b/app/src/main/res/layout/dia_keyboard_shortcuts.xml
index b6fb589..fca66b2 100644
--- a/app/src/main/res/layout/dia_keyboard_shortcuts.xml
+++ b/app/src/main/res/layout/dia_keyboard_shortcuts.xml
@@ -30,7 +30,7 @@
android:stretchColumns="1">
<TableRow>
<TextView
- android:text="Ctrl-Shift-V"
+ android:text="@string/paste_shortcut"
android:padding="3dip"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
@@ -45,7 +45,7 @@
<TableRow>
<TextView
- android:text="Ctrl and +"
+ android:text="@string/increase_font_shortcut"
android:padding="3dip"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
@@ -60,7 +60,7 @@
<TableRow>
<TextView
- android:text="Ctrl and -"
+ android:text="@string/decrease_font_shortcut"
android:padding="3dip"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
diff --git a/app/src/main/res/layout/fragment_host_editor.xml b/app/src/main/res/layout/fragment_host_editor.xml
index 6f429ac..5e809d8 100644
--- a/app/src/main/res/layout/fragment_host_editor.xml
+++ b/app/src/main/res/layout/fragment_host_editor.xml
@@ -15,226 +15,468 @@
~ limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
+ android:layout_height="wrap_content"
tools:context="org.connectbot.HostEditorFragment"
- >
+ >
<LinearLayout
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:layout_marginStart="4dp"
- android:layout_marginLeft="4dp"
- android:layout_marginBottom="4dp"
>
- <TextView
+ <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/protocol_spinner_label"
- android:textSize="12sp"
- />
+ android:orientation="vertical"
+ android:layout_marginStart="4dp"
+ android:layout_marginLeft="4dp"
+ android:layout_marginBottom="4dp"
+ >
- <Spinner
- android:id="@+id/transport_selector"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/protocol_spinner_label"
+ android:textSize="12sp"
+ />
- </LinearLayout>
+ <Spinner
+ android:id="@+id/transport_selector"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:animateLayoutChanges="true"
- tools:ignore="UnusedAttribute"
- >
+ </LinearLayout>
- <android.support.design.widget.TextInputLayout
- android:id="@+id/quickconnect_field_container"
- android:layout_width="0dp"
- android:layout_weight ="1"
- android:layout_height="wrap_content"
- >
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:animateLayoutChanges="true"
+ tools:ignore="UnusedAttribute"
+ >
+
+ <android.support.design.widget.TextInputLayout
+ android:id="@+id/quickconnect_field_container"
+ android:layout_width="0dp"
+ android:layout_weight ="1"
+ android:layout_height="wrap_content"
+ >
+
+ <EditText
+ android:id="@+id/quickconnect_field"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:maxLines="1"
+ android:inputType="textNoSuggestions"
+ />
+
+ </android.support.design.widget.TextInputLayout>
+
+ <ImageButton
+ android:id="@+id/expand_collapse_button"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:layout_gravity="center"
+ android:layout_margin="16dp"
+ android:src="@drawable/ic_expand_more"
+ android:contentDescription="@string/expand"
+ android:background="#00000000"
+ />
- <EditText
- android:id="@+id/quickconnect_field"
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/uri_parts_container"
android:layout_width="match_parent"
- android:layout_weight="1"
android:layout_height="wrap_content"
- android:maxLines="1"
- android:inputType="textNoSuggestions"
- />
+ android:orientation="vertical"
+ android:layout_marginLeft="56dp"
+ android:layout_marginStart="56dp"
+ android:visibility="gone"
+ android:animateLayoutChanges="true"
+ tools:ignore="UnusedAttribute"
+ >
+
+ <android.support.design.widget.TextInputLayout
+ android:id="@+id/username_field_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
+
+ <EditText
+ android:id="@+id/username_edit_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/hostpref_username_title"
+ android:maxLines="1"
+ android:inputType="textNoSuggestions"
+ />
+
+ </android.support.design.widget.TextInputLayout>
+
+ <android.support.design.widget.TextInputLayout
+ android:id="@+id/hostname_field_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
+
+ <EditText
+ android:id="@+id/hostname_edit_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/hostpref_hostname_title"
+ android:maxLines="1"
+ android:inputType="textNoSuggestions"
+ />
+
+ </android.support.design.widget.TextInputLayout>
+
+ <android.support.design.widget.TextInputLayout
+ android:id="@+id/port_field_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
- </android.support.design.widget.TextInputLayout>
+ <EditText
+ android:id="@+id/port_edit_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="number"
+ android:hint="@string/hostpref_port_title"
+ android:maxLines="1"
+ />
- <ImageButton
- android:id="@+id/expand_collapse_button"
- android:layout_width="16dp"
- android:layout_height="16dp"
- android:layout_gravity="center"
- android:layout_margin="16dp"
- android:src="@drawable/ic_expand_more"
- android:contentDescription="@string/expand"
- android:background="#00000000"
- />
+ </android.support.design.widget.TextInputLayout>
- </LinearLayout>
+ </LinearLayout>
- <LinearLayout
- android:id="@+id/uri_parts_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_marginLeft="56dp"
- android:layout_marginStart="56dp"
- android:visibility="gone"
- android:animateLayoutChanges="true"
- tools:ignore="UnusedAttribute"
- >
+ <View style="@style/Divider"
+ />
<android.support.design.widget.TextInputLayout
- android:id="@+id/username_field_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
- <EditText
- android:id="@+id/username_edit_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/hostpref_username_title"
- android:maxLines="1"
- android:inputType="textNoSuggestions"
- />
+ <EditText
+ android:id="@+id/nickname_field"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:maxLines="1"
+ android:inputType="text"
+ android:hint="@string/hostpref_nickname_title"
+ />
</android.support.design.widget.TextInputLayout>
- <android.support.design.widget.TextInputLayout
- android:id="@+id/hostname_field_container"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginStart="4dp"
+ android:layout_marginLeft="4dp"
+ android:layout_marginBottom="4dp"
>
- <EditText
- android:id="@+id/hostname_edit_text"
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_color_title"
+ android:textSize="12sp"
+ />
+
+ <Spinner
+ android:id="@+id/color_selector"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:entries="@array/list_colors"
+ android:entryValues="@array/list_color_values"
+ />
+
+ </LinearLayout>
+
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:hint="@string/hostpref_hostname_title"
- android:maxLines="1"
- android:inputType="textNoSuggestions"
+ android:orientation="vertical"
+ android:layout_marginStart="4dp"
+ android:layout_marginLeft="4dp"
+ android:layout_marginBottom="4dp"
+ >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_fontsize_title"
+ android:textSize="12sp"
+ />
+
+ <TextView
+ android:id="@+id/font_size_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="12sp"
+ />
+
+ </LinearLayout>
+
+ <SeekBar
+ android:id="@+id/font_size_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:max="32"
+ />
+
+ </LinearLayout>
+
+ <View style="@style/Divider"
/>
- </android.support.design.widget.TextInputLayout>
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginStart="4dp"
+ android:layout_marginLeft="4dp"
+ android:layout_marginBottom="4dp"
+ >
- <android.support.design.widget.TextInputLayout
- android:id="@+id/port_field_container"
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_pubkeyid_title"
+ android:textSize="12sp"
+ />
+
+ <Spinner
+ android:id="@+id/pubkey_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:entries="@array/list_pubkeyids"
+ android:entryValues="@array/list_pubkeyids_value"
+ />
+
+ </LinearLayout>
+
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:orientation="vertical"
>
- <EditText
- android:id="@+id/port_edit_text"
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_authagent_title"
+ />
+
+ <android.support.v7.widget.SwitchCompat
+ android:id="@+id/use_ssh_auth_switch"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ />
+
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:id="@+id/ssh_confirmation_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_authagent_with_confirmation"
+ />
+
+ <android.support.v7.widget.AppCompatCheckBox
+ android:id="@+id/ssh_auth_confirmation_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ />
+
+ </RelativeLayout>
+
+ </LinearLayout>
+
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:inputType="number"
- android:hint="@string/hostpref_port_title"
- android:maxLines="1"
- />
+ >
- </android.support.design.widget.TextInputLayout>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_compression_title"
+ />
- </LinearLayout>
+ <android.support.v7.widget.SwitchCompat
+ android:id="@+id/compression_switch"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ />
- <View style="@style/Divider"
- />
+ </RelativeLayout>
- <android.support.design.widget.TextInputLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- >
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_wantsession_title"
+ />
+
+ <android.support.v7.widget.SwitchCompat
+ android:id="@+id/start_shell_switch"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ />
- <EditText
- android:id="@+id/nickname_field"
+ </RelativeLayout>
+
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:maxLines="1"
- android:inputType="text"
- android:hint="@string/hostpref_nickname_title"
- />
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_stayconnected_title"
+ />
- </android.support.design.widget.TextInputLayout>
+ <android.support.v7.widget.SwitchCompat
+ android:id="@+id/stay_connected_switch"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_marginStart="4dp"
- android:layout_marginLeft="4dp"
- android:layout_marginBottom="4dp"
- >
+ </RelativeLayout>
- <TextView
- android:layout_width="wrap_content"
+ <RelativeLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/hostpref_color_title"
- android:textSize="12sp"
- />
+ >
- <Spinner
- android:id="@+id/color_selector"
- android:layout_width="wrap_content"
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_quickdisconnect_title"
+ />
+
+ <android.support.v7.widget.SwitchCompat
+ android:id="@+id/close_on_disconnect_switch"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ />
+
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:entries="@array/list_colors"
- android:entryValues="@array/list_color_values"
- />
+ >
- </LinearLayout>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_postlogin_title"
+ />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_marginStart="4dp"
- android:layout_marginLeft="4dp"
- android:layout_marginBottom="4dp"
- >
+ <EditText
+ android:id="@+id/post_login_automation_field"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:inputType="textMultiLine"
+ android:lines="8"
+ android:minLines="2"
+ />
+
+ </RelativeLayout>
<LinearLayout
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginStart="4dp"
+ android:layout_marginLeft="4dp"
+ android:layout_marginBottom="4dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/hostpref_fontsize_title"
+ android:text="@string/hostpref_delkey_title"
android:textSize="12sp"
/>
- <TextView
- android:id="@+id/font_size_text"
+ <Spinner
+ android:id="@+id/del_key_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="12sp"
+ android:entries="@array/list_delkey"
+ android:entryValues="@array/list_delkey_values"
/>
</LinearLayout>
- <SeekBar
- android:id="@+id/font_size_bar"
- android:layout_width="match_parent"
+ <LinearLayout
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:max="32"
- />
+ android:orientation="vertical"
+ android:layout_marginStart="4dp"
+ android:layout_marginLeft="4dp"
+ android:layout_marginBottom="4dp"
+ >
- </LinearLayout>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/hostpref_encoding_title"
+ android:textSize="12sp"
+ />
- <View style="@style/Divider"
- />
+ <Spinner
+ android:id="@+id/encoding_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+
+ </LinearLayout>
+
+ </LinearLayout>
-</LinearLayout>
+</ScrollView> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 9833a31..baf2db4 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -60,12 +60,57 @@
<!-- Title for the help page with the terms & conditions of the app. -->
<string name="terms_and_conditions">"Terms &amp; Conditions"</string>
+ <!-- Title for the help page with the hints about the app. -->
+ <string name="hints">"Hints"</string>
+
+ <!-- Header text for instructions about creating host shortcuts. -->
+ <string name="host_shortcuts_header">"Host Shortcuts"</string>
+
+ <!-- Instructions about creating host shortcuts. -->
+ <string name="host_shortcuts_content">"Long-press on your Android desktop to create direct shortcuts to frequently-used SSH hosts."</string>
+
+ <!-- Header text for instructions about scrolling the terminal. -->
+ <string name="scroll_hints_header">"Scroll back / Scroll forward"</string>
+
+ <!-- Instructions about scrolling the terminal. -->
+ <string name="scroll_hints_content">"Swiping your finger up on the right side of the screen allows you to scroll backward and forward in the local terminal buffer history."</string>
+
+ <!-- Captions for images showing the scroll back/forward gestures. -->
+ <string name="scrolling_back">"Scrolling back"</string>
+ <string name="scrolling_forward">"Scrolling forward"</string>
+
+ <!-- Header text for instructions about paging up and down in the terminal. -->
+ <string name="page_updn_header">"Page Up / Page Down"</string>
+
+ <!-- Instructions about paging up and down in the terminal. -->
+ <string name="page_updn_content">"Swiping your finger up and down on the left third of the screen will send a page up and page down key to the remote host. Many programs map this to scrolling back into history such as irssi or tinyfugue."</string>
+
+ <!-- Captions for images showing the page up/down gestures. -->
+ <string name="page_up">"Page up"</string>
+ <string name="page_down">"Page down"</string>
+
+ !-- Header text for instructions about switching to the next and previous host in the terminal. -->
+ <string name="switching_hosts_header">"Switching Hosts"</string>
+
+ <!-- Instructions about switching to the next and previous host in the terminal. -->
+ <string name="switching_hosts_content">"Swiping your finger from one side of the screen to the other will switch between currently connected hosts."</string>
+
+ <!-- Captions for images showing the next/previous host gestures. -->
+ <string name="next_host">"Next host"</string>
+ <string name="prev_host">"Previous host"</string>
+
<!-- Title for the help dialog showing keyboard shortcuts. -->
<string name="keyboard_shortcuts">"Keyboard Shortcuts"</string>
<!-- Text in a keyboard shortcuts list lined up to keys which increase the terminal font-size. -->
<string name="increase_font_size">"Increase Font Size"</string>
+ <!-- Keyboard shortcut for increasing the font size. -->
+ <string name="increase_font_shortcut">Ctrl and +</string>
<!-- Text in a keyboard shortcuts list lined up to keys which decrease the terminal font-size. -->
<string name="decrease_font_size">"Decrease Font Size"</string>
+ <!-- Keyboard shortcut for decreasing the font size. -->
+ <string name="decrease_font_shortcut">Ctrl and -</string>
+ <!-- Keyboard shortcut for pasting into the terminal. -->
+ <string name="paste_shortcut">Ctrl-Shift-V</string>
<string name="pubkey_generate">"Generate"</string>
<string name="pubkey_import">"Import"</string>
@@ -596,5 +641,7 @@
<string name="protocol_spinner_label">Protocol</string>
<!-- Label for button which expands/collapses section. -->
<string name="expand">Expand</string>
+ <!-- Label for checkbox which, when check, makes SSL authorization require confirmation. -->
+ <string name="hostpref_authagent_with_confirmation">require confirmation</string>
</resources>