Determine Screen Size in Sketchware

The code is:

Display display = getWindowManager().getDefaultDisplay();

DisplayMetrics outMetrics = new DisplayMetrics ();

display.getMetrics(outMetrics);

float density = getResources().getDisplayMetrics().density;

float height = outMetrics.heightPixels / density;

float width = outMetrics.widthPixels / density;


Comments

Popular posts from this blog

How to Create Material Ripple Effect in Sketchware

How to Create Custom Notifications with Listeners

How to create Custom Dialog in Sketchware