I am using the Nexus 7 API 1280x800 android 4.2.2 API
I want to get the size of the screen to divide it into square sections of the same height and width.
I use FrameLayout, and my squares are a subclass of ImageView.
I'm doing it
context.getResources().getDisplayMetrics().heightPixels; ----> 1205
context.getResources().getDisplayMetrics().widthPixels; ------> 800
I believe that 1205 is not 1280, because there are two Android menus at the top and bottom of the screen.
Each of my squares is 30x30 px.
To find out how many squares I can do as much as possible, I do:
int x=1205/30;
When I try to draw my image on the coordinates (x-1)*30 ,y, it is partially deleted from the screen.
How do I know the part of the screen that my application can use?
Hope I explained my problem well.
Many thanks.
source
share