-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/eliminate toasts #279
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
base: dev
Are you sure you want to change the base?
Changes from 9 commits
ca257c4
fb0d4f8
1f3c090
1ac762b
83be8ed
625437c
757eda4
c13bd9c
86fab49
114e439
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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)) | ||
|
Member
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 | ||
|
Member
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 was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <item android:drawable="@drawable/checked_round_checkbox" android:state_checked="true" /> | ||
| <item android:drawable="@drawable/checked_round_checkbox" android:state_pressed="true" /> | ||
| <item android:drawable="@drawable/unchecked_round_checkbox" android:state_pressed="false" /> | ||
| <item android:color="@color/colorBackground" android:drawable="@drawable/checked_round_checkbox" android:state_checked="true" /> | ||
| <item android:color="@color/colorBackground" android:drawable="@drawable/checked_round_checkbox" android:state_pressed="true" /> | ||
| <item android:color="@color/colorPrimary" android:drawable="@drawable/unchecked_round_checkbox" android:state_pressed="false" /> | ||
| </selector> |
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