aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-10-10 00:00:11 -0700
committerKenny Root <kenny@the-b.org>2015-10-13 21:26:30 -0700
commit8898ad7c99637ad84d588a7520f65d2d89ac1567 (patch)
tree4c6d162d185f7a24a7240dfc43547f7e659b2d3f
parentccc10dffefa2eaab6cb67e1f1ebf71909e8310ec (diff)
downloadconnectbot-8898ad7c99637ad84d588a7520f65d2d89ac1567.tar.gz
connectbot-8898ad7c99637ad84d588a7520f65d2d89ac1567.tar.bz2
connectbot-8898ad7c99637ad84d588a7520f65d2d89ac1567.zip
Move setting of hardware acceleration to view that needs it
Hardware acceleration was previously disabled for the entire activity, but we only need it specifically for TerminalView.
-rw-r--r--app/src/main/AndroidManifest.xml1
-rw-r--r--app/src/main/java/org/connectbot/TerminalView.java14
2 files changed, 14 insertions, 1 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index dd9db1f..ceaffd2 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -170,7 +170,6 @@
<activity
android:name=".ConsoleActivity"
android:configChanges="keyboardHidden|orientation"
- android:hardwareAccelerated="false"
android:launchMode="singleTop"
android:theme="@style/Theme.AppCompat"
android:windowSoftInputMode="stateAlwaysVisible|adjustResize">
diff --git a/app/src/main/java/org/connectbot/TerminalView.java b/app/src/main/java/org/connectbot/TerminalView.java
index 026fac7..44b5810 100644
--- a/app/src/main/java/org/connectbot/TerminalView.java
+++ b/app/src/main/java/org/connectbot/TerminalView.java
@@ -57,6 +57,7 @@ import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
+import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
@@ -137,6 +138,14 @@ public class TerminalView extends TextView implements FontSizeChangedListener {
setFocusable(true);
setFocusableInTouchMode(true);
+ // Some things TerminalView uses is unsupported in hardware acceleration
+ // so this is using software rendering until we can replace all the
+ // instances.
+ // See: https://developer.android.com/guide/topics/graphics/hardware-accel.html#unsupported
+ if (Build.VERSION.SDK_INT >= 11) {
+ setLayerTypeToSoftware();
+ }
+
paint = new Paint();
cursorPaint = new Paint();
@@ -251,6 +260,11 @@ public class TerminalView extends TextView implements FontSizeChangedListener {
}
@TargetApi(11)
+ private void setLayerTypeToSoftware() {
+ setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+ }
+
+ @TargetApi(11)
private void closeSelectionActionMode() {
if (selectionActionMode != null) {
selectionActionMode.finish();