Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
Symphonica: Add landscape mode
Browse files Browse the repository at this point in the history
Signed-off-by: Shinjo Akane <akane@akanework.org>
  • Loading branch information
AkaneTan committed Jul 19, 2023
1 parent 7398a33 commit e504efd
Show file tree
Hide file tree
Showing 2 changed files with 569 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/src/main/java/org/akanework/symphonica/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import android.content.res.ColorStateList
import android.content.res.Configuration
import android.media.MediaPlayer
import android.net.Uri
import android.os.Bundle
Expand All @@ -40,6 +41,7 @@ import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.ViewGroup
import android.view.WindowManager
import android.view.animation.AccelerateDecelerateInterpolator
import android.widget.FrameLayout
import android.widget.ImageView
Expand Down Expand Up @@ -339,6 +341,13 @@ class MainActivity : AppCompatActivity() {
playerBottomSheetBehavior =
BottomSheetBehavior.from(findViewById(R.id.standard_bottom_sheet))

if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
val params = window.attributes
params.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
window.attributes = params
}

checkIfSquigglyProgressBarEnabled()
if (isSquigglyProgressBarEnabled) {
trackSquigglyProgressBar()
Expand Down
Loading

0 comments on commit e504efd

Please sign in to comment.