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

Fixes #2008 Avoid volume seeker to reset when dragging out of bounds #2691

Merged
merged 1 commit into from
Jan 24, 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
@@ -1,14 +1,16 @@
package org.mozilla.vrbrowser.ui.views;

import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.FrameLayout;
import android.widget.SeekBar;

import org.mozilla.vrbrowser.R;

import androidx.annotation.Nullable;

import org.mozilla.vrbrowser.R;

public class VolumeControl extends FrameLayout implements SeekBar.OnSeekBarChangeListener {
private SeekBar mSeekBar;
private double mVolume;
Expand Down Expand Up @@ -40,11 +42,18 @@ public interface Delegate {
void onVolumeChange(double aVolume);
}

@SuppressLint("ClickableViewAccessibility")
private void initialize() {
inflate(getContext(), R.layout.volume_control, this);
mSeekBar = findViewById(R.id.volumeSeekBar);
mSeekBar.setProgress(100);
mSeekBar.setOnSeekBarChangeListener(this);
mSeekBar.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_UP) {
return true;
}
return false;
});
}

public void setDelegate(Delegate aDelegate) {
Expand Down