aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/org/connectbot/ConsoleActivity.java38
-rw-r--r--app/src/main/java/org/connectbot/util/PreferenceConstants.java3
-rw-r--r--app/src/main/res/values/strings.xml2
-rw-r--r--app/src/main/res/xml-v14/preferences.xml9
-rw-r--r--app/src/main/res/xml/preferences.xml7
5 files changed, 48 insertions, 11 deletions
diff --git a/app/src/main/java/org/connectbot/ConsoleActivity.java b/app/src/main/java/org/connectbot/ConsoleActivity.java
index 9cdb4a5..5cc9773 100644
--- a/app/src/main/java/org/connectbot/ConsoleActivity.java
+++ b/app/src/main/java/org/connectbot/ConsoleActivity.java
@@ -146,6 +146,7 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
@Nullable private ActionBar actionBar;
private boolean inActionBarMenu = false;
private boolean titleBarHide;
+ private boolean keyboardAlwaysVisible = false;
private ServiceConnection connection = new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
@@ -436,8 +437,10 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
if (keyboardGroup.getVisibility() == View.GONE || inActionBarMenu)
return;
- keyboardGroup.startAnimation(keyboard_fade_out);
- keyboardGroup.setVisibility(View.GONE);
+ if(keyboardAlwaysVisible == false) {
+ keyboardGroup.startAnimation(keyboard_fade_out);
+ keyboardGroup.setVisibility(View.GONE);
+ }
hideActionBarIfRequested();
keyboardGroupHider = null;
}
@@ -445,12 +448,14 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
handler.postDelayed(keyboardGroupHider, KEYBOARD_DISPLAY_TIME);
}
- private void hideEmulatedKeys() {
- if (keyboardGroupHider != null)
- handler.removeCallbacks(keyboardGroupHider);
- keyboardGroup.setVisibility(View.GONE);
- hideActionBarIfRequested();
- }
+ private void hideEmulatedKeys() {
+ if(keyboardAlwaysVisible == false) {
+ if (keyboardGroupHider != null)
+ handler.removeCallbacks(keyboardGroupHider);
+ keyboardGroup.setVisibility(View.GONE);
+ }
+ hideActionBarIfRequested();
+ }
@TargetApi(11)
private void requestActionBar() {
@@ -504,7 +509,6 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
toolbar = (Toolbar) findViewById(R.id.toolbar);
pager = (TerminalViewPager) findViewById(R.id.console_flip);
-
pager.addOnPageChangeListener(
new TerminalViewPager.SimpleOnPageChangeListener() {
@Override
@@ -574,6 +578,22 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne
keyboardGroup = (LinearLayout) findViewById(R.id.keyboard_group);
+ keyboardAlwaysVisible = prefs.getBoolean(PreferenceConstants.KEY_ALWAYS_VISIVLE, false);
+ if(keyboardAlwaysVisible) {
+ // equivalent to android:layout_above=keyboard_group
+ RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT);
+ layoutParams.addRule(RelativeLayout.ABOVE, R.id.keyboard_group);
+ pager.setLayoutParams(layoutParams);
+
+ // Show virtual keyboard
+ keyboardGroup.setVisibility(View.VISIBLE);
+
+ // We don't need the show keyboard button
+ findViewById(R.id.button_keyboard).setVisibility(View.GONE);
+ }
+
mKeyboardButton = (ImageView) findViewById(R.id.button_keyboard);
mKeyboardButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
diff --git a/app/src/main/java/org/connectbot/util/PreferenceConstants.java b/app/src/main/java/org/connectbot/util/PreferenceConstants.java
index fe80f24..ae9ab04 100644
--- a/app/src/main/java/org/connectbot/util/PreferenceConstants.java
+++ b/app/src/main/java/org/connectbot/util/PreferenceConstants.java
@@ -48,7 +48,8 @@ public class PreferenceConstants {
public static final String TITLEBARHIDE = "titlebarhide";
public static final String PG_UPDN_GESTURE = "pgupdngesture";
- public static final String KEYMODE = "keymode";
+ public static final String KEYMODE = "keymode";
+ public static final String KEY_ALWAYS_VISIVLE = "alwaysvisible";
public static final String KEYMODE_RIGHT = "Use right-side keys";
public static final String KEYMODE_LEFT = "Use left-side keys";
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e5dfeef..925f55f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -643,5 +643,7 @@
<string name="discard_host_button">Discard</string>
<!-- Text for button which does not discard changes and keeps editing. -->
<string name="discard_host_cancel_button">Keep editing</string>
+ <string name="pref_alwaysvisible_title">Keyboard always visible</string>
+ <string name="pref_alwaysvisible_summary">Always show the special keys</string>
</resources>
diff --git a/app/src/main/res/xml-v14/preferences.xml b/app/src/main/res/xml-v14/preferences.xml
index 9e76c36..b1eb274 100644
--- a/app/src/main/res/xml-v14/preferences.xml
+++ b/app/src/main/res/xml-v14/preferences.xml
@@ -114,7 +114,14 @@
<PreferenceCategory
android:title="@string/pref_keyboard_category">
- <SwitchPreference
+ <SwitchPreference
+ android:key="alwaysvisible"
+ android:title="@string/pref_alwaysvisible_title"
+ android:summary="@string/pref_alwaysvisible_summary"
+ android:defaultValue="false"
+ />
+
+ <SwitchPreference
android:key="shiftfkeys"
android:title="@string/pref_shiftfkeys_title"
android:summary="@string/pref_shiftfkeys_summary"
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index e87b263..a937b29 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -114,6 +114,13 @@
<PreferenceCategory
android:title="@string/pref_keyboard_category">
+ <org.connectbot.util.SwitchCompatPreference
+ android:key="alwaysvisible"
+ android:title="@string/pref_alwaysvisible_title"
+ android:summary="@string/pref_alwaysvisible_summary"
+ android:defaultValue="false"
+ />
+
<org.connectbot.util.SwitchCompatPreference
android:key="shiftfkeys"
android:title="@string/pref_shiftfkeys_title"