add an initial widget
|
@ -24,5 +24,13 @@
|
|||
|
||||
<service android:name="musicplayer.simplemobiletools.com.MusicService"/>
|
||||
|
||||
<receiver android:name=".MyAppWidgetProvider">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/widget_info"/>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package musicplayer.simplemobiletools.com;
|
||||
|
||||
import android.appwidget.AppWidgetProvider;
|
||||
|
||||
public class MyAppWidgetProvider extends AppWidgetProvider {
|
||||
|
||||
}
|
78
app/src/main/res/layout/widget.xml
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/black"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/songTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin"
|
||||
android:layout_marginRight="@dimen/activity_margin"
|
||||
android:layout_marginTop="@dimen/medium_padding"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="18sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/songArtist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/songTitle"
|
||||
android:layout_marginBottom="@dimen/medium_padding"
|
||||
android:layout_marginLeft="@dimen/activity_margin"
|
||||
android:layout_marginRight="@dimen/activity_margin"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/controls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_below="@+id/songArtist"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/previousBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:src="@mipmap/previous_white"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/playPauseBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:src="@mipmap/play_white"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/nextBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:src="@mipmap/next_white"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/stopBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:src="@mipmap/stop_white"/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
BIN
app/src/main/res/mipmap-hdpi/next_white.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/mipmap-hdpi/pause_white.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
app/src/main/res/mipmap-hdpi/play_white.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/mipmap-hdpi/previous_white.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-hdpi/stop_white.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
app/src/main/res/mipmap-mdpi/next_white.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/mipmap-mdpi/pause_white.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
app/src/main/res/mipmap-mdpi/play_white.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/previous_white.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-mdpi/stop_white.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
app/src/main/res/mipmap-xhdpi/next_white.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/pause_white.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
app/src/main/res/mipmap-xhdpi/play_white.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/mipmap-xhdpi/previous_white.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/stop_white.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
app/src/main/res/mipmap-xxhdpi/next_white.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/pause_white.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
app/src/main/res/mipmap-xxhdpi/play_white.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/previous_white.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/stop_white.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
app/src/main/res/mipmap-xxxhdpi/next_white.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/pause_white.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
app/src/main/res/mipmap-xxxhdpi/play_white.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/previous_white.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/stop_white.png
Normal file
After Width: | Height: | Size: 357 B |
|
@ -1,4 +1,5 @@
|
|||
<resources>
|
||||
<dimen name="activity_margin">16dp</dimen>
|
||||
<dimen name="song_item_padding">8dp</dimen>
|
||||
<dimen name="medium_padding">10dp</dimen>
|
||||
</resources>
|
||||
|
|
6
app/src/main/res/xml/widget_info.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialLayout="@layout/widget"
|
||||
android:minHeight="110dp"
|
||||
android:minWidth="250dp">
|
||||
</appwidget-provider>
|