Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tmatz committed Feb 12, 2023
2 parents d76796f + 498f149 commit 52f3b93
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 21 deletions.
55 changes: 40 additions & 15 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
name: Android CI

on: [push]
on:
push:
release:
types: [published, prereleased]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: chmod +x ./gradlew && ./gradlew build

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: app
path: app/**/*.apk
- uses: actions/checkout@v3

- name: set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "8"

- name: Decode keystore
run: |
if [ -n "$KEYSTORE_BASE64" ]; then
echo "$KEYSTORE_BASE64" | base64 --decode > release.keystore
fi
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}

- name: Build with Gradle
run: chmod +x ./gradlew && ./gradlew build
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: app
path: app/**/*.apk

- name: Upload release assets
if: ${{ github.event_name == 'release' }}
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "app/**/*.apk"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ captures/

# Keystore files
*.jks
*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
Expand All @@ -49,3 +50,6 @@ google-services.json
freeline.py
freeline/
freeline_project_description.json

# vim tmp file
*.swp
13 changes: 12 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,21 @@ android {
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
storeFile rootProject.file('release.keystore')
storePassword System.getenv('KEYSTORE_PASSWORD')
keyAlias System.getenv('KEY_ALIAS')
keyPassword System.getenv('KEY_PASSWORD')
}
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (rootProject.file('release.keystore').exists()) {
signingConfig signingConfigs.release
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import android.view.inputmethod.*;

public class GestureInputMethod
extends InputMethodService
Expand Down Expand Up @@ -101,6 +102,15 @@ public void performEditorAction()
getCurrentInputConnection().performEditorAction(getEditorAction());
}

public void showInputMethodPicker()
{
InputMethodManager manager = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
if (manager != null)
{
manager.showInputMethodPicker();
}
}

public void sendText(String str)
{
getCurrentInputConnection().commitText(str, str.length());
Expand Down Expand Up @@ -238,13 +248,20 @@ private void setupExtendKey(final View view)

keyboardArea.setVisibility(View.INVISIBLE);

extendKey.setOnClickListener(
new OnClickListener()
{
extendKey.setOnTouchListener(
new OnTouchGestureListener(view.getContext())
{
@Override
public void onClick(View v)
public boolean onSingleTapUp(MotionEvent e)
{
toggleKeyboadOn();
return true;
}

@Override
public void onLongPress(MotionEvent e)
{
showInputMethodPicker();
}

private void toggleKeyboadOn()
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Hacker\'s Unistroke Keyboard</string>
<string name="app_name">Unistroke Keyboard</string>
<string name="ime_name">Unistroke</string>
</resources>

0 comments on commit 52f3b93

Please sign in to comment.