Skip to content

Commit 5c7e221

Browse files
committed
Fix broken layouts
1 parent 5d0aed2 commit 5c7e221

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

app/src/main/java/com/launium/mcping/ui/AbstractActivity.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ abstract class AbstractActivity : AppCompatActivity() {
1010

1111
override fun onCreate(savedInstanceState: Bundle?) {
1212
super.onCreate(savedInstanceState)
13-
14-
val colorSurfaceContainer =
15-
getAttrColor(com.google.android.material.R.attr.colorSurfaceContainer)
16-
window.statusBarColor = colorSurfaceContainer
17-
window.navigationBarColor = colorSurfaceContainer
1813
}
1914

2015
fun setupHomeButton() {

app/src/main/res/layout/activity_error.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="match_parent"
44
android:layout_height="match_parent"
5-
android:padding="8dp"
6-
android:orientation="vertical">
5+
android:fitsSystemWindows="true"
6+
android:orientation="vertical"
7+
android:padding="8dp">
78

89
<com.google.android.material.card.MaterialCardView
910
android:layout_width="match_parent"

app/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:id="@+id/container"
55
android:layout_width="match_parent"
6-
android:layout_height="match_parent">
6+
android:layout_height="match_parent"
7+
android:fitsSystemWindows="true">
78

89
<LinearLayout
910
android:layout_width="match_parent"

app/src/main/res/layout/activity_player_list.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
6+
android:fitsSystemWindows="true"
67
tools:context=".ui.home.PlayerListActivity">
78

89
<androidx.recyclerview.widget.RecyclerView

app/src/main/res/layout/fragment_discovery.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
android:id="@+id/container"
1515
android:layout_width="match_parent"
1616
android:layout_height="match_parent"
17+
android:clipToPadding="false"
1718
android:padding="16dp" />
1819

1920
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

app/src/main/res/layout/fragment_home.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
android:id="@+id/container"
2525
android:layout_width="match_parent"
2626
android:layout_height="match_parent"
27+
android:clipToPadding="false"
2728
android:padding="16dp" />
2829

2930
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

app/src/main/res/values/themes.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22
<!-- Base application theme. -->
33
<style name="Theme.MCPing" parent="Theme.Material3.DynamicColors.Light">
4+
<item name="android:navigationBarColor" tools:targetApi="o">
5+
?attr/colorSurfaceContainer
6+
</item>
7+
<item name="android:statusBarColor" tools:targetApi="m">?attr/colorSurfaceContainer</item>
48
<item name="android:windowLightStatusBar" tools:targetApi="m">true</item>
9+
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item>
510
</style>
611
</resources>

0 commit comments

Comments
 (0)