From 97288df55258a66bfe94128873ff6b547833d874 Mon Sep 17 00:00:00 2001 From: kaustika Date: Fri, 17 Apr 2020 22:34:11 +0300 Subject: [PATCH 01/15] 4.4 scale all buttons for small and large screens --- .../src/main/res/values-sw320dp/dimens.xml | 38 ++++++++++ .../src/main/res/values-sw380dp/dimens.xml | 38 ++++++++++ .../src/main/res/values-sw720dp/dimens.xml | 24 +++++- android/app/src/main/res/values/dimens.xml | 74 +++++++++---------- 4 files changed, 136 insertions(+), 38 deletions(-) create mode 100644 android/app/src/main/res/values-sw320dp/dimens.xml create mode 100644 android/app/src/main/res/values-sw380dp/dimens.xml diff --git a/android/app/src/main/res/values-sw320dp/dimens.xml b/android/app/src/main/res/values-sw320dp/dimens.xml new file mode 100644 index 00000000..3eb369a4 --- /dev/null +++ b/android/app/src/main/res/values-sw320dp/dimens.xml @@ -0,0 +1,38 @@ + + + 25dp + 3dp + 30dp + 30dp + 20dp + 25dp + 2.6 + 1 + + 0.8 + 0.85 + 0.9 + + 50dp + 170dp + 85dp + 35dp + 30dp + 30dp + + 428dp + 64dp + 20sp + 0.05 + 250dp + 500dp + 18sp + 0.0 + 394dp + 175dp + + 170sp + + 30dp + + \ No newline at end of file diff --git a/android/app/src/main/res/values-sw380dp/dimens.xml b/android/app/src/main/res/values-sw380dp/dimens.xml new file mode 100644 index 00000000..63eecfc7 --- /dev/null +++ b/android/app/src/main/res/values-sw380dp/dimens.xml @@ -0,0 +1,38 @@ + + + 25dp + 3dp + 30dp + 30dp + 20dp + 25dp + 2.6 + 1.2 + + 1 + 0.85 + 0.9 + + 70dp + 230dp + 115dp + 50dp + 50dp + 40dp + + 428dp + 64dp + 20sp + 0.05 + 250dp + 500dp + 18sp + 0.0 + 394dp + 175dp + + 170sp + + 40dp + + \ No newline at end of file diff --git a/android/app/src/main/res/values-sw720dp/dimens.xml b/android/app/src/main/res/values-sw720dp/dimens.xml index b59e7adc..a9b2630d 100644 --- a/android/app/src/main/res/values-sw720dp/dimens.xml +++ b/android/app/src/main/res/values-sw720dp/dimens.xml @@ -8,5 +8,27 @@ 25dp 2.6 2.1 - 2 + 2.2 + + 120dp + 320dp + 170dp + 90dp + 85dp + 60dp + + 428dp + 64dp + 20sp + 0.05 + 300dp + 500dp + 18sp + 0.0 + 394dp + 175dp + + 150sp + + 30dp \ No newline at end of file diff --git a/android/app/src/main/res/values/dimens.xml b/android/app/src/main/res/values/dimens.xml index c5a5b4d1..8ad274d3 100644 --- a/android/app/src/main/res/values/dimens.xml +++ b/android/app/src/main/res/values/dimens.xml @@ -1,38 +1,38 @@ - - - 25dp - 3dp - 30dp - 30dp - 20dp - 25dp - 2.6 - 1.2 - - 1 - 0.85 - 0.9 - - 70dp - 230dp - 115dp - 50dp - 50dp - 40dp - - 428dp - 64dp - 20sp - 0.05 - 250dp - 500dp - 18sp - 0.0 - 394dp - 175dp - - 170sp - - 40dp - + + + 25dp + 3dp + 30dp + 30dp + 20dp + 25dp + 2.6 + 1 + + 0.8 + 0.85 + 0.9 + + 45dp + 200dp + 75dp + 30dp + 50dp + 20dp + + 428dp + 64dp + 20sp + 0.05 + 250dp + 500dp + 18sp + 0.0 + 394dp + 175dp + + 170sp + + 40dp + \ No newline at end of file From ff4b13b0f9bf7e240f14ee001887bab03eb009e7 Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Sat, 18 Apr 2020 21:08:05 +0300 Subject: [PATCH 02/15] 4.12 make toast on each new letter in practice --- .../screens/practice/PracticeFragment.kt | 13 +++++++++++++ android/app/src/main/res/values/strings.xml | 1 + 2 files changed, 14 insertions(+) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/practice/PracticeFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/practice/PracticeFragment.kt index 0ec98457..60825be9 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/practice/PracticeFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/practice/PracticeFragment.kt @@ -10,6 +10,7 @@ import android.view.ViewGroup import android.widget.Toast import androidx.core.content.getSystemService import androidx.databinding.DataBindingUtil +import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProvider import com.github.braillesystems.learnbraille.R import com.github.braillesystems.learnbraille.database.entities.spelling @@ -123,5 +124,17 @@ class PracticeFragment : AbstractFragmentWithHelp(R.string.practice_help) { } ) + viewModel.symbol.observe( + viewLifecycleOwner, + Observer { + require(it != null) + Toast.makeText( + context, + getString(R.string.practice_new_letter_toast_template).format(it), + Toast.LENGTH_SHORT + ).show() + } + ) + }.root } diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 22ee65e3..cbe84964 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -15,6 +15,7 @@ "Ответ: точки %s" Далее Практика: %d из %d + Буква: %s Date: Sat, 18 Apr 2020 21:49:13 +0300 Subject: [PATCH 03/15] Fix text formatting --- .../res/russian/steps/LessonLast.kt | 2 +- android/app/src/main/res/values/strings.xml | 29 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/res/russian/steps/LessonLast.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/res/russian/steps/LessonLast.kt index c84dd422..5cdcf3c6 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/res/russian/steps/LessonLast.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/res/russian/steps/LessonLast.kt @@ -10,6 +10,6 @@ val VERY_LAST = Step( data = LastInfo( """Вы дошли до конца курса. Спасибо, что воспользовались нашим обучающим |приложением! Вы всегда можете вернутся к ранее пройденному материалу и повторить его. - """ + |Продолжение следует!""" ) ) diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 22ee65e3..367a8839 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -18,10 +18,15 @@
В верхней половине экрана крупным шрифтом выведен символ, - который нужно ввести в шеститочии в нижней половине экрана и нажать кнопку “далее” справа.
- Выход в меню приложения - кнопка вверху слева.
- Вызов справки - кнопка вверху справа.
+ который нужно ввести в шеститочии в нижней половине экрана и нажать кнопку “далее” справа. +
+ Выход в меню приложения - кнопка вверху слева. +
+ Вызов справки - кнопка вверху справа. +

Если Вы забыли символ, можно нажать кнопку с вопросительным знаком слева внизу экрана. По нажатию этой кнопки будет выведено сообщение с верными номерами точек, шеститочие будет @@ -57,10 +62,13 @@ Обучение системе Луи Брайля: главное меню.
+ Обучение системе Луи Брайля: главное меню. +

“Продолжить курс“: пошаговые уроки с демонстрацией плоскопечатных и рельефно-точечных символов крупным шрифтом, вводом символов и поясняющими комментариями. - ”Практика“: Повторяйте буквы, вводя их в шеститочии на экране.
+
+ ”Практика“: Повторяйте буквы, вводя их в шеститочии на экране. +
”Сканировать QR-код“: если у Вас есть набор карточек с текстом Брайля и QR-кодами на обороте, по нажатию кнопки вы можете отсканировать QR-код и проверить, что написано на карточке. Для этого необходимо дополнительное приложение. @@ -93,9 +101,11 @@ %s\n\n%s + Переход к следующему шагу - кнопка справа, к предыдущему - кнопка слева. +
Выход в меню приложения - кнопка вверху слева. Вызов справки - кнопка вверху справа. ]]> @@ -104,15 +114,16 @@ шаг с вводом символа. +

В верхней половине экрана крупным шрифтом выведен символ, который нужно ввести в шеститочии в нижней половине экрана. ]]>
- шаг с вводом символа. +

Введите в шеститочии на экране точки с указанными номерами. ]]>
@@ -120,6 +131,7 @@ шаг с демонстрацией символа. +

В верхней половине экрана крупным шрифтом выведен плоскопечатный символ, а в нижней части - его представление точечным шрифтом. Нужно изучить точечный символ. ]]> @@ -128,13 +140,15 @@ шаг с демонстрацией символа. - На экран выведен точечный символ. Нужно внимательно изучить его точечный состав. +

+ На экран выведен точечный символ. Внимательно изучите его. ]]>
шаг с информационным сообщением. +

Ознакомьтесь с сообщением, выведенном в текстовом поле по центру экрана. ]]>
@@ -142,6 +156,7 @@ Самый последный шаг курса! Поздравляем! +

Чтобы выйти в главное меню, нажмите дважды кнопку слева сверху. ]]>
From 6cf3fccef5d15b62c7bbd74ef1effded33497969 Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Sat, 18 Apr 2020 22:03:41 +0300 Subject: [PATCH 04/15] Update DB version --- .../com/github/braillesystems/learnbraille/database/Database.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/Database.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/Database.kt index 261a787e..311ce59a 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/Database.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/Database.kt @@ -24,7 +24,7 @@ import timber.log.Timber User::class, Lesson::class, Step::class, Symbol::class, UserKnowsSymbol::class, UserPassedStep::class, UserLastStep::class ], - version = 4, + version = 5, exportSchema = false ) @TypeConverters( From 69c64ab0b37628f6e6791a3e4e77a6fafef70005 Mon Sep 17 00:00:00 2001 From: kaustika Date: Sat, 18 Apr 2020 23:44:51 +0300 Subject: [PATCH 05/15] 4.4 improve scaling --- .../src/main/res/values-sw380dp/dimens.xml | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 android/app/src/main/res/values-sw380dp/dimens.xml diff --git a/android/app/src/main/res/values-sw380dp/dimens.xml b/android/app/src/main/res/values-sw380dp/dimens.xml deleted file mode 100644 index 63eecfc7..00000000 --- a/android/app/src/main/res/values-sw380dp/dimens.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 25dp - 3dp - 30dp - 30dp - 20dp - 25dp - 2.6 - 1.2 - - 1 - 0.85 - 0.9 - - 70dp - 230dp - 115dp - 50dp - 50dp - 40dp - - 428dp - 64dp - 20sp - 0.05 - 250dp - 500dp - 18sp - 0.0 - 394dp - 175dp - - 170sp - - 40dp - - \ No newline at end of file From b3f8b06751eea6a5ff8e803228c62b52b44df60f Mon Sep 17 00:00:00 2001 From: kaustika Date: Sun, 19 Apr 2020 11:25:25 +0300 Subject: [PATCH 06/15] 4.4 scale for small screens --- .../src/main/res/values-sw320dp/dimens.xml | 4 +- .../src/main/res/values-sw360dp/dimens.xml | 38 +++++++++++++++++++ .../src/main/res/values-sw400dp/dimens.xml | 38 +++++++++++++++++++ .../src/main/res/values-sw600dp/dimens.xml | 4 +- 4 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 android/app/src/main/res/values-sw360dp/dimens.xml create mode 100644 android/app/src/main/res/values-sw400dp/dimens.xml diff --git a/android/app/src/main/res/values-sw320dp/dimens.xml b/android/app/src/main/res/values-sw320dp/dimens.xml index 3eb369a4..85c2f1d7 100644 --- a/android/app/src/main/res/values-sw320dp/dimens.xml +++ b/android/app/src/main/res/values-sw320dp/dimens.xml @@ -7,14 +7,14 @@ 20dp 25dp 2.6 - 1 + 1.1 0.8 0.85 0.9 50dp - 170dp + 190dp 85dp 35dp 30dp diff --git a/android/app/src/main/res/values-sw360dp/dimens.xml b/android/app/src/main/res/values-sw360dp/dimens.xml new file mode 100644 index 00000000..61c996ee --- /dev/null +++ b/android/app/src/main/res/values-sw360dp/dimens.xml @@ -0,0 +1,38 @@ + + + 25dp + 3dp + 30dp + 30dp + 20dp + 25dp + 2.6 + 1.25 + + 1 + 0.85 + 0.9 + + 70dp + 230dp + 115dp + 50dp + 50dp + 40dp + + 428dp + 64dp + 20sp + 0.05 + 250dp + 500dp + 18sp + 0.0 + 394dp + 175dp + + 170sp + + 40dp + + \ No newline at end of file diff --git a/android/app/src/main/res/values-sw400dp/dimens.xml b/android/app/src/main/res/values-sw400dp/dimens.xml new file mode 100644 index 00000000..cf0eed51 --- /dev/null +++ b/android/app/src/main/res/values-sw400dp/dimens.xml @@ -0,0 +1,38 @@ + + + 25dp + 3dp + 30dp + 30dp + 20dp + 25dp + 2.6 + 1.5 + + 1 + 0.85 + 0.9 + + 70dp + 240dp + 125dp + 50dp + 50dp + 40dp + + 428dp + 64dp + 20sp + 0.05 + 250dp + 500dp + 18sp + 0.0 + 394dp + 175dp + + 170sp + + 40dp + + \ No newline at end of file diff --git a/android/app/src/main/res/values-sw600dp/dimens.xml b/android/app/src/main/res/values-sw600dp/dimens.xml index 70459141..e980de0d 100644 --- a/android/app/src/main/res/values-sw600dp/dimens.xml +++ b/android/app/src/main/res/values-sw600dp/dimens.xml @@ -7,8 +7,8 @@ 20dp 25dp 2.6 - 1.6 - 1.8 + 1.8 + 1.9 100dp 300dp From e255d9ec4c620e282766c51f4c16f5b08ee30a2e Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Sat, 18 Apr 2020 21:18:00 +0300 Subject: [PATCH 07/15] 4.3 change class name for talkback --- .../learnbraille/database/entities/Symbols.kt | 2 -- .../learnbraille/views/BrailleDotsView.kt | 23 +++++++++++++++++-- ...braille_dots.xml => braille_dots_view.xml} | 12 +++++----- 3 files changed, 27 insertions(+), 10 deletions(-) rename android/app/src/main/res/layout/{braille_dots.xml => braille_dots_view.xml} (92%) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/Symbols.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/Symbols.kt index fcd7cf08..57b327ab 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/Symbols.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/Symbols.kt @@ -70,5 +70,3 @@ interface SymbolDao { @Query("DELETE FROM symbol") suspend fun deleteAll() } - - diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/views/BrailleDotsView.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/views/BrailleDotsView.kt index c669314c..bc21b162 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/views/BrailleDotsView.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/views/BrailleDotsView.kt @@ -3,6 +3,7 @@ package com.github.braillesystems.learnbraille.views import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater +import android.view.accessibility.AccessibilityNodeInfo import android.widget.CheckBox import androidx.constraintlayout.widget.ConstraintLayout import com.github.braillesystems.learnbraille.R @@ -10,7 +11,25 @@ import com.github.braillesystems.learnbraille.database.entities.BrailleDot import com.github.braillesystems.learnbraille.database.entities.BrailleDots import com.github.braillesystems.learnbraille.database.entities.list import com.github.braillesystems.learnbraille.database.entities.spelling -import kotlinx.android.synthetic.main.braille_dots.view.* +import kotlinx.android.synthetic.main.braille_dots_view.view.* + +class BrailleDotView : CheckBox { + + constructor(context: Context) : super(context) + + constructor(context: Context, attrSet: AttributeSet) : super(context, attrSet) + + constructor( + context: Context, attrSet: AttributeSet, defStyleAttr: Int + ) : super( + context, attrSet, defStyleAttr + ) + + override fun onInitializeAccessibilityNodeInfo(info: AccessibilityNodeInfo?) { + super.onInitializeAccessibilityNodeInfo(info) + info?.className = "" + } +} /** * Represents six Braille dots view. @@ -30,7 +49,7 @@ class BrailleDotsView : ConstraintLayout { init { LayoutInflater .from(context) - .inflate(R.layout.braille_dots, this, true) + .inflate(R.layout.braille_dots_view, this, true) } } diff --git a/android/app/src/main/res/layout/braille_dots.xml b/android/app/src/main/res/layout/braille_dots_view.xml similarity index 92% rename from android/app/src/main/res/layout/braille_dots.xml rename to android/app/src/main/res/layout/braille_dots_view.xml index ced39891..7d6f7660 100644 --- a/android/app/src/main/res/layout/braille_dots.xml +++ b/android/app/src/main/res/layout/braille_dots_view.xml @@ -5,7 +5,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"> - - - - - - Date: Sun, 19 Apr 2020 14:59:16 +0300 Subject: [PATCH 08/15] 4.12 refactor toasts system --- .../learnbraille/LearnBrailleApplication.kt | 3 ++ .../database/entities/BrailleDots.kt | 2 +- .../learnbraille/screens/DotsChecker.kt | 38 +++++++++++++++++++ .../screens/lessons/AbstractInputLesson.kt | 37 ++++++++---------- .../screens/lessons/InputDotsFragment.kt | 1 - .../screens/lessons/InputSymbolFragment.kt | 17 +++++---- .../learnbraille/screens/menu/MenuFragment.kt | 2 +- .../screens/practice/PracticeFragment.kt | 20 +++------- android/app/src/main/res/values/strings.xml | 17 ++++++--- 9 files changed, 85 insertions(+), 52 deletions(-) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt index d3314399..c8f701de 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt @@ -1,6 +1,7 @@ package com.github.braillesystems.learnbraille import android.app.Application +import android.widget.Toast import com.github.braillesystems.learnbraille.database.LearnBrailleDatabase import com.github.braillesystems.learnbraille.database.entities.Language import com.github.braillesystems.learnbraille.util.scope @@ -39,3 +40,5 @@ val language = Language.RU const val defaultUser = 1L const val DEBUG = false + +const val TOAST_DURATION = Toast.LENGTH_LONG diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/BrailleDots.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/BrailleDots.kt index 6beb0769..a9786583 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/BrailleDots.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/BrailleDots.kt @@ -63,7 +63,7 @@ val BrailleDots.spelling: String } } .filterNotNull() - .joinToString(separator = " ") + .joinToString(separator = ", ") class BrailleDotsConverters { diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/DotsChecker.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/DotsChecker.kt index 4558a664..86410725 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/DotsChecker.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/DotsChecker.kt @@ -1,12 +1,17 @@ package com.github.braillesystems.learnbraille.screens import android.os.Vibrator +import android.widget.Toast +import androidx.fragment.app.Fragment import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.Observer import com.github.braillesystems.learnbraille.CORRECT_BUZZ_PATTERN import com.github.braillesystems.learnbraille.INCORRECT_BUZZ_PATTERN +import com.github.braillesystems.learnbraille.R +import com.github.braillesystems.learnbraille.TOAST_DURATION import com.github.braillesystems.learnbraille.database.entities.BrailleDots +import com.github.braillesystems.learnbraille.database.entities.spelling import com.github.braillesystems.learnbraille.serial.UsbSerial import com.github.braillesystems.learnbraille.util.buzz import com.github.braillesystems.learnbraille.util.side @@ -217,3 +222,36 @@ fun DotsChecker.getEventPassHintObserver( block() onPassHintComplete() } + +fun Fragment.makeCorrectToast(): Unit = + Toast.makeText(context, getString(R.string.input_correct), TOAST_DURATION).show() + +fun Fragment.makeIntroLetterToast(toInput: String?): Unit = + Toast.makeText( + context, + if (toInput == null) getString(R.string.input_loading) + else getString(R.string.input_letter_intro_template).format(toInput), + TOAST_DURATION + ).show() + +fun Fragment.makeIncorrectToast(): Unit = + Toast.makeText( + context, + getString(R.string.input_incorrect), + TOAST_DURATION + ).show() + +fun Fragment.makeIncorrectLetterToast(letter: String?): Unit = + Toast.makeText( + context, + if (letter == null) getString(R.string.input_loading) + else getString(R.string.input_letter_incorrect_template).format(letter), + TOAST_DURATION + ).show() + +fun Fragment.makeHintDotsToast(expectedDots: BrailleDots): Unit = + Toast.makeText( + context, + getString(R.string.input_dots_hint_template).format(expectedDots.spelling), + TOAST_DURATION + ).show() diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/AbstractInputLesson.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/AbstractInputLesson.kt index 101d1424..77b128b2 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/AbstractInputLesson.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/AbstractInputLesson.kt @@ -1,13 +1,13 @@ package com.github.braillesystems.learnbraille.screens.lessons import android.view.View -import android.widget.Toast -import com.github.braillesystems.learnbraille.R import com.github.braillesystems.learnbraille.database.LearnBrailleDatabase import com.github.braillesystems.learnbraille.database.entities.BrailleDots import com.github.braillesystems.learnbraille.database.entities.Step -import com.github.braillesystems.learnbraille.database.entities.spelling import com.github.braillesystems.learnbraille.screens.HelpMsgId +import com.github.braillesystems.learnbraille.screens.makeCorrectToast +import com.github.braillesystems.learnbraille.screens.makeHintDotsToast +import com.github.braillesystems.learnbraille.screens.makeIncorrectToast import com.github.braillesystems.learnbraille.views.BrailleDotsState import com.github.braillesystems.learnbraille.views.spelling import timber.log.Timber @@ -18,6 +18,7 @@ import timber.log.Timber abstract class AbstractInputLesson(helpMsgId: HelpMsgId) : AbstractLesson(helpMsgId) { protected var userTouchedDots: Boolean = false + protected lateinit var viewModel: InputViewModel protected fun getPrevButtonListener(step: Step, userId: Long, database: LearnBrailleDatabase) = View.OnClickListener { @@ -49,9 +50,7 @@ abstract class AbstractInputLesson(helpMsgId: HelpMsgId) : AbstractLesson(helpMs ): () -> Unit = { database.apply { Timber.i("Handle correct") - Toast.makeText( - context, getString(R.string.msg_correct), Toast.LENGTH_SHORT - ).show() + makeCorrectToast() navigateToNextStep( current = step, userId = userId, @@ -66,24 +65,21 @@ abstract class AbstractInputLesson(helpMsgId: HelpMsgId) : AbstractLesson(helpMs step: Step, userId: Long, database: LearnBrailleDatabase, - dots: BrailleDotsState + dots: BrailleDotsState, + toastMaker: () -> Unit = ::makeIncorrectToast ): () -> Unit = { - database.apply { - Timber.i("Handle incorrect: entered = ${dots.spelling}") - if (userTouchedDots) { - Toast.makeText( - context, getString(R.string.msg_incorrect), Toast.LENGTH_SHORT - ).show() - } else { + Timber.i("Handle incorrect: entered = ${dots.spelling}") + if (userTouchedDots) { + toastMaker() + } else { + database.apply { navigateToNextStep( current = step, userId = userId, stepDao = stepDao, lastStepDao = userLastStep ) { - Toast.makeText( - context, getString(R.string.msg_incorrect), Toast.LENGTH_SHORT - ).show() + toastMaker() } } } @@ -91,12 +87,11 @@ abstract class AbstractInputLesson(helpMsgId: HelpMsgId) : AbstractLesson(helpMs protected fun getEventHintObserverBlock(): (BrailleDots) -> Unit = { expectedDots -> Timber.i("Handle hint") - val toast = getString(R.string.practice_hint_template) - .format(expectedDots.spelling) - Toast.makeText(context, toast, Toast.LENGTH_LONG).show() + makeHintDotsToast(expectedDots) } - protected fun getEventPassHintObserverBlock(): () -> Unit = { + protected fun getEventPassHintObserverBlock(toastMaker: () -> Unit = {}): () -> Unit = { Timber.i("Handle pass hint") + toastMaker() } } diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InputDotsFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InputDotsFragment.kt index e8cdbf10..e3fe32bc 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InputDotsFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InputDotsFragment.kt @@ -25,7 +25,6 @@ import timber.log.Timber class InputDotsFragment : AbstractInputLesson(R.string.lessons_help_input_dots) { - private lateinit var viewModel: InputViewModel private lateinit var expectedDots: BrailleDots private lateinit var dots: BrailleDotsState private var buzzer: Vibrator? = null diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InputSymbolFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InputSymbolFragment.kt index 4fa5ea15..052f440f 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InputSymbolFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InputSymbolFragment.kt @@ -13,10 +13,7 @@ import com.github.braillesystems.learnbraille.database.entities.InputSymbol import com.github.braillesystems.learnbraille.database.getDBInstance import com.github.braillesystems.learnbraille.databinding.FragmentLessonsInputSymbolBinding import com.github.braillesystems.learnbraille.defaultUser -import com.github.braillesystems.learnbraille.screens.getEventCorrectObserver -import com.github.braillesystems.learnbraille.screens.getEventHintObserver -import com.github.braillesystems.learnbraille.screens.getEventIncorrectObserver -import com.github.braillesystems.learnbraille.screens.getEventPassHintObserver +import com.github.braillesystems.learnbraille.screens.* import com.github.braillesystems.learnbraille.util.application import com.github.braillesystems.learnbraille.util.updateTitle import com.github.braillesystems.learnbraille.views.* @@ -24,7 +21,6 @@ import timber.log.Timber class InputSymbolFragment : AbstractInputLesson(R.string.lessons_help_input_symbol) { - private lateinit var viewModel: InputViewModel private lateinit var expectedDots: BrailleDots private lateinit var dots: BrailleDotsState private var buzzer: Vibrator? = null @@ -50,6 +46,7 @@ class InputSymbolFragment : AbstractInputLesson(R.string.lessons_help_input_symb titleTextView.text = step.title letter.text = step.data.symbol.symbol.toString() brailleDots.dots.display(step.data.symbol.brailleDots) + makeIntroLetterToast(step.data.symbol.symbol.toString()) expectedDots = step.data.symbol.brailleDots userTouchedDots = false @@ -94,7 +91,9 @@ class InputSymbolFragment : AbstractInputLesson(R.string.lessons_help_input_symb viewLifecycleOwner, viewModel.getEventIncorrectObserver( dots, buzzer, - getEventIncorrectObserverBlock(step, defaultUser, database, dots) + getEventIncorrectObserverBlock(step, defaultUser, database, dots) { + makeIncorrectLetterToast(step.data.symbol.symbol.toString()) + } ) ) @@ -108,7 +107,11 @@ class InputSymbolFragment : AbstractInputLesson(R.string.lessons_help_input_symb viewModel.eventPassHint.observe( viewLifecycleOwner, - viewModel.getEventPassHintObserver(dots, getEventPassHintObserverBlock()) + viewModel.getEventPassHintObserver( + dots, getEventPassHintObserverBlock { + makeIntroLetterToast(step.data.symbol.symbol.toString()) + } + ) ) }.root diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/menu/MenuFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/menu/MenuFragment.kt index 80b0c2bb..2bba4d09 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/menu/MenuFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/menu/MenuFragment.kt @@ -88,7 +88,7 @@ class MenuFragment : AbstractFragmentWithHelp(R.string.menu_help) { } if (resultCode == RESULT_CANCELED) { Toast.makeText( - context, getString(R.string.msg_cancelled), Toast.LENGTH_SHORT + context, getString(R.string.qr_intent_cancelled), Toast.LENGTH_SHORT ).show() } } diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/practice/PracticeFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/practice/PracticeFragment.kt index 60825be9..f27d7bac 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/practice/PracticeFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/practice/PracticeFragment.kt @@ -7,13 +7,11 @@ import android.os.Bundle import android.os.Vibrator import android.view.LayoutInflater import android.view.ViewGroup -import android.widget.Toast import androidx.core.content.getSystemService import androidx.databinding.DataBindingUtil import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProvider import com.github.braillesystems.learnbraille.R -import com.github.braillesystems.learnbraille.database.entities.spelling import com.github.braillesystems.learnbraille.database.getDBInstance import com.github.braillesystems.learnbraille.databinding.FragmentPracticeBinding import com.github.braillesystems.learnbraille.screens.* @@ -91,7 +89,7 @@ class PracticeFragment : AbstractFragmentWithHelp(R.string.practice_help) { viewLifecycleOwner, viewModel.getEventCorrectObserver(dots, buzzer) { Timber.i("Handle correct") - Toast.makeText(context, getString(R.string.msg_correct), Toast.LENGTH_SHORT).show() + makeCorrectToast() updateTitle(title) } ) @@ -100,9 +98,7 @@ class PracticeFragment : AbstractFragmentWithHelp(R.string.practice_help) { viewLifecycleOwner, viewModel.getEventIncorrectObserver(dots, buzzer) { Timber.i("Handle incorrect: entered = ${dots.spelling}") - Toast.makeText( - context, getString(R.string.msg_incorrect), Toast.LENGTH_SHORT - ).show() + makeIncorrectLetterToast(viewModel.symbol.value) updateTitle(title) } ) @@ -111,9 +107,7 @@ class PracticeFragment : AbstractFragmentWithHelp(R.string.practice_help) { viewLifecycleOwner, viewModel.getEventHintObserver(dots, serial) { expectedDots -> Timber.i("Handle hint") - val toast = getString(R.string.practice_hint_template) - .format(expectedDots.spelling) - Toast.makeText(context, toast, Toast.LENGTH_LONG).show() + makeHintDotsToast(expectedDots) } ) @@ -121,18 +115,14 @@ class PracticeFragment : AbstractFragmentWithHelp(R.string.practice_help) { viewLifecycleOwner, viewModel.getEventPassHintObserver(dots) { Timber.i("Handle pass hint") + makeIntroLetterToast(viewModel.symbol.value) } ) viewModel.symbol.observe( viewLifecycleOwner, Observer { - require(it != null) - Toast.makeText( - context, - getString(R.string.practice_new_letter_toast_template).format(it), - Toast.LENGTH_SHORT - ).show() + makeIntroLetterToast(it) } ) diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index cafa0a90..3aa4f3d0 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -5,17 +5,23 @@ Learn Braille Beta Hello blank fragment No help message - Правильно! - Неправильно! - Ошибка, попытайтесь ещё раз + + Правильно! + Неправильно! + Введите букву: %s + Неправильно. Введите букву %s + Ответ: точки %s + Подождите, задание загружается + + + + Ошибка, попытайтесь ещё раз Подсказка - "Ответ: точки %s" Далее Практика: %d из %d - Буква: %s Вызов справки - кнопка вверху справа.

- Если Вы забыли символ, можно нажать кнопку с вопросительным знаком слева внизу экрана. По нажатию этой кнопки будет выведено сообщение с верными номерами точек, шеститочие будет заполнено правильными точками и недоступно для переключения. После этого нужно нажать кнопку From f9b9bbe94bcbba95ed71f0284f03b843428d07e2 Mon Sep 17 00:00:00 2001 From: Valerii Zuev Date: Mon, 20 Apr 2020 11:16:07 +0300 Subject: [PATCH 09/15] 3.19 update version tag --- android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 2232f1ee..7230fc8e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -23,7 +23,7 @@ android { minSdkVersion 19 targetSdkVersion 29 versionCode 1 - versionName "0.3" + versionName "0.4.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } From 82e3c544fc8759f93ed04d02bd4add6844995621 Mon Sep 17 00:00:00 2001 From: Valerii Zuev Date: Mon, 20 Apr 2020 11:19:43 +0300 Subject: [PATCH 10/15] 3.19 fix dots numbers spelling with older TalkBack --- android/app/src/main/res/values/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 3aa4f3d0..8583e1d3 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -169,12 +169,12 @@ - точка 1 - точка 2 - точка 3 - точка 4 - точка 5 - точка 6 + точка один + точка два + точка три + точка четыре + точка пять + точка шесть From 965ba20797a8165b1b435b3da238805553bcbfef Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Mon, 20 Apr 2020 11:53:49 +0300 Subject: [PATCH 11/15] Unify toast durations --- .../learnbraille/LearnBrailleApplication.kt | 2 +- .../learnbraille/screens/menu/MenuFragment.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt index c8f701de..b0f3c052 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt @@ -41,4 +41,4 @@ const val defaultUser = 1L const val DEBUG = false -const val TOAST_DURATION = Toast.LENGTH_LONG +const val TOAST_DURATION = Toast.LENGTH_SHORT diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/menu/MenuFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/menu/MenuFragment.kt index 2bba4d09..c40b3f11 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/menu/MenuFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/menu/MenuFragment.kt @@ -13,6 +13,7 @@ import androidx.databinding.DataBindingUtil import androidx.navigation.Navigation import androidx.navigation.fragment.findNavController import com.github.braillesystems.learnbraille.R +import com.github.braillesystems.learnbraille.TOAST_DURATION import com.github.braillesystems.learnbraille.database.LearnBrailleDatabase import com.github.braillesystems.learnbraille.database.getDBInstance import com.github.braillesystems.learnbraille.databinding.FragmentMenuBinding @@ -44,7 +45,6 @@ class MenuFragment : AbstractFragmentWithHelp(R.string.menu_help) { ).apply { updateTitle(getString(R.string.menu_actionbar_text)) - setHasOptionsMenu(true) lessonsButton.setOnClickListener(interruptingOnClickListener { @@ -84,11 +84,11 @@ class MenuFragment : AbstractFragmentWithHelp(R.string.menu_help) { if (requestCode == qtResultCode) { if (resultCode == RESULT_OK) { val contents = data?.getStringExtra("SCAN_RESULT") - Toast.makeText(context, contents, Toast.LENGTH_SHORT).show() + Toast.makeText(context, contents, TOAST_DURATION).show() } if (resultCode == RESULT_CANCELED) { Toast.makeText( - context, getString(R.string.qr_intent_cancelled), Toast.LENGTH_SHORT + context, getString(R.string.qr_intent_cancelled), TOAST_DURATION ).show() } } @@ -97,7 +97,7 @@ class MenuFragment : AbstractFragmentWithHelp(R.string.menu_help) { private fun interruptingOnClickListener(block: (View) -> Unit) = View.OnClickListener { if (!isDbPrepopulated) { Toast.makeText( - context, getString(R.string.menu_db_not_initialized_warning), Toast.LENGTH_LONG + context, getString(R.string.menu_db_not_initialized_warning), TOAST_DURATION ).show() return@OnClickListener } From 896ff61e6427a1dfe79f47ce55415b233e2d8a9e Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Mon, 20 Apr 2020 11:54:47 +0300 Subject: [PATCH 12/15] Fix style --- .../learnbraille/database/entities/BrailleDots.kt | 7 ++----- .../learnbraille/database/entities/StepData.kt | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/BrailleDots.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/BrailleDots.kt index a9786583..4d0b8531 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/BrailleDots.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/BrailleDots.kt @@ -56,11 +56,8 @@ val BrailleDots.list: List val BrailleDots.spelling: String get() = list .mapIndexed { index, brailleDot -> - if (brailleDot == BrailleDot.F) { - (index + 1).toString() - } else { - null - } + if (brailleDot == E) null + else (index + 1).toString() } .filterNotNull() .joinToString(separator = ", ") diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/StepData.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/StepData.kt index ab138df7..62d9cacb 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/StepData.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/database/entities/StepData.kt @@ -36,7 +36,7 @@ fun stepDataOf(string: String): StepData = string } /** - * Represent step types with information. + * Represents step types with information. */ sealed class BaseInfo : StepData() From 835f48677222831b64d9c1e0e4f748880f8f8188 Mon Sep 17 00:00:00 2001 From: Andrey Stoyan Date: Mon, 20 Apr 2020 13:24:09 +0300 Subject: [PATCH 13/15] Fix style --- .../learnbraille/screens/lessons/AbstractInputLesson.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/AbstractInputLesson.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/AbstractInputLesson.kt index 77b128b2..35c29b88 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/AbstractInputLesson.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/AbstractInputLesson.kt @@ -48,9 +48,9 @@ abstract class AbstractInputLesson(helpMsgId: HelpMsgId) : AbstractLesson(helpMs userId: Long, database: LearnBrailleDatabase ): () -> Unit = { + Timber.i("Handle correct") + makeCorrectToast() database.apply { - Timber.i("Handle correct") - makeCorrectToast() navigateToNextStep( current = step, userId = userId, From 3b963efa3cf9dbec6341c39c30f31154168fd9cc Mon Sep 17 00:00:00 2001 From: Valerii Zuev Date: Mon, 20 Apr 2020 22:28:27 +0300 Subject: [PATCH 14/15] 4.19 make textviews in help and lessons scrollable --- .../braillesystems/learnbraille/screens/help/HelpFragment.kt | 2 ++ .../learnbraille/screens/lessons/FirstInfoFragment.kt | 2 ++ .../braillesystems/learnbraille/screens/lessons/InfoFragment.kt | 2 ++ .../learnbraille/screens/lessons/LastInfoFragment.kt | 2 ++ android/app/src/main/res/layout/fragment_help.xml | 1 + android/app/src/main/res/layout/fragment_lesson_first_info.xml | 1 + 6 files changed, 10 insertions(+) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/help/HelpFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/help/HelpFragment.kt index cb676be6..b021f748 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/help/HelpFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/help/HelpFragment.kt @@ -1,6 +1,7 @@ package com.github.braillesystems.learnbraille.screens.help import android.os.Bundle +import android.text.method.ScrollingMovementMethod import android.view.LayoutInflater import android.view.ViewGroup import androidx.databinding.DataBindingUtil @@ -25,6 +26,7 @@ class HelpFragment : Fragment() { ).apply { updateTitle(getString(R.string.help_title)) + helpMessage.movementMethod= ScrollingMovementMethod() helpMessage.text = getFormattedArg(helpMessageArgName) }.root diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/FirstInfoFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/FirstInfoFragment.kt index f5b55691..adb17313 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/FirstInfoFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/FirstInfoFragment.kt @@ -1,6 +1,7 @@ package com.github.braillesystems.learnbraille.screens.lessons import android.os.Bundle +import android.text.method.ScrollingMovementMethod import android.view.LayoutInflater import android.view.ViewGroup import androidx.databinding.DataBindingUtil @@ -31,6 +32,7 @@ class FirstInfoFragment : AbstractLesson(R.string.lessons_help_info) { require(step.data is FirstInfo) titleTextView.text = step.title infoTextView.text = step.data.text + infoTextView.movementMethod= ScrollingMovementMethod() getDBInstance().apply { nextButton.setOnClickListener { diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InfoFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InfoFragment.kt index 4cf4e595..f186e5a0 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InfoFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InfoFragment.kt @@ -1,6 +1,7 @@ package com.github.braillesystems.learnbraille.screens.lessons import android.os.Bundle +import android.text.method.ScrollingMovementMethod import android.view.LayoutInflater import android.view.ViewGroup import androidx.databinding.DataBindingUtil @@ -31,6 +32,7 @@ class InfoFragment : AbstractLesson(R.string.lessons_help_info) { require(step.data is Info) titleTextView.text = step.title infoTextView.text = step.data.text + infoTextView.movementMethod= ScrollingMovementMethod() getDBInstance().apply { prevButton.setOnClickListener { diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/LastInfoFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/LastInfoFragment.kt index cb4937ae..6fecedc8 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/LastInfoFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/LastInfoFragment.kt @@ -1,6 +1,7 @@ package com.github.braillesystems.learnbraille.screens.lessons import android.os.Bundle +import android.text.method.ScrollingMovementMethod import android.view.LayoutInflater import android.view.ViewGroup import androidx.databinding.DataBindingUtil @@ -31,6 +32,7 @@ class LastInfoFragment : AbstractLesson(R.string.lessons_help_last_info) { require(step.data is LastInfo) titleTextView.text = step.title infoTextView.text = step.data.text + infoTextView.movementMethod= ScrollingMovementMethod() getDBInstance().run { prevButton.setOnClickListener { diff --git a/android/app/src/main/res/layout/fragment_help.xml b/android/app/src/main/res/layout/fragment_help.xml index 6a6e9c5e..97844aa1 100644 --- a/android/app/src/main/res/layout/fragment_help.xml +++ b/android/app/src/main/res/layout/fragment_help.xml @@ -11,6 +11,7 @@ android:paddingTop="2dp" android:paddingEnd="2dp" android:paddingBottom="2dp" + android:scrollbars = "vertical" android:text="@string/default_help_message" android:textSize="18sp" app:autoSizeTextType="none" /> diff --git a/android/app/src/main/res/layout/fragment_lesson_first_info.xml b/android/app/src/main/res/layout/fragment_lesson_first_info.xml index e597e128..eb01513c 100644 --- a/android/app/src/main/res/layout/fragment_lesson_first_info.xml +++ b/android/app/src/main/res/layout/fragment_lesson_first_info.xml @@ -25,6 +25,7 @@ android:id="@+id/info_text_view" android:layout_width="@dimen/lessons_info_width" android:layout_height="@dimen/lessons_info_height" + android:scrollbars = "vertical" android:text="" android:textSize="@dimen/lessons_info_text_size" app:layout_constraintBottom_toBottomOf="parent" From 713eff064e580bdcfd7637808170bf5d3edfa5e5 Mon Sep 17 00:00:00 2001 From: Valerii Zuev Date: Mon, 20 Apr 2020 22:38:16 +0300 Subject: [PATCH 15/15] 4.19 fix code style --- .../braillesystems/learnbraille/screens/help/HelpFragment.kt | 2 +- .../learnbraille/screens/lessons/FirstInfoFragment.kt | 2 +- .../braillesystems/learnbraille/screens/lessons/InfoFragment.kt | 2 +- .../learnbraille/screens/lessons/LastInfoFragment.kt | 2 +- android/app/src/main/res/layout/fragment_help.xml | 2 +- android/app/src/main/res/layout/fragment_lesson_first_info.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/help/HelpFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/help/HelpFragment.kt index b021f748..79ed97ef 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/help/HelpFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/help/HelpFragment.kt @@ -26,7 +26,7 @@ class HelpFragment : Fragment() { ).apply { updateTitle(getString(R.string.help_title)) - helpMessage.movementMethod= ScrollingMovementMethod() + helpMessage.movementMethod = ScrollingMovementMethod() helpMessage.text = getFormattedArg(helpMessageArgName) }.root diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/FirstInfoFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/FirstInfoFragment.kt index adb17313..ef0ea5b2 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/FirstInfoFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/FirstInfoFragment.kt @@ -32,7 +32,7 @@ class FirstInfoFragment : AbstractLesson(R.string.lessons_help_info) { require(step.data is FirstInfo) titleTextView.text = step.title infoTextView.text = step.data.text - infoTextView.movementMethod= ScrollingMovementMethod() + infoTextView.movementMethod = ScrollingMovementMethod() getDBInstance().apply { nextButton.setOnClickListener { diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InfoFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InfoFragment.kt index f186e5a0..894fb0e0 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InfoFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/InfoFragment.kt @@ -32,7 +32,7 @@ class InfoFragment : AbstractLesson(R.string.lessons_help_info) { require(step.data is Info) titleTextView.text = step.title infoTextView.text = step.data.text - infoTextView.movementMethod= ScrollingMovementMethod() + infoTextView.movementMethod = ScrollingMovementMethod() getDBInstance().apply { prevButton.setOnClickListener { diff --git a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/LastInfoFragment.kt b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/LastInfoFragment.kt index 6fecedc8..74905756 100644 --- a/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/LastInfoFragment.kt +++ b/android/app/src/main/java/com/github/braillesystems/learnbraille/screens/lessons/LastInfoFragment.kt @@ -32,7 +32,7 @@ class LastInfoFragment : AbstractLesson(R.string.lessons_help_last_info) { require(step.data is LastInfo) titleTextView.text = step.title infoTextView.text = step.data.text - infoTextView.movementMethod= ScrollingMovementMethod() + infoTextView.movementMethod = ScrollingMovementMethod() getDBInstance().run { prevButton.setOnClickListener { diff --git a/android/app/src/main/res/layout/fragment_help.xml b/android/app/src/main/res/layout/fragment_help.xml index 97844aa1..3b624b46 100644 --- a/android/app/src/main/res/layout/fragment_help.xml +++ b/android/app/src/main/res/layout/fragment_help.xml @@ -11,7 +11,7 @@ android:paddingTop="2dp" android:paddingEnd="2dp" android:paddingBottom="2dp" - android:scrollbars = "vertical" + android:scrollbars="vertical" android:text="@string/default_help_message" android:textSize="18sp" app:autoSizeTextType="none" /> diff --git a/android/app/src/main/res/layout/fragment_lesson_first_info.xml b/android/app/src/main/res/layout/fragment_lesson_first_info.xml index eb01513c..5450cf3e 100644 --- a/android/app/src/main/res/layout/fragment_lesson_first_info.xml +++ b/android/app/src/main/res/layout/fragment_lesson_first_info.xml @@ -25,7 +25,7 @@ android:id="@+id/info_text_view" android:layout_width="@dimen/lessons_info_width" android:layout_height="@dimen/lessons_info_height" - android:scrollbars = "vertical" + android:scrollbars="vertical" android:text="" android:textSize="@dimen/lessons_info_text_size" app:layout_constraintBottom_toBottomOf="parent"