Release Boxcars v1.3.3 for Android

This commit is contained in:
Trevor Slocum 2024-04-19 11:00:29 -07:00
parent 61dd96baa5
commit ed32bc8ff4
3 changed files with 59 additions and 6 deletions

View file

@ -1,7 +1,7 @@
#!/bin/bash
LOCK_BIND=76ac6878050a2eef81867f2c6c21108e59919e8f
LOCK_EBITENGINE=2c967dd24e63b388479c71f2648418c14f7b94b7
LOCK_BIND=09dbf07665ed261ce09d387a5a9aea3e9c29069c
LOCK_EBITENGINE=f20fb3998c49877e8707cc2d5abe0e2216515bd2
export PROJECTPATH=$PWD
export GOPATH="$PROJECTPATH/go"

View file

@ -3,7 +3,7 @@ plugins {
}
project.ext {
boxcarsVersion = "v1.3.2" // https://code.rocket9labs.com/tslocum/boxcars/tags
boxcarsVersion = "v1.3.3" // https://code.rocket9labs.com/tslocum/boxcars/tags
}
android {
@ -17,8 +17,8 @@ android {
applicationId "com.rocket9labs.boxcars"
minSdkVersion 21
targetSdkVersion 34
versionCode 103020
versionName "1.3.2"
versionCode 103030
versionName "1.3.3"
}
buildTypes {

View file

@ -9,13 +9,22 @@ import android.view.inputmethod.InputMethodManager;
import com.rocket9labs.boxcars.mobile.EbitenView;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import go.Seq;
public class MainActivity extends Activity {
private static final int backButtonLongPress = 2000; // Milliseconds.
private long backButtonPressed;
private long keyPressed;
private final Handler handler = new Handler();
private Handler handler = new Handler();
private final Runnable exitRunnable = new Runnable() {
@Override
public void run() {
@ -23,6 +32,24 @@ public class MainActivity extends Activity {
}
};
private final Runnable showKeyboard = new Runnable() {
@Override
public void run() {
InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.toggleSoftInputFromWindow(getEbitenView().getWindowToken(), 0, InputMethodManager.HIDE_IMPLICIT_ONLY);
getEbitenView().requestFocus();
}
};
private final Runnable hideKeyboard = new Runnable() {
@Override
public void run() {
InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getEbitenView().getWindowToken(), 0);
getEbitenView().requestFocus();
}
};
private EbitenView getEbitenView() {
return this.findViewById(R.id.ebitenView);
}
@ -30,6 +57,32 @@ public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Thread thread = new Thread(new Runnable(){
@Override
public void run(){
try {
ServerSocket serverSocket = new ServerSocket(1337, 0, InetAddress.getByName("localhost"));
Socket socket = serverSocket.accept();
InputStream input = socket.getInputStream();
PrintWriter writer = new PrintWriter(socket.getOutputStream());
writer.write("boxcars\n");
writer.flush();
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
while (true) {
String line = reader.readLine();
if (line.equals("1")) {
runOnUiThread(showKeyboard);
} else if (line.equals("0")) {
runOnUiThread(hideKeyboard);
}
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
});
thread.start();
Seq.setContext(getApplicationContext());
setContentView(R.layout.activity_main);
getEbitenView().requestFocus();