Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdae272214 | ||
|
|
b7864d6ac2 | ||
|
|
d1f0c76db3 | ||
|
|
5652624fc2 | ||
|
|
35a9101f84 | ||
|
|
2b6a10712b | ||
|
|
c80e126b8f |
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
* text=auto
|
||||||
|
*.bat eol=crlf
|
||||||
|
*.sh eol=lf
|
||||||
@@ -13,8 +13,8 @@ android {
|
|||||||
applicationId "com.termux"
|
applicationId "com.termux"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode 63
|
versionCode 64
|
||||||
versionName "0.63"
|
versionName "0.64"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.termux.app;
|
package com.termux.app;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Build;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
import android.view.Gravity;
|
|
||||||
import android.view.HapticFeedbackConstants;
|
import android.view.HapticFeedbackConstants;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
@@ -28,8 +28,8 @@ import com.termux.view.TerminalView;
|
|||||||
public final class ExtraKeysView extends GridLayout {
|
public final class ExtraKeysView extends GridLayout {
|
||||||
|
|
||||||
private static final int TEXT_COLOR = 0xFFFFFFFF;
|
private static final int TEXT_COLOR = 0xFFFFFFFF;
|
||||||
private static final int BUTTON_COLOR = 0xFF000000;
|
private static final int BUTTON_COLOR = 0x00000000;
|
||||||
private static final int BUTTON_PRESSED_COLOR = 0xFF888888;
|
private static final int BUTTON_PRESSED_COLOR = 0x7FFFFFFF;
|
||||||
|
|
||||||
public ExtraKeysView(Context context, AttributeSet attrs) {
|
public ExtraKeysView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -269,9 +269,13 @@ public final class ExtraKeysView extends GridLayout {
|
|||||||
});
|
});
|
||||||
|
|
||||||
LayoutParams param = new GridLayout.LayoutParams();
|
LayoutParams param = new GridLayout.LayoutParams();
|
||||||
param.width = param.height = 0;
|
param.width = 0;
|
||||||
|
if(Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP){ //special handle api 21
|
||||||
|
param.height = (int)(37.5 * getResources().getDisplayMetrics().density + 0.5); // 37.5 equal to R.id.viewpager layout_heihgt / rows in DP
|
||||||
|
}else{
|
||||||
|
param.height = 0;
|
||||||
|
}
|
||||||
param.setMargins(0, 0, 0, 0);
|
param.setMargins(0, 0, 0, 0);
|
||||||
param.setGravity(Gravity.LEFT);
|
|
||||||
param.columnSpec = GridLayout.spec(col, GridLayout.FILL, 1.f);
|
param.columnSpec = GridLayout.spec(col, GridLayout.FILL, 1.f);
|
||||||
param.rowSpec = GridLayout.spec(row, GridLayout.FILL, 1.f);
|
param.rowSpec = GridLayout.spec(row, GridLayout.FILL, 1.f);
|
||||||
button.setLayoutParams(param);
|
button.setLayoutParams(param);
|
||||||
|
|||||||
@@ -209,18 +209,18 @@ final class TermuxInstaller {
|
|||||||
Arrays.toString(Build.SUPPORTED_ABIS));
|
Arrays.toString(Build.SUPPORTED_ABIS));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Delete a folder and all its content or throw. */
|
/** Delete a folder and all its content or throw. Don't follow symlinks. */
|
||||||
static void deleteFolder(File fileOrDirectory) throws IOException {
|
static void deleteFolder(File fileOrDirectory) throws IOException {
|
||||||
File[] children = fileOrDirectory.listFiles();
|
if (fileOrDirectory.getCanonicalPath().equals(fileOrDirectory.getAbsolutePath()) && fileOrDirectory.isDirectory()) {
|
||||||
if (children != null) {
|
File[] children = fileOrDirectory.listFiles();
|
||||||
for (File child : children) {
|
|
||||||
if (child.getCanonicalFile().equals(child.getAbsoluteFile())) {
|
if (children != null) {
|
||||||
|
for (File child : children) {
|
||||||
deleteFolder(child);
|
deleteFolder(child);
|
||||||
} else {
|
|
||||||
child.delete();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fileOrDirectory.delete()) {
|
if (!fileOrDirectory.delete()) {
|
||||||
throw new RuntimeException("Unable to delete " + (fileOrDirectory.isDirectory() ? "directory " : "file ") + fileOrDirectory.getAbsolutePath());
|
throw new RuntimeException("Unable to delete " + (fileOrDirectory.isDirectory() ? "directory " : "file ") + fileOrDirectory.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import android.text.InputType;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.accessibility.AccessibilityManager;
|
||||||
import android.view.ActionMode;
|
import android.view.ActionMode;
|
||||||
import android.view.HapticFeedbackConstants;
|
import android.view.HapticFeedbackConstants;
|
||||||
import android.view.InputDevice;
|
import android.view.InputDevice;
|
||||||
@@ -75,6 +76,8 @@ public final class TerminalView extends View {
|
|||||||
/** If non-zero, this is the last unicode code point received if that was a combining character. */
|
/** If non-zero, this is the last unicode code point received if that was a combining character. */
|
||||||
int mCombiningAccent;
|
int mCombiningAccent;
|
||||||
|
|
||||||
|
private boolean mAccessibilityEnabled;
|
||||||
|
|
||||||
public TerminalView(Context context, AttributeSet attributes) { // NO_UCD (unused code)
|
public TerminalView(Context context, AttributeSet attributes) { // NO_UCD (unused code)
|
||||||
super(context, attributes);
|
super(context, attributes);
|
||||||
mGestureRecognizer = new GestureAndScaleRecognizer(context, new GestureAndScaleRecognizer.Listener() {
|
mGestureRecognizer = new GestureAndScaleRecognizer(context, new GestureAndScaleRecognizer.Listener() {
|
||||||
@@ -197,6 +200,8 @@ public final class TerminalView extends View {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
mScroller = new Scroller(context);
|
mScroller = new Scroller(context);
|
||||||
|
AccessibilityManager am = (AccessibilityManager) context.getSystemService(context.ACCESSIBILITY_SERVICE);
|
||||||
|
mAccessibilityEnabled = am.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -384,6 +389,7 @@ public final class TerminalView extends View {
|
|||||||
mEmulator.clearScrollCounter();
|
mEmulator.clearScrollCounter();
|
||||||
|
|
||||||
invalidate();
|
invalidate();
|
||||||
|
if (mAccessibilityEnabled) setContentDescription(getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -915,4 +921,8 @@ public final class TerminalView extends View {
|
|||||||
return mTermSession;
|
return mTermSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CharSequence getText() {
|
||||||
|
return mEmulator.getScreen().getSelectedText(0, mTopRow, mEmulator.mColumns, mTopRow +mEmulator.mRows);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user