diff options
51 files changed, 1276 insertions, 1242 deletions
diff --git a/.gitignore b/.gitignore index 9f082390d..cbf04e1bd 100644 --- a/.gitignore +++ b/.gitignore @@ -12,9 +12,12 @@ bin/ gen/ target/ +build/ # Local configuration file (sdk path, etc) local.properties +gradle.properties +.gradle build.xml # Backup files diff --git a/.gitmodules b/.gitmodules index cd43a243e..17dac28b0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ -[submodule "submodules/ActionBarSherlock"] - path = submodules/ActionBarSherlock - url = git://github.com/JakeWharton/ActionBarSherlock.git -[submodule "submodules/ViewPagerIndicator"] - path = submodules/ViewPagerIndicator - url = git://github.com/JakeWharton/Android-ViewPagerIndicator.git [submodule "submodules/dslv"] path = submodules/dslv - url = git://github.com/bauerca/drag-sort-listview.git + url = git://github.com/danieloeh/drag-sort-listview.git diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 38441a520..5627077e1 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -9,7 +9,7 @@ <uses-sdk android:minSdkVersion="10" - android:targetSdkVersion="17" /> + android:targetSdkVersion="18" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> diff --git a/assets/about.html b/assets/about.html index b2188fc8b..84d94e39c 100644 --- a/assets/about.html +++ b/assets/about.html @@ -48,9 +48,6 @@ <h2>ActionBarSherlock <a href="http://actionbarsherlock.com" title="Link">(Link)</a></h2> by Jake Wharton, licensed under the Apache 2.0 license - <h2>Android-ViewPagerIndicator <a href="http://viewpagerindicator.com">(Link)</a></h2> - by Jake Wharton, licensed under the Apache 2.0 license - <h2>NineOldAndroids <a href="http://nineoldandroids.com">(Link)</a></h2> by Jake Wharton, licensed under the Apache 2.0 license diff --git a/build.gradle b/build.gradle new file mode 100644 index 000000000..e47d938dd --- /dev/null +++ b/build.gradle @@ -0,0 +1,55 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:0.5.5' + } +} +apply plugin: 'android' + +repositories { + mavenCentral() +} +dependencies { + compile 'com.android.support:appcompat-v7:18.0.+' + compile 'org.apache.commons:commons-lang3:3.1' + compile ('org.shredzone.flattr4j:flattr4j-core:2.4') { + exclude group: 'org.apache.httpcomponents', module: 'httpcore' + exclude group: 'org.apache.httpcomponents', module: 'httpclient' + exclude group: 'org.json', module: 'json' + } + compile 'commons-io:commons-io:2.4' + compile 'com.nineoldandroids:library:2.4.0' + compile project(':submodules:dslv:library') +} + +android { + compileSdkVersion 18 + buildToolsVersion "17" + + defaultConfig { + minSdkVersion 10 + targetSdkVersion 18 + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + resources.srcDirs = ['src'] + aidl.srcDirs = ['src'] + renderscript.srcDirs = ['src'] + res.srcDirs = ['res'] + assets.srcDirs = ['assets'] + } + + instrumentTest.setRoot('tests') + } + + buildTypes { + debug { + packageNameSuffix ".debug" + } + } +} @@ -1,251 +1,255 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>de.danoeh</groupId> - <artifactId>antennapod</artifactId> - <packaging>apk</packaging> - <version>0.9.7.4</version> - <name>AntennaPod</name> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>de.danoeh</groupId> + <artifactId>antennapod</artifactId> + <packaging>apk</packaging> + <version>0.9.7.4</version> + <name>AntennaPod</name> + <dependencies> + <dependency> + <groupId>android.support</groupId> + <artifactId>compatibility-v4</artifactId> + <version>18</version> + </dependency> + <dependency> + <groupId>android.support</groupId> + <artifactId>compatibility-v7-appcompat</artifactId> + <version>18</version> + <type>apklib</type> + </dependency> + <dependency> + <groupId>android.support</groupId> + <artifactId>compatibility-v7-appcompat</artifactId> + <version>18</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.1</version> + </dependency> + <dependency> + <groupId>org.shredzone.flattr4j</groupId> + <artifactId>flattr4j-core</artifactId> + <version>2.7</version> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + </exclusion> + <exclusion> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>com.google.android</groupId> + <artifactId>android</artifactId> + <scope>provided</scope> + <version>4.1.1.4</version> + </dependency> + <dependency> + <groupId>com.google.android</groupId> + <artifactId>annotations</artifactId> + <version>4.1.1.4</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.4</version> + </dependency> + <dependency> + <groupId>com.mobeta.android.dslv</groupId> + <artifactId>drag-sort-listview</artifactId> + <version>0.6.1-SNAPSHOT</version> + <type>apklib</type> + </dependency> + <dependency> + <groupId>com.nineoldandroids</groupId> + <artifactId>library</artifactId> + <version>2.4.0</version> + </dependency> + </dependencies> - <dependencies> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.1</version> - </dependency> - <dependency> - <groupId>org.shredzone.flattr4j</groupId> - <artifactId>flattr4j-core</artifactId> - <version>2.4</version> - <scope>compile</scope> - <exclusions> - <exclusion> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpcore</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - </exclusion> - <exclusion> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>com.google.android</groupId> - <artifactId>android</artifactId> - <scope>provided</scope> - <version>4.1.1.4</version> - </dependency> - <dependency> - <groupId>com.actionbarsherlock</groupId> - <artifactId>library</artifactId> - <version>4.1.0</version> - <type>apklib</type> - </dependency> - <dependency> - <groupId>com.viewpagerindicator</groupId> - <artifactId>library</artifactId> - <version>2.3.1</version> - <type>apklib</type> - </dependency> - <dependency> - <groupId>com.google.android</groupId> - <artifactId>annotations</artifactId> - <version>4.1.1.4</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.4</version> - </dependency> - <dependency> - <groupId>com.mobeta.android.dslv</groupId> - <artifactId>drag-sort-listview</artifactId> - <version>0.6.1-SNAPSHOT</version> - <type>apklib</type> - </dependency> - <dependency> - <groupId>com.nineoldandroids</groupId> - <artifactId>library</artifactId> - <version>2.4.0</version> - </dependency> - </dependencies> + <build> + <sourceDirectory>src</sourceDirectory> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <groupId>com.jayway.maven.plugins.android.generation2</groupId> + <artifactId>android-maven-plugin</artifactId> + <version>3.6.1</version> + <configuration> + <sdk> + <path>${env.ANDROID_HOME}</path> + <platform>18</platform> + </sdk> + <manifest> + <debuggable>true</debuggable> + </manifest> + </configuration> + <extensions>true</extensions> + <executions> + <execution> + <id>alignApk</id> + <phase>package</phase> + <goals> + <goal>zipalign</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> - <build> - <sourceDirectory>src</sourceDirectory> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - <plugin> - <groupId>com.jayway.maven.plugins.android.generation2</groupId> - <artifactId>android-maven-plugin</artifactId> - <version>3.6.1</version> - <configuration> - <sdk> - <path>${env.ANDROID_HOME}</path> - <platform>17</platform> - </sdk> - <manifest> - <debuggable>true</debuggable> - </manifest> - </configuration> - <extensions>true</extensions> - <executions> - <execution> - <id>alignApk</id> - <phase>package</phase> - <goals> - <goal>zipalign</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>development</id> - <!-- using this since activeByDefault does not work well with multiple - profiles --> - <activation> - <property> - <name>environment</name> - <value>!production</value> - </property> - </activation> - <properties> - <deployment.stage>In Development</deployment.stage> - </properties> - </profile> - <profile> - <id>production</id> - <properties> - <deployment.stage>In Production</deployment.stage> - </properties> - </profile> - <profile> - <id>release</id> - <!-- via this activation the profile is automatically used when the release - is done with the maven release plugin --> - <activation> - <property> - <name>performRelease</name> - <value>true</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jarsigner-plugin</artifactId> - <executions> - <execution> - <id>signing</id> - <goals> - <goal>sign</goal> - <goal>verify</goal> - </goals> - <phase>package</phase> - <inherited>true</inherited> - <configuration> - <removeExistingSignatures>true</removeExistingSignatures> - <archiveDirectory /> - <includes> - <include>${project.build.directory}/${project.artifactId}-${project.version}.apk</include> - </includes> - <keystore>${sign.keystore}</keystore> - <alias>${sign.alias}</alias> - <storepass>${sign.storepass}</storepass> - <keypass>${sign.keypass}</keypass> - <verbose>true</verbose> + <profiles> + <profile> + <id>development</id> + <!-- using this since activeByDefault does not work well with multiple + profiles --> + <activation> + <property> + <name>environment</name> + <value>!production</value> + </property> + </activation> + <properties> + <deployment.stage>In Development</deployment.stage> + </properties> + </profile> + <profile> + <id>production</id> + <properties> + <deployment.stage>In Production</deployment.stage> + </properties> + </profile> + <profile> + <id>release</id> + <!-- via this activation the profile is automatically used when the release + is done with the maven release plugin --> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jarsigner-plugin</artifactId> + <executions> + <execution> + <id>signing</id> + <goals> + <goal>sign</goal> + <goal>verify</goal> + </goals> + <phase>package</phase> + <inherited>true</inherited> + <configuration> + <removeExistingSignatures>true</removeExistingSignatures> + <archiveDirectory /> + <includes> + <include>${project.build.directory}/${project.artifactId}-${project.version}.apk</include> + </includes> + <keystore>${sign.keystore}</keystore> + <alias>${sign.alias}</alias> + <storepass>${sign.storepass}</storepass> + <keypass>${sign.keypass}</keypass> + <verbose>true</verbose> <arguments> <argument>-sigalg</argument><argument>MD5withRSA</argument> <argument>-digestalg</argument><argument>SHA1</argument> </arguments> - </configuration> - </execution> - </executions> - </plugin> - <!-- the signed apk then needs to be zipaligned and we activate proguard - and we run the manifest update --> - <plugin> - <groupId>com.jayway.maven.plugins.android.generation2</groupId> - <artifactId>android-maven-plugin</artifactId> - <inherited>true</inherited> - <configuration> - <sign> - <debug>false</debug> - </sign> - <zipalign> - <skip>false</skip> - <verbose>true</verbose> - <inputApk>${project.build.directory}/${project.artifactId}-${project.version}.apk</inputApk> - <outputApk>${project.build.directory}/${project.artifactId}-${project.version}-signed-aligned.apk - </outputApk> - </zipalign> - <manifest> - <debuggable>false</debuggable> - <versionCodeAutoIncrement>false</versionCodeAutoIncrement> - </manifest> - <proguard> + </configuration> + </execution> + </executions> + </plugin> + <!-- the signed apk then needs to be zipaligned and we activate proguard + and we run the manifest update --> + <plugin> + <groupId>com.jayway.maven.plugins.android.generation2</groupId> + <artifactId>android-maven-plugin</artifactId> + <inherited>true</inherited> + <configuration> + <sign> + <debug>false</debug> + </sign> + <zipalign> + <skip>false</skip> + <verbose>true</verbose> + <inputApk>${project.build.directory}/${project.artifactId}-${project.version}.apk</inputApk> + <outputApk>${project.build.directory}/${project.artifactId}-${project.version}-signed-aligned.apk + </outputApk> + </zipalign> + <manifest> + <debuggable>false</debuggable> + <versionCodeAutoIncrement>false</versionCodeAutoIncrement> + </manifest> + <proguard> <skip>false</skip> <config>proguard.cfg</config> - </proguard> - </configuration> - <executions> - <execution> - <id>alignApk</id> - <phase>package</phase> - <goals> - <goal>zipalign</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <configuration> - <artifacts> - <artifact> - <file>${project.build.directory}/${project.artifactId}-${project.version}-signed-aligned.apk</file> - <type>apk</type> - <classifier>signed-aligned</classifier> - </artifact> - <artifact> - <file>${project.build.directory}/proguard/mapping.txt</file> - <type>map</type> - <classifier>release</classifier> - </artifact> - </artifacts> - </configuration> - <executions> - <execution> - <id>attach-signed-aligned</id> - <phase>package</phase> - <goals> - <goal>attach-artifact</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> + </proguard> + </configuration> + <executions> + <execution> + <id>alignApk</id> + <phase>package</phase> + <goals> + <goal>zipalign</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <configuration> + <artifacts> + <artifact> + <file>${project.build.directory}/${project.artifactId}-${project.version}-signed-aligned.apk</file> + <type>apk</type> + <classifier>signed-aligned</classifier> + </artifact> + <artifact> + <file>${project.build.directory}/proguard/mapping.txt</file> + <type>map</type> + <classifier>release</classifier> + </artifact> + </artifacts> + </configuration> + <executions> + <execution> + <id>attach-signed-aligned</id> + <phase>package</phase> + <goals> + <goal>attach-artifact</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project> diff --git a/project.properties b/project.properties index 2706f89b9..75f295e31 100644 --- a/project.properties +++ b/project.properties @@ -9,7 +9,7 @@ # Project target. proguard.config=proguard.cfg -target=android-17 +target=android-18 android.library.reference.1=submodules/ActionBarSherlock/library android.library.reference.2=submodules/ViewPagerIndicator/library android.library.reference.3=submodules/dslv/library diff --git a/res/layout/listview_activity.xml b/res/layout/listview_activity.xml new file mode 100644 index 000000000..b276f506c --- /dev/null +++ b/res/layout/listview_activity.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"> + <ListView + android:id="@+id/listview" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + +</LinearLayout>
\ No newline at end of file diff --git a/res/layout/miroguide_category.xml b/res/layout/miroguide_category.xml index 1ab614050..b6f9f9418 100644 --- a/res/layout/miroguide_category.xml +++ b/res/layout/miroguide_category.xml @@ -5,17 +5,15 @@ android:layout_height="match_parent" android:orientation="vertical" > - <com.viewpagerindicator.TabPageIndicator - android:id="@+id/tabs" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - /> - <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="1"> + <android.support.v4.view.PagerTabStrip + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="top" /> </android.support.v4.view.ViewPager> </LinearLayout> diff --git a/res/layout/organize_queue.xml b/res/layout/organize_queue.xml index 62b2e980c..3982529a2 100644 --- a/res/layout/organize_queue.xml +++ b/res/layout/organize_queue.xml @@ -1,5 +1,5 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:dslv="http://schemas.android.com/apk/res/de.danoeh.antennapod" + xmlns:dslv="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="fill_parent" > diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml index 877ac6412..d964ef3d4 100644 --- a/res/values-land/styles.xml +++ b/res/values-land/styles.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <style name="Theme.MediaPlayer" parent="@style/Theme.Sherlock.Light.ForceOverflow"> + <style name="Theme.MediaPlayer" parent="@style/Theme.AppCompat.Light"> <item name="android:windowActionBarOverlay">true</item> </style> </resources>
\ No newline at end of file diff --git a/res/values/styles.xml b/res/values/styles.xml index f32ea3894..d08b8060f 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="Theme.AntennaPod.Light" parent="@style/Theme.Sherlock.Light.ForceOverflow"> - <item name="vpiTabPageIndicatorStyle">@style/AntennaPod.LightTabPageIndicator</item> + <style name="Theme.AntennaPod.Light" parent="@style/Theme.AppCompat.Light"> <item name="attr/action_about">@drawable/action_about</item> <item name="attr/action_search">@drawable/action_search</item> <item name="attr/action_settings">@drawable/action_settings</item> @@ -38,21 +37,7 @@ <item name="attr/dragview_float_background">@color/white</item> </style> - <style name="AntennaPod.TabPageIndicator" parent="Widget.TabPageIndicator"> - <item name="android:paddingTop">16dp</item> - <item name="android:paddingLeft">8dp</item> - <item name="android:paddingRight">8dp</item> - <item name="android:paddingBottom">16dp</item> - <item name="android:textSize">12sp</item> - <item name="android:textStyle">bold</item> - </style> - - <style name="AntennaPod.LightTabPageIndicator" parent="AntennaPod.TabPageIndicator"> - <item name="android:textColor">@color/black</item> - </style> - - <style name="Theme.AntennaPod.Dark" parent="@style/Theme.Sherlock.ForceOverflow"> - <item name="vpiTabPageIndicatorStyle">@style/AntennaPod.DarkTabPageIndicator</item> + <style name="Theme.AntennaPod.Dark" parent="@style/Theme.AppCompat"> <item name="attr/action_about">@drawable/action_about_dark</item> <item name="attr/action_search">@drawable/action_search_dark</item> <item name="attr/action_settings">@drawable/action_settings_dark</item> @@ -88,10 +73,6 @@ <item name="attr/dragview_float_background">@color/black</item> </style> - <style name="AntennaPod.DarkTabPageIndicator" parent="AntennaPod.TabPageIndicator"> - <item name="android:textColor">#FFFFFF</item> - </style> - <style name="UndoBar"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">48dp</item> @@ -102,9 +83,7 @@ <item name="android:orientation">horizontal</item> <item name="android:background">@drawable/undobar</item> <item name="android:clickable">true</item> - <item name="android:showDividers">middle</item> <item name="android:divider">@drawable/undobar_divider</item> - <item name="android:dividerPadding">10dp</item> </style> <style name="UndoBarMessage"> <item name="android:layout_width">0dp</item> @@ -125,7 +104,6 @@ <item name="android:drawableLeft">@drawable/ic_undobar_undo</item> <item name="android:drawablePadding">12dp</item> <item name="android:textAppearance">?android:textAppearanceSmall</item> - <item name="android:textAllCaps">true</item> <item name="android:textStyle">bold</item> <item name="android:textColor">#fff</item> <item name="android:text">@string/undo</item> diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 000000000..6de43d84c --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':submodules:dslv:library' diff --git a/src/de/danoeh/antennapod/activity/AboutActivity.java b/src/de/danoeh/antennapod/activity/AboutActivity.java index e3265d1eb..27fdbe241 100644 --- a/src/de/danoeh/antennapod/activity/AboutActivity.java +++ b/src/de/danoeh/antennapod/activity/AboutActivity.java @@ -1,15 +1,15 @@ package de.danoeh.antennapod.activity; import android.os.Bundle; +import android.support.v7.app.ActionBarActivity; import android.webkit.WebView; import android.webkit.WebViewClient; -import com.actionbarsherlock.app.SherlockActivity; import de.danoeh.antennapod.R; /** Displays the 'about' screen */ -public class AboutActivity extends SherlockActivity { +public class AboutActivity extends ActionBarActivity { private WebView webview; diff --git a/src/de/danoeh/antennapod/activity/AddFeedActivity.java b/src/de/danoeh/antennapod/activity/AddFeedActivity.java index 545b53494..4085fc8d2 100644 --- a/src/de/danoeh/antennapod/activity/AddFeedActivity.java +++ b/src/de/danoeh/antennapod/activity/AddFeedActivity.java @@ -2,6 +2,9 @@ package de.danoeh.antennapod.activity; import java.util.Date; +import android.support.v7.app.ActionBarActivity; +import android.view.Menu; +import android.view.MenuItem; import org.apache.commons.lang3.StringUtils; import android.app.AlertDialog; @@ -15,10 +18,6 @@ import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; -import com.actionbarsherlock.app.SherlockActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.feed.Feed; @@ -31,7 +30,7 @@ import de.danoeh.antennapod.util.StorageUtils; import de.danoeh.antennapod.util.URLChecker; /** Activity for adding a Feed */ -public class AddFeedActivity extends SherlockActivity { +public class AddFeedActivity extends ActionBarActivity { private static final String TAG = "AddFeedActivity"; private DownloadRequester requester; @@ -200,6 +199,8 @@ public class AddFeedActivity extends SherlockActivity { return true; } + + @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { diff --git a/src/de/danoeh/antennapod/activity/AudioplayerActivity.java b/src/de/danoeh/antennapod/activity/AudioplayerActivity.java index b73a17125..0a4c8ae14 100644 --- a/src/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -7,18 +7,17 @@ import android.content.res.TypedArray; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; +import android.support.v4.app.ListFragment; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; +import android.view.Window; import android.widget.ArrayAdapter; import android.widget.ImageButton; import android.widget.ImageView.ScaleType; import android.widget.ListView; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockListFragment; -import com.actionbarsherlock.view.Window; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.ChapterListAdapter; @@ -48,7 +47,7 @@ public class AudioplayerActivity extends MediaplayerActivity { private CoverFragment coverFragment; private ItemDescriptionFragment descriptionFragment; - private SherlockListFragment chapterFragment; + private ListFragment chapterFragment; private Fragment currentlyShownFragment; private int currentlyShownPosition = -1; @@ -248,8 +247,7 @@ public class AudioplayerActivity extends MediaplayerActivity { /** * Changes the currently displayed fragment. * - * @param Must - * be POS_COVER, POS_DESCR, or POS_CHAPTERS + * @param pos Must be POS_COVER, POS_DESCR, or POS_CHAPTERS * */ private void switchToFragment(int pos) { if (AppConfig.DEBUG) @@ -280,7 +278,7 @@ public class AudioplayerActivity extends MediaplayerActivity { break; case POS_CHAPTERS: if (chapterFragment == null) { - chapterFragment = new SherlockListFragment() { + chapterFragment = new ListFragment() { @Override public void onListItemClick(ListView l, View v, diff --git a/src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java b/src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java index 54c4f0589..984491174 100644 --- a/src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java +++ b/src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java @@ -12,7 +12,11 @@ import android.content.Intent; import android.os.Bundle; import android.os.Environment; import android.os.FileObserver; +import android.support.v7.app.ActionBarActivity; import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; @@ -24,11 +28,6 @@ import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; -import com.actionbarsherlock.app.SherlockActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuInflater; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.preferences.UserPreferences; @@ -37,7 +36,7 @@ import de.danoeh.antennapod.preferences.UserPreferences; * Let's the user choose a directory on the storage device. The selected folder * will be sent back to the starting activity as an activity result. */ -public class DirectoryChooserActivity extends SherlockActivity { +public class DirectoryChooserActivity extends ActionBarActivity { private static final String TAG = "DirectoryChooserActivity"; private static final String CREATE_DIRECTORY_NAME = "AntennaPod"; diff --git a/src/de/danoeh/antennapod/activity/DownloadActivity.java b/src/de/danoeh/antennapod/activity/DownloadActivity.java index 80fc1cdce..40c75d336 100644 --- a/src/de/danoeh/antennapod/activity/DownloadActivity.java +++ b/src/de/danoeh/antennapod/activity/DownloadActivity.java @@ -11,15 +11,17 @@ import android.content.res.TypedArray; import android.os.AsyncTask; import android.os.Bundle; import android.os.IBinder; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.app.ActionBarActivity; +import android.support.v7.view.ActionMode; import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemLongClickListener; -import com.actionbarsherlock.app.SherlockListActivity; -import com.actionbarsherlock.view.ActionMode; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; +import android.widget.ListView; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; @@ -33,222 +35,228 @@ import de.danoeh.antennapod.storage.DownloadRequester; * Shows all running downloads in a list. The list objects are DownloadStatus * objects created by a DownloadObserver. */ -public class DownloadActivity extends SherlockListActivity implements - ActionMode.Callback { - - private static final String TAG = "DownloadActivity"; - private static final int MENU_SHOW_LOG = 0; - private static final int MENU_CANCEL_ALL_DOWNLOADS = 1; - private DownloadlistAdapter dla; - private DownloadRequester requester; - - private ActionMode mActionMode; - private DownloadRequest selectedDownload; - - private DownloadService downloadService = null; - boolean mIsBound; - - private AsyncTask<Void, Void, Void> contentRefresher; - - @Override - protected void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); - if (AppConfig.DEBUG) - Log.d(TAG, "Creating Activity"); - requester = DownloadRequester.getInstance(); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - } - - @Override - protected void onPause() { - super.onPause(); - unbindService(mConnection); - unregisterReceiver(contentChanged); - } - - @Override - protected void onResume() { - super.onResume(); - registerReceiver(contentChanged, new IntentFilter( - DownloadService.ACTION_DOWNLOADS_CONTENT_CHANGED)); - bindService(new Intent(this, DownloadService.class), mConnection, 0); - startContentRefresher(); - if (dla != null) { - dla.notifyDataSetChanged(); - } - } - - @Override - protected void onStop() { - super.onStop(); - if (AppConfig.DEBUG) - Log.d(TAG, "Stopping Activity"); - stopContentRefresher(); - } - - private ServiceConnection mConnection = new ServiceConnection() { - public void onServiceDisconnected(ComponentName className) { - downloadService = null; - mIsBound = false; - Log.i(TAG, "Closed connection with DownloadService."); - } - - public void onServiceConnected(ComponentName name, IBinder service) { - downloadService = ((DownloadService.LocalBinder) service) - .getService(); - mIsBound = true; - if (AppConfig.DEBUG) - Log.d(TAG, "Connection to service established"); - dla = new DownloadlistAdapter(DownloadActivity.this, 0, - downloadService.getDownloads()); - setListAdapter(dla); - dla.notifyDataSetChanged(); - } - }; - - @SuppressLint("NewApi") - private void startContentRefresher() { - if (contentRefresher != null) { - contentRefresher.cancel(true); - } - contentRefresher = new AsyncTask<Void, Void, Void>() { - private final int WAITING_INTERVALL = 1000; - - @Override - protected void onProgressUpdate(Void... values) { - super.onProgressUpdate(values); - if (dla != null) { - if (AppConfig.DEBUG) - Log.d(TAG, "Refreshing content automatically"); - dla.notifyDataSetChanged(); - } - } - - @Override - protected Void doInBackground(Void... params) { - while (!isCancelled()) { - try { - Thread.sleep(WAITING_INTERVALL); - publishProgress(); - } catch (InterruptedException e) { - return null; - } - } - return null; - } - }; - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - contentRefresher.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - contentRefresher.execute(); - } - } - - private void stopContentRefresher() { - if (contentRefresher != null) { - contentRefresher.cancel(true); - } - } - - @Override - protected void onPostCreate(Bundle savedInstanceState) { - super.onPostCreate(savedInstanceState); - getListView().setOnItemLongClickListener(new OnItemLongClickListener() { - - @Override - public boolean onItemLongClick(AdapterView<?> arg0, View view, - int position, long id) { - DownloadRequest selection = dla.getItem(position) - .getDownloadRequest(); - if (selection != null && mActionMode != null) { - mActionMode.finish(); - } - dla.setSelectedItemIndex(position); - selectedDownload = selection; - mActionMode = startActionMode(DownloadActivity.this); - return true; - } - - }); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - menu.add(Menu.NONE, MENU_SHOW_LOG, Menu.NONE, - R.string.show_download_log).setShowAsAction( - MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); - menu.add(Menu.NONE, MENU_CANCEL_ALL_DOWNLOADS, Menu.NONE, - R.string.cancel_all_downloads_label).setShowAsAction( - MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - Intent intent = new Intent(this, MainActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP - | Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - break; - case MENU_SHOW_LOG: - startActivity(new Intent(this, DownloadLogActivity.class)); - break; - case MENU_CANCEL_ALL_DOWNLOADS: - requester.cancelAllDownloads(this); - break; - } - return true; - } - - @Override - public boolean onCreateActionMode(ActionMode mode, Menu menu) { - if (selectedDownload != null) { - TypedArray drawables = obtainStyledAttributes(new int[] { R.attr.navigation_cancel }); - menu.add(Menu.NONE, R.id.cancel_download_item, Menu.NONE, - R.string.cancel_download_label).setIcon( - drawables.getDrawable(0)); - } - return true; - } - - @Override - public boolean onPrepareActionMode(ActionMode mode, Menu menu) { - return false; - } - - @Override - public boolean onActionItemClicked(ActionMode mode, MenuItem item) { - boolean handled = false; - switch (item.getItemId()) { - case R.id.cancel_download_item: - requester.cancelDownload(this, selectedDownload.getSource()); - handled = true; - break; - } - mActionMode.finish(); - return handled; - } - - @Override - public void onDestroyActionMode(ActionMode mode) { - mActionMode = null; - selectedDownload = null; - dla.setSelectedItemIndex(DownloadlistAdapter.SELECTION_NONE); - } - - private BroadcastReceiver contentChanged = new BroadcastReceiver() { - - @Override - public void onReceive(Context context, Intent intent) { - if (dla != null) { - if (AppConfig.DEBUG) - Log.d(TAG, "Refreshing content"); - dla.notifyDataSetChanged(); - } - } - }; +public class DownloadActivity extends ActionBarActivity implements + ActionMode.Callback { + + private static final String TAG = "DownloadActivity"; + private static final int MENU_SHOW_LOG = 0; + private static final int MENU_CANCEL_ALL_DOWNLOADS = 1; + private DownloadlistAdapter dla; + private DownloadRequester requester; + + private ActionMode mActionMode; + private DownloadRequest selectedDownload; + + private DownloadService downloadService = null; + boolean mIsBound; + + private AsyncTask<Void, Void, Void> contentRefresher; + + private ListView listview; + + @Override + protected void onCreate(Bundle savedInstanceState) { + setTheme(UserPreferences.getTheme()); + super.onCreate(savedInstanceState); + setContentView(R.layout.listview_activity); + + listview = (ListView) findViewById(R.id.listview); + + if (AppConfig.DEBUG) + Log.d(TAG, "Creating Activity"); + requester = DownloadRequester.getInstance(); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + + @Override + protected void onPause() { + super.onPause(); + unbindService(mConnection); + unregisterReceiver(contentChanged); + } + + @Override + protected void onResume() { + super.onResume(); + registerReceiver(contentChanged, new IntentFilter( + DownloadService.ACTION_DOWNLOADS_CONTENT_CHANGED)); + bindService(new Intent(this, DownloadService.class), mConnection, 0); + startContentRefresher(); + if (dla != null) { + dla.notifyDataSetChanged(); + } + } + + @Override + protected void onStop() { + super.onStop(); + if (AppConfig.DEBUG) + Log.d(TAG, "Stopping Activity"); + stopContentRefresher(); + } + + private ServiceConnection mConnection = new ServiceConnection() { + public void onServiceDisconnected(ComponentName className) { + downloadService = null; + mIsBound = false; + Log.i(TAG, "Closed connection with DownloadService."); + } + + public void onServiceConnected(ComponentName name, IBinder service) { + downloadService = ((DownloadService.LocalBinder) service) + .getService(); + mIsBound = true; + if (AppConfig.DEBUG) + Log.d(TAG, "Connection to service established"); + dla = new DownloadlistAdapter(DownloadActivity.this, 0, + downloadService.getDownloads()); + listview.setAdapter(dla); + dla.notifyDataSetChanged(); + } + }; + + @SuppressLint("NewApi") + private void startContentRefresher() { + if (contentRefresher != null) { + contentRefresher.cancel(true); + } + contentRefresher = new AsyncTask<Void, Void, Void>() { + private final int WAITING_INTERVALL = 1000; + + @Override + protected void onProgressUpdate(Void... values) { + super.onProgressUpdate(values); + if (dla != null) { + if (AppConfig.DEBUG) + Log.d(TAG, "Refreshing content automatically"); + dla.notifyDataSetChanged(); + } + } + + @Override + protected Void doInBackground(Void... params) { + while (!isCancelled()) { + try { + Thread.sleep(WAITING_INTERVALL); + publishProgress(); + } catch (InterruptedException e) { + return null; + } + } + return null; + } + }; + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + contentRefresher.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } else { + contentRefresher.execute(); + } + } + + private void stopContentRefresher() { + if (contentRefresher != null) { + contentRefresher.cancel(true); + } + } + + @Override + protected void onPostCreate(Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + listview.setOnItemLongClickListener(new OnItemLongClickListener() { + + @Override + public boolean onItemLongClick(AdapterView<?> arg0, View view, + int position, long id) { + DownloadRequest selection = dla.getItem(position) + .getDownloadRequest(); + if (selection != null && mActionMode != null) { + mActionMode.finish(); + } + dla.setSelectedItemIndex(position); + selectedDownload = selection; + mActionMode = startSupportActionMode(DownloadActivity.this); + return true; + } + + }); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, MENU_SHOW_LOG, Menu.NONE, + R.string.show_download_log), + MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, MENU_CANCEL_ALL_DOWNLOADS, Menu.NONE, + R.string.cancel_all_downloads_label), + MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + Intent intent = new Intent(this, MainActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP + | Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + break; + case MENU_SHOW_LOG: + startActivity(new Intent(this, DownloadLogActivity.class)); + break; + case MENU_CANCEL_ALL_DOWNLOADS: + requester.cancelAllDownloads(this); + break; + } + return true; + } + + @Override + public boolean onCreateActionMode(ActionMode mode, Menu menu) { + if (selectedDownload != null) { + TypedArray drawables = obtainStyledAttributes(new int[]{R.attr.navigation_cancel}); + menu.add(Menu.NONE, R.id.cancel_download_item, Menu.NONE, + R.string.cancel_download_label).setIcon( + drawables.getDrawable(0)); + } + return true; + } + + @Override + public boolean onPrepareActionMode(ActionMode mode, Menu menu) { + return false; + } + + @Override + public boolean onActionItemClicked(ActionMode mode, MenuItem item) { + boolean handled = false; + switch (item.getItemId()) { + case R.id.cancel_download_item: + requester.cancelDownload(this, selectedDownload.getSource()); + handled = true; + break; + } + mActionMode.finish(); + return handled; + } + + @Override + public void onDestroyActionMode(ActionMode mode) { + mActionMode = null; + selectedDownload = null; + dla.setSelectedItemIndex(DownloadlistAdapter.SELECTION_NONE); + } + + private BroadcastReceiver contentChanged = new BroadcastReceiver() { + + @Override + public void onReceive(Context context, Intent intent) { + if (dla != null) { + if (AppConfig.DEBUG) + Log.d(TAG, "Refreshing content"); + dla.notifyDataSetChanged(); + } + } + }; } diff --git a/src/de/danoeh/antennapod/activity/DownloadLogActivity.java b/src/de/danoeh/antennapod/activity/DownloadLogActivity.java index ec5b0c980..949834596 100644 --- a/src/de/danoeh/antennapod/activity/DownloadLogActivity.java +++ b/src/de/danoeh/antennapod/activity/DownloadLogActivity.java @@ -3,11 +3,13 @@ package de.danoeh.antennapod.activity; import android.os.AsyncTask; import android.os.Bundle; -import android.util.Log; -import com.actionbarsherlock.app.SherlockListActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; +import android.support.v7.app.ActionBarActivity; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.ListView; +import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.DownloadLogAdapter; import de.danoeh.antennapod.feed.EventDistributor; import de.danoeh.antennapod.preferences.UserPreferences; @@ -19,20 +21,26 @@ import java.util.List; /** * Displays completed and failed downloads in a list. */ -public class DownloadLogActivity extends SherlockListActivity { +public class DownloadLogActivity extends ActionBarActivity { private static final String TAG = "DownloadLogActivity"; private List<DownloadStatus> downloadLog; private DownloadLogAdapter dla; + private ListView listview; + @Override protected void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTheme()); super.onCreate(savedInstanceState); + setContentView(R.layout.listview_activity); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + + + listview = (ListView) findViewById(R.layout.listview_activity); dla = new DownloadLogAdapter(this, itemAccess); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - setListAdapter(dla); + listview.setAdapter(dla); loadData(); } diff --git a/src/de/danoeh/antennapod/activity/FeedInfoActivity.java b/src/de/danoeh/antennapod/activity/FeedInfoActivity.java index 58fa78546..4a8a2f1f8 100644 --- a/src/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/src/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -2,15 +2,14 @@ package de.danoeh.antennapod.activity; import android.os.AsyncTask; import android.os.Bundle; +import android.support.v7.app.ActionBarActivity; import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.widget.ImageView; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuInflater; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.asynctask.ImageLoader; @@ -23,7 +22,7 @@ import de.danoeh.antennapod.util.LangUtils; import de.danoeh.antennapod.util.menuhandler.FeedMenuHandler; /** Displays information about a feed. */ -public class FeedInfoActivity extends SherlockActivity { +public class FeedInfoActivity extends ActionBarActivity { private static final String TAG = "FeedInfoActivity"; public static final String EXTRA_FEED_ID = "de.danoeh.antennapod.extra.feedId"; diff --git a/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java b/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java index f784628d3..64e4f2d30 100644 --- a/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java +++ b/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java @@ -8,14 +8,14 @@ import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.app.ActionBarActivity; import android.util.Log; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuInflater; -import com.actionbarsherlock.view.MenuItem; -import com.actionbarsherlock.view.Window; - +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.Window; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.asynctask.FeedRemover; @@ -31,34 +31,38 @@ import de.danoeh.antennapod.storage.DownloadRequestException; import de.danoeh.antennapod.util.StorageUtils; import de.danoeh.antennapod.util.menuhandler.FeedMenuHandler; -/** Displays a List of FeedItems */ -public class FeedItemlistActivity extends SherlockFragmentActivity { - private static final String TAG = "FeedItemlistActivity"; - - /** The feed which the activity displays */ - private Feed feed; - private ItemlistFragment filf; - private ExternalPlayerFragment externalPlayerFragment; - - @Override - public void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); - StorageUtils.checkStorageAvailability(this); - requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); - - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - setContentView(R.layout.feeditemlist_activity); - - long feedId = getIntent().getLongExtra( - FeedlistFragment.EXTRA_SELECTED_FEED, -1); - if (feedId == -1) { - Log.e(TAG, "Received invalid feed selection."); +/** + * Displays a List of FeedItems + */ +public class FeedItemlistActivity extends ActionBarActivity { + private static final String TAG = "FeedItemlistActivity"; + + /** + * The feed which the activity displays + */ + private Feed feed; + private ItemlistFragment filf; + private ExternalPlayerFragment externalPlayerFragment; + + @Override + public void onCreate(Bundle savedInstanceState) { + setTheme(UserPreferences.getTheme()); + super.onCreate(savedInstanceState); + StorageUtils.checkStorageAvailability(this); + requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setContentView(R.layout.feeditemlist_activity); + + long feedId = getIntent().getLongExtra( + FeedlistFragment.EXTRA_SELECTED_FEED, -1); + if (feedId == -1) { + Log.e(TAG, "Received invalid feed selection."); } else { loadData(feedId); } - } + } private void loadData(long id) { AsyncTask<Long, Void, Feed> loadTask = new AsyncTask<Long, Void, Feed>() { @@ -96,19 +100,19 @@ public class FeedItemlistActivity extends SherlockFragmentActivity { loadTask.execute(id); } - @Override - protected void onResume() { - super.onResume(); - StorageUtils.checkStorageAvailability(this); - } + @Override + protected void onResume() { + super.onResume(); + StorageUtils.checkStorageAvailability(this); + } - @Override - public boolean onCreateOptionsMenu(Menu menu) { + @Override + public boolean onCreateOptionsMenu(Menu menu) { if (feed != null) { - TypedArray drawables = obtainStyledAttributes(new int[] { R.attr.action_search }); - menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) - .setIcon(drawables.getDrawable(0)) - .setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); + TypedArray drawables = obtainStyledAttributes(new int[]{R.attr.action_search}); + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) + .setIcon(drawables.getDrawable(0)), + MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); return FeedMenuHandler .onCreateOptionsMenu(new MenuInflater(this), menu); } else { @@ -116,61 +120,61 @@ public class FeedItemlistActivity extends SherlockFragmentActivity { } } - @Override - public boolean onPrepareOptionsMenu(Menu menu) { - return FeedMenuHandler.onPrepareOptionsMenu(menu, feed); - } - - @SuppressLint("NewApi") - @Override - public boolean onOptionsItemSelected(MenuItem item) { - try { - if (FeedMenuHandler.onOptionsItemClicked(this, item, feed)) { - filf.getListAdapter().notifyDataSetChanged(); - } else { - switch (item.getItemId()) { - case R.id.remove_item: - final FeedRemover remover = new FeedRemover( - FeedItemlistActivity.this, feed) { - @Override - protected void onPostExecute(Void result) { - super.onPostExecute(result); - finish(); - } - }; - ConfirmationDialog conDialog = new ConfirmationDialog(this, - R.string.remove_feed_label, - R.string.feed_delete_confirmation_msg) { - - @Override - public void onConfirmButtonPressed( - DialogInterface dialog) { - dialog.dismiss(); - remover.executeAsync(); - } - }; - conDialog.createNewDialog().show(); - break; - case R.id.search_item: - onSearchRequested(); - break; - case android.R.id.home: - Intent intent = new Intent(this, MainActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(intent); - break; - } - } - } catch (DownloadRequestException e) { - e.printStackTrace(); - DownloadRequestErrorDialogCreator.newRequestErrorDialog(this, - e.getMessage()); - } - return true; - } - - @Override - public boolean onSearchRequested() { + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + return FeedMenuHandler.onPrepareOptionsMenu(menu, feed); + } + + @SuppressLint("NewApi") + @Override + public boolean onOptionsItemSelected(MenuItem item) { + try { + if (FeedMenuHandler.onOptionsItemClicked(this, item, feed)) { + filf.getListAdapter().notifyDataSetChanged(); + } else { + switch (item.getItemId()) { + case R.id.remove_item: + final FeedRemover remover = new FeedRemover( + FeedItemlistActivity.this, feed) { + @Override + protected void onPostExecute(Void result) { + super.onPostExecute(result); + finish(); + } + }; + ConfirmationDialog conDialog = new ConfirmationDialog(this, + R.string.remove_feed_label, + R.string.feed_delete_confirmation_msg) { + + @Override + public void onConfirmButtonPressed( + DialogInterface dialog) { + dialog.dismiss(); + remover.executeAsync(); + } + }; + conDialog.createNewDialog().show(); + break; + case R.id.search_item: + onSearchRequested(); + break; + case android.R.id.home: + Intent intent = new Intent(this, MainActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + break; + } + } + } catch (DownloadRequestException e) { + e.printStackTrace(); + DownloadRequestErrorDialogCreator.newRequestErrorDialog(this, + e.getMessage()); + } + return true; + } + + @Override + public boolean onSearchRequested() { if (feed != null) { Bundle bundle = new Bundle(); bundle.putLong(SearchActivity.EXTRA_FEED_ID, feed.getId()); @@ -179,6 +183,6 @@ public class FeedItemlistActivity extends SherlockFragmentActivity { } else { return false; } - } + } } diff --git a/src/de/danoeh/antennapod/activity/FlattrAuthActivity.java b/src/de/danoeh/antennapod/activity/FlattrAuthActivity.java index 75e513816..2ab95e287 100644 --- a/src/de/danoeh/antennapod/activity/FlattrAuthActivity.java +++ b/src/de/danoeh/antennapod/activity/FlattrAuthActivity.java @@ -1,6 +1,9 @@ package de.danoeh.antennapod.activity; +import android.support.v7.app.ActionBarActivity; +import android.view.Menu; +import android.view.MenuItem; import org.shredzone.flattr4j.exception.FlattrException; import android.content.Intent; @@ -12,10 +15,6 @@ import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.preferences.UserPreferences; @@ -23,7 +22,7 @@ import de.danoeh.antennapod.util.flattr.FlattrUtils; /** Guides the user through the authentication process */ -public class FlattrAuthActivity extends SherlockActivity { +public class FlattrAuthActivity extends ActionBarActivity { private static final String TAG = "FlattrAuthActivity"; private TextView txtvExplanation; diff --git a/src/de/danoeh/antennapod/activity/ItemviewActivity.java b/src/de/danoeh/antennapod/activity/ItemviewActivity.java index eb8d71bbe..43eea93e4 100644 --- a/src/de/danoeh/antennapod/activity/ItemviewActivity.java +++ b/src/de/danoeh/antennapod/activity/ItemviewActivity.java @@ -4,14 +4,15 @@ import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; +import android.support.v7.app.ActionBarActivity; import android.text.format.DateUtils; import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.Window; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuInflater; -import com.actionbarsherlock.view.MenuItem; -import com.actionbarsherlock.view.Window; + import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.dialog.DownloadRequestErrorDialogCreator; @@ -29,7 +30,7 @@ import de.danoeh.antennapod.util.menuhandler.FeedItemMenuHandler; import java.text.DateFormat; /** Displays a single FeedItem and provides various actions */ -public class ItemviewActivity extends SherlockFragmentActivity { +public class ItemviewActivity extends ActionBarActivity { private static final String TAG = "ItemviewActivity"; private static final int EVENTS = EventDistributor.DOWNLOAD_HANDLED | EventDistributor.DOWNLOAD_QUEUED; @@ -119,7 +120,7 @@ public class ItemviewActivity extends SherlockFragmentActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { if (item != null) { - MenuInflater inflater = getSupportMenuInflater(); + MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.feeditem, menu); return true; } else { diff --git a/src/de/danoeh/antennapod/activity/MainActivity.java b/src/de/danoeh/antennapod/activity/MainActivity.java index b42990224..92b56461c 100644 --- a/src/de/danoeh/antennapod/activity/MainActivity.java +++ b/src/de/danoeh/antennapod/activity/MainActivity.java @@ -9,16 +9,14 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.app.FragmentTransaction; import android.support.v4.view.ViewPager; +import android.support.v7.app.ActionBar; +import android.support.v7.app.ActionBarActivity; import android.util.Log; -import com.actionbarsherlock.app.ActionBar; -import com.actionbarsherlock.app.ActionBar.Tab; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuInflater; -import com.actionbarsherlock.view.MenuItem; -import com.actionbarsherlock.view.Window; - +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.Window; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.feed.EventDistributor; @@ -34,7 +32,7 @@ import de.danoeh.antennapod.storage.DownloadRequester; import de.danoeh.antennapod.util.StorageUtils; /** The activity that is shown when the user launches the app. */ -public class MainActivity extends SherlockFragmentActivity { +public class MainActivity extends ActionBarActivity { private static final String TAG = "MainActivity"; private static final int EVENTS = EventDistributor.DOWNLOAD_HANDLED @@ -61,9 +59,9 @@ public class MainActivity extends SherlockFragmentActivity { viewpager.setAdapter(pagerAdapter); - Tab feedsTab = getSupportActionBar().newTab(); + ActionBar.Tab feedsTab = getSupportActionBar().newTab(); feedsTab.setText(R.string.podcasts_label); - Tab episodesTab = getSupportActionBar().newTab(); + ActionBar.Tab episodesTab = getSupportActionBar().newTab(); episodesTab.setText(R.string.episodes_label); pagerAdapter.addTab(feedsTab, FeedlistFragment.class, null); @@ -244,7 +242,7 @@ public class MainActivity extends SherlockFragmentActivity { } @Override - public void onTabSelected(Tab tab, FragmentTransaction ft) { + public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { Object tag = tab.getTag(); for (int i = 0; i < mTabs.size(); i++) { if (mTabs.get(i) == tag) { @@ -254,12 +252,12 @@ public class MainActivity extends SherlockFragmentActivity { } @Override - public void onTabUnselected(Tab tab, FragmentTransaction ft) { + public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) { } @Override - public void onTabReselected(Tab tab, FragmentTransaction ft) { + public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) { } } diff --git a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java index 59e65bd48..b5b694995 100644 --- a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -6,17 +6,16 @@ import android.content.Intent; import android.graphics.PixelFormat; import android.net.Uri; import android.os.Bundle; +import android.support.v7.app.ActionBarActivity; import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.widget.ImageButton; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuInflater; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.asynctask.FlattrClickWorker; @@ -34,7 +33,7 @@ import de.danoeh.antennapod.util.playback.PlaybackController; * Provides general features which are both needed for playing audio and video * files. */ -public abstract class MediaplayerActivity extends SherlockFragmentActivity +public abstract class MediaplayerActivity extends ActionBarActivity implements OnSeekBarChangeListener { private static final String TAG = "MediaplayerActivity"; diff --git a/src/de/danoeh/antennapod/activity/MiroGuideCategoryActivity.java b/src/de/danoeh/antennapod/activity/MiroGuideCategoryActivity.java index bb50944cc..c039e96f8 100644 --- a/src/de/danoeh/antennapod/activity/MiroGuideCategoryActivity.java +++ b/src/de/danoeh/antennapod/activity/MiroGuideCategoryActivity.java @@ -5,13 +5,11 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.view.ViewPager; +import android.support.v7.app.ActionBarActivity; import android.util.Log; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; -import com.viewpagerindicator.TabPageIndicator; - +import android.view.Menu; +import android.view.MenuItem; import de.danoeh.antennapod.R; import de.danoeh.antennapod.fragment.MiroGuideChannellistFragment; import de.danoeh.antennapod.preferences.UserPreferences; @@ -21,14 +19,13 @@ import de.danoeh.antennapod.preferences.UserPreferences; * activity uses MiroGuideChannelListFragments for these lists. If the user * selects a channel, the MiroGuideChannelViewActivity is started. */ -public class MiroGuideCategoryActivity extends SherlockFragmentActivity { +public class MiroGuideCategoryActivity extends ActionBarActivity { private static final String TAG = "MiroGuideCategoryActivity"; public static String EXTRA_CATEGORY = "category"; private ViewPager viewpager; private CategoryPagerAdapter pagerAdapter; - private TabPageIndicator tabs; private String category; @@ -40,14 +37,12 @@ public class MiroGuideCategoryActivity extends SherlockFragmentActivity { setContentView(R.layout.miroguide_category); viewpager = (ViewPager) findViewById(R.id.viewpager); - tabs = (TabPageIndicator) findViewById(R.id.tabs); category = getIntent().getStringExtra(EXTRA_CATEGORY); if (category != null) { getSupportActionBar().setTitle(category); pagerAdapter = new CategoryPagerAdapter(getSupportFragmentManager()); viewpager.setAdapter(pagerAdapter); - tabs.setViewPager(viewpager); } else { Log.e(TAG, "Activity was started with invalid arguments"); } diff --git a/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java b/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java index eae54f712..d4b4597f2 100644 --- a/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java +++ b/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java @@ -8,7 +8,11 @@ import android.content.Intent; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; +import android.support.v7.app.ActionBarActivity; import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.widget.ListView; import android.widget.ProgressBar; @@ -16,11 +20,6 @@ import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; -import com.actionbarsherlock.app.SherlockActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuInflater; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.MiroGuideItemlistAdapter; @@ -38,8 +37,8 @@ import de.danoeh.antennapod.storage.DownloadRequester; * Displays information about one channel and lets the user add this channel to * his library. */ -public class MiroGuideChannelViewActivity extends SherlockActivity { - private static final String TAG = "MiroGuideChannelViewActivity"; +public class MiroGuideChannelViewActivity extends ActionBarActivity { + private static final String TAG = "MiroGuideChannelViewActivity"; public static final String EXTRA_CHANNEL_ID = "id"; public static final String EXTRA_CHANNEL_URL = "url"; diff --git a/src/de/danoeh/antennapod/activity/MiroGuideMainActivity.java b/src/de/danoeh/antennapod/activity/MiroGuideMainActivity.java index 8b33ef1da..99da9944f 100644 --- a/src/de/danoeh/antennapod/activity/MiroGuideMainActivity.java +++ b/src/de/danoeh/antennapod/activity/MiroGuideMainActivity.java @@ -4,16 +4,17 @@ import android.annotation.SuppressLint; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.app.ActionBarActivity; import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; +import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockListActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.miroguide.conn.MiroGuideException; @@ -24,132 +25,133 @@ import de.danoeh.antennapod.preferences.UserPreferences; * Shows a list of available categories and offers a search button. If the user * selects a category, the MiroGuideCategoryActivity is started. */ -public class MiroGuideMainActivity extends SherlockListActivity { - private static final String TAG = "MiroGuideMainActivity"; - - private static String[] categories; - private ArrayAdapter<String> listAdapter; - - private TextView txtvStatus; - - @Override - protected void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - setContentView(R.layout.miroguide_categorylist); - - txtvStatus = (TextView) findViewById(android.R.id.empty); - } - - @Override - protected void onPause() { - super.onPause(); - } - - @Override - protected void onResume() { - super.onResume(); - if (categories != null) { - createAdapter(); - } else { - loadCategories(); - } - } - - @Override - protected void onListItemClick(ListView l, View v, int position, long id) { - super.onListItemClick(l, v, position, id); - String selection = listAdapter.getItem(position); - Intent launchIntent = new Intent(this, MiroGuideCategoryActivity.class); - launchIntent.putExtra(MiroGuideCategoryActivity.EXTRA_CATEGORY, - selection); - startActivity(launchIntent); - } - - private void createAdapter() { - if (categories != null) { - listAdapter = new ArrayAdapter<String>(this, - android.R.layout.simple_list_item_1, categories); - txtvStatus.setText(R.string.no_items_label); - setListAdapter(listAdapter); - } - } - - /** - * Launches an AsyncTask to load the available categories in the background. - */ - @SuppressLint("NewApi") - private void loadCategories() { - AsyncTask<Void, Void, Void> listLoader = new AsyncTask<Void, Void, Void>() { - - private String[] c; - private MiroGuideException exception; - - @Override - protected void onPostExecute(Void result) { - if (exception == null) { - if (AppConfig.DEBUG) - Log.d(TAG, "Successfully loaded categories"); - categories = c; - createAdapter(); - } else { - Log.e(TAG, "Error happened while trying to load categories"); - txtvStatus.setText(exception.getMessage()); - } - } - - @Override - protected void onPreExecute() { - txtvStatus.setText(R.string.loading_categories_label); - } - - @Override - protected Void doInBackground(Void... params) { - MiroGuideService service = new MiroGuideService(); - try { - c = service.getCategories(); - } catch (MiroGuideException e) { - e.printStackTrace(); - exception = e; - } finally { - service.close(); - } - return null; - } - - }; - - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - listLoader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - listLoader.execute(); - } - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) - .setIcon( - obtainStyledAttributes( - new int[] { R.attr.action_search }) - .getDrawable(0)) - .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - finish(); - return true; - case R.id.search_item: - onSearchRequested(); - return true; - default: - return false; - } - } - +public class MiroGuideMainActivity extends ActionBarActivity implements AdapterView.OnItemClickListener { + private static final String TAG = "MiroGuideMainActivity"; + + private static String[] categories; + private ArrayAdapter<String> listAdapter; + + private TextView txtvStatus; + private ListView listView; + + @Override + protected void onCreate(Bundle savedInstanceState) { + setTheme(UserPreferences.getTheme()); + super.onCreate(savedInstanceState); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setContentView(R.layout.miroguide_categorylist); + + txtvStatus = (TextView) findViewById(android.R.id.empty); + listView = (ListView) findViewById(android.R.id.list); + listView.setOnItemClickListener(this); + } + + @Override + protected void onPause() { + super.onPause(); + } + + @Override + protected void onResume() { + super.onResume(); + if (categories != null) { + createAdapter(); + } else { + loadCategories(); + } + } + + private void createAdapter() { + if (categories != null) { + listAdapter = new ArrayAdapter<String>(this, + android.R.layout.simple_list_item_1, categories); + txtvStatus.setText(R.string.no_items_label); + listView.setAdapter(listAdapter); + } + } + + /** + * Launches an AsyncTask to load the available categories in the background. + */ + @SuppressLint("NewApi") + private void loadCategories() { + AsyncTask<Void, Void, Void> listLoader = new AsyncTask<Void, Void, Void>() { + + private String[] c; + private MiroGuideException exception; + + @Override + protected void onPostExecute(Void result) { + if (exception == null) { + if (AppConfig.DEBUG) + Log.d(TAG, "Successfully loaded categories"); + categories = c; + createAdapter(); + } else { + Log.e(TAG, "Error happened while trying to load categories"); + txtvStatus.setText(exception.getMessage()); + } + } + + @Override + protected void onPreExecute() { + txtvStatus.setText(R.string.loading_categories_label); + } + + @Override + protected Void doInBackground(Void... params) { + MiroGuideService service = new MiroGuideService(); + try { + c = service.getCategories(); + } catch (MiroGuideException e) { + e.printStackTrace(); + exception = e; + } finally { + service.close(); + } + return null; + } + + }; + + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + listLoader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } else { + listLoader.execute(); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) + .setIcon( + obtainStyledAttributes( + new int[]{R.attr.action_search}) + .getDrawable(0)), + MenuItem.SHOW_AS_ACTION_IF_ROOM); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + case R.id.search_item: + onSearchRequested(); + return true; + default: + return false; + } + } + + @Override + public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { + String selection = listAdapter.getItem(position); + Intent launchIntent = new Intent(this, MiroGuideCategoryActivity.class); + launchIntent.putExtra(MiroGuideCategoryActivity.EXTRA_CATEGORY, + selection); + startActivity(launchIntent); + } } diff --git a/src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java b/src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java index a30777fb1..4ea0b1699 100644 --- a/src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java +++ b/src/de/danoeh/antennapod/activity/MiroGuideSearchActivity.java @@ -4,12 +4,12 @@ import android.app.SearchManager; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.app.ActionBarActivity; import android.util.Log; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - +import android.view.Menu; +import android.view.MenuItem; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.fragment.MiroGuideChannellistFragment; @@ -19,72 +19,72 @@ import de.danoeh.antennapod.preferences.UserPreferences; * Displays results when a search for miroguide channels has been performed. It * uses a MiroGuideChannelListFragment to display the results. */ -public class MiroGuideSearchActivity extends SherlockFragmentActivity { - private static final String TAG = "MiroGuideSearchActivity"; +public class MiroGuideSearchActivity extends ActionBarActivity { + private static final String TAG = "MiroGuideSearchActivity"; - private MiroGuideChannellistFragment listFragment; + private MiroGuideChannellistFragment listFragment; - @Override - protected void onCreate(Bundle arg0) { - setTheme(UserPreferences.getTheme()); - super.onCreate(arg0); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - setContentView(R.layout.miroguidesearch); - } + @Override + protected void onCreate(Bundle arg0) { + setTheme(UserPreferences.getTheme()); + super.onCreate(arg0); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setContentView(R.layout.miroguidesearch); + } - @Override - protected void onResume() { - super.onResume(); - Intent intent = getIntent(); - if (Intent.ACTION_SEARCH.equals(intent.getAction())) { - String query = intent.getStringExtra(SearchManager.QUERY); - getSupportActionBar() - .setSubtitle( - getString(R.string.search_term_label) + "\"" - + query + "\""); - handleSearchRequest(query); - } - } + @Override + protected void onResume() { + super.onResume(); + Intent intent = getIntent(); + if (Intent.ACTION_SEARCH.equals(intent.getAction())) { + String query = intent.getStringExtra(SearchManager.QUERY); + getSupportActionBar() + .setSubtitle( + getString(R.string.search_term_label) + "\"" + + query + "\""); + handleSearchRequest(query); + } + } - private void handleSearchRequest(String query) { - if (AppConfig.DEBUG) - Log.d(TAG, "Performing search"); - FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); - listFragment = MiroGuideChannellistFragment.newInstance("name", query, - "name"); - ft.replace(R.id.channellistFragment, listFragment); - ft.commit(); - } + private void handleSearchRequest(String query) { + if (AppConfig.DEBUG) + Log.d(TAG, "Performing search"); + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + listFragment = MiroGuideChannellistFragment.newInstance("name", query, + "name"); + ft.replace(R.id.channellistFragment, listFragment); + ft.commit(); + } - @Override - protected void onNewIntent(Intent intent) { - setIntent(intent); - } + @Override + protected void onNewIntent(Intent intent) { + setIntent(intent); + } - @Override - public boolean onCreateOptionsMenu(Menu menu) { - menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) - .setIcon( - obtainStyledAttributes( - new int[] { R.attr.action_search }) - .getDrawable(0)) - .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) + .setIcon( + obtainStyledAttributes( + new int[]{R.attr.action_search}) + .getDrawable(0)), + MenuItem.SHOW_AS_ACTION_IF_ROOM); - return true; - } + return true; + } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - finish(); - return true; - case R.id.search_item: - onSearchRequested(); - return true; - default: - return false; - } - } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + case R.id.search_item: + onSearchRequested(); + return true; + default: + return false; + } + } } diff --git a/src/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/src/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index ce58babc0..cb1c66cab 100644 --- a/src/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/src/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -6,6 +6,7 @@ import java.util.Date; import javax.xml.parsers.ParserConfigurationException; +import android.support.v7.app.ActionBarActivity; import org.xml.sax.SAXException; import android.app.AlertDialog; @@ -17,8 +18,6 @@ import android.view.Gravity; import android.widget.LinearLayout; import android.widget.ProgressBar; -import com.actionbarsherlock.app.SherlockFragmentActivity; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.feed.Feed; @@ -43,7 +42,7 @@ import de.danoeh.antennapod.util.URLChecker; * If the feed cannot be downloaded or parsed, an error dialog will be displayed * and the activity will finish as soon as the error dialog is closed. */ -public abstract class OnlineFeedViewActivity extends SherlockFragmentActivity { +public abstract class OnlineFeedViewActivity extends ActionBarActivity { private static final String TAG = "OnlineFeedViewActivity"; private static final String ARG_FEEDURL = "arg.feedurl"; diff --git a/src/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java b/src/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java index 9ba355baf..2ec42e9ef 100644 --- a/src/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java +++ b/src/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java @@ -5,17 +5,17 @@ import java.util.List; import android.content.Intent; import android.os.Bundle; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.app.ActionBarActivity; import android.util.SparseBooleanArray; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; -import com.actionbarsherlock.app.SherlockActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.R; import de.danoeh.antennapod.opml.OpmlElement; import de.danoeh.antennapod.preferences.UserPreferences; @@ -24,110 +24,111 @@ import de.danoeh.antennapod.preferences.UserPreferences; * Displays the feeds that the OPML-Importer has read and lets the user choose * which feeds he wants to import. */ -public class OpmlFeedChooserActivity extends SherlockActivity { - private static final String TAG = "OpmlFeedChooserActivity"; - - public static final String EXTRA_SELECTED_ITEMS = "de.danoeh.antennapod.selectedItems"; - - private Button butConfirm; - private Button butCancel; - private ListView feedlist; - private ArrayAdapter<String> listAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); - - setContentView(R.layout.opml_selection); - butConfirm = (Button) findViewById(R.id.butConfirm); - butCancel = (Button) findViewById(R.id.butCancel); - feedlist = (ListView) findViewById(R.id.feedlist); - - feedlist.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); - listAdapter = new ArrayAdapter<String>(this, - android.R.layout.simple_list_item_multiple_choice, - getTitleList()); - - feedlist.setAdapter(listAdapter); - - butCancel.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - setResult(RESULT_CANCELED); - finish(); - } - }); - - butConfirm.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - Intent intent = new Intent(); - SparseBooleanArray checked = feedlist.getCheckedItemPositions(); - - int checkedCount = 0; - // Get number of checked items - for (int i = 0; i < checked.size(); i++) { - if (checked.valueAt(i)) { - checkedCount++; - } - } - int[] selection = new int[checkedCount]; - for (int i = 0, collected = 0; collected < checkedCount; i++) { - if (checked.valueAt(i)) { - selection[collected] = checked.keyAt(i); - collected++; - } - } - intent.putExtra(EXTRA_SELECTED_ITEMS, selection); - setResult(RESULT_OK, intent); - finish(); - } - }); - - } - - private List<String> getTitleList() { - List<String> result = new ArrayList<String>(); - if (OpmlImportHolder.getReadElements() != null) { - for (OpmlElement element : OpmlImportHolder.getReadElements()) { - result.add(element.getText()); - } - - } - return result; - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - menu.add(Menu.NONE, R.id.select_all_item, Menu.NONE, - R.string.select_all_label).setShowAsAction( - MenuItem.SHOW_AS_ACTION_IF_ROOM); - menu.add(Menu.NONE, R.id.deselect_all_item, Menu.NONE, - R.string.deselect_all_label).setShowAsAction( - MenuItem.SHOW_AS_ACTION_IF_ROOM); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case R.id.select_all_item: - selectAllItems(true); - return true; - case R.id.deselect_all_item: - selectAllItems(false); - return true; - default: - return false; - } - } - - private void selectAllItems(boolean b) { - for (int i = 0; i < feedlist.getCount(); i++) { - feedlist.setItemChecked(i, b); - } - } +public class OpmlFeedChooserActivity extends ActionBarActivity { + private static final String TAG = "OpmlFeedChooserActivity"; + + public static final String EXTRA_SELECTED_ITEMS = "de.danoeh.antennapod.selectedItems"; + + private Button butConfirm; + private Button butCancel; + private ListView feedlist; + private ArrayAdapter<String> listAdapter; + + @Override + protected void onCreate(Bundle savedInstanceState) { + setTheme(UserPreferences.getTheme()); + super.onCreate(savedInstanceState); + + setContentView(R.layout.opml_selection); + butConfirm = (Button) findViewById(R.id.butConfirm); + butCancel = (Button) findViewById(R.id.butCancel); + feedlist = (ListView) findViewById(R.id.feedlist); + + feedlist.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); + listAdapter = new ArrayAdapter<String>(this, + android.R.layout.simple_list_item_multiple_choice, + getTitleList()); + + feedlist.setAdapter(listAdapter); + + butCancel.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + setResult(RESULT_CANCELED); + finish(); + } + }); + + butConfirm.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + Intent intent = new Intent(); + SparseBooleanArray checked = feedlist.getCheckedItemPositions(); + + int checkedCount = 0; + // Get number of checked items + for (int i = 0; i < checked.size(); i++) { + if (checked.valueAt(i)) { + checkedCount++; + } + } + int[] selection = new int[checkedCount]; + for (int i = 0, collected = 0; collected < checkedCount; i++) { + if (checked.valueAt(i)) { + selection[collected] = checked.keyAt(i); + collected++; + } + } + intent.putExtra(EXTRA_SELECTED_ITEMS, selection); + setResult(RESULT_OK, intent); + finish(); + } + }); + + } + + private List<String> getTitleList() { + List<String> result = new ArrayList<String>(); + if (OpmlImportHolder.getReadElements() != null) { + for (OpmlElement element : OpmlImportHolder.getReadElements()) { + result.add(element.getText()); + } + + } + return result; + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.select_all_item, Menu.NONE, + R.string.select_all_label), + MenuItem.SHOW_AS_ACTION_IF_ROOM); + + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.deselect_all_item, Menu.NONE, + R.string.deselect_all_label), + MenuItem.SHOW_AS_ACTION_IF_ROOM); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.select_all_item: + selectAllItems(true); + return true; + case R.id.deselect_all_item: + selectAllItems(false); + return true; + default: + return false; + } + } + + private void selectAllItems(boolean b) { + for (int i = 0; i < feedlist.getCount(); i++) { + feedlist.setItemChecked(i, b); + } + } } diff --git a/src/de/danoeh/antennapod/activity/OpmlImportBaseActivity.java b/src/de/danoeh/antennapod/activity/OpmlImportBaseActivity.java index f887fdd94..905183aa2 100644 --- a/src/de/danoeh/antennapod/activity/OpmlImportBaseActivity.java +++ b/src/de/danoeh/antennapod/activity/OpmlImportBaseActivity.java @@ -4,10 +4,9 @@ import java.io.Reader; import java.util.ArrayList; import android.content.Intent; +import android.support.v7.app.ActionBarActivity; import android.util.Log; -import com.actionbarsherlock.app.SherlockActivity; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.asynctask.OpmlFeedQueuer; import de.danoeh.antennapod.asynctask.OpmlImportWorker; @@ -16,7 +15,7 @@ import de.danoeh.antennapod.opml.OpmlElement; /** * Base activity for Opml Import - e.g. with code what to do afterwards * */ -public class OpmlImportBaseActivity extends SherlockActivity { +public class OpmlImportBaseActivity extends ActionBarActivity { private static final String TAG = "OpmlImportBaseActivity"; private OpmlImportWorker importWorker; diff --git a/src/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java b/src/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java index b38e0c443..259689abf 100644 --- a/src/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java +++ b/src/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java @@ -9,15 +9,14 @@ import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.preferences.UserPreferences; diff --git a/src/de/danoeh/antennapod/activity/OrganizeQueueActivity.java b/src/de/danoeh/antennapod/activity/OrganizeQueueActivity.java index 38f0b5ae6..77dae303e 100644 --- a/src/de/danoeh/antennapod/activity/OrganizeQueueActivity.java +++ b/src/de/danoeh/antennapod/activity/OrganizeQueueActivity.java @@ -5,6 +5,8 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; +import android.support.v7.app.ActionBarActivity; +import android.view.*; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -12,9 +14,7 @@ import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockListActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; + import com.mobeta.android.dslv.DragSortListView; import de.danoeh.antennapod.R; import de.danoeh.antennapod.asynctask.ImageLoader; @@ -28,7 +28,7 @@ import de.danoeh.antennapod.util.UndoBarController; import java.util.List; -public class OrganizeQueueActivity extends SherlockListActivity implements +public class OrganizeQueueActivity extends ActionBarActivity implements UndoBarController.UndoListener { private static final String TAG = "OrganizeQueueActivity"; @@ -39,6 +39,8 @@ public class OrganizeQueueActivity extends SherlockListActivity implements private OrganizeAdapter adapter; private UndoBarController undoBarController; + private DragSortListView listView; + @Override protected void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTheme()); @@ -46,7 +48,7 @@ public class OrganizeQueueActivity extends SherlockListActivity implements setContentView(R.layout.organize_queue); getSupportActionBar().setDisplayHomeAsUpEnabled(true); - DragSortListView listView = (DragSortListView) getListView(); + listView = (DragSortListView) findViewById(android.R.id.list); listView.setDropListener(dropListener); listView.setRemoveListener(removeListener); @@ -70,7 +72,7 @@ public class OrganizeQueueActivity extends SherlockListActivity implements queue = feedItems; if (adapter == null) { adapter = new OrganizeAdapter(OrganizeQueueActivity.this); - setListAdapter(adapter); + listView.setAdapter(adapter); } adapter.notifyDataSetChanged(); } else { @@ -124,7 +126,7 @@ public class OrganizeQueueActivity extends SherlockListActivity implements @Override public void remove(int which) { - FeedItem item = (FeedItem) getListAdapter().getItem(which); + FeedItem item = (FeedItem) listView.getAdapter().getItem(which); DBWriter.removeQueueItem(OrganizeQueueActivity.this, item.getId(), true); undoBarController.showUndoBar(false, getString(R.string.removed_from_queue), new UndoToken(item, diff --git a/src/de/danoeh/antennapod/activity/PlaybackHistoryActivity.java b/src/de/danoeh/antennapod/activity/PlaybackHistoryActivity.java index 4d4a3d260..f329581e5 100644 --- a/src/de/danoeh/antennapod/activity/PlaybackHistoryActivity.java +++ b/src/de/danoeh/antennapod/activity/PlaybackHistoryActivity.java @@ -3,25 +3,25 @@ package de.danoeh.antennapod.activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.app.ActionBarActivity; import android.util.Log; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - +import android.view.Menu; +import android.view.MenuItem; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.fragment.PlaybackHistoryFragment; import de.danoeh.antennapod.preferences.UserPreferences; import de.danoeh.antennapod.storage.DBWriter; -public class PlaybackHistoryActivity extends SherlockFragmentActivity { +public class PlaybackHistoryActivity extends ActionBarActivity { private static final String TAG = "PlaybackHistoryActivity"; @Override public boolean onCreateOptionsMenu(Menu menu) { - menu.add(Menu.NONE, R.id.clear_history_item, Menu.NONE, - R.string.clear_history_label).setShowAsAction( + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.clear_history_item, Menu.NONE, + R.string.clear_history_label), MenuItem.SHOW_AS_ACTION_IF_ROOM); return true; } diff --git a/src/de/danoeh/antennapod/activity/PreferenceActivity.java b/src/de/danoeh/antennapod/activity/PreferenceActivity.java index be5fc2c26..880724c28 100644 --- a/src/de/danoeh/antennapod/activity/PreferenceActivity.java +++ b/src/de/danoeh/antennapod/activity/PreferenceActivity.java @@ -19,10 +19,8 @@ import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceScreen; import android.util.Log; -import com.actionbarsherlock.app.SherlockPreferenceActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - +import android.view.Menu; +import android.view.MenuItem; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.asynctask.FlattrClickWorker; @@ -33,7 +31,7 @@ import de.danoeh.antennapod.util.flattr.FlattrUtils; /** * The main preference activity */ -public class PreferenceActivity extends SherlockPreferenceActivity { +public class PreferenceActivity extends android.preference.PreferenceActivity { private static final String TAG = "PreferenceActivity"; private static final String PREF_FLATTR_THIS_APP = "prefFlattrThisApp"; @@ -52,10 +50,13 @@ public class PreferenceActivity extends SherlockPreferenceActivity { setTheme(UserPreferences.getTheme()); super.onCreate(savedInstanceState); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - addPreferencesFromResource(R.xml.preferences); - findPreference(PREF_FLATTR_THIS_APP).setOnPreferenceClickListener( - new OnPreferenceClickListener() { + if (android.os.Build.VERSION.SDK_INT >= 11) { + getActionBar().setDisplayHomeAsUpEnabled(true); + } + + addPreferencesFromResource(R.xml.preferences); + findPreference(PREF_FLATTR_THIS_APP).setOnPreferenceClickListener( + new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { diff --git a/src/de/danoeh/antennapod/activity/SearchActivity.java b/src/de/danoeh/antennapod/activity/SearchActivity.java index 6a20ed765..b6bdab83c 100644 --- a/src/de/danoeh/antennapod/activity/SearchActivity.java +++ b/src/de/danoeh/antennapod/activity/SearchActivity.java @@ -6,15 +6,16 @@ import android.annotation.SuppressLint; import android.app.SearchManager; import android.content.Intent; import android.os.Bundle; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.app.ActionBarActivity; import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; +import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockListActivity; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.SearchlistAdapter; @@ -26,158 +27,165 @@ import de.danoeh.antennapod.fragment.FeedlistFragment; import de.danoeh.antennapod.fragment.ItemlistFragment; import de.danoeh.antennapod.preferences.UserPreferences; -/** Displays the results when the user searches for FeedItems or Feeds. */ -public class SearchActivity extends SherlockListActivity { - private static final String TAG = "SearchActivity"; +/** + * Displays the results when the user searches for FeedItems or Feeds. + */ +public class SearchActivity extends ActionBarActivity implements AdapterView.OnItemClickListener { + private static final String TAG = "SearchActivity"; - public static final String EXTRA_FEED_ID = "de.danoeh.antennapod.searchactivity.extra.feedId"; + public static final String EXTRA_FEED_ID = "de.danoeh.antennapod.searchactivity.extra.feedId"; - private SearchlistAdapter searchAdapter; - private List<SearchResult> content; + private SearchlistAdapter searchAdapter; + private List<SearchResult> content; - /** ID of the feed that is being searched or null if the search is global. */ + /** + * ID of the feed that is being searched or null if the search is global. + */ private long feedID; - private TextView txtvStatus; - - @Override - protected void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); - - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - setContentView(R.layout.searchlist); - txtvStatus = (TextView) findViewById(android.R.id.empty); - } - - @Override - protected void onNewIntent(Intent intent) { - setIntent(intent); - } - - @Override - protected void onResume() { - super.onResume(); - Intent intent = getIntent(); - if (Intent.ACTION_SEARCH.equals(intent.getAction())) { - Bundle extra = intent.getBundleExtra(SearchManager.APP_DATA); - if (extra != null) { - if (AppConfig.DEBUG) - Log.d(TAG, "Found bundle extra"); - feedID = extra.getLong(EXTRA_FEED_ID); - } - if (AppConfig.DEBUG) - Log.d(TAG, "Starting search"); - String query = intent.getStringExtra(SearchManager.QUERY); - getSupportActionBar() - .setSubtitle( - getString(R.string.search_term_label) + "\"" - + query + "\""); - handleSearchRequest(query); - } - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) - .setIcon( - obtainStyledAttributes( - new int[] { R.attr.action_search }) - .getDrawable(0)) - .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - Intent intent = new Intent(this, MainActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(intent); - return true; - case R.id.search_item: - onSearchRequested(); - return true; - default: - return false; - } - } - - @Override - public boolean onSearchRequested() { - Bundle extra = null; - if (feedID != 0) { - extra = new Bundle(); - extra.putLong(EXTRA_FEED_ID, feedID); - } - startSearch(null, false, extra, false); - return true; - } - - @Override - protected void onListItemClick(ListView l, View v, int position, long id) { - super.onListItemClick(l, v, position, id); - SearchResult selection = searchAdapter.getItem(position); - if (selection.getComponent().getClass() == Feed.class) { - Feed feed = (Feed) selection.getComponent(); - Intent launchIntent = new Intent(this, FeedItemlistActivity.class); - launchIntent.putExtra(FeedlistFragment.EXTRA_SELECTED_FEED, - feed.getId()); - startActivity(launchIntent); - - } else if (selection.getComponent().getClass() == FeedItem.class) { - FeedItem item = (FeedItem) selection.getComponent(); - Intent launchIntent = new Intent(this, ItemviewActivity.class); - launchIntent.putExtra(FeedlistFragment.EXTRA_SELECTED_FEED, item - .getFeed().getId()); - launchIntent.putExtra(ItemlistFragment.EXTRA_SELECTED_FEEDITEM, - item.getId()); - startActivity(launchIntent); - } - } - - @SuppressLint({ "NewApi", "NewApi" }) - private void handleSearchRequest(final String query) { - if (searchAdapter != null) { - searchAdapter.clear(); - searchAdapter.notifyDataSetChanged(); - } - txtvStatus.setText(R.string.search_status_searching); - - Thread thread = new Thread() { - - @Override - public void run() { - Log.d(TAG, "Starting background work"); - final List<SearchResult> result = FeedSearcher - .performSearch(SearchActivity.this, query, feedID); - if (SearchActivity.this != null) { - SearchActivity.this.runOnUiThread(new Runnable() { - - @Override - public void run() { - if (AppConfig.DEBUG) - Log.d(TAG, "Background work finished"); - if (AppConfig.DEBUG) - Log.d(TAG, "Found " + result.size() - + " results"); - content = result; - - searchAdapter = new SearchlistAdapter( - SearchActivity.this, 0, content); - getListView().setAdapter(searchAdapter); - searchAdapter.notifyDataSetChanged(); - if (content.isEmpty()) { - txtvStatus - .setText(R.string.search_status_no_results); - } - } - }); - } - } - }; - thread.start(); - - } + private ListView listView; + private TextView txtvStatus; + + @Override + protected void onCreate(Bundle savedInstanceState) { + setTheme(UserPreferences.getTheme()); + super.onCreate(savedInstanceState); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + setContentView(R.layout.searchlist); + listView = (ListView) findViewById(android.R.id.list); + txtvStatus = (TextView) findViewById(android.R.id.empty); + + listView.setOnItemClickListener(this); + } + + @Override + protected void onNewIntent(Intent intent) { + setIntent(intent); + } + + @Override + protected void onResume() { + super.onResume(); + Intent intent = getIntent(); + if (Intent.ACTION_SEARCH.equals(intent.getAction())) { + Bundle extra = intent.getBundleExtra(SearchManager.APP_DATA); + if (extra != null) { + if (AppConfig.DEBUG) + Log.d(TAG, "Found bundle extra"); + feedID = extra.getLong(EXTRA_FEED_ID); + } + if (AppConfig.DEBUG) + Log.d(TAG, "Starting search"); + String query = intent.getStringExtra(SearchManager.QUERY); + getSupportActionBar() + .setSubtitle( + getString(R.string.search_term_label) + "\"" + + query + "\""); + handleSearchRequest(query); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label) + .setIcon( + obtainStyledAttributes( + new int[]{R.attr.action_search}) + .getDrawable(0)), + (MenuItem.SHOW_AS_ACTION_IF_ROOM)); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + Intent intent = new Intent(this, MainActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + return true; + case R.id.search_item: + onSearchRequested(); + return true; + default: + return false; + } + } + + @Override + public boolean onSearchRequested() { + Bundle extra = null; + if (feedID != 0) { + extra = new Bundle(); + extra.putLong(EXTRA_FEED_ID, feedID); + } + startSearch(null, false, extra, false); + return true; + } + + @SuppressLint({"NewApi", "NewApi"}) + private void handleSearchRequest(final String query) { + if (searchAdapter != null) { + searchAdapter.clear(); + searchAdapter.notifyDataSetChanged(); + } + txtvStatus.setText(R.string.search_status_searching); + + Thread thread = new Thread() { + + @Override + public void run() { + Log.d(TAG, "Starting background work"); + final List<SearchResult> result = FeedSearcher + .performSearch(SearchActivity.this, query, feedID); + if (SearchActivity.this != null) { + SearchActivity.this.runOnUiThread(new Runnable() { + + @Override + public void run() { + if (AppConfig.DEBUG) + Log.d(TAG, "Background work finished"); + if (AppConfig.DEBUG) + Log.d(TAG, "Found " + result.size() + + " results"); + content = result; + + searchAdapter = new SearchlistAdapter( + SearchActivity.this, 0, content); + listView.setAdapter(searchAdapter); + searchAdapter.notifyDataSetChanged(); + if (content.isEmpty()) { + txtvStatus + .setText(R.string.search_status_no_results); + } + } + }); + } + } + }; + thread.start(); + + } + + @Override + public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { + SearchResult selection = searchAdapter.getItem(position); + if (selection.getComponent().getClass() == Feed.class) { + Feed feed = (Feed) selection.getComponent(); + Intent launchIntent = new Intent(this, FeedItemlistActivity.class); + launchIntent.putExtra(FeedlistFragment.EXTRA_SELECTED_FEED, + feed.getId()); + startActivity(launchIntent); + + } else if (selection.getComponent().getClass() == FeedItem.class) { + FeedItem item = (FeedItem) selection.getComponent(); + Intent launchIntent = new Intent(this, ItemviewActivity.class); + launchIntent.putExtra(FeedlistFragment.EXTRA_SELECTED_FEED, item + .getFeed().getId()); + launchIntent.putExtra(ItemlistFragment.EXTRA_SELECTED_FEEDITEM, + item.getId()); + startActivity(launchIntent); + } + } } diff --git a/src/de/danoeh/antennapod/activity/StorageErrorActivity.java b/src/de/danoeh/antennapod/activity/StorageErrorActivity.java index 4d9184dcf..33277ebc9 100644 --- a/src/de/danoeh/antennapod/activity/StorageErrorActivity.java +++ b/src/de/danoeh/antennapod/activity/StorageErrorActivity.java @@ -5,17 +5,16 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; +import android.support.v7.app.ActionBarActivity; import android.util.Log; -import com.actionbarsherlock.app.SherlockActivity; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.preferences.UserPreferences; import de.danoeh.antennapod.util.StorageUtils; /** Is show if there is now external storage available. */ -public class StorageErrorActivity extends SherlockActivity { +public class StorageErrorActivity extends ActionBarActivity { private static final String TAG = "StorageErrorActivity"; @Override diff --git a/src/de/danoeh/antennapod/activity/VideoplayerActivity.java b/src/de/danoeh/antennapod/activity/VideoplayerActivity.java index b3567e417..01841f099 100644 --- a/src/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -5,18 +5,13 @@ import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; -import android.view.MotionEvent; -import android.view.SurfaceHolder; -import android.view.View; -import android.view.WindowManager; +import android.view.*; import android.view.animation.AnimationUtils; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.SeekBar; import android.widget.VideoView; -import com.actionbarsherlock.view.Window; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.feed.MediaType; diff --git a/src/de/danoeh/antennapod/fragment/CoverFragment.java b/src/de/danoeh/antennapod/fragment/CoverFragment.java index 6be76f515..791315719 100644 --- a/src/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/src/de/danoeh/antennapod/fragment/CoverFragment.java @@ -1,14 +1,13 @@ package de.danoeh.antennapod.fragment; import android.os.Bundle; +import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; -import com.actionbarsherlock.app.SherlockFragment; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.AudioplayerActivity.AudioplayerContentFragment; @@ -16,7 +15,7 @@ import de.danoeh.antennapod.asynctask.ImageLoader; import de.danoeh.antennapod.util.playback.Playable; /** Displays the cover and the title of a FeedItem. */ -public class CoverFragment extends SherlockFragment implements +public class CoverFragment extends Fragment implements AudioplayerContentFragment { private static final String TAG = "CoverFragment"; private static final String ARG_PLAYABLE = "arg.playable"; diff --git a/src/de/danoeh/antennapod/fragment/EpisodesFragment.java b/src/de/danoeh/antennapod/fragment/EpisodesFragment.java index c3cfb6557..a99056c9a 100644 --- a/src/de/danoeh/antennapod/fragment/EpisodesFragment.java +++ b/src/de/danoeh/antennapod/fragment/EpisodesFragment.java @@ -4,19 +4,13 @@ import android.content.Context; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; +import android.support.v4.app.Fragment; import android.util.Log; -import android.view.ContextMenu; +import android.view.*; import android.view.ContextMenu.ContextMenuInfo; -import android.view.LayoutInflater; -import android.view.MenuInflater; -import android.view.View; -import android.view.ViewGroup; import android.widget.ExpandableListView; import android.widget.ExpandableListView.OnChildClickListener; -import com.actionbarsherlock.app.SherlockFragment; -import com.actionbarsherlock.view.Menu; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.ItemviewActivity; @@ -35,7 +29,7 @@ import de.danoeh.antennapod.util.menuhandler.FeedItemMenuHandler; import java.util.List; -public class EpisodesFragment extends SherlockFragment { +public class EpisodesFragment extends Fragment { private static final String TAG = "EpisodesFragment"; private static final int EVENTS = EventDistributor.QUEUE_UPDATE @@ -249,7 +243,7 @@ public class EpisodesFragment extends SherlockFragment { if (selectedItem != null) { try { handled = FeedItemMenuHandler.onMenuItemClicked( - getSherlockActivity(), item.getItemId(), selectedItem); + getActivity(), item.getItemId(), selectedItem); } catch (DownloadRequestException e) { e.printStackTrace(); DownloadRequestErrorDialogCreator.newRequestErrorDialog( diff --git a/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index a50e820b6..10312b20b 100644 --- a/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.fragment; import android.os.Bundle; +import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -10,8 +11,6 @@ import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockFragment; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.asynctask.ImageLoader; @@ -24,7 +23,7 @@ import de.danoeh.antennapod.util.playback.PlaybackController; * Fragment which is supposed to be displayed outside of the MediaplayerActivity * if the PlaybackService is running */ -public class ExternalPlayerFragment extends SherlockFragment { +public class ExternalPlayerFragment extends Fragment { private static final String TAG = "ExternalPlayerFragment"; private ViewGroup fragmentLayout; diff --git a/src/de/danoeh/antennapod/fragment/FeedlistFragment.java b/src/de/danoeh/antennapod/fragment/FeedlistFragment.java index 95fdc92da..3e8679bca 100644 --- a/src/de/danoeh/antennapod/fragment/FeedlistFragment.java +++ b/src/de/danoeh/antennapod/fragment/FeedlistFragment.java @@ -3,22 +3,17 @@ package de.danoeh.antennapod.fragment; import java.util.List; import android.annotation.SuppressLint; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.app.ActionBarActivity; +import android.support.v7.view.ActionMode; import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; +import android.view.*; import android.widget.*; -import com.actionbarsherlock.app.SherlockFragment; -import com.actionbarsherlock.view.ActionMode; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.FeedItemlistActivity; @@ -33,10 +28,10 @@ import de.danoeh.antennapod.storage.DownloadRequestException; import de.danoeh.antennapod.storage.FeedItemStatistics; import de.danoeh.antennapod.util.menuhandler.FeedMenuHandler; -public class FeedlistFragment extends SherlockFragment implements - ActionMode.Callback, AdapterView.OnItemClickListener, - AdapterView.OnItemLongClickListener { - private static final String TAG = "FeedlistFragment"; +public class FeedlistFragment extends Fragment implements + ActionMode.Callback, AdapterView.OnItemClickListener, + AdapterView.OnItemLongClickListener { + private static final String TAG = "FeedlistFragment"; private static final int EVENTS = EventDistributor.DOWNLOAD_HANDLED | EventDistributor.DOWNLOAD_QUEUED @@ -201,14 +196,14 @@ public class FeedlistFragment extends SherlockFragment implements @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { try { - if (FeedMenuHandler.onOptionsItemClicked(getSherlockActivity(), + if (FeedMenuHandler.onOptionsItemClicked(getActivity(), item, selectedFeed)) { loadFeeds(); } else { switch (item.getItemId()) { case R.id.remove_item: final FeedRemover remover = new FeedRemover( - getSherlockActivity(), selectedFeed) { + getActivity(), selectedFeed) { @Override protected void onPostExecute(Void result) { super.onPostExecute(result); @@ -268,8 +263,7 @@ public class FeedlistFragment extends SherlockFragment implements } fla.setSelectedItemIndex(position); selectedFeed = selection; - mActionMode = getSherlockActivity().startActionMode( - FeedlistFragment.this); + mActionMode = ((ActionBarActivity) getActivity()).startSupportActionMode(FeedlistFragment.this); } return true; diff --git a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index 3d74653f3..9183180c1 100644 --- a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -1,7 +1,8 @@ package de.danoeh.antennapod.fragment; +import android.support.v4.app.Fragment; +import android.support.v7.app.ActionBarActivity; import de.danoeh.antennapod.feed.FeedItem; -import de.danoeh.antennapod.feed.FeedMedia; import de.danoeh.antennapod.storage.DBReader; import de.danoeh.antennapod.util.ShownotesProvider; import org.apache.commons.lang3.StringEscapeUtils; @@ -31,8 +32,6 @@ import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; -import com.actionbarsherlock.app.SherlockFragment; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.preferences.UserPreferences; @@ -40,13 +39,9 @@ import de.danoeh.antennapod.util.ShareUtils; import de.danoeh.antennapod.util.playback.Playable; import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.FutureTask; -/** - * Displays the description of a Playable object in a Webview. - */ -public class ItemDescriptionFragment extends SherlockFragment { +/** Displays the description of a Playable object in a Webview. */ +public class ItemDescriptionFragment extends Fragment { private static final String TAG = "ItemDescriptionFragment"; @@ -335,8 +330,8 @@ public class ItemDescriptionFragment extends SherlockFragment { @Override protected void onCancelled() { super.onCancelled(); - if (getSherlockActivity() != null) { - getSherlockActivity() + if (getActivity() != null) { + ((ActionBarActivity) getActivity()) .setSupportProgressBarIndeterminateVisibility(false); } webViewLoader = null; @@ -350,8 +345,8 @@ public class ItemDescriptionFragment extends SherlockFragment { // /webvDescription.loadData(url, "text/html", "utf-8"); webvDescription.loadDataWithBaseURL(null, data, "text/html", "utf-8", "about:blank"); - if (getSherlockActivity() != null) { - getSherlockActivity() + if (getActivity() != null) { + ((ActionBarActivity) getActivity()) .setSupportProgressBarIndeterminateVisibility(false); } if (AppConfig.DEBUG) @@ -362,9 +357,9 @@ public class ItemDescriptionFragment extends SherlockFragment { @Override protected void onPreExecute() { super.onPreExecute(); - if (getSherlockActivity() != null) { - getSherlockActivity() - .setSupportProgressBarIndeterminateVisibility(true); + if (getActivity() != null) { + ((ActionBarActivity) getActivity()) + .setSupportProgressBarIndeterminateVisibility(false); } } diff --git a/src/de/danoeh/antennapod/fragment/ItemlistFragment.java b/src/de/danoeh/antennapod/fragment/ItemlistFragment.java index 1ebb2ba29..40637544d 100644 --- a/src/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -5,6 +5,8 @@ import android.content.Context; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; +import android.support.v4.app.ListFragment; +import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; @@ -15,7 +17,6 @@ import android.view.ViewGroup; import android.widget.ListView; import android.widget.TextView; -import com.actionbarsherlock.app.SherlockListFragment; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; @@ -38,7 +39,7 @@ import java.util.List; /** Displays a list of FeedItems. */ @SuppressLint("ValidFragment") -public class ItemlistFragment extends SherlockListFragment { +public class ItemlistFragment extends ListFragment { private static final String TAG = "ItemlistFragment"; private static final int EVENTS = EventDistributor.DOWNLOAD_HANDLED @@ -245,13 +246,13 @@ public class ItemlistFragment extends SherlockListFragment { if (feed != null) { if (DownloadService.isRunning && DownloadRequester.getInstance().isDownloadingFile(feed)) { - getSherlockActivity() + ((ActionBarActivity) getActivity()) .setSupportProgressBarIndeterminateVisibility(true); } else { - getSherlockActivity() + ((ActionBarActivity) getActivity()) .setSupportProgressBarIndeterminateVisibility(false); } - getSherlockActivity().supportInvalidateOptionsMenu(); + getActivity().supportInvalidateOptionsMenu(); } } @@ -273,7 +274,6 @@ public class ItemlistFragment extends SherlockListFragment { getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); registerForContextMenu(getListView()); getListView().setOnItemLongClickListener(null); - setEmptyViewIfListIsEmpty(); } @Override @@ -310,7 +310,7 @@ public class ItemlistFragment extends SherlockListFragment { try { handled = FeedItemMenuHandler.onMenuItemClicked( - getSherlockActivity(), item.getItemId(), selectedItem); + getActivity(), item.getItemId(), selectedItem); } catch (DownloadRequestException e) { e.printStackTrace(); DownloadRequestErrorDialogCreator.newRequestErrorDialog( diff --git a/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java b/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java index c378c0acd..c6901ad17 100644 --- a/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java +++ b/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java @@ -10,6 +10,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; +import android.support.v4.app.ListFragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -17,8 +18,6 @@ import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import android.widget.ListView; -import com.actionbarsherlock.app.SherlockListFragment; - import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MiroGuideChannelViewActivity; @@ -33,7 +32,7 @@ import de.danoeh.antennapod.miroguide.model.MiroGuideChannel; * entries will be loaded until all entries have been loaded or the maximum * number of channels has been reached. * */ -public class MiroGuideChannellistFragment extends SherlockListFragment { +public class MiroGuideChannellistFragment extends ListFragment { private static final String TAG = "MiroGuideChannellistFragment"; private static final String ARG_FILTER = "filter"; diff --git a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java index 912e7c1c6..aa029f672 100644 --- a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java +++ b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java @@ -25,7 +25,7 @@ public class FeedItemMenuHandler { /** * Used by the MenuHandler to access different types of menus through one - * interface (for example android.view.Menu and com.actionbarsherlock.Menu) + * interface */ public interface MenuInterface { /** diff --git a/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java b/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java index fee8027a0..843607617 100644 --- a/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java +++ b/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java @@ -5,10 +5,9 @@ import android.content.Intent; import android.net.Uri; import android.util.Log; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuInflater; -import com.actionbarsherlock.view.MenuItem; - +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.FeedInfoActivity; diff --git a/submodules/ActionBarSherlock b/submodules/ActionBarSherlock deleted file mode 160000 -Subproject 9598f2bb2ceed4a834cd5586a903f270ca4c0cc diff --git a/submodules/ViewPagerIndicator b/submodules/ViewPagerIndicator deleted file mode 160000 -Subproject 8cd549f23f3d20ff920e19a2345c54983f65e26 diff --git a/submodules/dslv b/submodules/dslv -Subproject c5f07d473a48325d0f12994025fce525c3027e2 +Subproject c56bf97269d5dc90df1c428fd18df0e7619eff0 |