Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
528fa21
CI: Lint + unit tests, build sample, and run translation check
jihanurrahman33 Sep 3, 2025
6246ce9
CI: Add Gradle wrapper validation workflow
jihanurrahman33 Sep 3, 2025
26c168b
CI: Add dependency review action for PRs
jihanurrahman33 Sep 3, 2025
368f890
Style: Add .editorconfig for consistent formatting
jihanurrahman33 Sep 3, 2025
80ae6d3
Docs: Add feature request issue template
jihanurrahman33 Sep 3, 2025
d266fc2
Docs: Add Android CI badge to README
jihanurrahman33 Sep 3, 2025
2961178
CI: Enable Dependabot for GitHub Actions updates (weekly)
jihanurrahman33 Sep 3, 2025
fe2c3cc
Docs: Add README for the sample module
jihanurrahman33 Sep 3, 2025
7b1d056
Docs: Update translation scripts to Python 3 in docs
jihanurrahman33 Sep 3, 2025
cc4cb9c
Docs: Add CONTRIBUTING guide with checks and tips
jihanurrahman33 Sep 3, 2025
894b7fa
Cleanup: Remove unused SessionController1 and fix incorrect Runnable …
jihanurrahman33 Sep 3, 2025
025fb56
CI: Add Detekt static analysis workflow (non-blocking) with SARIF upload
jihanurrahman33 Sep 3, 2025
1fa8da2
feat: Display captured face thumbnails in SessionView and signal capa…
jihanurrahman33 Sep 3, 2025
4a18ad0
CI: Add CodeQL analysis for Java/Kotlin
jihanurrahman33 Sep 3, 2025
62d949a
Chore: Fix AWS S3 version range syntax in version catalog
jihanurrahman33 Sep 3, 2025
5c727e1
Chore: Harden translation checker for Python 3 and regex safety
jihanurrahman33 Sep 3, 2025
20e9045
Chore: Make translation XML generator Python 3 friendly with main guard
jihanurrahman33 Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{kt,kts,java}]
indent_style = space
indent_size = 4
max_line_length = 120

[*.xml]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false

20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature] "
labels: enhancement
assignees: ''
---

## Summary
Describe the problem this feature solves and the value.

## Proposed solution
What should be added or changed? UI/UX, API shape, etc.

## Alternatives considered
List any alternative solutions or workarounds.

## Additional context
Screenshots, references, or links.

8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5

50 changes: 50 additions & 0 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Android CI

on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "*" ]

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- name: Set up Android SDK
uses: android-actions/setup-android@v3

- name: Install SDK packages
shell: bash
run: |
sdkmanager --install \
"platforms;android-34" \
"build-tools;34.0.0" \
"platform-tools"
yes | sdkmanager --licenses

- name: Gradle version
run: ./gradlew --version

- name: Lint and unit tests
run: ./gradlew :veridui:lint :veridui:test --no-daemon --stacktrace

- name: Build library and sample
run: ./gradlew :veridui:assembleRelease :sample:assembleDebug --no-daemon --stacktrace

- name: Translation checks
run: |
python3 test_translation.py veridui/src/main/assets/fr.xml

35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CodeQL

on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "master", "main" ]
schedule:
- cron: '0 3 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'java-kotlin'

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

18 changes: 18 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Dependency Review

on:
pull_request:
branches: [ "master", "main" ]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Dependency Review
uses: actions/dependency-review-action@v4

39 changes: 39 additions & 0 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Detekt

on:
pull_request:
branches: [ "master", "main" ]

jobs:
detekt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

- name: Download detekt
run: |
DETEKT_VERSION=1.23.6
curl -sSL -o detekt.jar https://github.com/detekt/detekt/releases/download/v${DETEKT_VERSION}/detekt-cli-${DETEKT_VERSION}-all.jar

- name: Run detekt (non-blocking)
continue-on-error: true
run: |
java -jar detekt.jar \
--build-upon-default-config \
--parallel \
--input veridui/src/main/java,sample/src/main/java \
--report sarif:detekt.sarif

- name: Upload SARIF report
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: detekt.sarif

13 changes: 13 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Validate Gradle Wrapper

on:
pull_request:
branches: [ "*" ]

jobs:
validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1

19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Contributing

Thanks for your interest in contributing to Ver-ID UI for Android!

Before you open a pull request:

- Ensure `./gradlew :veridui:lint :veridui:test` passes
- Build `:veridui` and `:sample` locally (or let CI validate)
- Follow the PR template and keep changes focused and scoped

Development tips

- Use Android Studio Giraffe or newer with JDK 17
- Run the sample app on a physical device for camera features

Project scripts

