Squash bugs and set up workflow

This commit is contained in:
Suhan G Paradkar 2021-05-27 13:37:26 +05:30 committed by Wisest_wizard
parent d13faa8924
commit f41c0357d3
4 changed files with 70 additions and 2 deletions

26
.github/workflows/debug_build.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Build
on:
push:
branches:
- master
- android-10
pull_request:
branches:
- master
- android-10
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Build
run: |
./gradlew assembleDebug
- name: Store generated APK file
uses: actions/upload-artifact@v2
with:
name: termux-x11
path: ./app/build/outputs/apk/debug

View File

@ -0,0 +1,19 @@
name: "Validate Gradle Wrapper"
on:
push:
branches:
- master
- android-10
pull_request:
branches:
- master
- android-10
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1

21
.github/workflows/run_tests.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Unit tests
on:
push:
branches:
- master
- android-10
pull_request:
branches:
- master
- android-10
jobs:
testing:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Execute tests
run: |
./gradlew test

View File

@ -30,6 +30,8 @@ import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.widget.Toast;
import android.graphics.PixelFormat;
@SuppressWarnings({"ConstantConditions", "SameParameterValue"})
@SuppressLint({"ClickableViewAccessibility", "StaticFieldLeak"})
@ -234,14 +236,14 @@ public class LorieService extends Service {
@SuppressWarnings("SameParameterValue")
private static class ServiceEventListener implements SurfaceHolder.Callback, View.OnTouchListener, View.OnKeyListener, View.OnHoverListener, View.OnGenericMotionListener, TouchParser.OnTouchParseListener {
LorieService svc;
private void setAsListenerTo(SurfaceView view) {
view.getHolder().addCallback(this);
view.setOnTouchListener(this);
view.setOnHoverListener(this);
view.setOnGenericMotionListener(this);
view.setOnKeyListener(this);
surfaceChanged(view.getHolder(), 0, view.getWidth(), view.getHeight());
surfaceChanged(view.getHolder(), PixelFormat.UNKNOWN, view.getWidth(), view.getHeight());
}
public void onPointerButton(int button, int state) {