mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-08 19:46:10 +01:00
Reformat all code in float/, getting rid of tabs
This commit is contained in:
parent
af8b269b51
commit
5cd705d6d1
6 changed files with 256 additions and 240 deletions
|
|
@ -3,7 +3,9 @@ package com.termux.window;
|
|||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
|
||||
/** Simple activity which immediately launches {@link TermuxFloatService} and exits. */
|
||||
/**
|
||||
* Simple activity which immediately launches {@link TermuxFloatService} and exits.
|
||||
*/
|
||||
public class TermuxFloatActivity extends Activity {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ import com.termux.view.TerminalKeyListener;
|
|||
public class TermuxFloatKeyListener implements TerminalKeyListener {
|
||||
|
||||
private final TermuxFloatView view;
|
||||
/** Keeping track of the special keys acting as Ctrl and Fn for the soft keyboard and other hardware keys. */
|
||||
/**
|
||||
* Keeping track of the special keys acting as Ctrl and Fn for the soft keyboard and other hardware keys.
|
||||
*/
|
||||
boolean mVirtualControlKeyDown, mVirtualFnKeyDown;
|
||||
|
||||
public TermuxFloatKeyListener(TermuxFloatView view) {
|
||||
|
|
@ -195,7 +197,9 @@ public class TermuxFloatKeyListener implements TerminalKeyListener {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** Handle dedicated volume buttons as virtual keys if applicable. */
|
||||
/**
|
||||
* Handle dedicated volume buttons as virtual keys if applicable.
|
||||
*/
|
||||
private boolean handleVirtualKeys(int keyCode, KeyEvent event, boolean down) {
|
||||
InputDevice inputDevice = event.getDevice();
|
||||
if (inputDevice != null && inputDevice.getKeyboardType() == InputDevice.KEYBOARD_TYPE_ALPHABETIC) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ public class TermuxFloatView extends LinearLayout {
|
|||
|
||||
TerminalView mTerminalView;
|
||||
|
||||
/** The last toast shown, used cancel current toast before showing new in {@link #showToast(String, boolean)}. */
|
||||
/**
|
||||
* The last toast shown, used cancel current toast before showing new in {@link #showToast(String, boolean)}.
|
||||
*/
|
||||
Toast mLastToast;
|
||||
|
||||
private boolean withFocus = true;
|
||||
|
|
@ -118,7 +120,9 @@ public class TermuxFloatView extends LinearLayout {
|
|||
showTouchKeyboard();
|
||||
}
|
||||
|
||||
/** Intercept touch events to obtain and loose focus on touch events. */
|
||||
/**
|
||||
* Intercept touch events to obtain and loose focus on touch events.
|
||||
*/
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent event) {
|
||||
if (isInLongPressState) return true;
|
||||
|
|
@ -164,7 +168,9 @@ public class TermuxFloatView extends LinearLayout {
|
|||
}
|
||||
}
|
||||
|
||||
/** Motion events should only be dispatched here when {@link #onInterceptTouchEvent(MotionEvent)} returns true. */
|
||||
/**
|
||||
* Motion events should only be dispatched here when {@link #onInterceptTouchEvent(MotionEvent)} returns true.
|
||||
*/
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
|
|
@ -187,7 +193,9 @@ public class TermuxFloatView extends LinearLayout {
|
|||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
/** Visually indicate focus and show the soft input as needed. */
|
||||
/**
|
||||
* Visually indicate focus and show the soft input as needed.
|
||||
*/
|
||||
void changeFocus(boolean newFocus) {
|
||||
if (newFocus == withFocus) {
|
||||
if (newFocus) showTouchKeyboard();
|
||||
|
|
@ -199,7 +207,9 @@ public class TermuxFloatView extends LinearLayout {
|
|||
setAlpha(newFocus ? ALPHA_FOCUS : ALPHA_NOT_FOCUS);
|
||||
}
|
||||
|
||||
/** Show a toast and dismiss the last one if still visible. */
|
||||
/**
|
||||
* Show a toast and dismiss the last one if still visible.
|
||||
*/
|
||||
void showToast(String text, boolean longDuration) {
|
||||
if (mLastToast != null) mLastToast.cancel();
|
||||
mLastToast = Toast.makeText(getContext(), text, longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue