Commit f5084e04 authored by Mygod's avatar Mygod

Various fixes for #2263

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