question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add asset for exo_controls_shuffle_off rather than applying transparency in code

See original GitHub issue

Before filing a question:

how to change color of Shuffle and Repeat Toggle button in exo_playback_control_view when selected

The way to change color for Shuffle button is

<ImageButton
            android:layout_weight="1"
            android:id="@id/exo_shuffle"
            android:tint="@android:color/holo_orange_light"    
            style="@style/ExoMediaButton.Shuffle" />

when its clicked the transparency changes to 0.3f

But I want to change the color to White , when the button is selected

how can this be done

thanks in advance

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marcbaechingercommented, Aug 30, 2019

The logic to apply the transparency is in code. You can not change this easily without changing the source code of PlayerControlView.

The style of the button is defined in a style. You can customize the existing style or apply another style. It’s possible to change the background color of the button or the tint of the icon on the button:

For example:

  <style name="ExoMediaButton.Shuffle">
    <item name="android:background">#FFFF0000</item>
    <item name="android:tint">#FF00FF00</item>
    <item name="android:src">@drawable/exo_controls_shuffle</item>
    <item name="android:contentDescription">@string/exo_controls_shuffle_description</item>
  </style>

With the style above, the background of the button is red and the shuffle icon is tinted green. Besides my color choice being ugly, that works fine and you can customize as you want.

There is a blog post around customizing the UI on Medium if you want more details about customizing the UI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found