¡@

Home 

2014/10/16 ¤W¤È 08:12:21

android Programming Glossary: devicewidth

Android - How to make slide menu like facebook, spotify and Google +

http://stackoverflow.com/questions/11465774/android-how-to-make-slide-menu-like-facebook-spotify-and-google

private boolean isOtherSlideOut false private int deviceWidth private int margin public FilterAnimation Context context this.context.. displayMetrics context.getResources .getDisplayMetrics deviceWidth displayMetrics.widthPixels as my animation is x axis related.. params isOtherSlideOut false else margin deviceWidth 80 100 here im coverting device percentage width into pixels..

Multiple screen resolution

http://stackoverflow.com/questions/7156752/multiple-screen-resolution

metrics getResources .getDisplayMetrics int deviceWidth metrics.widthPixels int deviceHeight metrics.heightPixels float.. float 300 480 100 int mLayoutWidth int widthInPercentage deviceWidth 100 int mLayoutHeight int heightInPercentage deviceHeight 100.. percentage and then int mLayoutWidth int widthInPercentage deviceWidth 100 here i'm calculating the new width for my layout according..

Android - How to make slide menu like facebook, spotify and Google +

http://stackoverflow.com/questions/11465774/android-how-to-make-slide-menu-like-facebook-spotify-and-google

otherSlideOut private static int otherLayoutWidth otherLayoutHeight private boolean isOtherSlideOut false private int deviceWidth private int margin public FilterAnimation Context context this.context context DisplayMetrics displayMetrics context.getResources.. Context context this.context context DisplayMetrics displayMetrics context.getResources .getDisplayMetrics deviceWidth displayMetrics.widthPixels as my animation is x axis related so i gets the device width and will use that width so that.. otherLayoutWidth otherLayoutHeight otherLayout.setLayoutParams params isOtherSlideOut false else margin deviceWidth 80 100 here im coverting device percentage width into pixels in my other_slide_in.xml or other_slide_out.xml you can see..

Multiple screen resolution

http://stackoverflow.com/questions/7156752/multiple-screen-resolution

@Override public void onGlobalLayout DisplayMetrics metrics getResources .getDisplayMetrics int deviceWidth metrics.widthPixels int deviceHeight metrics.heightPixels float widthInPercentage float 280 320 100 float heightInPercentage.. widthInPercentage float 280 320 100 float heightInPercentage float 300 480 100 int mLayoutWidth int widthInPercentage deviceWidth 100 int mLayoutHeight int heightInPercentage deviceHeight 100 LayoutParams layoutParams new LayoutParams mLayoutWidth.. calculating how much area my layout is covering in terms of percentage and then int mLayoutWidth int widthInPercentage deviceWidth 100 here i'm calculating the new width for my layout according to the screen resolution and by this way your Views Layouts..