title: ZXing barcode scanner in custom layout in fragment
body: <p>I develope ZXing barcode continuous scanner following <a href="https://github.com/journeyapps/zxing-android-embedded">this page</a> on Android Studio.</p>
  
  <p>My App <code>build.gradle</code> had include:</p>
  
  <pre><code>repositories {
      mavenCentral()
  
      maven {
          url "https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/"
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:appcompat-v7:23.0.1'
      compile files('src/main/jniLibs/scanditsdk-android-4.7.5.jar')
      compile files('src/main/jniLibs/httpclient-4.0.jar')
  
      compile 'com.journeyapps:zxing-android-embedded:3.0.3@aar'
      compile 'com.google.zxing:core:3.2.0'
  }
  </code></pre>
  
  <p>And my <code>Fragment.xml</code>'s layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="#00CC00"
      android:orientation="vertical"
      android:weightSum="100"&gt;
  
      &lt;com.journeyapps.barcodescanner.CompoundBarcodeView
          android:id="@+id/barcode_scanner"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="40"
          &gt;
  
      &lt;/com.journeyapps.barcodescanner.CompoundBarcodeView&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="5dp"
          android:gravity="center"
          android:orientation="horizontal"
          android:weightSum="100"
          style="?android:attr/buttonBarStyle"
          &gt;
  
  
          &lt;Button
              android:id="@+id/btnStartScan"
              android:layout_width="0dp"
              android:layout_height="50dp"
              android:layout_weight="25"
              android:text="Start"
              android:background="@drawable/buttonstyle"
              style="@style/button_style"/&gt;
  
          &lt;Button
              android:id="@+id/btnStopScan"
              android:layout_width="0dp"
              android:layout_height="50dp"
              android:layout_weight="25"
              android:text="Stop"
              android:background="@drawable/buttonstyle"
              style="@style/button_style"/&gt;
  
          &lt;Button
              android:id="@+id/btnPauseScan"
              android:layout_width="0dp"
              android:layout_height="50dp"
              android:layout_weight="25"
              android:text="Pause"
              android:background="@drawable/buttonstyle"
              style="@style/button_style"/&gt;
  
          &lt;Button
              android:id="@+id/btnResumeScan"
              android:layout_width="0dp"
              android:layout_height="50dp"
              android:layout_weight="25"
              android:text="Resume"
              android:background="@drawable/buttonstyle"
              style="@style/button_style"/&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Then, my Fragment code look like following:</p>
  
  <pre><code>public class CMCSMOFragment extends Fragment implements View.OnClickListener {
  
      private CompoundBarcodeView barcodeView;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          if (container == null) {
              return null;
          }
  
          View v;
          v = inflater.inflate(R.layout.cmcsmo_layout, container, false);
  
          barcodeView = (CompoundBarcodeView) v.findViewById(R.id.barcode_scanner);
          barcodeView.decodeContinuous(callback);
  
          return v;
      }
  
      private BarcodeCallback callback = new BarcodeCallback() {
          @Override
          public void barcodeResult(BarcodeResult result) {
              if (result.getText() != null) {
                  barcodeView.setStatusText(result.getText());
              }
  
              //Do something with code result
          }
  
          @Override
          public void possibleResultPoints(List&lt;ResultPoint&gt; resultPoints) {
          }
      };
  }
  </code></pre>
  
  <p>And when I build my app, the <code>CompoundBarcodeView</code> only show a <strong>black view</strong> with ZXing text:</p>
  
  <blockquote>
    <p>Place a barcode inside the viewfinder rectangle to scan it.</p>
  </blockquote>
  
  <p><strong>Edit:</strong></p>
  
  <p>Follow <strong>Lennon</strong> suggestion, I had used <code>zxing-minimum</code> but it doesn't allow to work on Portrait mode :(.</p>
  
  <p>How should I do to solve this problem? Thanks for all help!</p>