My ImageButton isn't rescaling like the code is telling it to. Infact it's not doing anything.
Code:
public void getScreenRes(){
DisplayMetrics display = this.getResources().getDisplayMetrics();
int width = display.widthPixels;
int height = display.heightPixels;
int buttonheight = display.heightPixels / 8;
double buttonwidth = buttonheight * 2.66666667;
int buttonwidthint = (int) Math.round(buttonwidth);
ImageButton firsttimeFB = (ImageButton) findViewById(R.id.firsttime_fb);
firsttimeFB.setMaxWidth(buttonwidthint);
firsttimeFB.setMaxHeight(buttonheight);
}
XML
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/facebook"
android:id="@+id/firsttime_fb"
/>