Skip to content

Can we override visibility of prev and next button ? #7410

@Clement-Jean

Description

@Clement-Jean

After trying to do something like:

<ImageButton android:id="@+id/exo_prev"
             style="@style/ExoMediaButton.Previous"
             android:tint="@color/white"
             android:visibility="gone" />

I noticed that the button doesn't appear on Android studio preview but appears when I'm running the app. I then checked the source code and found that it comes from here:

  private void setButtonEnabled(boolean enabled, @Nullable View view) {
    if (view == null) {
      return;
    }
    view.setEnabled(enabled);
    view.setAlpha(enabled ? buttonAlphaEnabled : buttonAlphaDisabled);
    view.setVisibility(VISIBLE); // HERE
  }

Is there a way to override the visibility or should I do a PR (replacing VISIBLE by view.visibility) ?

EDIT:

Just to be clear, I think it should be possible to display it just under some conditions instead of displaying it automatically. In my case, I have an activity for the portrait mode (shouldn't get displayed) and another for the landscape (should get displayed).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions