Improve usability of settings on TV devices

* Add focus overlay to SettingsActivity
* Make screen "Contents of Main Page" navigable from remote
This commit is contained in:
Alexander-- 2019-12-01 12:38:01 +06:59
parent 29136d633a
commit 3f51114129
2 changed files with 7 additions and 0 deletions

View file

@ -12,7 +12,9 @@ import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.util.FireTvUtils;
import org.schabi.newpipe.util.ThemeHelper; import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.views.FocusOverlayView;
/* /*
@ -56,6 +58,10 @@ public class SettingsActivity extends AppCompatActivity implements BasePreferenc
.replace(R.id.fragment_holder, new MainSettingsFragment()) .replace(R.id.fragment_holder, new MainSettingsFragment())
.commit(); .commit();
} }
if (FireTvUtils.isFireTv()) {
FocusOverlayView.setupFocusObserver(this);
}
} }
@Override @Override

View file

@ -12,6 +12,7 @@
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:minHeight="?listPreferredItemHeightSmall" android:minHeight="?listPreferredItemHeightSmall"
android:orientation="horizontal" android:orientation="horizontal"
android:focusable="true"
app:cardCornerRadius="5dp" app:cardCornerRadius="5dp"
app:cardElevation="4dp"> app:cardElevation="4dp">