Release seekbar on any confirmation key, not just DPAD_CENTER

This commit is contained in:
Alexander-- 2019-11-16 13:05:59 +06:59
parent 8d98f9a967
commit 72d23158c3
2 changed files with 15 additions and 1 deletions

View file

@ -25,6 +25,7 @@ import android.view.ViewTreeObserver;
import android.widget.SeekBar;
import androidx.appcompat.widget.AppCompatSeekBar;
import org.schabi.newpipe.util.FireTvUtils;
/**
* SeekBar, adapted for directional navigation. It emulates touch-related callbacks
@ -57,7 +58,7 @@ public final class FocusAwareSeekBar extends AppCompatSeekBar {
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (!isInTouchMode() && keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
if (!isInTouchMode() && FireTvUtils.isConfirmKey(keyCode)) {
releaseTrack();
}