aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authoralescdb <alescdb@users.noreply.github.com>2015-08-22 22:19:50 +0200
committeralescdb <alescdb@users.noreply.github.com>2015-08-22 22:19:50 +0200
commite8786cac42d92f0efa32a84417b4470e79a96bb9 (patch)
tree8d4e2ec3a2979b60df9fc2f485d0dc83d6477934 /app
parent3f7146bf87b79cc6fd48cf79b65933199e24e9ba (diff)
downloadconnectbot-e8786cac42d92f0efa32a84417b4470e79a96bb9.tar.gz
connectbot-e8786cac42d92f0efa32a84417b4470e79a96bb9.tar.bz2
connectbot-e8786cac42d92f0efa32a84417b4470e79a96bb9.zip
Scroll hint to the end (F12 key)
Only show scroll hint if hard keyboard is not detected Conditional Log.d()
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/org/connectbot/ConsoleActivity.java50
1 files changed, 29 insertions, 21 deletions
diff --git a/app/src/main/java/org/connectbot/ConsoleActivity.java b/app/src/main/java/org/connectbot/ConsoleActivity.java
index ef47794..31ad68c 100644
--- a/app/src/main/java/org/connectbot/ConsoleActivity.java
+++ b/app/src/main/java/org/connectbot/ConsoleActivity.java
@@ -246,10 +246,12 @@ public class ConsoleActivity extends Activity implements BridgeDisconnectedListe
@Override
public boolean onTouch(View v, MotionEvent event) {
- Log.d(TAG, "KeyRepeater.onTouch(" + v.getId() + ", " +
- event.getAction() + ", " +
- event.getActionIndex() + ", " +
- event.getActionMasked() + ");");
+ if (BuildConfig.DEBUG) {
+ Log.d(TAG, "KeyRepeater.onTouch(" + v.getId() + ", " +
+ event.getAction() + ", " +
+ event.getActionIndex() + ", " +
+ event.getActionMasked() + ");");
+ }
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mDown = false;
@@ -593,24 +595,30 @@ public class ConsoleActivity extends Activity implements BridgeDisconnectedListe
}
});
- // Show virtual keyboard and scroll back and forth
- final HorizontalScrollView keyboardScroll = (HorizontalScrollView) findViewById(R.id.keyboard_hscroll);
- showEmulatedKeys();
- keyboardScroll.postDelayed(new Runnable() {
- @Override
- public void run() {
- final int xscroll = keyboardScroll.getMaxScrollAmount();
- Log.d(TAG, "smoothScrollBy(1)");
- keyboardScroll.smoothScrollBy(xscroll, 0);
- keyboardScroll.postDelayed(new Runnable() {
- @Override
- public void run() {
- Log.d(TAG, "smoothScrollBy(2)");
- keyboardScroll.smoothScrollBy(-xscroll, 0);
+ if(!hardKeyboard) {
+ // Show virtual keyboard and scroll back and forth
+ final HorizontalScrollView keyboardScroll = (HorizontalScrollView) findViewById(R.id.keyboard_hscroll);
+ showEmulatedKeys();
+ keyboardScroll.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ final int xscroll = findViewById(R.id.button_f12).getRight();
+ if (BuildConfig.DEBUG) {
+ Log.d(TAG, "smoothScrollBy(toEnd[" + xscroll + "])");
}
- }, 1000);
- }
- }, 1000);
+ keyboardScroll.smoothScrollBy(xscroll, 0);
+ keyboardScroll.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ if (BuildConfig.DEBUG) {
+ Log.d(TAG, "smoothScrollBy(toStart[" + (-xscroll) + "])");
+ }
+ keyboardScroll.smoothScrollBy(-xscroll, 0);
+ }
+ }, 1000);
+ }
+ }, 1000);
+ }
tabs = (TabLayout) findViewById(R.id.tabs);
if (tabs != null)