Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Cast MiniControllerFragment customization

I'm trying to customize castBackground and castProgressBarColor MiniControllerFragment attributes as explained in official documentation: https://developers.google.com/cast/docs/android_sender_advanced

I use the following style for my Activity:

 <style name="AppTheme.NoActionBarNoTitle" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="castIntroOverlayStyle">@style/CustomCastIntroOverlay</item>
    <item name="castMiniControllerStyle">@style/CustomCastMiniController</item>
</style>

and this is CustomCastMiniController style:

   <style name="CustomCastMiniController" parent="CastMiniController">
    <item name="castShowImageThumbnail">true</item>
    <item name="castTitleTextAppearance">@style/TextAppearance.AppCompat.Subhead</item>
    <item name="castSubtitleTextAppearance">@style/TextAppearance.AppCompat.Caption</item>
    <item name="castBackground">#FFFFFF</item>
    <item name="castProgressBarColor">#FFFFFF</item>
</style>

I am unable to build because these errors:

Error:(2073, 21) No resource found that matches the given name: attr 'castBackground'.
Error:(2074, 21) No resource found that matches the given name: attr 'castProgressBarColor'.

If I remove these two attributes in my CustomCastMiniController style app start successfully.

like image 859
TheModularMind Avatar asked Jan 18 '26 05:01

TheModularMind


1 Answers

The attributes castBackground and castProgressBarColor were introduced in a later version of the Google Cast SDK, as indicated in the release notes:

Oktober 24, 2016

  • Added ability to customize the style of mini controllers: added castBackground for setting its background color, castButtonColor to color all buttons used in the mini controller, and castProgressBarColor to color the progress bar.

So please make sure that you are compiling with the latest release of the Google Cast SDK in your build.gradle file (version 10.0.0 at the time of writing):

dependencies {
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:mediarouter-v7:25.0.1'
    compile 'com.google.android.gms:play-services-cast-framework:10.0.0'
}
like image 143
TR4Android Avatar answered Jan 19 '26 19:01

TR4Android



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!