I'm trying to build a dynamic ConstraintLayout with an offscreen element that I can translate in later. However, I cannot get the element to start offscreen.
<android.support.constraint.ConstraintLayout
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"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/onscreen_iv"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<ImageView
android:id="@+id/offscreen_iv"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
By setting the left of the image to the right of the fullscreen layout, the image should be offscreen -- shouldn't it? Instead, the result is that offscreen_iv is positioned directly over onscreen_iv. EDIT: The result is the same if I set offscreen_iv to the right of onscreen_iv as opposed to the right of the parent.
It seems to be to do with setting the width to match_parent, as if I set it to a raw number it seems to work, but is of course the wrong size. I need my image to be screen width.
Appreciate the help!