Skip to content

Instantly share code, notes, and snippets.

@Arunshaik2001
Created January 21, 2023 15:06
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 Arunshaik2001/d333b8b57ac4af6b6860d6baf88fa5c9 to your computer and use it in GitHub Desktop.
Save Arunshaik2001/d333b8b57ac4af6b6860d6baf88fa5c9 to your computer and use it in GitHub Desktop.
<androidx.constraintlayout.widget.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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:id="@+id/stopwatch_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/red"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0" />
<ImageButton
android:id="@+id/start_or_pause"
android:layout_width="@dimen/button_size"
android:layout_height="@dimen/button_size"
android:layout_margin="@dimen/spacing_medium"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_play_arrow_24dp"
app:layout_constraintBottom_toBottomOf="@id/stopwatch_background"
app:layout_constraintEnd_toEndOf="@id/stopwatch_background"
app:layout_constraintTop_toTopOf="@id/stopwatch_background"
app:tint="@android:color/white" />
<TextView
android:id="@+id/time"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="@dimen/spacing_medium"
android:autoSizeTextType="uniform"
android:gravity="center"
android:maxLines="1"
android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="@id/stopwatch_background"
app:layout_constraintEnd_toStartOf="@id/start_or_pause"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/stopwatch_background"
tools:text="00:00:00:00" />
</androidx.constraintlayout.widget.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment