-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/eliminate toasts #279
Draft
zuevval
wants to merge
10
commits into
braille-systems:dev
Choose a base branch
from
zuevval:feature/eliminate-toasts
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ca257c4
#278 add text on braille dots
zuevval fb0d4f8
#278 replace flipColumns toasts with announcement for accessibility
zuevval 1f3c090
#278 refine dots captions appearance
zuevval 1ac762b
#278 always announce dots reflection
zuevval 83be8ed
#278 change correct/incorrect toasts to button animation + announce
zuevval 625437c
#278 tweak dotButtons text padding in right column for different scre…
zuevval 757eda4
#278 change button animation to background animation
zuevval c13bd9c
#278 fix detekt: too many functions in Messages.kt
zuevval 86fab49
.idea: roll back to 'dev' (changed previously by mistake)
zuevval 114e439
#278 make gradient flash
zuevval File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
package com.github.braillesystems.learnbraille.utils | ||
|
||
import android.animation.ArgbEvaluator | ||
import android.animation.ObjectAnimator | ||
import android.content.Context | ||
import android.os.Vibrator | ||
import android.view.View | ||
import android.view.accessibility.AccessibilityEvent | ||
import android.widget.Toast | ||
import androidx.appcompat.app.ActionBar | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.constraintlayout.widget.ConstraintLayout | ||
import androidx.fragment.app.Fragment | ||
import com.github.braillesystems.learnbraille.LearnBrailleApplication | ||
import com.github.braillesystems.learnbraille.R | ||
|
@@ -68,6 +72,10 @@ fun Fragment.checkedAnnounce( | |
announce(announcement) | ||
} | ||
|
||
fun Fragment.announceCorrect() = announce(getString(R.string.input_correct)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is |
||
|
||
fun Fragment.announceIncorrect(hint: String = "") = | ||
announce("${getString(R.string.input_incorrect)} $hint") | ||
|
||
val Fragment.actionBar: ActionBar? | ||
get() = (activity as AppCompatActivity).supportActionBar | ||
|
@@ -88,6 +96,14 @@ fun Fragment.updateTitle(title: String) { | |
this.title = title | ||
} | ||
|
||
fun animateView(obj: View?, colorFrom: Int?, colorTo: Int?) { | ||
val duration = 1000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rathe be |
||
ObjectAnimator | ||
.ofObject(obj, "backgroundColor", ArgbEvaluator(), colorFrom, colorTo, colorFrom) | ||
.setDuration(duration.toLong()) | ||
.start() | ||
} | ||
|
||
|
||
fun <T> stringify(s: SerializationStrategy<T>, obj: T) = Json.stringify(s, obj) | ||
fun <T> parse(d: DeserializationStrategy<T>, s: String) = Json.parse(d, s) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<transition xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/background_blank" /> | ||
<item android:drawable="@drawable/background_gradient_green" /> | ||
</transition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<transition xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/background_blank" /> | ||
<item android:drawable="@drawable/background_gradient_red" /> | ||
</transition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@color/colorBackground" /> | ||
</shape> | ||
</item> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="rectangle"> | ||
<gradient | ||
android:startColor="@color/colorBackground" | ||
android:endColor="@color/lightGreen" | ||
android:angle="90"/> | ||
</shape> | ||
</item> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="rectangle"> | ||
<gradient | ||
android:startColor="@color/colorBackground" | ||
android:centerColor="@color/colorBackground" | ||
android:endColor="@color/lightRed" | ||
android:angle="90"/> | ||
</shape> | ||
</item> | ||
</selector> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This thing looked good to me. I think it is still useful