forked from Ivy-Apps/ivy-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Fix issue Ivy-Apps#2987: Add User Feedback for Unselected '…
…To' Account in Transfers (Ivy-Apps#2988) * Fix issue Ivy-Apps#2987: Added Toast to notify a user that he hasn't chosen an account to send his money when doing Account Transfer Transaction * Fix issue Ivy-Apps#2987: Created Toaster class in shared.base to utilize it in EditTransactionViewModel. Added SharedModule to be able to inject Toaster into the ViewModel. Did all of this to make sure that ViewModel is not reliant on ApplicationContext or any other UI dependencies, but to our shared Toaster which we can utilize further in other sections of the app. * Fix issue Ivy-Apps#2987: Test push * Added annotation fix * Removed SharedModule because @Inject const is sufficient to let Hilt to build Toaster instances
- Loading branch information
1 parent
65e9f23
commit 0566fdd
Showing
3 changed files
with
35 additions
and
11 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.ivy.base | ||
|
||
import android.content.Context | ||
import android.widget.Toast | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import javax.inject.Inject | ||
|
||
class Toaster @Inject constructor( | ||
@ApplicationContext private val context: Context, | ||
) { | ||
fun show(messageId: Int, duration: Int = Toast.LENGTH_SHORT) { | ||
Toast.makeText(context, context.getString(messageId), duration).show() | ||
} | ||
} |
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