Skip to content

Commit be1b3d3

Browse files
committed
Fixed video title covered by the camera notch in portrait mode #512
1 parent caec940 commit be1b3d3

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

app/src/main/java/de/christinecoenen/code/zapp/app/player/AbstractPlayerActivity.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ import android.view.View
1616
import androidx.activity.OnBackPressedCallback
1717
import androidx.appcompat.app.AppCompatActivity
1818
import androidx.core.view.MenuProvider
19+
import androidx.core.view.ViewCompat
1920
import androidx.core.view.WindowInsetsCompat
2021
import androidx.core.view.WindowInsetsControllerCompat
2122
import androidx.core.view.isVisible
23+
import androidx.core.view.updatePadding
2224
import androidx.media3.ui.PlayerView
2325
import de.christinecoenen.code.zapp.R
2426
import de.christinecoenen.code.zapp.app.player.BackgroundPlayerService.Companion.bind
@@ -113,6 +115,12 @@ abstract class AbstractPlayerActivity :
113115
)
114116
}
115117
}
118+
119+
ViewCompat.setOnApplyWindowInsetsListener(binding.toolbarWrapper) { view, windowInsets ->
120+
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
121+
view.updatePadding(insets.left, insets.top, insets.right, insets.bottom)
122+
WindowInsetsCompat.CONSUMED
123+
}
116124
}
117125

118126
override fun onNewIntent(intent: Intent) {
@@ -252,7 +260,7 @@ abstract class AbstractPlayerActivity :
252260
private fun pauseActivity() {
253261
try {
254262
unbindService(backgroundPlayerServiceConnection)
255-
} catch (ignored: IllegalArgumentException) {
263+
} catch (_: IllegalArgumentException) {
256264
}
257265
}
258266

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
tools:visibility="visible" />
7979

8080
<FrameLayout
81+
android:id="@+id/toolbar_wrapper"
8182
android:layout_width="match_parent"
8283
android:layout_height="wrap_content"
8384
android:animateLayoutChanges="true"

app/src/main/res/raw-en/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Automatic picture in picture mode starts when exiting Zapp via the home button (starting with Android 12) ([#506](https://github.com/mediathekview/zapp/issues/506))
77
* Stop video playback when turning off the screen ([#490](https://github.com/mediathekview/zapp/issues/490))
88
* Fixed downloads sometimes showing up in notifications but in the user interface ([#508](https://github.com/mediathekview/zapp/issues/508))
9+
* Fixed video title covered by the camera notch in portrait mode ([#512](https://github.com/mediathekview/zapp/issues/512))
910

1011
# 9.1.1
1112
* Fixed a crash upon start when the channel order has been changed previously

app/src/main/res/raw/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Automatischer Picture-in-Picture-Modus startet auch, wenn Zapp über den Home-Button verlassen wird (ab Android 12) ([#506](https://github.com/mediathekview/zapp/issues/506))
77
* Stoppt die Videowiedergabe, wenn der Bildschirm ausgeschaltet wird ([#490](https://github.com/mediathekview/zapp/issues/490))
88
* Behoben, dass Downloads manchmal in Benachrichtigungen, aber nicht in der Benutzeroberfläche auftauchen ([#508](https://github.com/mediathekview/zapp/issues/508))
9+
* behoben, dass der Video-Titel im Hochvormat von Kamera-Notches verdeckt wird ([#512](https://github.com/mediathekview/zapp/issues/512))
910

1011
# 9.1.1
1112
* Absturz beim Start behoben, wenn schon einmal die Sender-Reihenfolge angepasst wurde

0 commit comments

Comments
 (0)