Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
7074e6b
Created new ui-tookit module with onboarding
Fabtron Aug 15, 2022
3068bdb
Added extension functions to resolve image or text source
Fabtron Aug 15, 2022
cb9015e
Added Hybrid-View with Alt-Text and Dynamic Button Config
Fabtron Aug 15, 2022
e940424
Added show terms button and result listener to catch onboarding seen …
Fabtron Aug 15, 2022
e69e166
Move onboarding result handling to viewmodel
Fabtron Aug 15, 2022
68bb4df
Add view model
Fabtron Aug 15, 2022
825b487
Moved terms and privacy view into ui-toolkit.
Fabtron Aug 15, 2022
88c5423
syntax fix
Fabtron Aug 15, 2022
3058915
Improve accessibility
rekire Aug 15, 2022
de886da
Added DeeplinkUtils.kt and README.md
Fabtron Aug 17, 2022
1f03aab
Moved out accessibility toolbox and fixed references in the ui-toolki…
rekire Aug 17, 2022
5395a2b
Moved out accessibility toolbox and fixed references in the ui-toolki…
rekire Aug 17, 2022
cc21716
Change imports for the AccessibilityToolBox
rekire Aug 17, 2022
9b820f2
Added onboarding to sample app and custom sample app.
Fabtron Aug 17, 2022
e1ec1c4
Add themeable onboarding images
rekire Aug 19, 2022
8f75875
Rename colors to
rekire Aug 19, 2022
6e18efe
Update assets
rekire Aug 22, 2022
bb60689
Add image handling for vector drawables in the webview
rekire Aug 22, 2022
70da367
Move view logic
rekire Aug 22, 2022
8835b74
Added SnabbleUiToolkit for Event handling
Fabtron Aug 23, 2022
51a1a2a
Added SnabbleUiToolkit for Event handling
Fabtron Aug 23, 2022
d6abfeb
Move to AppCompatImageView
rekire Aug 23, 2022
179d57c
Move out accesibility string
rekire Aug 23, 2022
773ad02
Formatting and spelling
rekire Aug 24, 2022
3954388
Merge branch 'main' into feature/ui-toolkit
rekire Aug 24, 2022
6c9d339
Update dependencies
rekire Aug 24, 2022
bc92cce
Fix broken labels
rekire Aug 24, 2022
a25c5ee
Add onboarding localization
rekire Aug 25, 2022
a485a78
Add documentation
rekire Aug 25, 2022
e475e58
Add link parser
rekire Aug 26, 2022
f34b0e6
Move link parser to utils and cleanup the onboarding model
rekire Aug 29, 2022
9b23c7a
Add sample app translations
rekire Aug 29, 2022
936bc65
Use SnabbleUiToolkit for deeplink handling
rekire Aug 30, 2022
a1fa102
Cleanup
rekire Aug 30, 2022
af7df05
Refactor HideOnOverlapFrameLayout to use a min height
rekire Aug 30, 2022
755b3a6
Use the OnboardingStepView in the OnboardingFragment to recycle the v…
rekire Aug 30, 2022
9122a81
Make text anonymous
cmaier Sep 5, 2022
f531387
Remove duplicated code
cmaier Sep 5, 2022
b1db1d7
Revert "Remove duplicated code"
cmaier Sep 6, 2022
8e137c1
Add a not null contract for `isNotNullOrBlank()`
cmaier Sep 6, 2022
30bb888
Merge branch 'main' into feature/ui-toolkit
rekire Sep 7, 2022
2e3adcd
Removed unused code splitted the onCreate fun
cmaier Sep 7, 2022
7845932
Merge remote-tracking branch 'origin/feature/ui-toolkit' into feature…
cmaier Sep 7, 2022
c532143
Set scope of private method correct
cmaier Sep 7, 2022
b63730b
Remove obsolete Action interface
cmaier Sep 7, 2022
10d5744
Reorder when statement
cmaier Sep 7, 2022
3f1dec4
Rename val cb to callback
cmaier Sep 7, 2022
8e9de62
Wrap Intent configuration w/ the apply fun
cmaier Sep 7, 2022
e96c18a
Use StringRes as bundle key and small restructurings
cmaier Sep 7, 2022
0515825
Replace let()-run() construct w/ if-else-statement
cmaier Sep 7, 2022
648ca4d
Refactor to smaller methods
cmaier Sep 7, 2022
cc88b12
Suppressing unused for the library object
cmaier Sep 7, 2022
11080fd
Remove warnings from Fragment and reformattings
cmaier Sep 7, 2022
140e93b
Add an explanatory comment and renamed variables
cmaier Sep 7, 2022
530e1f5
Phrase pull and string replacement
cmaier Sep 7, 2022
530f6bd
Phrase pull
cmaier Sep 7, 2022
c07f162
Setup .phrase.yml for Android & phrase pull
cmaier Sep 7, 2022
5958349
Comment .phrase.yml
cmaier Sep 8, 2022
5086869
Comment language code where missing
cmaier Sep 8, 2022
88011ec
Add a repository to provide the onboarding config
cmaier Sep 8, 2022
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
123 changes: 110 additions & 13 deletions .phrase.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,119 @@
# Configuration for Android projects: https://help.phrase.com/help/examples
phrase:
project_id: 3e43b3f90cf19e83c7d85652df5766ca
file_format: strings
file_format: xml
pull:
targets:
# ui module
- file: ./ui/src/main/res/values/strings.xml
params:
locale_id: b220db5757be359631c55ec54fb65ac6
encoding: "UTF-8"
file_format: xml
include_empty_translations: false
params: &defaults
locale_id: b220db5757be359631c55ec54fb65ac6 # en-US
fallback_locale_id: b220db5757be359631c55ec54fb65ac6 # en-US
tags: SDK,Coupons
include_empty_translations: true
format_options:
convert_placeholder: true
escape_linebreaks: true
- file: ./ui/src/main/res/values-<locale_name>/strings.xml
- file: ./ui/src/main/res/values-de/strings.xml
params:
encoding: "UTF-8"
file_format: xml
include_empty_translations: false
format_options:
convert_placeholder: true
escape_linebreaks: true
<<: *defaults
locale_id: 512f99f8cd03c80affd16303fb5de9c2 # de
- file: ./ui/src/main/res/values-fr/strings.xml
params:
<<: *defaults
locale_id: edf0b29dd998221329199f185d360ae4 # fr
- file: ./ui/src/main/res/values-fr-rCH/strings.xml
params:
<<: *defaults
locale_id: fae2e092d1704da2ed88f3f56eb6f219 # fr-CH
- file: ./ui/src/main/res/values-hu/strings.xml
params:
<<: *defaults
locale_id: 8f797bd77008e27f6286531a5ad55f67 # hu
- file: ./ui/src/main/res/values-it/strings.xml
params:
<<: *defaults
locale_id: a4dea5c3e2c77e7c6ea344e69db63ed9 # it
- file: ./ui/src/main/res/values-sk/strings.xml
params:
<<: *defaults
locale_id: 9ee4c528e480d56878c98ee8bfbc521b # sk

# ui-toolkit module
- file: ./ui-toolkit/src/debug/res/values/strings.xml
params:
<<: *defaults
locale_id: b220db5757be359631c55ec54fb65ac6 # en-US
tags: Sample
- file: ./ui-toolkit/src/main/res/values/strings.xml
params:
<<: *defaults
locale_id: b220db5757be359631c55ec54fb65ac6 # en-US
tags: Onboarding
- file: ./ui-toolkit/src/main/res/values-de/strings.xml
params:
<<: *defaults
locale_id: 512f99f8cd03c80affd16303fb5de9c2 # de
tags: Onboarding
- file: ./ui-toolkit/src/main/res/values-fr/strings.xml
params:
<<: *defaults
locale_id: edf0b29dd998221329199f185d360ae4 # fr
tags: Onboarding
- file: ./ui-toolkit/src/main/res/values-fr-rCH/strings.xml
params:
<<: *defaults
locale_id: fae2e092d1704da2ed88f3f56eb6f219 # fr-CH
tags: Onboarding
- file: ./ui-toolkit/src/main/res/values-hu/strings.xml
params:
<<: *defaults
locale_id: 8f797bd77008e27f6286531a5ad55f67 # hu
tags: Onboarding
- file: ./ui-toolkit/src/main/res/values-it/strings.xml
params:
<<: *defaults
locale_id: a4dea5c3e2c77e7c6ea344e69db63ed9 # it
tags: Onboarding
- file: ./ui-toolkit/src/main/res/values-sk/strings.xml
params:
<<: *defaults
locale_id: 9ee4c528e480d56878c98ee8bfbc521b # sk
tags: Onboarding

# kotlin-sample module
- file: ./kotlin-sample/src/main/res/values/strings.xml
params:
<<: *defaults
locale_id: b220db5757be359631c55ec54fb65ac6 # en-US
tags: Sample
- file: ./kotlin-sample/src/main/res/values-de/strings.xml
params:
<<: *defaults
locale_id: 512f99f8cd03c80affd16303fb5de9c2 # de
tags: Sample
- file: ./kotlin-sample/src/main/res/values-fr/strings.xml
params:
<<: *defaults
locale_id: edf0b29dd998221329199f185d360ae4 # fr
tags: Sample
- file: ./kotlin-sample/src/main/res/values-fr-rCH/strings.xml
params:
<<: *defaults
locale_id: fae2e092d1704da2ed88f3f56eb6f219 # fr-CH
tags: Sample
- file: ./kotlin-sample/src/main/res/values-hu/strings.xml
params:
<<: *defaults
locale_id: 8f797bd77008e27f6286531a5ad55f67 # hu
tags: Sample
- file: ./kotlin-sample/src/main/res/values-it/strings.xml
params:
<<: *defaults
locale_id: a4dea5c3e2c77e7c6ea344e69db63ed9 # it
tags: Sample
- file: ./kotlin-sample/src/main/res/values-sk/strings.xml
params:
<<: *defaults
locale_id: 9ee4c528e480d56878c98ee8bfbc521b # sk
tags: Sample
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.69.0]

### Changed
- Added ui-toolkit for more realistic sample app with onboarding
- Moved accessibility toolbox to an own dependency

### Breaking Changes
- Renamed some colors which should be only used internal only

## [0.68.6]

# Changed
### Changed
- Apply new Phrase key structure

## [0.68.5]
Expand Down
1 change: 1 addition & 0 deletions accessibility-toolbox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
58 changes: 58 additions & 0 deletions accessibility-toolbox/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: '../scripts/maven.gradle'
apply plugin: 'org.jetbrains.dokka'
apply plugin: "org.jetbrains.kotlin.plugin.parcelize"

description = "Accessibility-Toolbox: Make it easy to make your app accessibile"

android {
compileSdkVersion project.compileSdkVersion

defaultConfig {
minSdkVersion project.minSdkVersion
targetSdkVersion project.targetSdkVersion
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

buildTypes {
release {
postprocessing {
removeUnusedCode false
removeUnusedResources false
obfuscate false
optimizeCode false
proguardFile 'proguard-rules.pro'
}
}
}

compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

sourceSets {
getByName("main").java.srcDirs("src/main/kotlin")
getByName("test").java.srcDirs("src/test/kotlin")
getByName("androidTest").java.srcDirs("src/androidTest/kotlin")
}

kotlinOptions {
freeCompilerArgs = ['-Xjvm-default=all']
jvmTarget = '1.8'
}

lint {
disable 'LabelFor', 'MissingTranslation'
}
}

dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:${project.desugarVersion}"

implementation project(':utils')

implementation 'androidx.core:core-ktx:1.8.0'
}
21 changes: 21 additions & 0 deletions accessibility-toolbox/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions accessibility-toolbox/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="io.snabble.accessibility" />
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.snabble.sdk.ui
package io.snabble.accessibility

import android.accessibilityservice.AccessibilityServiceInfo
import android.annotation.SuppressLint
Expand All @@ -15,7 +15,6 @@ import androidx.core.view.AccessibilityDelegateCompat
import androidx.core.view.ViewCompat
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat
import androidx.core.view.isVisible
import io.snabble.sdk.Snabble

typealias AccessibilityEventListener = (host: ViewGroup?,
child: View?,
Expand Down Expand Up @@ -47,18 +46,16 @@ class AccessibilityToolBox(private val target: View): AccessibilityDelegateCompa
}

override fun onRequestSendAccessibilityEvent(
host: ViewGroup?,
child: View?,
event: AccessibilityEvent?
host: ViewGroup,
child: View,
event: AccessibilityEvent
): Boolean {
val listener = event?.let { eventListeners[event.eventType] }
listener?.invoke(host, child, event)
eventListeners[event.eventType]?.invoke(host, child, event)
return super.onRequestSendAccessibilityEvent(host, child, event)
}

override fun onPopulateAccessibilityEvent(host: View, event: AccessibilityEvent?) {
val listener = event?.let { populateListeners[event.eventType] }
listener?.invoke(host.parent as? ViewGroup, host, event)
override fun onPopulateAccessibilityEvent(host: View, event: AccessibilityEvent) {
populateListeners[event.eventType]?.invoke(host.parent as? ViewGroup, host, event)
super.onPopulateAccessibilityEvent(host, event)
}

Expand Down Expand Up @@ -234,17 +231,4 @@ fun <T> Iterable<T>.forEachWindow(iterator: (last: T?, current: T, next: T?) ->
}
}
}
}

object AccessibilityPreferences {
private const val KEY_SUPPRESS_SCANNER_HINT = "suppress_scanner_hint"
private val sharedPreferences = Snabble.application.getSharedPreferences("accessibility", Context.MODE_PRIVATE)
var suppressScannerHint: Boolean
get() = sharedPreferences.getBoolean(KEY_SUPPRESS_SCANNER_HINT, false)
set(seen) {
sharedPreferences
.edit()
.putBoolean(KEY_SUPPRESS_SCANNER_HINT, seen)
.apply()
}
}
4 changes: 4 additions & 0 deletions accessibility-toolbox/src/main/res/values/ids.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="id" name="snabble_accessibility_toolbox" />
</resources>
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-base:$kotlin_version"
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'gradle.plugin.com.github.jlouns:gradle-cross-platform-exec-plugin:0.5.0'
classpath 'gradle.plugin.gmazzo:sqlite-plugin:0.2'
classpath 'com.github.bjoernq:unmockplugin:0.7.9'
}
}

Expand All @@ -40,7 +41,7 @@ allprojects {
minSdkVersion=21
targetSdkVersion=31

okhttpVersion='4.9.3'
okhttpVersion='4.10.0'
desugarVersion='1.1.5'

sdkVersion += project.getProperties().get('versionSuffix', '')
Expand Down
8 changes: 4 additions & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ dependencies {
implementation 'com.google.android.gms:play-services-wallet:19.1.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.biometric:biometric:1.2.0-alpha04'
implementation 'androidx.lifecycle:lifecycle-process:2.4.1'
implementation 'androidx.lifecycle:lifecycle-common:2.4.1'
implementation 'androidx.lifecycle:lifecycle-process:2.5.1'
implementation 'androidx.lifecycle:lifecycle-common:2.5.1'

api "com.squareup.okhttp3:okhttp:${project.okhttpVersion}"
implementation "com.squareup.okhttp3:logging-interceptor:${project.okhttpVersion}"
implementation 'eu.rekisoft.android.util:LazyWorker:2.1.0'

api 'com.google.code.gson:gson:2.9.0'
api 'com.google.code.gson:gson:2.9.1'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.8.1'
testImplementation "com.squareup.okhttp3:mockwebserver:${project.okhttpVersion}"
testImplementation 'org.jetbrains.kotlin:kotlin-reflect:1.6.21'
testImplementation "org.jetbrains.kotlin:kotlin-reflect:${project.kotlin_version}"
testImplementation 'androidx.arch.core:core-testing:2.1.0'
}
2 changes: 1 addition & 1 deletion java-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies {

//noinspection GradleDependency
implementation 'commons-io:commons-io:2.5'
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.android.material:material:1.6.1'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
Expand Down
1 change: 0 additions & 1 deletion kotlin-compose-sample/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="AppTheme" parent="@style/Theme.Material3.DayNight.NoActionBar" />
</resources>
14 changes: 8 additions & 6 deletions kotlin-customization-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,23 @@ dependencies {

implementation project(':core')
implementation project(':ui')
// used for onboarding implementation
implementation project(':ui-toolkit')

// in your app you need to use those dependencies:
// implementation 'io.snabble.sdk:core:{currentVersion}'
// implementation 'io.snabble.sdk:ui:{currentVersion}'

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.1'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
Loading