From 0c67ac6a6a01ab7eb2dfdf9e6d282fa799578206 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 16 Mar 2019 13:15:33 +0800 Subject: [PATCH] Revert "Revert "Revert "Revert "Make app fullscreen to match guidelines"""" This reverts commit 57b846d22a85a446f5503709d16e822dd7ef8e52. --- .../java/com/github/shadowsocks/tv/MainFragment.kt | 11 +++++++++++ tv/src/main/res/values/styles.xml | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tv/src/main/java/com/github/shadowsocks/tv/MainFragment.kt b/tv/src/main/java/com/github/shadowsocks/tv/MainFragment.kt index 88d8981b65..df10c729dd 100644 --- a/tv/src/main/java/com/github/shadowsocks/tv/MainFragment.kt +++ b/tv/src/main/java/com/github/shadowsocks/tv/MainFragment.kt @@ -20,7 +20,11 @@ package com.github.shadowsocks.tv +import android.os.Bundle +import android.view.View +import android.view.ViewGroup import androidx.core.os.bundleOf +import androidx.core.view.updateLayoutParams import androidx.leanback.preference.LeanbackPreferenceDialogFragmentCompat import androidx.leanback.preference.LeanbackSettingsFragmentCompat import androidx.preference.* @@ -55,4 +59,11 @@ class MainFragment : LeanbackSettingsFragmentCompat() { } return super.onPreferenceDisplayDialog(caller, pref) } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + view.findViewById(R.id.settings_preference_fragment_container).updateLayoutParams { + width = ViewGroup.LayoutParams.MATCH_PARENT + } + } } diff --git a/tv/src/main/res/values/styles.xml b/tv/src/main/res/values/styles.xml index b7e3e05261..d96fdd4613 100644 --- a/tv/src/main/res/values/styles.xml +++ b/tv/src/main/res/values/styles.xml @@ -5,9 +5,6 @@ @color/material_accent_200 @color/color_primary @color/color_primary_dark - true - @android:color/transparent - true @style/PreferenceThemeOverlay.v14.Leanback