Commit f5084e04 authored by Mygod's avatar Mygod

Various fixes for #2263

parent 5a6e2561
...@@ -216,7 +216,7 @@ class AppManager : AppCompatActivity() { ...@@ -216,7 +216,7 @@ class AppManager : AppCompatActivity() {
SingleInstanceActivity.register(this) ?: return SingleInstanceActivity.register(this) ?: return
setContentView(R.layout.layout_apps) setContentView(R.layout.layout_apps)
findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { v, insets -> findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { v, insets ->
v.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin += insets.systemWindowInsetTop } v.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = insets.systemWindowInsetTop }
insets.consumeSystemWindowInsetTop() insets.consumeSystemWindowInsetTop()
} }
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
...@@ -242,7 +242,7 @@ class AppManager : AppCompatActivity() { ...@@ -242,7 +242,7 @@ class AppManager : AppCompatActivity() {
initProxiedUids() initProxiedUids()
list.setOnApplyWindowInsetsListener { v, insets -> list.setOnApplyWindowInsetsListener { v, insets ->
v.updatePadding(bottom = v.paddingBottom + insets.systemWindowInsetBottom) v.updatePadding(bottom = insets.systemWindowInsetBottom)
insets.consumeSystemWindowInsets() insets.consumeSystemWindowInsets()
} }
list.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false) list.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)
......
...@@ -59,7 +59,7 @@ class ProfileConfigActivity : AppCompatActivity() { ...@@ -59,7 +59,7 @@ class ProfileConfigActivity : AppCompatActivity() {
SingleInstanceActivity.register(this) ?: return SingleInstanceActivity.register(this) ?: return
setContentView(R.layout.layout_profile_config) setContentView(R.layout.layout_profile_config)
findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { v, insets -> findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { v, insets ->
v.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin += insets.systemWindowInsetTop } v.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = insets.systemWindowInsetTop }
insets.consumeSystemWindowInsetTop() insets.consumeSystemWindowInsetTop()
} }
setSupportActionBar(findViewById(R.id.toolbar)) setSupportActionBar(findViewById(R.id.toolbar))
......
...@@ -117,7 +117,7 @@ class ProfileConfigFragment : PreferenceFragmentCompat(), ...@@ -117,7 +117,7 @@ class ProfileConfigFragment : PreferenceFragmentCompat(),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
listView.setOnApplyWindowInsetsListener { v, insets -> listView.setOnApplyWindowInsetsListener { v, insets ->
v.updatePadding(bottom = v.paddingBottom + insets.systemWindowInsetBottom) v.updatePadding(bottom = insets.systemWindowInsetBottom)
insets.consumeSystemWindowInsets() insets.consumeSystemWindowInsets()
} }
} }
......
...@@ -89,7 +89,7 @@ class UdpFallbackProfileActivity : AppCompatActivity() { ...@@ -89,7 +89,7 @@ class UdpFallbackProfileActivity : AppCompatActivity() {
SingleInstanceActivity.register(this) ?: return SingleInstanceActivity.register(this) ?: return
setContentView(R.layout.layout_udp_fallback) setContentView(R.layout.layout_udp_fallback)
findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { v, insets -> findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { v, insets ->
v.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin += insets.systemWindowInsetTop } v.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = insets.systemWindowInsetTop }
insets.consumeSystemWindowInsetTop() insets.consumeSystemWindowInsetTop()
} }
...@@ -100,7 +100,7 @@ class UdpFallbackProfileActivity : AppCompatActivity() { ...@@ -100,7 +100,7 @@ class UdpFallbackProfileActivity : AppCompatActivity() {
findViewById<RecyclerView>(R.id.list).apply { findViewById<RecyclerView>(R.id.list).apply {
setOnApplyWindowInsetsListener { v, insets -> setOnApplyWindowInsetsListener { v, insets ->
v.updatePadding(bottom = v.paddingBottom + insets.systemWindowInsetBottom) v.updatePadding(bottom = insets.systemWindowInsetBottom)
insets.consumeSystemWindowInsets() insets.consumeSystemWindowInsets()
} }
itemAnimator = DefaultItemAnimator() itemAnimator = DefaultItemAnimator()
......
...@@ -96,7 +96,7 @@ class ConfigActivity : AppCompatActivity() { ...@@ -96,7 +96,7 @@ class ConfigActivity : AppCompatActivity() {
taskerOption = Settings.fromIntent(intent) taskerOption = Settings.fromIntent(intent)
setContentView(R.layout.layout_tasker) setContentView(R.layout.layout_tasker)
findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { v, insets -> findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { v, insets ->
v.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin += insets.systemWindowInsetTop } v.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = insets.systemWindowInsetTop }
insets.consumeSystemWindowInsetTop() insets.consumeSystemWindowInsetTop()
} }
...@@ -109,7 +109,7 @@ class ConfigActivity : AppCompatActivity() { ...@@ -109,7 +109,7 @@ class ConfigActivity : AppCompatActivity() {
switch.isChecked = taskerOption.switchOn switch.isChecked = taskerOption.switchOn
findViewById<RecyclerView>(R.id.list).apply { findViewById<RecyclerView>(R.id.list).apply {
setOnApplyWindowInsetsListener { v, insets -> setOnApplyWindowInsetsListener { v, insets ->
v.updatePadding(bottom = v.paddingBottom + insets.systemWindowInsetBottom) v.updatePadding(bottom = insets.systemWindowInsetBottom)
insets.consumeSystemWindowInsets() insets.consumeSystemWindowInsets()
} }
itemAnimator = DefaultItemAnimator() itemAnimator = DefaultItemAnimator()
......
...@@ -9,9 +9,13 @@ ...@@ -9,9 +9,13 @@
<item name="colorPrimaryDark">@color/color_primary_dark</item> <item name="colorPrimaryDark">@color/color_primary_dark</item>
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
</style> </style>
<style name="ThemeOverlay.MaterialComponents.Dialog.Alert.Immersive">
<item name="android:windowTranslucentNavigation">false</item>
</style>
<style name="Theme.Shadowsocks.Immersive"> <style name="Theme.Shadowsocks.Immersive">
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentNavigation">true</item> <item name="android:windowTranslucentNavigation">true</item>
<item name="alertDialogTheme">@style/ThemeOverlay.MaterialComponents.Dialog.Alert.Immersive</item>
</style> </style>
<style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat.Dialog"> <style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat.Dialog">
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</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