Updated cast-framework dependency

- Fix Dialog opener context
This commit is contained in:
gianlucaparadise 2021-10-12 08:51:53 +02:00
parent d019f322d5
commit c19b39a216
3 changed files with 6 additions and 7 deletions

View file

@ -44,7 +44,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api "com.google.android.gms:play-services-cast-framework:17.1.0" api "com.google.android.gms:play-services-cast-framework:19.0.0"
// Lifecycle // Lifecycle
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"

View file

@ -7,7 +7,6 @@ import androidx.mediarouter.app.MediaRouteChooserDialog
import androidx.mediarouter.app.MediaRouteControllerDialog import androidx.mediarouter.app.MediaRouteControllerDialog
import com.gianlucaparadise.flutter_cast_framework.FlutterCastFrameworkPlugin import com.gianlucaparadise.flutter_cast_framework.FlutterCastFrameworkPlugin
import com.google.android.gms.cast.framework.CastContext import com.google.android.gms.cast.framework.CastContext
import io.flutter.plugin.common.PluginRegistry
object CastDialogOpener { object CastDialogOpener {
fun showCastDialog(applicationContext: Context, activity: Activity) { fun showCastDialog(applicationContext: Context, activity: Activity) {
@ -19,11 +18,11 @@ object CastDialogOpener {
try { try {
if (castSession != null) { if (castSession != null) {
// This dialog allows the user to control or disconnect from the currently selected route. // This dialog allows the user to control or disconnect from the currently selected route.
MediaRouteControllerDialog(applicationContext, themeResId) MediaRouteControllerDialog(activity, themeResId)
.show() .show()
} else { } else {
// This dialog allows the user to choose a route that matches a given selector. // This dialog allows the user to choose a route that matches a given selector.
MediaRouteChooserDialog(applicationContext, themeResId).apply { MediaRouteChooserDialog(activity, themeResId).apply {
routeSelector = castContext.mergedSelector routeSelector = castContext.mergedSelector
show() show()
} }

View file

@ -62,8 +62,8 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.appcompat:appcompat:1.3.1'
androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
} }