mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-01-03 12:30:33 +01:00
Created layouts and classes for widget
This commit is contained in:
parent
0c02286f83
commit
897516aa88
@ -9,39 +9,77 @@
|
|||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="10" />
|
<uses-sdk android:minSdkVersion="10" />
|
||||||
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION"/>
|
|
||||||
|
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
android:name="de.podfetcher.PodcastApp"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/Theme.Sherlock.Light.ForceOverflow"
|
android:logo="@drawable/ic_launcher"
|
||||||
android:name="de.podfetcher.PodcastApp" android:logo="@drawable/ic_launcher">
|
android:theme="@style/Theme.Sherlock.Light.ForceOverflow" >
|
||||||
<activity
|
<activity
|
||||||
|
android:name="de.podfetcher.activity.PodfetcherActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:name="de.podfetcher.activity.PodfetcherActivity" android:theme="@style/StyledIndicators">
|
android:theme="@style/StyledIndicators" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name="de.podfetcher.activity.AddFeedActivity"
|
<activity
|
||||||
android:label="@string/add_new_feed_label"/>
|
android:name="de.podfetcher.activity.AddFeedActivity"
|
||||||
<activity android:name="de.podfetcher.activity.FeedItemlistActivity" android:configChanges="orientation|screenSize"/>
|
android:label="@string/add_new_feed_label" />
|
||||||
<activity android:name="de.podfetcher.activity.ItemviewActivity"/>
|
<activity
|
||||||
<activity android:name="de.podfetcher.activity.DownloadActivity"
|
android:name="de.podfetcher.activity.FeedItemlistActivity"
|
||||||
android:label="@string/downloads_label"/>
|
android:configChanges="orientation|screenSize" />
|
||||||
<activity android:name="de.podfetcher.activity.MediaplayerActivity" android:launchMode="singleTask" android:configChanges="orientation" android:theme="@style/Theme.MediaPlayer"/>
|
<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:enabled="true" android:name="de.podfetcher.service.DownloadService" />
|
<service
|
||||||
<service android:enabled="true" android:name="de.podfetcher.service.PlaybackService" >
|
android:name="de.podfetcher.service.DownloadService"
|
||||||
|
android:enabled="true" />
|
||||||
|
<service
|
||||||
|
android:name="de.podfetcher.service.PlaybackService"
|
||||||
|
android:enabled="true" >
|
||||||
</service>
|
</service>
|
||||||
<activity android:name=".activity.PreferenceActivity"></activity>
|
|
||||||
<activity android:name=".activity.DownloadLogActivity"></activity>
|
<activity android:name=".activity.PreferenceActivity" >
|
||||||
<receiver android:name=".service.MediaButtonReceiver">
|
</activity>
|
||||||
|
<activity android:name=".activity.DownloadLogActivity" >
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<receiver android:name=".receiver.MediaButtonReceiver" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MEDIA_BUTTON"/>
|
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</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>
|
</application>
|
||||||
</manifest>
|
|
||||||
|
</manifest>
|
BIN
res/drawable-hdpi/av_pause.png
Normal file
BIN
res/drawable-hdpi/av_pause.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
48
res/layout/player_widget.xml
Normal file
48
res/layout/player_widget.xml
Normal file
@ -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>
|
4
res/xml/player_widget_info.xml
Normal file
4
res/xml/player_widget_info.xml
Normal file
@ -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>
|
@ -1,5 +1,6 @@
|
|||||||
package de.podfetcher.service;
|
package de.podfetcher.receiver;
|
||||||
|
|
||||||
|
import de.podfetcher.service.PlaybackService;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
7
src/de/podfetcher/receiver/PlayerWidget.java
Normal file
7
src/de/podfetcher/receiver/PlayerWidget.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package de.podfetcher.receiver;
|
||||||
|
|
||||||
|
import android.appwidget.AppWidgetProvider;
|
||||||
|
|
||||||
|
public class PlayerWidget extends AppWidgetProvider {
|
||||||
|
|
||||||
|
}
|
@ -31,6 +31,7 @@ import de.podfetcher.feed.FeedItem;
|
|||||||
import de.podfetcher.feed.FeedMedia;
|
import de.podfetcher.feed.FeedMedia;
|
||||||
import de.podfetcher.feed.Feed;
|
import de.podfetcher.feed.Feed;
|
||||||
import de.podfetcher.feed.FeedManager;
|
import de.podfetcher.feed.FeedManager;
|
||||||
|
import de.podfetcher.receiver.MediaButtonReceiver;
|
||||||
|
|
||||||
/** Controls the MediaPlayer that plays a FeedMedia-file */
|
/** Controls the MediaPlayer that plays a FeedMedia-file */
|
||||||
public class PlaybackService extends Service {
|
public class PlaybackService extends Service {
|
||||||
|
16
src/de/podfetcher/service/PlayerWidgetService.java
Normal file
16
src/de/podfetcher/service/PlayerWidgetService.java
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user