这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 30
defaultConfig {
applicationId "com.termux.x11"
minSdkVersion 24
Expand Down Expand Up @@ -59,4 +59,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
implementation 'com.termux.termux-app:termux-shared:master-SNAPSHOT'
implementation "com.google.guava:guava:24.1-jre"
}
202 changes: 0 additions & 202 deletions app/src/main/java/com/termux/x11/AdditionalKeyboardView.java

This file was deleted.

55 changes: 55 additions & 0 deletions app/src/main/java/com/termux/x11/Fullscreenworkaround.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.termux.x11;

import android.view.ViewTreeObserver;
import android.graphics.Rect;
import android.widget.FrameLayout;
import android.view.View;
import android.app.Activity;

public class Fullscreenworkaround {

// For more information, see https://issuetracker.google.com/issues/36911528
// To use this class, simply invoke assistActivity() on an Activity that already has its content view set.

public static void assistActivity (Activity activity) {
new Fullscreenworkaround(activity);
}

private View mChildOfContent;
private int usableHeightPrevious;
private FrameLayout.LayoutParams frameLayoutParams;

private Fullscreenworkaround(Activity activity) {
FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);
mChildOfContent = content.getChildAt(0);
mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
public void onGlobalLayout() {
possiblyResizeChildOfContent();
}
});
frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();
}

private void possiblyResizeChildOfContent() {
int usableHeightNow = computeUsableHeight();
if (usableHeightNow != usableHeightPrevious) {
int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();
int heightDifference = usableHeightSansKeyboard - usableHeightNow;
if (heightDifference > (usableHeightSansKeyboard/4)) {
// keyboard probably just became visible
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
} else {
// keyboard probably just became hidden
frameLayoutParams.height = usableHeightSansKeyboard;
}
mChildOfContent.requestLayout();
usableHeightPrevious = usableHeightNow;
}
}

private int computeUsableHeight() {
Rect r = new Rect();
mChildOfContent.getWindowVisibleDisplayFrame(r);
return (r.bottom - r.top);
}
}
20 changes: 9 additions & 11 deletions app/src/main/java/com/termux/x11/LorieService.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ public int onStartCommand(Intent intent, int flags, int startId) {
}

onPreferencesChanged();

return START_REDELIVER_INTENT;
}

Expand Down Expand Up @@ -399,7 +398,7 @@ public boolean onKey(View v, int keyCode, KeyEvent e) {
svc.pointerButton(TouchParser.BTN_RIGHT, (e.getAction() == KeyEvent.ACTION_DOWN) ? TouchParser.ACTION_DOWN : TouchParser.ACTION_UP);
rightPressed = (e.getAction() == KeyEvent.ACTION_DOWN);
} else if (e.getAction() == KeyEvent.ACTION_UP) {
if (act.kbd!=null) act.kbd.requestFocus();
if (act.getTerminalToolbarViewPager()!=null) act.getTerminalToolbarViewPager().requestFocus();
KeyboardUtils.toggleKeyboardVisibility(act);
}
return true;
Expand Down Expand Up @@ -505,36 +504,35 @@ public static void unzip(InputStream zipStream, File targetDirectory) throws IOE

private void windowChanged(Surface s, int w, int h, int pw, int ph) {windowChanged(compositor, s, w, h, pw, ph);}
private native void windowChanged(long compositor, Surface surface, int width, int height, int mmWidth, int mmHeight);

private void touchDown(int id, float x, float y) { touchDown(compositor, id, (int) x, (int) y); }
private native void touchDown(long compositor, int id, int x, int y);

private void touchMotion(int id, float x, float y) { touchMotion(compositor, id, (int) x, (int) y); }
private native void touchMotion(long compositor, int id, int x, int y);

private void touchUp(int id) { touchUp(compositor, id); }
private native void touchUp(long compositor, int id);

private void touchFrame() { touchFrame(compositor); }
private native void touchFrame(long compositor);

private void pointerMotion(float x, float y) { pointerMotion(compositor, (int) x, (int) y); }
private native void pointerMotion(long compositor, int x, int y);

private void pointerScroll(int axis, float value) { pointerScroll(compositor, axis, value); }
private native void pointerScroll(long compositor, int axis, float value);

private void pointerButton(int button, int type) { pointerButton(compositor, button, type); }
private native void pointerButton(long compositor, int button, int type);

private void keyboardKey(int key, int type, int shift, String characters) {keyboardKey(compositor, key, type, shift, characters);}
private native void keyboardKey(long compositor, int key, int type, int shift, String characters);

private void passWaylandFD(int fd) {passWaylandFD(compositor, fd);}
private native void passWaylandFD(long compositor, int fd);

private native long createLorieThread();

private native void terminate(long compositor);

public static native void startLogcatForFd(int fd);
Expand Down
Loading