Updated on 2026-08-14
This commit is contained in:
parent
b9e1691dd2
commit
b50063f7dd
13 changed files with 70 additions and 29 deletions
|
|
@ -16,6 +16,12 @@ internal class NavigatorModule {
|
|||
return Navigator()
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
fun provideToastHelper(): ToastHelper {
|
||||
return ToastHelper()
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
fun provideWaitSecurityDelayDialogNew(): WaitSecurityDelayDialogNew {
|
||||
|
|
|
|||
27
app/src/main/java/com/tangem/di/ToastHelper.kt
Normal file
27
app/src/main/java/com/tangem/di/ToastHelper.kt
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package com.tangem.di
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.view.ViewGroup
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.tangem.Constant
|
||||
import com.tangem.wallet.R
|
||||
|
||||
class ToastHelper {
|
||||
|
||||
fun showSnackbarUpdateVersion(context: Context, vg: ViewGroup, versionName: String) {
|
||||
Snackbar.make(vg, String.format(context.getString(R.string.new_app_version), versionName), Snackbar.LENGTH_INDEFINITE)
|
||||
.setAction(R.string.update) {
|
||||
try {
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.data = Uri.parse(Constant.URL_TANGEM)
|
||||
context.startActivity(intent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}.show()
|
||||
}
|
||||
|
||||
}
|
||||
13
app/src/main/java/com/tangem/di/ToastHelperComponent.kt
Normal file
13
app/src/main/java/com/tangem/di/ToastHelperComponent.kt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package com.tangem.di
|
||||
|
||||
import com.tangem.ui.activity.MainActivity
|
||||
import dagger.Component
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
@Component(modules = [NavigatorModule::class])
|
||||
interface ToastHelperComponent {
|
||||
|
||||
fun inject(activity: MainActivity)
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue