Android equivalent of java.awt.Dimension

I need a class that represents width and height.

I know that creating such a class is quite simple. However, instead of creating my own, I want to know if Android came with any equivalent of the java.awt.Dimension class? The closest I can find is Camera.Size . However, I have a problem in creating an instance from it.

+6
source share
2 answers

How about a rect ? Not quite what you are looking for, but it contains width and height and a little more.

+5
source

I would probably go with something like android.graphics.PointF . It is quite simple and gives you basically the same data as java.awt.Dimension.

+3
source

Source: https://habr.com/ru/post/909701/


All Articles