Issue
I have a var in Swift like this :
@Published var textFieldSize = UIDevice.current.userInterfaceIdiom == .pad ? 20.0 : 12.0
How can i get the same device type (phone or tablet) but in Jetpack Compose Android ??
Solution
You can do this:
val configuration = LocalConfiguration.current
val expanded = configuration.screenWidthDp > 840
This corresponds to 97.22% of tablets in landscape. For sizes corresponding to phones or tablets there is more info here.
Answered By - Code Poet
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.