Forked from rharter/ThemeableMediaRouteActionProvider.java
Last active
October 7, 2016 15:09
-
-
Save danybony/e339d46776004f99ac9b3ac6f4812b4a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<resources> | |
<declare-styleable name="ThemeableMediaRouteButton"> | |
<attr name="iconColor" format="reference|color" /> | |
</declare-styleable> | |
</resources> |
This file contains hidden or 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
<resources> | |
<style name="Widget.MediaRouter.MediaRouteButton" parent="Widget.MediaRouter.Light.MediaRouteButton"> | |
<item name="iconColor">@color/red</item> | |
</style> | |
<style name="Widget.MediaRouter.MediaRouteButton.Section1"> | |
<item name="iconColor">@color/white</item> | |
</style> | |
<style name="Widget.MediaRouter.MediaRouteButton.Section2"> | |
<item name="iconColor">@color/blue</item> | |
</style> | |
</resources> |
This file contains hidden or 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
package com.ryanharter.mediaroute.widgets; | |
import android.content.Context; | |
import android.support.v7.app.MediaRouteActionProvider; | |
import android.support.v7.app.MediaRouteButton; | |
/** | |
* A MediaRouteActionProvider that allows the use of a ThemeableMediaRouteButton. | |
*/ | |
public class ThemeableMediaRouteActionProvider extends MediaRouteActionProvider { | |
public ThemeableMediaRouteActionProvider(Context context) { | |
super(context); | |
} | |
@Override public MediaRouteButton onCreateMediaRouteButton() { | |
return new ThemeableMediaRouteButton(getContext()); | |
} | |
} |
This file contains hidden or 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
<resources> | |
<style name="Theme.MyApp"> | |
<item name="mediaRouteButtonStyle">@style/Widget.MediaRouter.MediaRouteButton</item> | |
</style> | |
<style name="Theme.MyApp.Section1"> | |
<item name="mediaRouteButtonStyle">@style/Widget.MediaRouter.MediaRouteButton.Section1</item> | |
</style> | |
<style name="Theme.MyApp.Section2"> | |
<item name="mediaRouteButtonStyle">@style/Widget.MediaRouter.MediaRouteButton.Section2</item> | |
</style> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment