diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-07-07 13:30:17 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-07-07 13:30:17 +0200 |
commit | 897516aa88714bc21a6ce1c93a7ddfa38dd7f2d7 (patch) | |
tree | 7e36bc4f85fce4b29997a445dfda199f69bbe16d | |
parent | 0c02286f8320c9ca8b8d323061aa7a034f32293b (diff) | |
download | AntennaPod-897516aa88714bc21a6ce1c93a7ddfa38dd7f2d7.zip |
Created layouts and classes for widget
-rw-r--r-- | AndroidManifest.xml | 78 | ||||
-rw-r--r-- | res/drawable-hdpi/av_pause.png | bin | 0 -> 1116 bytes | |||
-rw-r--r-- | res/layout/player_widget.xml | 48 | ||||
-rw-r--r-- | res/xml/player_widget_info.xml | 4 | ||||
-rw-r--r-- | src/de/podfetcher/receiver/MediaButtonReceiver.java (renamed from src/de/podfetcher/service/MediaButtonReceiver.java) | 3 | ||||
-rw-r--r-- | src/de/podfetcher/receiver/PlayerWidget.java | 7 | ||||
-rw-r--r-- | src/de/podfetcher/service/PlaybackService.java | 1 | ||||
-rw-r--r-- | src/de/podfetcher/service/PlayerWidgetService.java | 16 |
8 files changed, 136 insertions, 21 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 9007e9234..7d69defdd 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -9,39 +9,77 @@ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-sdk android:minSdkVersion="10" /> - <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION"/> + + <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> <application + android:name="de.podfetcher.PodcastApp" android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:theme="@style/Theme.Sherlock.Light.ForceOverflow" - android:name="de.podfetcher.PodcastApp" android:logo="@drawable/ic_launcher"> + android:logo="@drawable/ic_launcher" + android:theme="@style/Theme.Sherlock.Light.ForceOverflow" > <activity + android:name="de.podfetcher.activity.PodfetcherActivity" android:label="@string/app_name" - android:name="de.podfetcher.activity.PodfetcherActivity" android:theme="@style/StyledIndicators"> + android:theme="@style/StyledIndicators" > <intent-filter> <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <activity android:name="de.podfetcher.activity.AddFeedActivity" - android:label="@string/add_new_feed_label"/> - <activity android:name="de.podfetcher.activity.FeedItemlistActivity" android:configChanges="orientation|screenSize"/> - <activity android:name="de.podfetcher.activity.ItemviewActivity"/> - <activity android:name="de.podfetcher.activity.DownloadActivity" - android:label="@string/downloads_label"/> - <activity android:name="de.podfetcher.activity.MediaplayerActivity" android:launchMode="singleTask" android:configChanges="orientation" android:theme="@style/Theme.MediaPlayer"/> - - <service android:enabled="true" android:name="de.podfetcher.service.DownloadService" /> - <service android:enabled="true" android:name="de.podfetcher.service.PlaybackService" > + <activity + android:name="de.podfetcher.activity.AddFeedActivity" + android:label="@string/add_new_feed_label" /> + <activity + android:name="de.podfetcher.activity.FeedItemlistActivity" + android:configChanges="orientation|screenSize" /> + <activity android:name="de.podfetcher.activity.ItemviewActivity" /> + <activity + android:name="de.podfetcher.activity.DownloadActivity" + android:label="@string/downloads_label" /> + <activity + android:name="de.podfetcher.activity.MediaplayerActivity" + android:configChanges="orientation" + android:launchMode="singleTask" + android:theme="@style/Theme.MediaPlayer" /> + + <service + android:name="de.podfetcher.service.DownloadService" + android:enabled="true" /> + <service + android:name="de.podfetcher.service.PlaybackService" + android:enabled="true" > </service> - <activity android:name=".activity.PreferenceActivity"></activity> - <activity android:name=".activity.DownloadLogActivity"></activity> - <receiver android:name=".service.MediaButtonReceiver"> + + <activity android:name=".activity.PreferenceActivity" > + </activity> + <activity android:name=".activity.DownloadLogActivity" > + </activity> + + <receiver android:name=".receiver.MediaButtonReceiver" > <intent-filter> - <action android:name="android.intent.action.MEDIA_BUTTON"/> + <action android:name="android.intent.action.MEDIA_BUTTON" /> </intent-filter> </receiver> - <activity android:name=".activity.FeedInfoActivity"></activity> + + <activity android:name=".activity.FeedInfoActivity" > + </activity> + + <service + android:name=".service.PlayerWidgetService" + android:enabled="true" + android:exported="false" > + </service> + <receiver android:name=".receiver.PlayerWidget"> + <intent-filter> + <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/> + </intent-filter> + <intent-filter> + <action android:name="de.podfetcher.FORCE_WIDGET_UPDATE"/> + </intent-filter> + <meta-data android:resource="@xml/player_widget_info" android:name="android.appwidget.provider"/> + </receiver> </application> -</manifest> + +</manifest>
\ No newline at end of file diff --git a/res/drawable-hdpi/av_pause.png b/res/drawable-hdpi/av_pause.png Binary files differnew file mode 100644 index 000000000..9661cfbb0 --- /dev/null +++ b/res/drawable-hdpi/av_pause.png diff --git a/res/layout/player_widget.xml b/res/layout/player_widget.xml new file mode 100644 index 000000000..6e0f96ba4 --- /dev/null +++ b/res/layout/player_widget.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="294dp" + android:layout_height="74dp" > + + <ImageButton + android:id="@+id/butPlay" + android:layout_width="56dp" + android:layout_height="match_parent" + android:layout_alignParentRight="true" + android:layout_margin="12dp" + android:background="@drawable/borderless_button" + android:src="@drawable/av_play" /> + + <View + android:id="@+id/divider" + android:layout_width="1dp" + android:layout_height="match_parent" + android:layout_marginBottom="8dp" + android:layout_marginTop="8dp" + android:layout_toLeftOf="@id/butPlay" + android:background="@color/gray" /> + + <LinearLayout + android:id="@+id/layout_left" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_alignParentLeft="true" + android:layout_toLeftOf="@id/divider" + android:orientation="vertical" > + + <TextView + android:id="@+id/txtvTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="8dp" + android:text="Test Titel" + android:textStyle="bold" /> + + <TextView + android:id="@+id/txtvProgress" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="8dp" + android:text="Test progress" /> + </LinearLayout> + +</RelativeLayout>
\ No newline at end of file diff --git a/res/xml/player_widget_info.xml b/res/xml/player_widget_info.xml new file mode 100644 index 000000000..064381730 --- /dev/null +++ b/res/xml/player_widget_info.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:resizeMode="none" android:initialLayout="@layout/player_widget" android:minHeight="74dp" android:minWidth="294dp"> + +</appwidget-provider>
\ No newline at end of file diff --git a/src/de/podfetcher/service/MediaButtonReceiver.java b/src/de/podfetcher/receiver/MediaButtonReceiver.java index 9558b0e1d..8380c27d9 100644 --- a/src/de/podfetcher/service/MediaButtonReceiver.java +++ b/src/de/podfetcher/receiver/MediaButtonReceiver.java @@ -1,5 +1,6 @@ -package de.podfetcher.service; +package de.podfetcher.receiver; +import de.podfetcher.service.PlaybackService; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; diff --git a/src/de/podfetcher/receiver/PlayerWidget.java b/src/de/podfetcher/receiver/PlayerWidget.java new file mode 100644 index 000000000..c05ae6099 --- /dev/null +++ b/src/de/podfetcher/receiver/PlayerWidget.java @@ -0,0 +1,7 @@ +package de.podfetcher.receiver; + +import android.appwidget.AppWidgetProvider; + +public class PlayerWidget extends AppWidgetProvider { + +} diff --git a/src/de/podfetcher/service/PlaybackService.java b/src/de/podfetcher/service/PlaybackService.java index f10164e47..7d3561a3d 100644 --- a/src/de/podfetcher/service/PlaybackService.java +++ b/src/de/podfetcher/service/PlaybackService.java @@ -31,6 +31,7 @@ import de.podfetcher.feed.FeedItem; import de.podfetcher.feed.FeedMedia; import de.podfetcher.feed.Feed; import de.podfetcher.feed.FeedManager; +import de.podfetcher.receiver.MediaButtonReceiver; /** Controls the MediaPlayer that plays a FeedMedia-file */ public class PlaybackService extends Service { diff --git a/src/de/podfetcher/service/PlayerWidgetService.java b/src/de/podfetcher/service/PlayerWidgetService.java new file mode 100644 index 000000000..97efef9fa --- /dev/null +++ b/src/de/podfetcher/service/PlayerWidgetService.java @@ -0,0 +1,16 @@ +package de.podfetcher.service; + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; + +/** Updates the state of the player widget */ +public class PlayerWidgetService extends Service { + public PlayerWidgetService() { + } + + @Override + public IBinder onBind(Intent intent) { + return null; + } +} |