Android TV support

This commit is contained in:
kilowatt 2020-10-31 23:52:23 +03:00
parent dab540674b
commit f91fe8f216
7 changed files with 184 additions and 112 deletions

View file

@ -20,6 +20,7 @@ class PlayerBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
var focusNode = FocusNode();
return GestureDetector(
onHorizontalDragUpdate: (details) async {
if (_gestureRegistered) return;
@ -46,9 +47,11 @@ class PlayerBar extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
color: Theme.of(context).bottomAppBarColor,
// For Android TV: indicate focus by grey
color: focusNode.hasFocus ? Colors.black26 : Theme.of(context).bottomAppBarColor,
child: ListTile(
dense: true,
focusNode: focusNode,
contentPadding: EdgeInsets.symmetric(horizontal: 8.0),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(