It is possible to use PercentRelativeLayout specifying only the desired width dimension and getting automatic heigh?
I mean doing this:
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/earthImageView"
app:layout_widthPercent="30%"
android:src="@drawable/earth"
android:layout_alignParentRight="true"
android:adjustViewBounds="true"/>
</android.support.percent.PercentRelativeLayout >
The view has the correct width but if I check the layout boundaries I can see that the height is MATCH_PARENT. It means hat android:adjustViewBounds="true" is not working.
I tried adding app:layout_widthPercent="WRAP_CONTENT" but has no effect.
Edit
Also having problems when doing the inverse situation:
<ImageView
android:id="@+id/earthImageView"
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_heightPercent="20%"
android:src="@drawable/earth"
android:adjustViewBounds="true"/>