Skip to content

Instantly share code, notes, and snippets.

@codingwithsara
Created September 20, 2020 06:18
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 codingwithsara/f33d2eb3743c6ab3dfde600fa1a1034c to your computer and use it in GitHub Desktop.
Save codingwithsara/f33d2eb3743c6ab3dfde600fa1a1034c to your computer and use it in GitHub Desktop.
Kotlin (Android Studio) Tutorial - The Simple Music Player -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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"
tools:context=".MainActivity"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image"/>
<SeekBar
android:id="@+id/positionBar"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/elapsedTimeLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0:11"
android:layout_marginLeft="40dp"/>
<TextView
android:id="@+id/remainingTimeLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-1:11"
android:layout_marginLeft="240dp"/>
</LinearLayout>
<Button
android:id="@+id/playBtn"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/play"
android:layout_marginTop="40dp"
android:onClick="playBtnClick"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="40dp"
android:gravity="center">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@drawable/sound"/>
<SeekBar
android:id="@+id/volumeBar"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:progress="50"
android:max="100"/>
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@drawable/sound2"/>
</LinearLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment