Skip to content

Commit

Permalink
Merge branch 'master' into context/options
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdurdin authored Sep 25, 2024
2 parents 035af72 + 98566b4 commit 0b09ffa
Show file tree
Hide file tree
Showing 1,395 changed files with 51,823 additions and 20,764 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: AllDefinitions
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
Expand Down Expand Up @@ -58,7 +58,7 @@ ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
Expand Down
6 changes: 2 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ common/:
- common/**
- resources/**

common/models/: common/models/**
common/models/types/: common/models/types/**
common/models/templates/: common/models/templates/**
common/models/wordbreakers/: common/models/wordbreakers/**
common/models/templates/: web/src/engine/predictive-text/templates/**
common/models/wordbreakers/: web/src/engine/predictive-text/wordbreakers/**

common/resources/: resources/**
common/web/: common/web/**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deb-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
strategy:
fail-fast: true
matrix:
dist: [focal, jammy, mantic, noble]
dist: [focal, jammy, noble]

steps:
- name: Checkout
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,3 @@ lcov.info
/keyman*.buildinfo
/keyman*.changes
/keyman*.tar.?z

579 changes: 575 additions & 4 deletions HISTORY.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# License

Copyright (c) 2017-2022 SIL International. All rights reserved.
Copyright (c) 2017-2024 SIL Global. All rights reserved.

Licensed under the MIT License.

Expand All @@ -10,7 +10,7 @@ Licensed under the MIT License.

The MIT License

Copyright (c) 2017-2022 SIL International
Copyright (c) 2017-2024 SIL Global

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# License

Copyright (c) SIL International.
Copyright (c) SIL Global.

Keyman is an open source project distributed under the [MIT license](LICENSE.md).

Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.0.51
18.0.118
2 changes: 0 additions & 2 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ KMEA/**/assets/keymanandroid.js
KMEA/**/assets/keyman.js.map
KMEA/**/assets/keymanweb-webview.js
KMEA/**/assets/keymanweb-webview.js.map
KMEA/**/assets/keymanweb-webview.es5.js
KMEA/**/assets/keymanweb-webview.es5.js.map
KMEA/**/assets/map-polyfill.js
KMEA/**/assets/sentry.min.js
KMEA/**/assets/keyman-sentry.js
Expand Down
10 changes: 6 additions & 4 deletions android/KMAPro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
flatDir {
dirs "kMAPro/libs/com/stepstone/stepper/material-stepper/4.3.1/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
// sentry-android-gradle-plugin 2.1.5+ requires AGP 7.0
classpath 'io.sentry:sentry-android-gradle-plugin:4.6.0'
classpath 'name.remal:gradle-plugins:1.5.0'

// From jcenter() which could be sunset in future
// From jcenter() which was deprecated August 2024
// https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
classpath 'com.stepstone.stepper:material-stepper:4.3.1'
classpath 'com.stepstone.stepper:material-stepper:4.3.1@aar'
}
}

allprojects {
repositories {
maven { url uri("${projectDir}/libs") }
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
Expand Down
13 changes: 13 additions & 0 deletions android/KMAPro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "$KEYMAN_ROOT/resources/build/build-help.inc.sh"
. "$KEYMAN_ROOT/resources/build/build-download-resources.sh"

. "$KEYMAN_ROOT/android/KMAPro/build-play-store-notes.inc.sh"

# ################################ Main script ################################

# Definition of global compile constants
Expand All @@ -25,6 +27,7 @@ builder_describe "Builds Keyman for Android app." \
"configure" \
"build" \
"test Runs lint and unit tests." \
"publish Publishes symbols to Sentry and the APK to the Play Store." \
"--ci Don't start the Gradle daemon. For CI" \
"--upload-sentry Upload to sentry"

Expand Down Expand Up @@ -109,3 +112,13 @@ if builder_start_action test; then

builder_finish_action success test
fi

if builder_start_action publish; then
# Copy Release Notes
generateReleaseNotes

# Publish symbols and Keyman for Android to Play Store
./gradlew $DAEMON_FLAG publishSentry publishReleaseApk

builder_finish_action success publish
fi
18 changes: 11 additions & 7 deletions android/KMAPro/kMAPro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,17 @@ android {
}

// how to configure the sentry android gradle plugin
sentry {
// Disables or enables the automatic configuration of Native symbols
uploadNativeSymbols = true

// Does or doesn't include the source code of native code for Sentry
includeNativeSources = true
task publishSentry {
doLast {
println 'Publishing Keyman symbols to Sentry'
sentry {
// Disables or enables the automatic configuration of Native symbols
uploadNativeSymbols = true

// Does or doesn't include the source code of native code for Sentry
includeNativeSources = true
}
}
}

String env_keys_json_file = System.getenv("keys_json_file")
Expand Down Expand Up @@ -145,7 +150,6 @@ repositories {
dirs 'libs'
}
google()
jcenter()
}

dependencies {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.stepstone.stepper</groupId>
<artifactId>material-stepper</artifactId>
<version>4.3.1</version>
<packaging>aar</packaging>
<name>Android Material Stepper</name>
<description>This library allows to use Material steppers inside Android applications.</description>
<url>https://github.com/stepstone-tech/android-material-stepper</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<id>zawadz88</id>
<name>Piotr Zawadzki</name>
<email>[email protected]</email>
</developer>
</developers>
<scm>
<connection>https://github.com/stepstone-tech/android-material-stepper.git</connection>
<developerConnection>https://github.com/stepstone-tech/android-material-stepper.git</developerConnection>
<url>https://github.com/stepstone-tech/android-material-stepper</url>
</scm>
<dependencies>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>25.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.7.21</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.assertj</groupId>
<artifactId>assertj-android</artifactId>
<version>1.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>3.3.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jre7</artifactId>
<version>1.1.4-3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>1.1.4-3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.nhaarman</groupId>
<artifactId>mockito-kotlin</artifactId>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
5 changes: 5 additions & 0 deletions android/KMAPro/kMAPro/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@
android:configChanges="orientation"
android:label="@string/app_name"
android:theme="@style/AppTheme.Base" />
<activity
android:name=".AdjustLongpressDelayActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:theme="@style/AppTheme.Base" />

<!-- Put other WebViewActivities in a separate process so the Keyboard WebView doesn't lag.
Ref https://stackoverflow.com/questions/40650643/timed-out-waiting-on-iinputcontextcallback-with-custom-keyboard-on-android -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package com.keyman.android;

import com.tavultesoft.kmapro.AdjustLongpressDelayActivity;
import com.tavultesoft.kmapro.BuildConfig;
import com.tavultesoft.kmapro.DefaultLanguageResource;
import com.tavultesoft.kmapro.KeymanSettingsActivity;
Expand Down Expand Up @@ -147,14 +148,23 @@ public void onStartInput(EditorInfo attribute, boolean restarting) {
KMManager.onStartInput(attribute, restarting);
KMManager.resetContext(KeyboardType.KEYBOARD_TYPE_SYSTEM);

// This method (likely) includes the IME equivalent to `onResume` for `Activity`-based classes,
// making it an important time to detect orientation changes.
Context appContext = getApplicationContext();
int newOrientation = KMManager.getOrientation(appContext);
if(newOrientation != lastOrientation) {
lastOrientation = newOrientation;
Configuration newConfig = this.getResources().getConfiguration();
KMManager.onConfigurationChanged(newConfig);
}

// Temporarily disable predictions on certain fields (e.g. hidden password field or numeric)
int inputType = attribute.inputType;
KMManager.setMayPredictOverride(inputType);
if (KMManager.getMayPredictOverride()) {
KMManager.setBannerOptions(false);
} else if (KMManager.isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)){
// Check if predictions needs to be re-enabled per Settings preference
Context appContext = getApplicationContext();
Keyboard kbInfo = KMManager.getCurrentKeyboardInfo(appContext);
if (kbInfo != null) {
String langId = kbInfo.getLanguageID();
Expand All @@ -166,12 +176,15 @@ public void onStartInput(EditorInfo attribute, boolean restarting) {
}
}

// Determine special handling for ENTER key
KMManager.setEnterMode(attribute.imeOptions, inputType);

InputConnection ic = getCurrentInputConnection();
if (ic != null) {
ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0);
/*
We do sometimes receive null `icText.text`, even though
getExtractedText() docs does not list this as a possible
getExtractedText() docs does not list this as a possible
return value, so we test for that as well (#11479)
*/
if (icText != null && icText.text != null) {
Expand Down Expand Up @@ -199,15 +212,6 @@ public void onUpdateExtractingVisibility(EditorInfo ei) {
super.onUpdateExtractingVisibility(ei);
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation != lastOrientation) {
lastOrientation = newConfig.orientation;
KMManager.onConfigurationChanged(newConfig);
}
}

@Override
public void onConfigureWindow(Window win, boolean isFullscreen, boolean isCandidatesOnly) {
super.onConfigureWindow(win, isFullscreen, isCandidatesOnly);
Expand Down Expand Up @@ -244,6 +248,8 @@ public void onKeyboardLoaded(KeyboardType keyboardType) {
if (exText != null)
exText = null;
}
// Initialize keyboard options
KMManager.sendOptionsToKeyboard();
}

@Override
Expand Down
Loading

0 comments on commit 0b09ffa

Please sign in to comment.