Unverified Commit cc9e26a8 authored by Mygod's avatar Mygod Committed by GitHub

Bring back semitransparent TV app via build variants (#2741)

This creates two variants for tv, freedom containing the original design, and google containing one matching Google's nonsense guideline. The former should be published on GitHub and elsewhere.

Revert "Revert "Revert "Revert "Revert "Make app fullscreen to match guidelines"""""

This reverts commit 0c67ac6a.
parent c62d405c
......@@ -9,7 +9,22 @@ plugins {
setupApp()
android.defaultConfig.applicationId = "com.github.shadowsocks.tv"
android {
defaultConfig {
applicationId = "com.github.shadowsocks.tv"
buildConfigField("boolean", "FULLSCREEN", "false")
}
flavorDimensions("market")
productFlavors {
create("freedom") {
dimension("market")
}
create("google") {
dimension("market")
buildConfigField("boolean", "FULLSCREEN", "true")
}
}
}
dependencies {
implementation("androidx.leanback:leanback-preference:1.1.0-rc01")
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Shadowsocks.TV" parent="@style/Theme.Shadowsocks.TVBase">
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
</resources>
......@@ -62,8 +62,10 @@ class MainFragment : LeanbackSettingsFragmentCompat() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.findViewById<View>(R.id.settings_preference_fragment_container).updateLayoutParams {
width = ViewGroup.LayoutParams.MATCH_PARENT
if (BuildConfig.FULLSCREEN) {
view.findViewById<View>(R.id.settings_preference_fragment_container).updateLayoutParams {
width = ViewGroup.LayoutParams.MATCH_PARENT
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Shadowsocks.TV" parent="@style/Theme.AppCompat.Leanback">
<style name="Theme.Shadowsocks.TVBase" parent="@style/Theme.AppCompat.Leanback">
<item name="android:colorAccent">@color/material_accent_200</item>
<item name="android:colorButtonNormal">@color/material_accent_200</item>
<item name="android:colorPrimary">@color/color_primary</item>
<item name="android:colorPrimaryDark">@color/color_primary_dark</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Shadowsocks.TV</item>
</style>
<style name="Theme.Shadowsocks.TV" parent="@style/Theme.Shadowsocks.TVBase" />
<style name="PreferenceThemeOverlay.Shadowsocks.TV" parent="@style/PreferenceThemeOverlay.v14.Leanback">
<item name="android:colorAccent">@color/material_accent_200</item>
<item name="android:colorButtonNormal">@color/material_accent_200</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment