Skip to content

Instantly share code, notes, and snippets.

@PedroCarrillo
Created August 12, 2017 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PedroCarrillo/811deec0ea54e0d429c5e5804042e1aa to your computer and use it in GitHub Desktop.
Save PedroCarrillo/811deec0ea54e0d429c5e5804042e1aa to your computer and use it in GitHub Desktop.
this is a layout for a simple comment
<?xml version="1.0" encoding="utf-8"?>
<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="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:id="@+id/separatorContainer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
android:orientation="horizontal"/>
<TextView
android:id="@+id/tv_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_horizontal_margin"
tools:text="/u/Username"
app:layout_constraintTop_toTopOf="parent"
android:textColor="@color/grey2"
app:layout_constraintLeft_toRightOf="@id/separatorContainer" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="* 5h"
app:layout_constraintTop_toTopOf="parent"
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_marginStart="4dp"
app:layout_constraintLeft_toRightOf="@id/tv_user"
android:id="@+id/textView" />
<TextView
android:id="@+id/body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_margin="@dimen/activity_horizontal_margin"
tools:text="Body of comment"
app:layout_constraintTop_toBottomOf="@id/tv_user"
app:layout_constraintLeft_toRightOf="@id/separatorContainer" />
<TextView
android:id="@+id/tv_reply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:text="Reply" />
<View
android:id="@+id/separator1"
android:layout_width="1dp"
android:layout_height="16dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/grey"
app:layout_constraintTop_toBottomOf="@id/body"
app:layout_constraintRight_toLeftOf="@id/tv_reply"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageButton
android:id="@+id/btn_down_vote"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@android:drawable/ic_media_next"
app:layout_constraintTop_toBottomOf="@id/body"
app:layout_constraintRight_toLeftOf="@id/separator1"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:id="@+id/tv_votes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constraintRight_toLeftOf="@id/btn_down_vote"
app:layout_constraintBottom_toBottomOf="parent"
android:text="1.4k" />
<ImageButton
android:id="@+id/btn_upvote"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@android:drawable/ic_media_next"
app:layout_constraintTop_toBottomOf="@id/body"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_votes" />
</android.support.constraint.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment