From fa497185456ba0d78bcb169e02f6182267efe98b Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Sat, 25 Jul 2020 14:59:18 +0400 Subject: [PATCH 001/117] Add android.yml (#58) --- .github/workflows/android.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 00000000..897a252c --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,24 @@ +name: Android CI + +on: [push] + +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: Chmod .gradlew + run: chmod +x ./gradlew + + - name: Build with Gradle + run: ./gradlew assembleDebug + + - name: Run unit tests + run: ./gradlew testStageDebugUnitTest From c7da83b5e1c7b4c9e19639030f29ea7a62ffd69e Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Sun, 9 Aug 2020 16:25:42 +0400 Subject: [PATCH 002/117] Fix naming --- .../com/github/braillesystems/learnbraille/utils/_Kotlin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/braillesystems/learnbraille/utils/_Kotlin.kt b/app/src/main/java/com/github/braillesystems/learnbraille/utils/_Kotlin.kt index 7c57b06d..735a35f6 100644 --- a/app/src/main/java/com/github/braillesystems/learnbraille/utils/_Kotlin.kt +++ b/app/src/main/java/com/github/braillesystems/learnbraille/utils/_Kotlin.kt @@ -44,7 +44,7 @@ fun Rules.matchF(key: T): ((T) -> R)? { return null } -fun Iterable>.match(key: T): R? = matchF(key)?.invoke(key) +fun Rules.match(key: T): R? = matchF(key)?.invoke(key) operator fun Rules.get(x: T): R? = match(x) From c214d21cdc090891fcf669abe26e94c09c87f780 Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Sun, 9 Aug 2020 16:28:36 +0400 Subject: [PATCH 003/117] Force db preparation --- .../braillesystems/learnbraille/LearnBrailleApplication.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt b/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt index a152f586..92c26699 100644 --- a/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt +++ b/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt @@ -6,6 +6,8 @@ import com.github.braillesystems.learnbraille.data.dsl.UsersCourse import com.github.braillesystems.learnbraille.data.entities.BrailleDots import com.github.braillesystems.learnbraille.data.repository.* import com.github.braillesystems.learnbraille.ui.screens.practice.CardViewModelFactory +import com.github.braillesystems.learnbraille.utils.devnull +import org.koin.android.ext.android.get import org.koin.android.ext.koin.androidContext import org.koin.core.Koin import org.koin.core.context.startKoin @@ -105,6 +107,9 @@ class LearnBrailleApplication : Application() { androidContext(this@LearnBrailleApplication) modules(koinModule) }.koin + + // Touch database to force it's preparation + get().devnull } } From 8f7466f47f2a69a503d925ce72f5ef745317a1e4 Mon Sep 17 00:00:00 2001 From: zuevval Date: Mon, 17 Aug 2020 09:42:01 +0300 Subject: [PATCH 004/117] #223 refactor: reduce hardcode in BrailleDotsView --- app/src/main/res/layout/braille_dots_view.xml | 30 ------------------- app/src/main/res/values/styles.xml | 3 ++ 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/app/src/main/res/layout/braille_dots_view.xml b/app/src/main/res/layout/braille_dots_view.xml index 7a7bc894..0ff2a92b 100644 --- a/app/src/main/res/layout/braille_dots_view.xml +++ b/app/src/main/res/layout/braille_dots_view.xml @@ -8,16 +8,11 @@ wrap_content wrap_content + 2.6 + 2.6 + @drawable/round_checkbox + + + + From 42b0e5e0862e3544e655939cb4848339332271aa Mon Sep 17 00:00:00 2001 From: zuevval Date: Sat, 26 Sep 2020 20:48:35 +0300 Subject: [PATCH 090/117] #223 fix detekt & fix a little mess --- .../ui/screens/browser/MarkerViewFragment.kt | 2 ++ .../ui/screens/browser/SymbolViewFragment.kt | 4 +--- .../learnbraille/ui/screens/practice/CardFragment.kt | 2 +- .../braillesystems/learnbraille/utils/Utils.kt | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/MarkerViewFragment.kt b/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/MarkerViewFragment.kt index a14a4c81..414b5577 100644 --- a/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/MarkerViewFragment.kt +++ b/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/MarkerViewFragment.kt @@ -37,5 +37,7 @@ class MarkerViewFragment : AbstractFragmentWithHelp(R.string.browser_marker_view binding.infoTextView.text = showMarkerPrintRules.getValue(m.data.type) binding.brailleDots.dotsState.display(m.data.brailleDots) + // TODO #223 add flip button & apply extended accessibility for it + }.root } diff --git a/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/SymbolViewFragment.kt b/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/SymbolViewFragment.kt index f828e446..aee82cf2 100644 --- a/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/SymbolViewFragment.kt +++ b/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/SymbolViewFragment.kt @@ -40,10 +40,8 @@ class SymbolViewFragment : AbstractFragmentWithHelp(R.string.browser_symbol_view letterCaption.text = captionRules.getValue(m.data) brailleDots.dotsState.display(m.data.brailleDots) - // TODO #223 add flip button & apply extended accessibility for it - if (preferenceRepository.extendedAccessibilityEnabled) { - applyExtendedAccessibility(flipButton = flipButton) + applyExtendedAccessibility(rightButton = flipButton) } }.root diff --git a/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/practice/CardFragment.kt b/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/practice/CardFragment.kt index 81c72c6e..fe5897b5 100644 --- a/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/practice/CardFragment.kt +++ b/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/practice/CardFragment.kt @@ -60,7 +60,7 @@ class CardFragment : AbstractFragmentWithHelp(R.string.practice_help) { applyExtendedAccessibility( leftButton = binding.hintButton, rightButton = binding.nextButton, - flipButton = binding.flipButton, + rightMiddleButton = binding.flipButton, textView = binding.markerDescription ) } diff --git a/app/src/main/java/com/github/braillesystems/learnbraille/utils/Utils.kt b/app/src/main/java/com/github/braillesystems/learnbraille/utils/Utils.kt index 2c203de1..72aa33d4 100644 --- a/app/src/main/java/com/github/braillesystems/learnbraille/utils/Utils.kt +++ b/app/src/main/java/com/github/braillesystems/learnbraille/utils/Utils.kt @@ -104,17 +104,17 @@ val Context.extendedTextSize: Float by lazyWithContext { fun Fragment.applyExtendedAccessibility( leftButton: Button? = null, rightButton: Button? = null, - flipButton: Button? = null, leftMiddleButton: Button? = null, rightMiddleButton: Button? = null, textView: TextView? = null ) { val width = resources.getDimension(R.dimen.side_buttons_extended_width).toInt() - leftButton?.setSize(width = width) - rightButton?.setSize(width = width) - flipButton?.setSize(width=width) - leftMiddleButton?.setSize(width = width) - rightMiddleButton?.setSize(width = width) + forEach( + leftButton, + rightButton, + leftMiddleButton, + rightMiddleButton + ) { it?.setSize(width = width) } textView?.setTextSize( TypedValue.COMPLEX_UNIT_SP, contextNotNull.extendedTextSize From b02e0bf3d9423c4e089bb75941c86e62f654cb40 Mon Sep 17 00:00:00 2001 From: zuevval Date: Sat, 26 Sep 2020 20:57:09 +0300 Subject: [PATCH 091/117] extended accessibility: change textView size in MarkerViewFragment --- .../learnbraille/ui/screens/browser/MarkerViewFragment.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/MarkerViewFragment.kt b/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/MarkerViewFragment.kt index 414b5577..ddf11850 100644 --- a/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/MarkerViewFragment.kt +++ b/app/src/main/java/com/github/braillesystems/learnbraille/ui/screens/browser/MarkerViewFragment.kt @@ -12,6 +12,7 @@ import com.github.braillesystems.learnbraille.res.showMarkerPrintRules import com.github.braillesystems.learnbraille.ui.screens.AbstractFragmentWithHelp import com.github.braillesystems.learnbraille.ui.views.display import com.github.braillesystems.learnbraille.ui.views.dotsState +import com.github.braillesystems.learnbraille.utils.applyExtendedAccessibility import com.github.braillesystems.learnbraille.utils.getFragmentStringArg import com.github.braillesystems.learnbraille.utils.getValue import com.github.braillesystems.learnbraille.utils.parse @@ -37,6 +38,8 @@ class MarkerViewFragment : AbstractFragmentWithHelp(R.string.browser_marker_view binding.infoTextView.text = showMarkerPrintRules.getValue(m.data.type) binding.brailleDots.dotsState.display(m.data.brailleDots) + applyExtendedAccessibility(textView = binding.infoTextView) + // TODO #223 add flip button & apply extended accessibility for it }.root From aaae9ef9de27eff2bd5808b8eed9c0eee5b7c834 Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Sat, 26 Sep 2020 23:47:51 +0300 Subject: [PATCH 092/117] Check not using developers course --- .github/workflows/android.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 2d5ff33d..07234ec8 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -58,3 +58,5 @@ jobs: run: curl -sSLO https://github.com/detekt/detekt/releases/download/v1.12.0-RC1/detekt && chmod a+x detekt - name: Static check with detekt run: ./detekt -c detekt-config.yml --build-upon-default-config + - name: Check not using developer's course + run: grep UsersCourse app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt From 1bc654b577d6b8b6aea742085e8345ada78c92df Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Sat, 26 Sep 2020 23:51:06 +0300 Subject: [PATCH 093/117] Fix course --- .../braillesystems/learnbraille/LearnBrailleApplication.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt b/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt index 596d7fbb..eb584dbc 100644 --- a/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt +++ b/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt @@ -2,7 +2,7 @@ package com.github.braillesystems.learnbraille import android.app.Application import com.github.braillesystems.learnbraille.data.db.LearnBrailleDatabase -import com.github.braillesystems.learnbraille.data.dsl.DevelopersCourse +import com.github.braillesystems.learnbraille.data.dsl.UsersCourse import com.github.braillesystems.learnbraille.data.entities.BrailleDots import com.github.braillesystems.learnbraille.data.repository.* import com.github.braillesystems.learnbraille.ui.screens.practice.CardViewModelFactory @@ -119,4 +119,4 @@ class LearnBrailleApplication : Application() { lateinit var koin: Koin private set -val COURSE = DevelopersCourse +val COURSE = UsersCourse(2) From f7d4909fc02c6d7aadd92b4ba9b638b8da13fdd2 Mon Sep 17 00:00:00 2001 From: zuevval Date: Sun, 27 Sep 2020 13:51:48 +0300 Subject: [PATCH 094/117] #223 disable shadow around dots --- app/src/main/res/drawable/left_border.xml | 2 +- app/src/main/res/drawable/right_border.xml | 2 +- app/src/main/res/values/styles.xml | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/drawable/left_border.xml b/app/src/main/res/drawable/left_border.xml index d192e2fe..b179c88d 100644 --- a/app/src/main/res/drawable/left_border.xml +++ b/app/src/main/res/drawable/left_border.xml @@ -2,7 +2,7 @@ diff --git a/app/src/main/res/drawable/right_border.xml b/app/src/main/res/drawable/right_border.xml index 718e1edb..b9ca9b86 100644 --- a/app/src/main/res/drawable/right_border.xml +++ b/app/src/main/res/drawable/right_border.xml @@ -2,7 +2,7 @@ diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 29788f62..d2cfacdc 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -45,7 +45,6 @@ @dimen/braille_dots_scale_of_one_dot @dimen/braille_dots_scale_of_one_dot @drawable/round_checkbox - @color/colorBackground