Skip to content

Instantly share code, notes, and snippets.

@st235
Last active March 12, 2023 13:19
Show Gist options
  • Save st235/e50473854e3e6029bf1e032b86fc43f2 to your computer and use it in GitHub Desktop.
Save st235/e50473854e3e6029bf1e032b86fc43f2 to your computer and use it in GitHub Desktop.
[HSE] [My first Android application] Step 2: Timer activity
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<include
android:id="@+id/progress_content"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="64dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
layout="@layout/content_progressbar" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/play_button"
android:layout_width="72dp"
android:layout_height="72dp"
android:background="@drawable/circle"
android:layout_marginTop="32dp"
android:padding="12dp"
app:tint="#EF5350"
app:srcCompat="@drawable/ic_play"
app:layout_constraintTop_toBottomOf="@id/progress_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:width="6dp"
android:color="#EEEEEE" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M366,728Q351,738 335.5,729Q320,720 320,702L320,252Q320,234 335.5,225Q351,216 366,226L720,452Q734,461 734,477Q734,493 720,502L366,728ZM380,477L380,477L380,477L380,477ZM380,648L649,477L380,306L380,648Z"/>
</vector>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment