Skip to content

Allow overriding drawables locally (only for a specific PlayerView instance) #1200

Closed

Description

@ziem

[REQUIRED] Use case description

My app has two players: video player and podcast player. Both should look different in terms of icons, buttons' positions, and spacing. Spacing and reordering buttons is easy, but it seems that the only option to replace icons is to do it globally1, for all PlayerViews.

Proposed solution

It would be great to have attributes similar to show_timeout2 for icons/resources used in the PlayerControlView.
e.g.:

  • play_resource_id
  • pause_resource_id
  • etc.

with the fallback to exo_styled_controls_play, exo_styled_controls_pause, .. if not present.

Alternatives considered

No alternatives were considered.


Ref.:

Activity

  1. oceanjules commented on Mar 19, 2024

    @oceanjules
    Contributor

    Please correct me if I'm wrong. Do I understand that you want:

    playResourceId = 
       a.getResourceId(R.styleable.PlayerView_play_resource_id, 
                      /* defValue= */ R.drawable.exo_styled_controls_play);
    

    and then you can define various xml views

    app:play_resource_id="R.drawable.personal_controls_play"

    or

    app:play_resource_id="R.drawable.personal_controls_play_new"

    and

    <drawable name="personal_controls_play">@drawable/personal_play_circle_filled</drawable>

    <drawable name="personal_controls_play_new">@drawable/personal_play_square</drawable>

  2. ziem commented on Mar 20, 2024

    @ziem
    Author

    Yes, exactly

  3. self-assigned this
    on Mar 23, 2024
  4. ziem commented on Apr 15, 2024

    @ziem
    Author

    Do you have any updates on this ticket?

  5. oceanjules commented on May 8, 2024

    @oceanjules
    Contributor

    Hi @ziem, apologies, I have been away for a month. I discussed this internally within the team and I don't see any issue with the proposed solution above. I will prioritise it next week and hopefully you can test it out in 1.4.0 alpha/beta

  6. ziem commented on May 9, 2024

    @ziem
    Author

    Awesome, thank you 🙂

  7. locked and limited conversation to collaborators on Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions