diff options
Diffstat (limited to 'app')
16 files changed, 250 insertions, 104 deletions
diff --git a/app/build.gradle b/app/build.gradle index cf1af78fa..2294f8148 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,13 +7,10 @@ dependencies { compile 'com.android.support:support-v4:21.0.2' compile 'com.android.support:appcompat-v7:21.0.2' compile 'org.apache.commons:commons-lang3:3.3.2' - compile('org.shredzone.flattr4j:flattr4j-core:2.10') { - exclude group: 'org.apache.httpcomponents', module: 'httpcore' - exclude group: 'org.apache.httpcomponents', module: 'httpclient' + compile('org.shredzone.flattr4j:flattr4j-core:2.12') { exclude group: 'org.json', module: 'json' } compile 'commons-io:commons-io:2.4' - compile 'com.nineoldandroids:library:2.4.0' compile project('dslv:library') compile 'com.jayway.android.robotium:robotium-solo:5.2.1' compile 'org.jsoup:jsoup:1.7.3' diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java index a96c9a6d3..1f6a907d4 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java @@ -2,6 +2,12 @@ package de.test.antennapod.storage; import android.content.Context; import android.test.InstrumentationTestCase; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Random; + import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; @@ -10,11 +16,6 @@ import de.danoeh.antennapod.core.storage.FeedItemStatistics; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.util.flattr.FlattrStatus; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Random; - import static de.test.antennapod.storage.DBTestUtils.saveFeedlist; /** @@ -325,7 +326,7 @@ public class DBReaderTest extends InstrumentationTestCase { public void testGetPlaybackHistory() { final Context context = getInstrumentation().getTargetContext(); - final int numItems = (DBReader.PLAYBACK_HISTORY_SIZE+1) * 2; + final int numItems = (DBReader.PLAYBACK_HISTORY_SIZE + 1) * 2; final int playedItems = DBReader.PLAYBACK_HISTORY_SIZE + 1; final int numReturnedItems = Math.min(playedItems, DBReader.PLAYBACK_HISTORY_SIZE); final int numFeeds = 1; @@ -405,4 +406,64 @@ public class DBReaderTest extends InstrumentationTestCase { assertEquals(NUM_UNREAD, navDrawerData.numUnreadItems); assertEquals(NUM_QUEUE, navDrawerData.queueSize); } + + public void testGetFeedItemlistCheckChaptersFalse() throws Exception { + Context context = getInstrumentation().getTargetContext(); + List<Feed> feeds = DBTestUtils.saveFeedlist(context, 10, 10, false, false, 0); + for (Feed feed : feeds) { + for (FeedItem item : feed.getItems()) { + assertFalse(item.hasChapters()); + } + } + } + + public void testGetFeedItemlistCheckChaptersTrue() throws Exception { + Context context = getInstrumentation().getTargetContext(); + List<Feed> feeds = saveFeedlist(context, 10, 10, false, true, 10); + for (Feed feed : feeds) { + for (FeedItem item : feed.getItems()) { + assertTrue(item.hasChapters()); + } + } + } + + public void testLoadChaptersOfFeedItemNoChapters() throws Exception { + Context context = getInstrumentation().getTargetContext(); + List<Feed> feeds = saveFeedlist(context, 1, 3, false, false, 0); + saveFeedlist(context, 1, 3, false, true, 3); + for (Feed feed : feeds) { + for (FeedItem item : feed.getItems()) { + assertFalse(item.hasChapters()); + DBReader.loadChaptersOfFeedItem(context, item); + assertFalse(item.hasChapters()); + assertNull(item.getChapters()); + } + } + } + + public void testLoadChaptersOfFeedItemWithChapters() throws Exception { + Context context = getInstrumentation().getTargetContext(); + final int NUM_CHAPTERS = 3; + DBTestUtils.saveFeedlist(context, 1, 3, false, false, 0); + List<Feed> feeds = saveFeedlist(context, 1, 3, false, true, NUM_CHAPTERS); + for (Feed feed : feeds) { + for (FeedItem item : feed.getItems()) { + assertTrue(item.hasChapters()); + DBReader.loadChaptersOfFeedItem(context, item); + assertTrue(item.hasChapters()); + assertNotNull(item.getChapters()); + assertEquals(NUM_CHAPTERS, item.getChapters().size()); + } + } + } + + public void testGetItemWithChapters() throws Exception { + Context context = getInstrumentation().getTargetContext(); + final int NUM_CHAPTERS = 3; + List<Feed> feeds = saveFeedlist(context, 1, 1, false, true, NUM_CHAPTERS); + FeedItem item1 = feeds.get(0).getItems().get(0); + FeedItem item2 = DBReader.getFeedItem(context, item1.getId()); + assertTrue(item2.hasChapters()); + assertEquals(item1.getChapters(), item2.getChapters()); + } } diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java b/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java index 9e5f6546d..17c926cc2 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java @@ -1,12 +1,7 @@ package de.test.antennapod.storage; import android.content.Context; -import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedItem; -import de.danoeh.antennapod.core.feed.FeedMedia; -import de.danoeh.antennapod.core.storage.PodDBAdapter; -import de.danoeh.antennapod.core.util.comparator.FeedItemPubdateComparator; -import de.danoeh.antennapod.core.util.flattr.FlattrStatus; + import junit.framework.Assert; import java.util.ArrayList; @@ -14,12 +9,32 @@ import java.util.Collections; import java.util.Date; import java.util.List; +import de.danoeh.antennapod.core.feed.Chapter; +import de.danoeh.antennapod.core.feed.Feed; +import de.danoeh.antennapod.core.feed.FeedItem; +import de.danoeh.antennapod.core.feed.FeedMedia; +import de.danoeh.antennapod.core.feed.SimpleChapter; +import de.danoeh.antennapod.core.storage.PodDBAdapter; +import de.danoeh.antennapod.core.util.comparator.FeedItemPubdateComparator; +import de.danoeh.antennapod.core.util.flattr.FlattrStatus; + /** * Utility methods for DB* tests. */ public class DBTestUtils { + /** + * Use this method when tests don't involve chapters. + */ public static List<Feed> saveFeedlist(Context context, int numFeeds, int numItems, boolean withMedia) { + return saveFeedlist(context, numFeeds, numItems, withMedia, false, 0); + } + + /** + * Use this method when tests involve chapters. + */ + public static List<Feed> saveFeedlist(Context context, int numFeeds, int numItems, boolean withMedia, + boolean withChapters, int numChapters) { if (numFeeds <= 0) { throw new IllegalArgumentException("numFeeds<=0"); } @@ -36,11 +51,18 @@ public class DBTestUtils { f.setItems(new ArrayList<FeedItem>()); for (int j = 0; j < numItems; j++) { FeedItem item = new FeedItem(0, "item " + j, "id" + j, "link" + j, new Date(), - true, f); + true, f, withChapters); if (withMedia) { FeedMedia media = new FeedMedia(item, "url" + j, 1, "audio/mp3"); item.setMedia(media); } + if (withChapters) { + List<Chapter> chapters = new ArrayList<>(); + item.setChapters(chapters); + for (int k = 0; k < numChapters; k++) { + chapters.add(new SimpleChapter(k, "item " + j + " chapter " + k, item, "http://example.com")); + } + } f.getItems().add(item); } Collections.sort(f.getItems(), new FeedItemPubdateComparator()); @@ -52,6 +74,7 @@ public class DBTestUtils { feeds.add(f); } adapter.close(); + return feeds; } } diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java index 4678a843b..ec8e19e22 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java @@ -4,10 +4,13 @@ import android.content.Context; import android.database.Cursor; import android.test.InstrumentationTestCase; import android.util.Log; + +import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; +import de.danoeh.antennapod.core.feed.SimpleChapter; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.PodDBAdapter; @@ -101,7 +104,7 @@ public class DBWriterTest extends InstrumentationTestCase { List<File> itemFiles = new ArrayList<File>(); // create items with downloaded media files for (int i = 0; i < 10; i++) { - FeedItem item = new FeedItem(0, "Item " + i, "Item" + i, "url", new Date(), true, feed); + FeedItem item = new FeedItem(0, "Item " + i, "Item" + i, "url", new Date(), true, feed, true); feed.getItems().add(item); File enc = new File(destFolder, "file " + i); @@ -110,6 +113,9 @@ public class DBWriterTest extends InstrumentationTestCase { FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", true, null, 0); item.setMedia(media); + + item.setChapters(new ArrayList<Chapter>()); + item.getChapters().add(new SimpleChapter(0, "item " + i, item, "example.com")); } PodDBAdapter adapter = new PodDBAdapter(getInstrumentation().getContext()); @@ -122,6 +128,7 @@ public class DBWriterTest extends InstrumentationTestCase { for (FeedItem item : feed.getItems()) { assertTrue(item.getId() != 0); assertTrue(item.getMedia().getId() != 0); + assertTrue(item.getChapters().get(0).getId() != 0); } DBWriter.deleteFeed(getInstrumentation().getTargetContext(), feed.getId()).get(TIMEOUT, TimeUnit.SECONDS); @@ -135,18 +142,20 @@ public class DBWriterTest extends InstrumentationTestCase { adapter = new PodDBAdapter(getInstrumentation().getContext()); adapter.open(); Cursor c = adapter.getFeedCursor(feed.getId()); - assertTrue(c.getCount() == 0); + assertEquals(0, c.getCount()); c.close(); c = adapter.getImageCursor(image.getId()); - assertTrue(c.getCount() == 0); + assertEquals(0, c.getCount()); c.close(); for (FeedItem item : feed.getItems()) { c = adapter.getFeedItemCursor(String.valueOf(item.getId())); - assertTrue(c.getCount() == 0); + assertEquals(0, c.getCount()); c.close(); c = adapter.getSingleFeedMediaCursor(item.getMedia().getId()); - assertTrue(c.getCount() == 0); + assertEquals(0, c.getCount()); c.close(); + c = adapter.getSimpleChaptersOfFeedItemCursor(item); + assertEquals(0, c.getCount()); } } diff --git a/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java b/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java index 47b58268b..aa197b6e1 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java @@ -73,4 +73,32 @@ public class URLCheckerTest extends AndroidTestCase { final String out = URLChecker.prepareURL(in); assertEquals("https://example.com", out); } + + public void testProtocolRelativeUrlIsAbsolute() throws Exception { + final String in = "https://example.com"; + final String inBase = "http://examplebase.com"; + final String out = URLChecker.prepareURL(in, inBase); + assertEquals(in, out); + } + + public void testProtocolRelativeUrlIsRelativeHttps() throws Exception { + final String in = "//example.com"; + final String inBase = "https://examplebase.com"; + final String out = URLChecker.prepareURL(in, inBase); + assertEquals("https://example.com", out); + + } + + public void testProtocolRelativeUrlIsHttpsWithAPSubscribeProtocol() throws Exception { + final String in = "//example.com"; + final String inBase = "antennapod-subscribe://https://examplebase.com"; + final String out = URLChecker.prepareURL(in, inBase); + assertEquals("https://example.com", out); + } + + public void testProtocolRelativeUrlBaseUrlNull() throws Exception { + final String in = "example.com"; + final String out = URLChecker.prepareURL(in, null); + assertEquals("http://example.com", out); + } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 44eee8539..50d1d2874 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.danoeh.antennapod" - android:versionCode="42" - android:versionName="0.9.9.5"> + android:versionCode="43" + android:versionName="0.9.9.6"> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> diff --git a/app/src/main/assets/about.html b/app/src/main/assets/about.html index e0f36ba79..172b49aab 100644 --- a/app/src/main/assets/about.html +++ b/app/src/main/assets/about.html @@ -41,7 +41,7 @@ <div id="header" align="center"> <img src="logo.png" alt="Logo" width="100px" height="100px"/> - <p>AntennaPod, Version 0.9.9.5</p> + <p>AntennaPod, Version 0.9.9.6</p> <p>Copyright © 2014 Daniel Oeh</p> @@ -49,9 +49,6 @@ </div> <h1>Used libraries</h1> -<h2>NineOldAndroids <a href="http://nineoldandroids.com">(Link)</a></h2> -by Jake Wharton, licensed under the Apache 2.0 license <a href="LICENSE_NINE_OLD_ANDROIDS.txt">(View)</a> - <h2>Apache Commons <a href="http://commons.apache.org/">(Link)</a></h2> by The Apache Software Foundation, licensed under the Apache 2.0 license <a href="LICENSE_APACHE_COMMONS.txt">(View)</a> @@ -65,12 +62,9 @@ licensed under the Apache 2.0 license <a href="LICENSE_DSLV.txt">(View)</a> <h2>Presto Client <a href="http://www.aocate.com/presto/">(Link)</a></h2> licensed under the Apache 2.0 license <a href="LICENSE_PRESTO.txt">(View)</a> -<h2>Better Pickers <a href="https://github.com/derekbrameyer/android-betterpickers">(Link)</a></h2> -licensed under the Apache 2.0 license <a href="LICENSE_BETTERPICKERS.txt">(View)</a> - <h2>jsoup <a href="http://jsoup.org/">(Link)</a></h2> licensed under the MIT license <a href="LICENSE_JSOUP.txt">(View)</a> -</body> + <h2>Picasso <a href="https://github.com/square/picasso">(Link)</a></h2> licensed under the Apache 2.0 license <a href="LICENSE_PICASSO.txt">(View)</a> @@ -83,4 +77,5 @@ licensed under the Apache 2.0 license <a href="LICENSE_OKIO.txt">(View)</a> <h2>Material Design Icons <a href="https://github.com/google/material-design-icons">(Link)</a></h2> by Google, licensed under an Attribution-ShareAlike 4.0 International license <a href="LICENSE_MATERIAL_DESIGN_ICONS.txt">(View)</a> +</body> </html> diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java index cf7de1709..811628ebf 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java @@ -4,29 +4,43 @@ import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.LinearLayout; + import de.danoeh.antennapod.R; -/** Displays the 'about' screen */ +/** + * Displays the 'about' screen + */ public class AboutActivity extends ActionBarActivity { - private WebView webview; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - getSupportActionBar().hide(); - setContentView(R.layout.about); - webview = (WebView) findViewById(R.id.webvAbout); - webview.setWebViewClient(new WebViewClient() { - - @Override - public boolean shouldOverrideUrlLoading(WebView view, String url) { - view.loadUrl(url); - return false; - } - - }); - webview.loadUrl("file:///android_asset/about.html"); - } + private WebView webview; + private LinearLayout webviewContainer; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + getSupportActionBar().hide(); + setContentView(R.layout.about); + webviewContainer = (LinearLayout) findViewById(R.id.webvContainer); + webview = (WebView) findViewById(R.id.webvAbout); + webview.setWebViewClient(new WebViewClient() { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + view.loadUrl(url); + return false; + } + + }); + webview.loadUrl("file:///android_asset/about.html"); + } + @Override + protected void onDestroy() { + super.onDestroy(); + if (webviewContainer != null && webview != null) { + webviewContainer.removeAllViews(); + webview.destroy(); + } + } } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java index d265c05b1..8401b41a7 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java @@ -123,7 +123,7 @@ public class DefaultOnlineFeedViewActivity extends OnlineFeedViewActivity { subscribeButton = (Button) header.findViewById(R.id.butSubscribe); - if (feed.getImage() != null && StringUtils.isNoneBlank(feed.getImage().getDownload_url())) { + if (feed.getImage() != null && StringUtils.isNotBlank(feed.getImage().getDownload_url())) { Picasso.with(this) .load(feed.getImage().getDownload_url()) .fit() diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index d625f21da..727b25296 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -54,6 +54,7 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected void onCreate(Bundle savedInstanceState) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); // has to be called before setting layout content super.onCreate(savedInstanceState); getSupportActionBar().setBackgroundDrawable(new ColorDrawable(0x80000000)); @@ -116,6 +117,13 @@ public class VideoplayerActivity extends MediaplayerActivity { videoview.getHolder().addCallback(surfaceHolderCallback); videoview.setOnTouchListener(onVideoviewTouched); + if (Build.VERSION.SDK_INT >= 16) { + videoview.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + } + if (Build.VERSION.SDK_INT >= 14) { + videoOverlay.setFitsSystemWindows(true); + } + setupVideoControlsToggler(); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); @@ -333,10 +341,10 @@ public class VideoplayerActivity extends MediaplayerActivity { butPlay.startAnimation(animation); } if (Build.VERSION.SDK_INT >= 14) { - videoview.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); - getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); - + int videoviewFlag = (Build.VERSION.SDK_INT >= 16) ? View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION : 0; + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | videoviewFlag); + videoOverlay.setFitsSystemWindows(true); } videoOverlay.setVisibility(View.GONE); butPlay.setVisibility(View.GONE); diff --git a/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java b/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java index de2cb5ffb..8941a5d71 100644 --- a/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java +++ b/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java @@ -8,7 +8,7 @@ import de.danoeh.antennapod.core.ClientConfig; public class ClientConfigurator { static { - ClientConfig.USER_AGENT = "AntennaPod/0.9.9.5"; + ClientConfig.USER_AGENT = "AntennaPod/0.9.9.6"; ClientConfig.applicationCallbacks = new ApplicationCallbacksImpl(); ClientConfig.downloadServiceCallbacks = new DownloadServiceCallbacksImpl(); ClientConfig.gpodnetCallbacks = new GpodnetCallbacksImpl(); diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FeedItemDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FeedItemDialog.java index 613cd1fec..eeed10b98 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/FeedItemDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/FeedItemDialog.java @@ -16,6 +16,7 @@ import android.util.Log; import android.util.TypedValue; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; @@ -54,6 +55,7 @@ public class FeedItemDialog extends Dialog { private FeedItem item; private QueueAccess queue; + private ViewGroup contentContainer; private View header; private TextView txtvTitle; private WebView webvDescription; @@ -107,6 +109,7 @@ public class FeedItemDialog extends Dialog { requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.feeditem_dialog); + contentContainer = (ViewGroup) findViewById(R.id.contentContainer); txtvTitle = (TextView) findViewById(R.id.txtvTitle); header = findViewById(R.id.header); webvDescription = (WebView) findViewById(R.id.webview); @@ -225,6 +228,14 @@ public class FeedItemDialog extends Dialog { updateMenuAppearance(); } + @Override + public void dismiss() { + super.dismiss(); + if (contentContainer != null && webvDescription != null) { + contentContainer.removeAllViews(); + webvDescription.destroy(); + } + } private final FeedItemMenuHandler.MenuInterface popupMenuInterface = new FeedItemMenuHandler.MenuInterface() { @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index 4a5c3f718..c0222de8e 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -162,11 +162,6 @@ public class ItemDescriptionFragment extends Fragment { } @Override - public void onDestroyView() { - super.onDestroyView(); - } - - @Override public void onAttach(Activity activity) { super.onAttach(activity); if (BuildConfig.DEBUG) @@ -191,6 +186,10 @@ public class ItemDescriptionFragment extends Fragment { if (webViewLoader != null) { webViewLoader.cancel(true); } + if (webvDescription != null) { + webvDescription.removeAllViews(); + webvDescription.destroy(); + } } @SuppressLint("NewApi") diff --git a/app/src/main/res/layout/about.xml b/app/src/main/res/layout/about.xml index acde9d786..02e232d9a 100644 --- a/app/src/main/res/layout/about.xml +++ b/app/src/main/res/layout/about.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/webvContainer" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > diff --git a/app/src/main/res/layout/feeditem_dialog.xml b/app/src/main/res/layout/feeditem_dialog.xml index 24abae762..5937480df 100644 --- a/app/src/main/res/layout/feeditem_dialog.xml +++ b/app/src/main/res/layout/feeditem_dialog.xml @@ -1,58 +1,59 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent"> + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/contentContainer" + android:layout_width="match_parent" + android:layout_height="match_parent"> <TextView + android:id="@+id/txtvTitle" + style="@style/AntennaPod.Dialog.Title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="16dp" - android:id="@+id/txtvTitle" android:layout_alignParentTop="true" - style="@style/AntennaPod.Dialog.Title" - android:maxLines="5" - android:ellipsize="none"/> + android:layout_margin="16dp" + android:ellipsize="none" + android:maxLines="5" /> <View android:id="@+id/title_divider" android:layout_width="match_parent" android:layout_height="2dp" android:layout_below="@id/txtvTitle" - android:background="@color/bright_blue"/> + android:background="@color/bright_blue" /> <LinearLayout android:id="@+id/header" - android:orientation="horizontal" - android:layout_below="@id/title_divider" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:layout_below="@id/title_divider" + android:orientation="horizontal"> <ImageButton + android:id="@+id/butAction1" android:layout_width="0dp" android:layout_height="48dp" android:layout_weight="1" - android:id="@+id/butAction1" android:background="?attr/selectableItemBackground" - tools:ignore="ContentDescription"/> + tools:ignore="ContentDescription" /> <ImageButton + android:id="@+id/butAction2" android:layout_width="0dp" android:layout_height="48dp" android:layout_weight="1" - android:id="@+id/butAction2" android:background="?attr/selectableItemBackground" - tools:ignore="ContentDescription"/> + tools:ignore="ContentDescription" /> <ImageButton + android:id="@+id/butMoreActions" android:layout_width="0dp" android:layout_height="48dp" android:layout_weight="1" - android:id="@+id/butMoreActions" android:background="?attr/selectableItemBackground" - android:src="?attr/ic_action_overflow" - android:contentDescription="@string/butAction_label"/> + android:contentDescription="@string/butAction_label" + android:src="?attr/ic_action_overflow" /> </LinearLayout> <View @@ -60,13 +61,13 @@ android:layout_width="match_parent" android:layout_height="2dp" android:layout_below="@id/header" - android:background="@color/bright_blue"/> + android:background="@color/bright_blue" /> <WebView + android:id="@+id/webview" android:layout_width="match_parent" android:layout_height="0dp" - android:layout_below="@id/divider" android:layout_alignParentBottom="true" - android:id="@+id/webview"/> + android:layout_below="@id/divider" /> </RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/videoplayer_activity.xml b/app/src/main/res/layout/videoplayer_activity.xml index f1e54f7c3..766cd6e04 100644 --- a/app/src/main/res/layout/videoplayer_activity.xml +++ b/app/src/main/res/layout/videoplayer_activity.xml @@ -1,47 +1,46 @@ <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/black" + android:orientation="vertical"> <de.danoeh.antennapod.view.AspectRatioVideoView android:id="@+id/videoview" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center"/> + android:layout_gravity="center" /> <ProgressBar android:id="@+id/progressIndicator" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:visibility="invisible" - android:indeterminateOnly="true"/> + android:indeterminateOnly="true" + android:visibility="invisible" /> <ImageButton android:id="@+id/butPlay" - android:contentDescription="@string/pause_label" - android:layout_width="80dp" - android:layout_height="80dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_gravity="center" - android:scaleType="fitXY" android:background="@drawable/overlay_button_circle_background" - android:src="@drawable/ic_action_pause_over_video"/> + android:contentDescription="@string/pause_label" + android:src="@drawable/ic_av_pause_circle_outline_80dp" /> <LinearLayout android:id="@+id/overlay" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom|center" - android:background="#80000000" android:orientation="vertical"> <RelativeLayout android:id="@+id/timecontrol" android:layout_width="match_parent" android:layout_height="50dp" - android:paddingTop="8dp" - android:layout_marginBottom="4dp"> + android:background="#80000000" + android:paddingTop="8dp"> <TextView android:id="@+id/txtvPosition" @@ -53,9 +52,9 @@ android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="4dp" + android:text="@string/position_default_label" android:textColor="@color/white" - android:textStyle="bold" - android:text="@string/position_default_label"/> + android:textStyle="bold" /> <TextView android:id="@+id/txtvLength" @@ -67,9 +66,9 @@ android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="4dp" + android:text="@string/position_default_label" android:textColor="@color/white" - android:textStyle="bold" - android:text="@string/position_default_label"/> + android:textStyle="bold" /> <SeekBar android:id="@+id/sbPosition" @@ -77,7 +76,7 @@ android:layout_height="wrap_content" android:layout_toLeftOf="@+id/txtvLength" android:layout_toRightOf="@+id/txtvPosition" - android:max="500"/> + android:max="500" /> </RelativeLayout> </LinearLayout> |