Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Fixes #3591 Support for media controls live language update #3622

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package org.mozilla.vrbrowser.ui.widgets;

import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Handler;
import android.util.AttributeSet;
Expand Down Expand Up @@ -38,20 +39,26 @@ public class MediaControlsWidget extends UIWidget implements MediaElement.Delega

public MediaControlsWidget(Context aContext) {
super(aContext);
initialize(aContext);
initialize();
}

public MediaControlsWidget(Context aContext, AttributeSet aAttrs) {
super(aContext, aAttrs);
initialize(aContext);
initialize();
}

public MediaControlsWidget(Context aContext, AttributeSet aAttrs, int aDefStyle) {
super(aContext, aAttrs, aDefStyle);
initialize(aContext);
initialize();
}

private void initialize(Context aContext) {
private void initialize() {
updateUI();
}

private void updateUI() {
removeAllViews();

LayoutInflater inflater = LayoutInflater.from(getContext());
mBinding = DataBindingUtil.inflate(inflater, R.layout.media_controls, this, true);
mBinding.setPlaying(true);
Expand Down Expand Up @@ -237,8 +244,13 @@ else if ((event.getX() <= 0) || (event.getX() >= v.getWidth()) || (!(event.getY(
}
return false;
});
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);

updateUI();
}

@Override
Expand Down