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); setContentView(R.layout.activity_main);
ButterKnife.bind(this); 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(); mCurrCamera = mConfig.getLastUsedCamera();
mPreview = new Preview(this, (SurfaceView) findViewById(R.id.camera_view), this); mPreview = new Preview(this, (SurfaceView) findViewById(R.id.camera_view), this);
mPreview.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); mPreview.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

View File

@ -50,7 +50,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/preview_btn_margin" android:layout_marginBottom="@dimen/activity_margin"
android:gravity="center_horizontal|bottom"> android:gravity="center_horizontal|bottom">
<ImageView <ImageView