reduce the bottom margin on devices with hardware navigation

This commit is contained in:
Tibor Kaputa
2016-10-27 16:55:55 +02:00
parent 9db80ebf70
commit 604dc90ab1
2 changed files with 7 additions and 1 deletions

View File

@@ -159,6 +159,12 @@ public class MainActivity extends SimpleActivity
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
if (Utils.hasNavBar(getResources())) {
final View btnLayout = findViewById(R.id.btn_holder);
final int bottomMargin = (int) getResources().getDimension(R.dimen.preview_btn_margin);
((RelativeLayout.LayoutParams) btnLayout.getLayoutParams()).setMargins(0, 0, 0, bottomMargin);
}
mCurrCamera = mConfig.getLastUsedCamera();
mPreview = new Preview(this, (SurfaceView) findViewById(R.id.camera_view), this);
mPreview.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));