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 a1e02f7704
commit c0fb96a911
2 changed files with 15 additions and 1 deletions

View file

@ -3,6 +3,7 @@ package org.schabi.newpipe.util;
import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import android.view.KeyEvent;
import org.schabi.newpipe.App;
public class FireTvUtils {
@ -15,4 +16,16 @@ public class FireTvUtils {
return pm.hasSystemFeature(AMAZON_FEATURE_FIRE_TV)
|| pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK);
}
public static boolean isConfirmKey(int keyCode) {
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
return true;
default:
return false;
}
}
}