Skip to content

Commit

Permalink
Merge pull request #2002 from agnostic-apollo/termux-various-fixes-an…
Browse files Browse the repository at this point in the history
…d-improvements
  • Loading branch information
agnostic-apollo authored Apr 13, 2021
2 parents bbb6f44 + ae1c9ba commit 354fe19
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 44 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/termux/app/TermuxService.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.termux.shared.termux.TermuxConstants.TERMUX_APP.TERMUX_SERVICE;
import com.termux.shared.settings.preferences.TermuxAppSharedPreferences;
import com.termux.shared.shell.TermuxSession;
import com.termux.shared.shell.TermuxTerminalSessionClientBase;
import com.termux.shared.terminal.TermuxTerminalSessionClientBase;
import com.termux.shared.logger.Logger;
import com.termux.shared.notification.NotificationUtils;
import com.termux.shared.packages.PermissionUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.termux.shared.shell.TermuxSession;
import com.termux.shared.interact.DialogUtils;
import com.termux.app.TermuxActivity;
import com.termux.shared.shell.TermuxTerminalSessionClientBase;
import com.termux.shared.terminal.TermuxTerminalSessionClientBase;
import com.termux.shared.termux.TermuxConstants;
import com.termux.app.TermuxService;
import com.termux.shared.settings.properties.TermuxPropertyConstants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.termux.R;
import com.termux.app.TermuxActivity;
import com.termux.shared.shell.ShellUtils;
import com.termux.shared.terminal.TermuxTerminalViewClientBase;
import com.termux.shared.termux.TermuxConstants;
import com.termux.app.activities.ReportActivity;
import com.termux.app.models.ReportInfo;
Expand All @@ -35,7 +36,6 @@
import com.termux.terminal.KeyHandler;
import com.termux.terminal.TerminalEmulator;
import com.termux.terminal.TerminalSession;
import com.termux.view.TerminalViewClient;

import java.util.Arrays;
import java.util.Collections;
Expand All @@ -44,7 +44,7 @@

import androidx.drawerlayout.widget.DrawerLayout;

public class TermuxTerminalViewClient implements TerminalViewClient {
public class TermuxTerminalViewClient extends TermuxTerminalViewClientBase {

final TermuxActivity mActivity;

Expand Down Expand Up @@ -440,41 +440,4 @@ public void doPaste() {
session.getEmulator().paste(paste.toString());
}



@Override
public void logError(String tag, String message) {
Logger.logError(tag, message);
}

@Override
public void logWarn(String tag, String message) {
Logger.logWarn(tag, message);
}

@Override
public void logInfo(String tag, String message) {
Logger.logInfo(tag, message);
}

@Override
public void logDebug(String tag, String message) {
Logger.logDebug(tag, message);
}

@Override
public void logVerbose(String tag, String message) {
Logger.logVerbose(tag, message);
}

@Override
public void logStackTraceWithMessage(String tag, String message, Exception e) {
Logger.logStackTraceWithMessage(tag, message, e);
}

@Override
public void logStackTrace(String tag, Exception e) {
Logger.logStackTrace(tag, e);
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.termux.shared.shell;
package com.termux.shared.terminal;

import com.termux.shared.logger.Logger;
import com.termux.terminal.TerminalSession;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package com.termux.shared.terminal;

import android.view.KeyEvent;
import android.view.MotionEvent;

import com.termux.shared.logger.Logger;
import com.termux.terminal.TerminalSession;
import com.termux.view.TerminalViewClient;

public class TermuxTerminalViewClientBase implements TerminalViewClient {

public TermuxTerminalViewClientBase() {
}

@Override
public float onScale(float scale) {
return 1.0f;
}

@Override
public void onSingleTapUp(MotionEvent e) {
}

public boolean shouldBackButtonBeMappedToEscape() {
return false;
}

public boolean shouldEnforceCharBasedInput() {
return false;
}

public boolean shouldUseCtrlSpaceWorkaround() {
return false;
}

@Override
public void copyModeChanged(boolean copyMode) {
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent e, TerminalSession session) {
return false;
}

@Override
public boolean onKeyUp(int keyCode, KeyEvent e) {
return false;
}

@Override
public boolean onLongPress(MotionEvent event) {
return false;
}

@Override
public boolean readControlKey() {
return false;
}

@Override
public boolean readAltKey() {
return false;
}

@Override
public boolean onCodePoint(int codePoint, boolean ctrlDown, TerminalSession session) {
return false;
}

@Override
public void logError(String tag, String message) {
Logger.logError(tag, message);
}

@Override
public void logWarn(String tag, String message) {
Logger.logWarn(tag, message);
}

@Override
public void logInfo(String tag, String message) {
Logger.logInfo(tag, message);
}

@Override
public void logDebug(String tag, String message) {
Logger.logDebug(tag, message);
}

@Override
public void logVerbose(String tag, String message) {
Logger.logVerbose(tag, message);
}

@Override
public void logStackTraceWithMessage(String tag, String message, Exception e) {
Logger.logStackTraceWithMessage(tag, message, e);
}

@Override
public void logStackTrace(String tag, Exception e) {
Logger.logStackTrace(tag, e);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ subscribed_repositories() {
else
echo "#### sources.list.d/$(basename "$filename")"
fi
echo "\`$supl_sources\`"
echo "\`$supl_sources\` "
fi
done < <(find "@TERMUX_PREFIX@/etc/apt/sources.list.d" -maxdepth 1 ! -type d)
}
Expand All @@ -37,7 +37,7 @@ updatable_packages() {
if [ -z "$updatable" ];then
echo "All packages up to date"
else
echo "\`$updatable\`"
echo $'```\n'"$updatable"$'\n```\n'
fi
fi
}
Expand All @@ -50,6 +50,7 @@ $(subscribed_repositories)
### Updatable Packages
$(updatable_packages)
##
Expand Down

0 comments on commit 354fe19

Please sign in to comment.