scaling view according to logo size
/* rescale view to better match original logo height */
// calculate view height needed for logo
float originalHeight = App.getScreenHeight() / 3; // can't get height from view here due to view not always already finished inflating
float newHeight = bitmap.getHeight() + mLogoView.getPaddingBottom() + mLogoView.getPaddingTop();
float scaleFactor = (originalHeight - newHeight) / originalHeight;
// keep scaleFactor between 0-0.25 to prevent view adjust to make view too big/small
if (scaleFactor > 0.25f) {scaleFactor = 0.25f;
} else if (scaleFactor < 0) {
scaleFactor = 0;
}
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mLogoView.getLayoutParams();
params.weight = 1 + scaleFactor;
mLogoView.setLayoutParams(params);
LinearLayout.LayoutParams params2 = (LinearLayout.LayoutParams) mBarcodeView.getLayoutParams();
params2.weight = 1 - scaleFactor;
mBarcodeView.setLayoutParams(params2);