Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db13ea02b6 | ||
|
|
61a44dbfa8 | ||
|
|
aaa92279ca | ||
|
|
365f9723cc | ||
|
|
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"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
versionCode 63
|
||||
versionName "0.63"
|
||||
versionCode 65
|
||||
versionName "0.65"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.termux.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import android.view.Gravity;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
@@ -28,8 +28,8 @@ import com.termux.view.TerminalView;
|
||||
public final class ExtraKeysView extends GridLayout {
|
||||
|
||||
private static final int TEXT_COLOR = 0xFFFFFFFF;
|
||||
private static final int BUTTON_COLOR = 0xFF000000;
|
||||
private static final int BUTTON_PRESSED_COLOR = 0xFF888888;
|
||||
private static final int BUTTON_COLOR = 0x00000000;
|
||||
private static final int BUTTON_PRESSED_COLOR = 0x7FFFFFFF;
|
||||
|
||||
public ExtraKeysView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@@ -269,9 +269,13 @@ public final class ExtraKeysView extends GridLayout {
|
||||
});
|
||||
|
||||
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.setGravity(Gravity.LEFT);
|
||||
param.columnSpec = GridLayout.spec(col, GridLayout.FILL, 1.f);
|
||||
param.rowSpec = GridLayout.spec(row, GridLayout.FILL, 1.f);
|
||||
button.setLayoutParams(param);
|
||||
|
||||
@@ -209,18 +209,18 @@ final class TermuxInstaller {
|
||||
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 {
|
||||
File[] children = fileOrDirectory.listFiles();
|
||||
if (children != null) {
|
||||
for (File child : children) {
|
||||
if (child.getCanonicalFile().equals(child.getAbsoluteFile())) {
|
||||
if (fileOrDirectory.getCanonicalPath().equals(fileOrDirectory.getAbsolutePath()) && fileOrDirectory.isDirectory()) {
|
||||
File[] children = fileOrDirectory.listFiles();
|
||||
|
||||
if (children != null) {
|
||||
for (File child : children) {
|
||||
deleteFolder(child);
|
||||
} else {
|
||||
child.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!fileOrDirectory.delete()) {
|
||||
throw new RuntimeException("Unable to delete " + (fileOrDirectory.isDirectory() ? "directory " : "file ") + fileOrDirectory.getAbsolutePath());
|
||||
}
|
||||
|
||||
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/ic_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_foreground"/>
|
||||
</adaptive-icon>
|
||||
BIN
app/src/main/res/mipmap/ic_background.png
Normal file
BIN
app/src/main/res/mipmap/ic_background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 700 B |
BIN
app/src/main/res/mipmap/ic_foreground.png
Normal file
BIN
app/src/main/res/mipmap/ic_foreground.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -15,6 +15,7 @@ import android.text.InputType;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.view.ActionMode;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
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. */
|
||||
int mCombiningAccent;
|
||||
|
||||
private boolean mAccessibilityEnabled;
|
||||
|
||||
public TerminalView(Context context, AttributeSet attributes) { // NO_UCD (unused code)
|
||||
super(context, attributes);
|
||||
mGestureRecognizer = new GestureAndScaleRecognizer(context, new GestureAndScaleRecognizer.Listener() {
|
||||
@@ -197,6 +200,8 @@ public final class TerminalView extends View {
|
||||
}
|
||||
});
|
||||
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();
|
||||
|
||||
invalidate();
|
||||
if (mAccessibilityEnabled) setContentDescription(getText());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -594,7 +600,7 @@ public final class TerminalView extends View {
|
||||
if (controlDownFromEvent) keyMod |= KeyHandler.KEYMOD_CTRL;
|
||||
if (event.isAltPressed()) keyMod |= KeyHandler.KEYMOD_ALT;
|
||||
if (event.isShiftPressed()) keyMod |= KeyHandler.KEYMOD_SHIFT;
|
||||
if (handleKeyCode(keyCode, keyMod)) {
|
||||
if (!event.isFunctionPressed() && handleKeyCode(keyCode, keyMod)) {
|
||||
if (LOG_KEY_EVENTS) Log.i(EmulatorDebug.LOG_TAG, "handleKeyCode() took key event");
|
||||
return true;
|
||||
}
|
||||
@@ -613,7 +619,7 @@ public final class TerminalView extends View {
|
||||
if (LOG_KEY_EVENTS)
|
||||
Log.i(EmulatorDebug.LOG_TAG, "KeyEvent#getUnicodeChar(" + effectiveMetaState + ") returned: " + result);
|
||||
if (result == 0) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int oldCombiningAccent = mCombiningAccent;
|
||||
@@ -915,4 +921,8 @@ public final class TerminalView extends View {
|
||||
return mTermSession;
|
||||
}
|
||||
|
||||
private CharSequence getText() {
|
||||
return mEmulator.getScreen().getSelectedText(0, mTopRow, mEmulator.mColumns, mTopRow +mEmulator.mRows);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user