title: Why does the imageView get doubled in android?
body: <p>I have problem in android layout,that I don't know what is the problem.
  Actually I want to change the font of the text beside the image.
  When I don't put any text inside the textViews in xml code and I set the text in java code and also set the typeface,I got this problem.</p>
  
  <p>This is my 
  <strong>group_view_two_4_first_activity.xml</strong> file:
      </p>
  
  <pre><code>    &lt;android.support.v7.widget.CardView
          android:layout_width="70dp"
          android:layout_height="70dp"
          android:layout_marginStart="16dp"
          android:layout_marginEnd="8dp"
          android:layout_marginBottom="8dp"
          app:cardCornerRadius="8dp"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toEndOf="@+id/sport_complex_name"
          app:layout_constraintTop_toTopOf="@+id/sport_complex_name"&gt;
  
          &lt;ImageView
              android:id="@+id/image"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:scaleType="fitXY"
              android:src="@drawable/field" /&gt;
  
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;TextView
          android:id="@+id/sport_complex_name"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:textColor="#565657"
          android:textSize="20sp"
          android:textStyle="bold"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
      &lt;TextView
          android:id="@+id/hallNumber"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          android:textColor="#7E7E7F"
          android:textSize="18sp"
          app:layout_constraintEnd_toEndOf="@+id/sport_complex_name"
          app:layout_constraintTop_toBottomOf="@+id/sport_complex_name" /&gt;
  
      &lt;TextView
          android:id="@+id/number"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textColor="#7E7E7F"
          android:textSize="18sp"
  
          app:layout_constraintBottom_toBottomOf="@+id/hallNumber"
          app:layout_constraintEnd_toStartOf="@+id/hallNumber"
          app:layout_constraintTop_toTopOf="@+id/hallNumber" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>And this is its java file:<strong>GroupViewTwo4FirstActivity</strong></p>
  
  <pre><code>public class GroupViewTwo4FirstActivity extends ConstraintLayout {
  
      View rootView;
      TextView sportComplexName;
      TextView hallNumber;
      TextView number;
      String txtNo;
      String complexName;
      public GroupViewTwo4FirstActivity(Context context) {
          super(context);
          init(context);
      }
  
      public GroupViewTwo4FirstActivity(Context context, AttributeSet attrs) {
          this(context, attrs, 0);
          init(context);
      }
  
      public GroupViewTwo4FirstActivity(Context context, AttributeSet attrs, int defStyleAttr) {
          super(context, attrs, defStyleAttr);
          TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.GroupViewTwo4FirstActivity, defStyleAttr, 0);
          txtNo = ta.getString(R.styleable.GroupViewTwo4FirstActivity_hallNo);
          complexName = ta.getString(R.styleable.GroupViewTwo4FirstActivity_complex_name);
          ta.recycle();
          init(context);
      }
  
      private void init(Context context) {
          rootView = inflate(context, R.layout.group_view_two_4_first_activity, this);
          Typeface typeface = EnglishToPersian.createTypeFace1(context);
          sportComplexName = rootView.findViewById(R.id.sport_complex_name);
          hallNumber = rootView.findViewById(R.id.hallNumber);
          number = rootView.findViewById(R.id.number);
          sportComplexName.setTypeface(typeface);
          hallNumber.setTypeface(typeface);
          number.setTypeface(typeface);
  
          number.setText(EnglishToPersian.englishToPersian(txtNo));
          hallNumber.setText("سالن شماره ");
          sportComplexName.setText("مجتمع ورزشی افق لاله");
  
      }
  }
  </code></pre>
  
  <p>Everything is OK,But when I run the program,instead of getting this picture:
  <a href="https://i.stack.imgur.com/r4InS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r4InS.png" alt="Wanted"></a></p>
  
  <p>I got this one:<a href="https://i.stack.imgur.com/kMsqr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kMsqr.png" alt="Bug"></a></p>