- Translation completeness check: `python3 test_translation.py veridui/src/main/assets/<locale>.xml`

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
![Maven Central](https://img.shields.io/maven-central/v/com.appliedrec.verid/ui2)
![Android CI](https://github.com/AppliedRecognition/Ver-ID-UI-Android/actions/workflows/android-ci.yml/badge.svg)

# Ver-ID UI for Android

Expand Down
8 changes: 4 additions & 4 deletions Translating-Ver-ID-UI.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

Ver-ID UI allows you to supply a language translation when starting a Ver-ID session.

The Ver-ID-UI project provides [Python 2.7](https://www.python.org/download/releases/2.7/) scripts to generate an empty translation XML and to verify that a given file is not missing any translations.
The Ver-ID-UI project provides Python 3 scripts to generate an empty translation XML and to verify that a given file is not missing any translations.

## Generating a translation XML

~~~shell
python translation_xml.py
python3 translation_xml.py
~~~
The command will collect all strings used in the source code and output a string like this:

Expand Down Expand Up @@ -76,14 +76,14 @@ Enter the translation of the string inside the `<original>` tag in the `<transla
To save the generated XML as **es.xml**:

~~~shell
python translation_xml.py > es.xml
python3 translation_xml.py > es.xml
~~~

## Checking that your translation is complete
Once you translate all the strings in the XML run:

~~~shell
python test_translation.py es.xml
python3 test_translation.py es.xml
~~~
If all strings are translated the command will output:

Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ targetSdkVersion = "34"
javaVersion = "17"
google-services = "4.4.2"
crashlytics = "19.2.0"
aws-s3 = "[2.19.1,3.0.0["
aws-s3 = "[2.19.1,3.0.0)"
android-material = "1.12.0"
androidx-activity = "1.9.1"
kotlin-compiler-ext = "1.5.15"
Expand Down Expand Up @@ -143,4 +143,4 @@ nebula-lint = { id = "nebula.lint", version = "18.0.3" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-stdlib" }
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version = "0.24.0" }
google-services = { id = "com.google.gms.google-services", version.ref = "google-services" }
crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" }
crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" }
15 changes: 15 additions & 0 deletions sample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Sample App

- Module: `:sample`
- Builds a demo app using the Ver-ID UI library (`:veridui`).

Build and run

- From IDE: Open the project in Android Studio and run the `sample` configuration on a device.
- CLI: `./gradlew :sample:assembleDebug`

Notes

- The sample uses Compose and AndroidX; ensure you’re on Android Studio Giraffe or newer.
- Some features may require a device with a camera for full functionality.

55 changes: 35 additions & 20 deletions test_translation.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
import argparse
import re
import sys
from translations import strings

parser = argparse.ArgumentParser()
parser.add_argument('filename',help="XML file to test")
args = parser.parse_args()

f = open(args.filename, "r")
xml = f.read()
def main() -> int:
parser = argparse.ArgumentParser(description="Verify translation XML completeness")
parser.add_argument("filename", help="XML file to test")
args = parser.parse_args()

words = strings()
try:
with open(args.filename, "r", encoding="utf-8") as f:
xml = f.read()
except FileNotFoundError:
print(f"File not found: {args.filename}", file=sys.stderr)
return 2

missing = []
for word in words:
match = re.search("<original>"+word+"</original>", xml)
if match == None and word not in missing:
missing.append(word)
else:
match = re.search(r"<original>"+word+"</original>\s*<translation></translation>", xml)
if match != None:
words = strings()

missing = []
for word in words:
# Escape any regex metacharacters in the original string
escaped = re.escape(word)
present = re.search(rf"<original>{escaped}</original>", xml)
if present is None and word not in missing:
missing.append(word)
else:
empty = re.search(rf"<original>{escaped}</original>\s*<translation></translation>", xml)
if empty is not None:
missing.append(word)

if len(missing) == 0:
print("All translated")
return 0
else:
print("Missing:")
for word in missing:
print(word)
return 1


if len(missing) == 0:
print("All translated")
else:
print("Missing:")
for word in missing:
print(word)
if __name__ == "__main__":
sys.exit(main())
29 changes: 21 additions & 8 deletions translation_xml.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
from translations import strings

words = strings()
xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\
<strings>\n"
for word in words:
xml += " <string>\n <original>"+word+"</original>\n <translation></translation>\n </string>\n"
xml += "</strings>"

print(xml)

def main():
words = strings()
xml = (
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<strings>\n"
)
for word in words:
xml += (
" <string>\n"
f" <original>{word}</original>\n"
" <translation></translation>\n"
" </string>\n"
)
xml += "</strings>"

print(xml)


if __name__ == "__main__":
main()
Loading