How to ZXING Barcode Scanner not full screen only half screen
<p>I want create application 
Scan Barcode using ZXING Barcode Scanner</p>

<p>Like Blackberry Messenger</p>

<p><a href="https://i.stack.imgur.com/6W3ce.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6W3ce.jpg" alt="enter image description here"></a></p>

<p>This is my code "<strong>MainActivity.java</strong>"</p>

<pre><code>package com.example.ridwan.myapplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import info.vividcode.android.zxing.CaptureActivity;
import info.vividcode.android.zxing.CaptureActivityIntents;

public class MainActivity extends AppCompatActivity  {

    private TextView tvScanResult;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Intent captureIntent = new Intent(MainActivity.this, CaptureActivity.class);
        CaptureActivityIntents.setPromptMessage(captureIntent, "Barcode scanning...");
        startActivityForResult(captureIntent, 0);

        tvScanResult = (TextView) findViewById(R.id.tv_scanresult);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == 0) {
            if (resultCode == Activity.RESULT_OK &amp;&amp; data != null) {
                String value = data.getStringExtra("SCAN_RESULT");
                tvScanResult.setText(value);
            } else if (resultCode == Activity.RESULT_CANCELED) {
                tvScanResult.setText("Scanning Gagal, mohon coba lagi.");
            }
        } else {

        }
        super.onActivityResult(requestCode, resultCode, data);
    }


}
</code></pre>

<p>Then this is my "<strong>activity_main.xml</strong>"</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.ridwan.myapplication.MainActivity"
    tools:showIn="@layout/activity_main"&gt;

    &lt;TextView
        android:layout_marginTop="50dp"
        android:id="@+id/tv_scanresult_title"
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Result Scan : " /&gt;

    &lt;TextView
        android:layout_below="@id/tv_scanresult_title"
        android:id="@+id/tv_scanresult"
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:textColor="#ff1493"
        android:layout_height="wrap_content"
        android:text="_" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>Can you give me solution ?
i want to barcode in fragment.</p>