Skip to content

Commit

Permalink
braille-systems#278 fix detekt: too many functions in Messages.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
zuevval committed Oct 3, 2020
1 parent 757eda4 commit c13bd9c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ fun Fragment.showCorrectToast() = toast(getString(R.string.input_correct))
fun Fragment.showIncorrectToast(hint: String = "") =
toast("${getString(R.string.input_incorrect)} $hint")

fun Fragment.announceCorrect() = announce(getString(R.string.input_correct))

fun Fragment.announceIncorrect(hint: String = "") =
announce("${getString(R.string.input_incorrect)} $hint")

fun Fragment.dotsMode(mode: BrailleDotsViewMode): String =
when (mode) {
BrailleDotsViewMode.Writing -> getString(R.string.braille_dots_mode_writing)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.github.braillesystems.learnbraille.ui.screens.practice

import android.animation.ArgbEvaluator
import android.animation.ObjectAnimator
import android.os.Bundle
import android.os.Vibrator
import android.view.*
import android.widget.Button
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.core.content.getSystemService
import androidx.databinding.DataBindingUtil
Expand All @@ -20,16 +17,15 @@ import com.github.braillesystems.learnbraille.databinding.FragmentCardBinding
import com.github.braillesystems.learnbraille.res.captionRules
import com.github.braillesystems.learnbraille.res.deckTagToName
import com.github.braillesystems.learnbraille.res.inputMarkerPrintRules
import com.github.braillesystems.learnbraille.ui.announceCorrect
import com.github.braillesystems.learnbraille.ui.announceIncorrect
import com.github.braillesystems.learnbraille.utils.announceCorrect
import com.github.braillesystems.learnbraille.utils.announceIncorrect
import com.github.braillesystems.learnbraille.ui.brailletrainer.BrailleTrainer
import com.github.braillesystems.learnbraille.ui.brailletrainer.BrailleTrainerSignalHandler
import com.github.braillesystems.learnbraille.ui.inputPrint
import com.github.braillesystems.learnbraille.ui.screens.*
import com.github.braillesystems.learnbraille.ui.showHintToast
import com.github.braillesystems.learnbraille.ui.views.*
import com.github.braillesystems.learnbraille.utils.*
import com.google.android.material.button.MaterialButton
import org.koin.android.ext.android.inject
import org.koin.core.parameter.parametersOf
import timber.log.Timber
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ fun Fragment.checkedAnnounce(
announce(announcement)
}

fun Fragment.announceCorrect() = announce(getString(R.string.input_correct))

fun Fragment.announceIncorrect(hint: String = "") =
announce("${getString(R.string.input_incorrect)} $hint")

val Fragment.actionBar: ActionBar?
get() = (activity as AppCompatActivity).supportActionBar
Expand All @@ -92,7 +96,7 @@ fun Fragment.updateTitle(title: String) {
this.title = title
}

fun animateView(obj: View?, colorFrom: Int?, colorTo: Int?){
fun animateView(obj: View?, colorFrom: Int?, colorTo: Int?) {
val duration = 1000
ObjectAnimator
.ofObject(obj, "backgroundColor", ArgbEvaluator(), colorFrom, colorTo, colorFrom)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<string name="deck_name_markers">Специальные символы</string>
<string name="deck_name_math">Математические символы</string>

<!-- TODO #278 correct help messages after un-setting dots background -->

<string name="practice_help">
<![CDATA[
Expand Down

0 comments on commit c13bd9c

Please sign in to comment.