Linked Questions

Popular Questions

I'm trying to fill a section of my app with 3 imageViews. I want them to fill the constraint equally. When I set the height to a set number, such as 150dp, on smaller screens the view obtrudes the layout. I have tried setting the width to 0dp, match_parent and wrap_content. Nothing seems to work. I also tried adding a linear layout to place the imageViews in but that doesn't help. Here's my XMl. I've also included a picture of how the view looks on a 3.7 inch display.

   <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fancy="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.fume.ali.getrequests.MainActivity">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="124dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="16dp"
        android:adjustViewBounds="true"
        android:gravity="center_vertical"
        android:paddingTop="0dp"
        android:scaleType="centerCrop"
        app:layout_constraintBottom_toTopOf="@+id/imageView3"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/progress"
        app:layout_constraintVertical_bias="1.0"
        app:srcCompat="@drawable/pc" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="match_parent"
        android:layout_height="125dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:adjustViewBounds="true"
        android:gravity="center_vertical"
        android:paddingTop="0dp"
        android:scaleType="centerCrop"
        app:layout_constraintBottom_toTopOf="@+id/btn_spotify"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageView3"
        app:layout_constraintVertical_bias="0.0"
        app:srcCompat="@drawable/ps" />

    <ImageView
        android:id="@+id/imageView3"
        android:layout_width="match_parent"
        android:layout_height="125dp"
        android:layout_marginBottom="164dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:adjustViewBounds="true"
        android:gravity="center_vertical"
        android:paddingTop="0dp"
        android:scaleType="centerCrop"
        app:layout_constraintBottom_toTopOf="@+id/btn_spotify"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.6"
        app:layout_constraintStart_toStartOf="parent"
        app:srcCompat="@drawable/xbox" />

    <com.github.florent37.awesomebar.AwesomeBar
        android:id="@+id/bar"
        android:layout_width="match_parent"
        android:layout_height="65dp"
        android:layout_marginEnd="0dp"
        android:layout_marginStart="0dp"
        android:background="@android:color/white"
        android:elevation="4dp"
        android:paddingLeft="0dp"
        app:bar_primaryColor="#000000"
        app:contentInsetLeft="0dp"
        app:contentInsetStart="0dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <mehdi.sakout.fancybuttons.FancyButton
        android:id="@+id/btn_spotify"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="36dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:paddingBottom="10dp"
        android:paddingLeft="20dp"
        android:paddingRight="20dp"
        android:paddingTop="10dp"
        app:fb_text="Search"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"

        app:layout_constraintVertical_bias="1.0"
        fancy:fb_borderColor="#FFFFFF"
        fancy:fb_borderWidth="1dp"
        fancy:fb_defaultColor="#7ab800"
        fancy:fb_focusColor="#9bd823"
        fancy:fb_iconPosition="left"
        fancy:fb_radius="30dp"
        fancy:fb_textColor="#FFFFFF" />


    <fr.castorflex.android.smoothprogressbar.SmoothProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/progress"
        android:layout_width="match_parent"
        android:layout_height="14dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="168dp"
        android:indeterminate="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.0"
        app:spb_color="#FF0000"
        app:spb_mirror_mode="false"
        app:spb_progressiveStart_activated="true"
        app:spb_progressiveStart_speed="1.5"
        app:spb_progressiveStop_speed="3.4"
        app:spb_reversed="false"
        app:spb_sections_count="4"
        app:spb_speed="2.0"
        app:spb_stroke_separator_length="4dp"
        app:spb_stroke_width="4dp" />

    <studio.carbonylgroup.textfieldboxes.TextFieldBoxes
        android:id="@+id/text_field_boxes"
        android:layout_width="0dp"
        android:layout_height="88dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        app:enabled="true"
        app:hasClearButton="true"
        app:helperText="Helper is here"
        app:iconSignifier="@drawable/finder"
        app:labelText="Username"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/bar"
        app:maxCharacters="16"
        app:minCharacters="3"
        app:primaryColor="@android:color/holo_green_dark">


        <studio.carbonylgroup.textfieldboxes.ExtendedEditText
            android:id="@+id/extended_edit_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:hint="EpicUsername" />

    </studio.carbonylgroup.textfieldboxes.TextFieldBoxes>


</android.support.constraint.ConstraintLayout>

My app on a 3.7 inch screen

Related Questions