1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-01-25 08:26:57 +00:00

Added success toasts

This commit is contained in:
Isira Seneviratne 2024-11-29 07:05:06 +05:30
parent 6046e9642b
commit d4c4710b2d
2 changed files with 13 additions and 0 deletions

View File

@ -58,6 +58,12 @@ class SubscriptionExportWorker(
Log.i(TAG, "Exported $qty subscriptions")
}
withContext(Dispatchers.Main) {
Toast
.makeText(applicationContext, R.string.export_complete_toast, Toast.LENGTH_SHORT)
.show()
}
Result.success()
} catch (e: Exception) {
if (BuildConfig.DEBUG) {

View File

@ -6,6 +6,7 @@ import android.content.pm.ServiceInfo
import android.os.Build
import android.util.Pair
import android.webkit.MimeTypeMap
import android.widget.Toast
import androidx.core.app.NotificationCompat
import androidx.core.net.toUri
import androidx.work.CoroutineWorker
@ -98,6 +99,12 @@ class SubscriptionImportWorker(
setForeground(createForegroundInfo(createNotification(title, null, index, qty)))
}
withContext(Dispatchers.Main) {
Toast
.makeText(applicationContext, R.string.import_complete_toast, Toast.LENGTH_SHORT)
.show()
}
return Result.success()
}