-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf908c5
commit e83a580
Showing
6 changed files
with
132 additions
and
19 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
43 changes: 43 additions & 0 deletions
43
app/src/main/java/ani/dantotsu/media/anime/CustomCastThemeFactory.kt
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,43 @@ | ||
package ani.dantotsu.media.anime | ||
|
||
import android.content.Context | ||
import android.os.Bundle | ||
import androidx.mediarouter.app.MediaRouteActionProvider | ||
import androidx.mediarouter.app.MediaRouteChooserDialog | ||
import androidx.mediarouter.app.MediaRouteChooserDialogFragment | ||
import androidx.mediarouter.app.MediaRouteControllerDialog | ||
import androidx.mediarouter.app.MediaRouteControllerDialogFragment | ||
import androidx.mediarouter.app.MediaRouteDialogFactory | ||
import ani.dantotsu.R | ||
|
||
class CustomCastProvider(context: Context) : MediaRouteActionProvider(context) { | ||
init { | ||
dialogFactory = CustomCastThemeFactory() | ||
} | ||
} | ||
|
||
class CustomCastThemeFactory : MediaRouteDialogFactory() { | ||
override fun onCreateChooserDialogFragment(): MediaRouteChooserDialogFragment { | ||
return CustomMediaRouterChooserDialogFragment() | ||
} | ||
|
||
override fun onCreateControllerDialogFragment(): MediaRouteControllerDialogFragment { | ||
return CustomMediaRouteControllerDialogFragment() | ||
} | ||
} | ||
|
||
class CustomMediaRouterChooserDialogFragment: MediaRouteChooserDialogFragment() { | ||
override fun onCreateChooserDialog( | ||
context: Context, | ||
savedInstanceState: Bundle? | ||
): MediaRouteChooserDialog = | ||
MediaRouteChooserDialog(context) | ||
} | ||
|
||
class CustomMediaRouteControllerDialogFragment: MediaRouteControllerDialogFragment() { | ||
override fun onCreateControllerDialog( | ||
context: Context, | ||
savedInstanceState: Bundle? | ||
): MediaRouteControllerDialog = | ||
MediaRouteControllerDialog(context, R.style.ThemeOverlay_Dantotsu_MediaRouter) | ||
} |
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
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