Skip to content

Commit

Permalink
Use resources.configuration.orientation instead of bool resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Abestanis committed Oct 21, 2024
1 parent f5d4d07 commit e2efeda
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.appwidget.AppWidgetProviderInfo
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.content.res.Configuration
import android.content.res.Resources
import android.graphics.*
import android.net.Uri
Expand Down Expand Up @@ -202,7 +203,7 @@ internal class WidgetInfoProvider(
private fun calculateSizes(newOptions: Bundle? = null): SizeInfo {
var maxWidth = 0
var maxHeight = 0
val isPortraitOrientation = context.resources.getBoolean(R.bool.isPortraitScreen)
val isPortraitOrientation = context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
val sizes = appWidgetIds.map { appWidgetId ->
val width: Int
val height: Int
Expand Down
4 changes: 0 additions & 4 deletions android/app/src/main/res/values-port/bools.xml

This file was deleted.

4 changes: 0 additions & 4 deletions android/app/src/main/res/values/bools.xml

This file was deleted.

0 comments on commit e2efeda

Please sign in to comment.