I want to make a markup in which there will be a square on the left, a square on the right and a rectangle in the middle for the rest of the length. The squares are an ImageView , the right one should be with a Play image. The height of the bottom panel should be with a weight of 10. Tangled up at all in everything, created its own ImageView and redefined the onMeasure method so that it returns the length as width. And I do it like this, but nothing happens, even if you kill yourself. And this way and that, no way: (
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightSum="100"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="0dp" android:theme="@style/ThemeOverlay.AppCompat.Light" android:layout_weight="7"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" app:layout_scrollFlags="scroll|enterAlways" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:layout_height="match_parent" android:background="@color/toolbar_background"/> </android.support.design.widget.AppBarLayout> <android.support.design.widget.TabLayout android:id="@+id/tab_layout" android:layout_width="match_parent" android:layout_height="0dp" app:tabGravity="fill" app:tabTextColor="@color/white" app:tabSelectedTextColor="@color/pink" app:tabBackground="@color/toolbar_background" app:tabIndicatorColor="@color/pink" app:tabIndicatorHeight="4dp" app:tabMode="fixed" android:layout_weight="7"/> <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:gravity="center" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="79"/> <RelativeLayout android:layout_height="0dp" android:layout_width="match_parent" android:layout_weight="7"> <ru.albatros.mp3.SquareImageView android:id="@+id/panel_art" android:layout_height="match_parent" android:layout_width="0dp" android:src="@drawable/no_art" android:background="@drawable/circle" android:layout_alignParentLeft="true" android:scaleType="center"/> <ImageView android:id="@+id/panel_toggle" android:layout_width="0dp" android:layout_height="match_parent" android:background="@drawable/ripple" android:src="@drawable/panel_play" android:clickable="true" android:layout_alignParentRight="true" android:scaleType="center"/> <RelativeLayout android:layout_height="match_parent" android:layout_width="match_parent" android:layout_toRightOf="@id/panel_art" android:layout_toLeftOf="@id/panel_toggle" android:layout_marginRight="10dp" android:layout_marginLeft="10dp"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_centerVertical="true"> <TextView android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:layout_width="wrap_content" android:textColor="@color/black" android:layout_marginBottom="4dp"/> <TextView android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:layout_width="wrap_content" android:textColor="@color/gray" android:layout_below="@id/track_name"/> </LinearLayout> </RelativeLayout> </RelativeLayout> </LinearLayout> Toolbar , TabLayout , ViewPager and Layout I leveled by weight. In the lower Layout put one to the left, the other to the right between them Layout , but it turns out that. Left ImageView compressed, there is no right at all.
