Skip to content

Instantly share code, notes, and snippets.

@Elvis10ten
Created November 7, 2017 00:34
Show Gist options
  • Save Elvis10ten/75ef66359a049b6af2fc1722b2d39a69 to your computer and use it in GitHub Desktop.
Save Elvis10ten/75ef66359a049b6af2fc1722b2d39a69 to your computer and use it in GitHub Desktop.
<android.support.constraint.ConstraintLayout
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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
tools:context="com.mobymagic.shazamclone.discover.DiscoverFragment">
<!-- The left and right constraint on the parent centers the view horizontally while the top
and bottom constraints centers it vertically. This is because when you set the left,
right or top, bottom constraints bigger than the view it self, the view gets centered
between the two constraints i.e the bias is set to 50%. -->
<com.github.ybq.android.spinkit.SpinKitView
android:id="@+id/discoverProgressView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="parent"
style="@style/SpinKitView.MultiplePulse" />
<ImageButton
android:id="@+id/discoverStartStopButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="24dp"
android:background="@drawable/bg_circle_white"
android:contentDescription="@string/discover_action_content_desc_start_identifying"
android:src="@drawable/ic_mic_black_48dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="parent" />
<!-- The left and right constraint on the parent centers the view horizontally while the
bottom constraint keeps the bottom of the view with the bottom of the parent (Align to bottom) -->
<TextView
android:id="@+id/discoverHintTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="@color/primary_text_light"
android:text="@string/discover_hint_tap_to_identify"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment