Skip to content

Commit

Permalink
Use system background for main activity in landscape
Browse files Browse the repository at this point in the history
  • Loading branch information
svetter committed Aug 12, 2024
1 parent 48e8d61 commit bd26b64
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import android.content.res.Configuration
import android.graphics.Color
import android.os.Bundle
import android.util.Log
import android.util.TypedValue
import android.view.KeyEvent
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -679,7 +680,10 @@ class MainActivity : AppCompatActivity() {
ViewGroup.LayoutParams.MATCH_PARENT
)
// Set background color for graphicsFrameLayout
graphicsViewLayout.setBackgroundColor(Color.BLACK)
val backgroundColorValue = TypedValue()
theme.resolveAttribute(android.R.attr.colorBackground, backgroundColorValue, true)
val backgroundColor = backgroundColorValue.data
graphicsViewLayout.setBackgroundColor(backgroundColor)
}

graphicsView.resetCache()
Expand Down

0 comments on commit bd26b64

Please sign in to comment.