Last active
March 28, 2017 17:34
-
-
Save jush/7a34cfa7c19649d0dd70a9ad9dad6764 to your computer and use it in GitHub Desktop.
Constraint layout example of an unevenly distributed vertical weighted spread inside chain (Screenshot at https://goo.gl/photos/kTWbF7UNbKjy8gKX8)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- See screenshot at https://goo.gl/photos/kTWbF7UNbKjy8gKX8 --> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="208dp" | |
android:background="@android:color/black"> | |
<android.support.constraint.Guideline | |
android:id="@+id/guideline" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:orientation="vertical" | |
app:layout_constraintGuide_percent="0.75" /> | |
<FrameLayout | |
android:id="@+id/hr_5_peak" | |
android:layout_width="5dp" | |
android:layout_height="0dp" | |
android:layout_marginBottom="2dp" | |
android:layout_marginLeft="0dp" | |
android:layout_marginTop="16dp" | |
android:background="@android:color/darker_gray" | |
app:layout_constraintBottom_toTopOf="@+id/hr_4_anaerobic" | |
app:layout_constraintHorizontal_bias="0.5" | |
app:layout_constraintLeft_toLeftOf="@+id/guideline" | |
app:layout_constraintTop_toTopOf="parent" | |
app:layout_constraintVertical_chainStyle="spread_inside" /> | |
<FrameLayout | |
android:id="@+id/hr_4_anaerobic" | |
android:layout_width="5dp" | |
android:layout_height="0dp" | |
android:layout_marginBottom="2dp" | |
android:layout_marginLeft="0dp" | |
android:layout_marginTop="2dp" | |
android:background="@android:color/darker_gray" | |
app:layout_constraintBottom_toTopOf="@+id/hr_3_aerobic" | |
app:layout_constraintHorizontal_bias="0.5" | |
app:layout_constraintLeft_toLeftOf="@+id/guideline" | |
app:layout_constraintTop_toBottomOf="@+id/hr_5_peak" /> | |
<FrameLayout | |
android:id="@+id/hr_3_aerobic" | |
android:layout_width="5dp" | |
android:layout_height="0dp" | |
android:layout_marginBottom="2dp" | |
android:layout_marginLeft="0dp" | |
android:layout_marginTop="2dp" | |
android:background="@android:color/darker_gray" | |
app:layout_constraintBottom_toTopOf="@+id/hr_2_fatburn" | |
app:layout_constraintHorizontal_bias="0.5" | |
app:layout_constraintLeft_toLeftOf="@+id/guideline" | |
app:layout_constraintTop_toBottomOf="@+id/hr_4_anaerobic" | |
tools:layout_editor_absoluteY="247dp" /> | |
<FrameLayout | |
android:id="@+id/hr_2_fatburn" | |
android:layout_width="5dp" | |
android:layout_height="0dp" | |
android:layout_marginBottom="2dp" | |
android:layout_marginLeft="0dp" | |
android:layout_marginTop="2dp" | |
android:background="@android:color/darker_gray" | |
app:layout_constraintBottom_toTopOf="@+id/hr_1_warm" | |
app:layout_constraintHorizontal_bias="0.5" | |
app:layout_constraintLeft_toLeftOf="@+id/guideline" | |
app:layout_constraintTop_toBottomOf="@+id/hr_3_aerobic" /> | |
<FrameLayout | |
android:id="@+id/hr_1_warm" | |
android:layout_width="5dp" | |
android:layout_height="0dp" | |
android:layout_marginBottom="16dp" | |
android:layout_marginLeft="0dp" | |
android:layout_marginTop="2dp" | |
android:background="@android:color/darker_gray" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintHorizontal_bias="0.5" | |
app:layout_constraintLeft_toLeftOf="@+id/guideline" | |
app:layout_constraintTop_toBottomOf="@+id/hr_2_fatburn" /> | |
</android.support.constraint.ConstraintLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment