diff options
Diffstat (limited to 'app')
44 files changed, 306 insertions, 1880 deletions
diff --git a/app/proguard.cfg b/app/proguard.cfg index 121ea23f1..a70b226cd 100644 --- a/app/proguard.cfg +++ b/app/proguard.cfg @@ -41,15 +41,6 @@ # for okhttp -dontwarn okhttp3.** -dontwarn okio.** --dontwarn javax.annotation.** --keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase --dontwarn org.codehaus.mojo.animal_sniffer.* - -# for RxJava: --dontwarn sun.misc.Unsafe - -# for retrolambda --dontwarn java.lang.invoke.* # greenrobot EventBus -keepattributes *Annotation* @@ -61,21 +52,7 @@ # android-iconify -keep class com.joanzapata.** { *; } -# Glide --keep public class * implements com.bumptech.glide.module.GlideModule --keep public class * extends com.bumptech.glide.module.AppGlideModule --keep public enum com.bumptech.glide.load.ImageHeaderParser$** { - **[] $VALUES; - public *; -} --dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder - -# for ViewPageIndicator problems (https://github.com/JakeWharton/ViewPagerIndicator/issues/366): --dontwarn com.viewpagerindicator.LinePageIndicator - -# for some reason ProGuard removes this file. Why? Unsure. --keep class de.danoeh.antennapod.core.cast.SwitchableMediaRouteActionProvider { *; } - +#### Proguard rules for fyyd client # Retrofit 2.0 -dontwarn retrofit2.** -keep class retrofit2.** { *; } @@ -89,7 +66,7 @@ # Moshi -keep class com.squareup.moshi.** { *; } -keep interface com.squareup.moshi.** { *; } --keep public class retrofit2.adapter.rxjava.RxJavaCallAdapterFactory { *; } +#### # awaitility -dontwarn java.beans.BeanInfo diff --git a/app/sampledata/inplaylist b/app/sampledata/inplaylist deleted file mode 100644 index e78406d75..000000000 --- a/app/sampledata/inplaylist +++ /dev/null @@ -1,2 +0,0 @@ -@null -@drawable/ic_list_grey600_24dp
\ No newline at end of file diff --git a/app/src/main/assets/30sec.mp3 b/app/src/androidTest/assets/30sec.mp3 Binary files differindex 48e398434..48e398434 100644 --- a/app/src/main/assets/30sec.mp3 +++ b/app/src/androidTest/assets/30sec.mp3 diff --git a/app/src/main/assets/3sec.mp3 b/app/src/androidTest/assets/3sec.mp3 Binary files differindex 8ae450d01..8ae450d01 100644 --- a/app/src/main/assets/3sec.mp3 +++ b/app/src/androidTest/assets/3sec.mp3 diff --git a/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java b/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java deleted file mode 100644 index b13af78f7..000000000 --- a/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java +++ /dev/null @@ -1,110 +0,0 @@ -package de.test.antennapod.gpodnet; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import androidx.test.ext.junit.runners.AndroidJUnit4; -import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetService; -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetServiceException; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetDevice; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetTag; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; - -import static java.util.Collections.singletonList; - -/** - * Test class for GpodnetService - */ -@Ignore("Needs valid credentials to run") -@RunWith(AndroidJUnit4.class) -public class GPodnetServiceTest { - - private GpodnetService service; - - private static final String USER = ""; - private static final String PW = ""; - private static final String DEVICE_ID = "radio"; - - @Before - public void setUp() { - service = new GpodnetService(AntennapodHttpClient.getHttpClient(), - GpodnetService.DEFAULT_BASE_HOST, DEVICE_ID, USER, PW); - } - - private void authenticate() throws GpodnetServiceException { - service.login(); - } - - @Test - public void testUploadSubscription() throws GpodnetServiceException { - authenticate(); - ArrayList<String> l = new ArrayList<>(); - l.add("http://bitsundso.de/feed"); - service.uploadSubscriptions(DEVICE_ID, l); - } - - @Test - public void testUploadSubscription2() throws GpodnetServiceException { - authenticate(); - ArrayList<String> l = new ArrayList<>(); - l.add("http://bitsundso.de/feed"); - l.add("http://gamesundso.de/feed"); - service.uploadSubscriptions(DEVICE_ID, l); - } - - @Test - public void testUploadChanges() throws GpodnetServiceException { - authenticate(); - String[] URLS = {"http://bitsundso.de/feed", "http://gamesundso.de/feed", "http://cre.fm/feed/mp3/", "http://freakshow.fm/feed/m4a/"}; - List<String> subscriptions = Arrays.asList(URLS[0], URLS[1]); - List<String> removed = singletonList(URLS[0]); - List<String> added = Arrays.asList(URLS[2], URLS[3]); - service.uploadSubscriptions(DEVICE_ID, subscriptions); - service.uploadSubscriptionChanges(added, removed); - } - - @Test - public void testGetSubscriptionChanges() throws GpodnetServiceException { - authenticate(); - service.getSubscriptionChanges(1362322610L); - } - - @Test - public void testConfigureDevices() throws GpodnetServiceException { - authenticate(); - service.configureDevice("foo", "This is an updated caption", GpodnetDevice.DeviceType.LAPTOP); - } - - @Test - public void testGetDevices() throws GpodnetServiceException { - authenticate(); - service.getDevices(); - } - - @Test - public void testTags() throws GpodnetServiceException { - service.getTopTags(20); - } - - @Test - public void testPodcastForTags() throws GpodnetServiceException { - List<GpodnetTag> tags = service.getTopTags(20); - service.getPodcastsForTag(tags.get(1), - 10); - } - - @Test - public void testSearch() throws GpodnetServiceException { - service.searchPodcasts("linux", 64); - } - - @Test - public void testToplist() throws GpodnetServiceException { - service.getPodcastToplist(10); - } -} diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java index e115bc34e..aa2f1cf98 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java @@ -85,7 +85,7 @@ public class PlaybackServiceMediaPlayerTest { assertTrue(cacheDir.canWrite()); assertTrue(cacheDir.canRead()); if (!dest.exists()) { - InputStream i = getInstrumentation().getTargetContext().getAssets().open("3sec.mp3"); + InputStream i = getInstrumentation().getContext().getAssets().open("3sec.mp3"); OutputStream o = new FileOutputStream(new File(cacheDir, PLAYABLE_DEST_URL)); IOUtils.copy(i, o); o.flush(); diff --git a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java index 834c7d48b..44a11d9cf 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java @@ -2,6 +2,9 @@ package de.test.antennapod.ui; import android.content.Context; import android.util.Log; + +import androidx.test.platform.app.InstrumentationRegistry; + import de.danoeh.antennapod.event.FeedListUpdateEvent; import de.danoeh.antennapod.event.QueueEvent; import de.danoeh.antennapod.model.feed.Feed; @@ -99,7 +102,8 @@ public class UITestUtils { } Assert.assertFalse(mediaFile.exists()); - InputStream in = context.getAssets().open(testFileName); + InputStream in = InstrumentationRegistry.getInstrumentation().getContext() + .getAssets().open(testFileName); Assert.assertNotNull(in); FileOutputStream out = new FileOutputStream(mediaFile); diff --git a/app/src/main/assets/LICENSE_ANDROID_ICONIFY.txt b/app/src/main/assets/LICENSE_ANDROID_ICONIFY.txt index 85a6c0cf2..954402c93 100644 --- a/app/src/main/assets/LICENSE_ANDROID_ICONIFY.txt +++ b/app/src/main/assets/LICENSE_ANDROID_ICONIFY.txt @@ -1,4 +1,4 @@ -Copyright 2013 Joan Zapata +Copyright 2015 Joan Zapata Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/app/src/main/assets/LICENSE_BETTERPICKERS.txt b/app/src/main/assets/LICENSE_BETTERPICKERS.txt deleted file mode 100644 index 80830ed73..000000000 --- a/app/src/main/assets/LICENSE_BETTERPICKERS.txt +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2013 Derek Brameyer - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/app/src/main/assets/LICENSE_JSOUP.txt b/app/src/main/assets/LICENSE_JSOUP.txt index f3ef71dbf..fef8197fe 100644 --- a/app/src/main/assets/LICENSE_JSOUP.txt +++ b/app/src/main/assets/LICENSE_JSOUP.txt @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2009, 2010, 2011, 2012, 2013 Jonathan Hedley <jonathan@hedley.net> +Copyright (c) 2009-2022 Jonathan Hedley <https://jsoup.org/> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/app/src/main/assets/LICENSE_MATERIAL_DESIGN_ICONS.txt b/app/src/main/assets/LICENSE_MATERIAL_DESIGN_ICONS.txt deleted file mode 100644 index 34ec65f34..000000000 --- a/app/src/main/assets/LICENSE_MATERIAL_DESIGN_ICONS.txt +++ /dev/null @@ -1,425 +0,0 @@ -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More_considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the "Licensor." Except for the limited purpose of indicating -that material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/app/src/main/assets/LICENSE_NINE_OLD_ANDROIDS.txt b/app/src/main/assets/LICENSE_NINE_OLD_ANDROIDS.txt deleted file mode 100644 index d64569567..000000000 --- a/app/src/main/assets/LICENSE_NINE_OLD_ANDROIDS.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/app/src/main/assets/LICENSE_OKHTTP.txt b/app/src/main/assets/LICENSE_OKHTTP.txt index 90edcee40..48164b3fc 100644 --- a/app/src/main/assets/LICENSE_OKHTTP.txt +++ b/app/src/main/assets/LICENSE_OKHTTP.txt @@ -1,3 +1,5 @@ +Copyright 2019 Square, Inc. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/app/src/main/assets/LICENSE_PICTOGRAMMERS.txt b/app/src/main/assets/LICENSE_PICTOGRAMMERS.txt new file mode 100644 index 000000000..382f8a138 --- /dev/null +++ b/app/src/main/assets/LICENSE_PICTOGRAMMERS.txt @@ -0,0 +1,20 @@ +Pictogrammers Free License +-------------------------- + +This icon collection is released as free, open source, and GPL friendly by +the [Pictogrammers](http://pictogrammers.com/) icon group. You may use it +for commercial projects, open source projects, or anything really. + +# Icons: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) +Some of the icons are redistributed under the Apache 2.0 license. All other +icons are either redistributed under their respective licenses or are +distributed under the Apache 2.0 license. + +# Fonts: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) +All web and desktop fonts are distributed under the Apache 2.0 license. Web +and desktop fonts contain some icons that are redistributed under the Apache +2.0 license. All other icons are either redistributed under their respective +licenses or are distributed under the Apache 2.0 license. + +# Code: MIT (https://opensource.org/licenses/MIT) +The MIT license applies to all non-font and non-icon files. diff --git a/app/src/main/assets/LICENSE_PRESTO.txt b/app/src/main/assets/LICENSE_PRESTO.txt deleted file mode 100644 index b4b1a8cf5..000000000 --- a/app/src/main/assets/LICENSE_PRESTO.txt +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2011, Aocate, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/app/src/main/assets/LICENSE_MATERIAL_DIALOGS.txt b/app/src/main/assets/LICENSE_SEARCHPREFERENCE.txt index f6bf77906..2e1603517 100644 --- a/app/src/main/assets/LICENSE_MATERIAL_DIALOGS.txt +++ b/app/src/main/assets/LICENSE_SEARCHPREFERENCE.txt @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2015 Aidan Michael Follestad +Copyright (c) 2018 ByteHamster Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/src/main/assets/LICENSE_SIL.txt b/app/src/main/assets/LICENSE_SIL.txt deleted file mode 100644 index f5ed6fa72..000000000 --- a/app/src/main/assets/LICENSE_SIL.txt +++ /dev/null @@ -1,91 +0,0 @@ -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE.
\ No newline at end of file diff --git a/app/src/main/assets/licenses.xml b/app/src/main/assets/licenses.xml index aa0ad740b..f458da2aa 100644 --- a/app/src/main/assets/licenses.xml +++ b/app/src/main/assets/licenses.xml @@ -3,13 +3,13 @@ <library name="AntennaPod" author="The AntennaPod team" - website="https://github.com/AntennaPod/AntennaPod/" + website="https://github.com/AntennaPod/AntennaPod" license="GPL-3.0" licenseText="LICENSE.txt" /> <library name="AntennaPod-AudioPlayer" author="The AntennaPod team" - website="https://github.com/AntennaPod/AntennaPod-AudioPlayer/" + website="https://github.com/AntennaPod/AntennaPod-AudioPlayer" license="Apache 2.0" licenseText="LICENSE_APACHE-2.0.txt" /> <library @@ -21,7 +21,19 @@ <library name="Apache Commons" author="The Apache Software Foundation" - website="http://commons.apache.org/" + website="https://commons.apache.org/" + license="Apache 2.0" + licenseText="LICENSE_APACHE-2.0.txt" /> + <library + name="Balloon" + author="Jaewoong Eum" + website="https://github.com/skydoves/Balloon" + license="Apache 2.0" + licenseText="LICENSE_APACHE-2.0.txt" /> + <library + name="Conscrypt" + author="Google" + website="https://github.com/google/conscrypt" license="Apache 2.0" licenseText="LICENSE_APACHE-2.0.txt" /> <library @@ -43,9 +55,15 @@ license="Apache 2.0" licenseText="LICENSE_APACHE-2.0.txt" /> <library + name="fyydlin" + author="Martin Fietz" + website="https://github.com/mfietz/fyydlin" + license="Apache 2.0" + licenseText="LICENSE_APACHE-2.0.txt" /> + <library name="Glide" author="bumptech" - website="https://github.com/bumptech/glide/" + website="https://github.com/bumptech/glide" license="Simplified BSD" licenseText="LICENSE_GLIDE.txt" /> <library @@ -57,27 +75,33 @@ <library name="jsoup" author="Jonathan Hedley" - website="http://jsoup.org/" + website="https://jsoup.org/" license="MIT" licenseText="LICENSE_JSOUP.txt" /> <library + name="Lightweight-Stream-API" + author="Victor Melnik" + website="https://github.com/aNNiMON/Lightweight-Stream-API" + license="Apache 2.0" + licenseText="LICENSE_APACHE-2.0.txt" /> + <library + name="Material Components for Android" + author="Google" + website="https://github.com/material-components/material-components-android" + license="Apache 2.0" + licenseText="LICENSE_APACHE-2.0.txt" /> + <library name="Material Design Icons" author="Google" website="https://github.com/google/material-design-icons" - license="Attribution-ShareAlike 4.0 International" - licenseText="LICENSE_MATERIAL_DESIGN_ICONS.txt" /> + license="Apache 2.0" + licenseText="LICENSE_APACHE-2.0.txt" /> <library name="Material Design Icons" author="Templarian" website="https://github.com/Templarian/MaterialDesign" - license="SIL Open Font, Version 1.1" - licenseText="LICENSE_SIL.txt" /> - <library - name="Material Components" - author="Google" - website="https://github.com/material-components/material-components-android" - license="Apache 2.0" - licenseText="LICENSE_APACHE-2.0.txt" /> + license="Pictogrammers Free License" + licenseText="LICENSE_PICTOGRAMMERS.txt" /> <library name="OkHttp" author="Square" @@ -91,12 +115,30 @@ license="Apache 2.0" licenseText="LICENSE_APACHE-2.0.txt" /> <library + name="RecyclerViewSwipeDecorator" + author="Paolo Montalto" + website="https://github.com/xabaras/RecyclerViewSwipeDecorator" + license="Apache 2.0" + licenseText="LICENSE_APACHE-2.0.txt" /> + <library name="RxAndroid" author="ReactiveX" website="https://github.com/ReactiveX/RxAndroid" license="Apache 2.0" licenseText="LICENSE_APACHE-2.0.txt" /> <library + name="RxJava" + author="ReactiveX" + website="https://github.com/ReactiveX/RxJava" + license="Apache 2.0" + licenseText="LICENSE_APACHE-2.0.txt" /> + <library + name="SearchPreference" + author="ByteHamster" + website="https://github.com/ByteHamster/SearchPreference" + license="MIT" + licenseText="LICENSE_SEARCHPREFERENCE.txt" /> + <library name="StackBlur" author="Enrique López Mañas" website="https://github.com/kikoso/android-stackblur" diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 62c6bbd79..19b08fc02 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -85,6 +85,7 @@ public class MainActivity extends CastEnabledActivity { public static final String EXTRA_FEED_ID = "fragment_feed_id"; public static final String EXTRA_REFRESH_ON_START = "refresh_on_start"; public static final String EXTRA_STARTED_FROM_SEARCH = "started_from_search"; + public static final String EXTRA_ADD_TO_BACK_STACK = "add_to_back_stack"; public static final String KEY_GENERATED_VIEW_ID = "generated_view_id"; private @Nullable DrawerLayout drawerLayout; @@ -408,11 +409,6 @@ public class MainActivity extends CastEnabledActivity { super.onStart(); EventBus.getDefault().register(this); RatingDialog.init(this); - - if (lastTheme != UserPreferences.getNoTitleTheme()) { - finish(); - startActivity(new Intent(this, MainActivity.class)); - } } @Override @@ -421,6 +417,17 @@ public class MainActivity extends CastEnabledActivity { StorageUtils.checkStorageAvailability(this); handleNavIntent(); RatingDialog.check(); + + if (lastTheme != UserPreferences.getNoTitleTheme()) { + finish(); + startActivity(new Intent(this, MainActivity.class)); + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + lastTheme = UserPreferences.getNoTitleTheme(); // Don't recreate activity when a result is pending } @Override @@ -524,7 +531,9 @@ public class MainActivity extends CastEnabledActivity { if (tag != null) { loadFragment(tag, args); } else if (feedId > 0) { - if (intent.getBooleanExtra(EXTRA_STARTED_FROM_SEARCH, false)) { + boolean startedFromSearch = intent.getBooleanExtra(EXTRA_STARTED_FROM_SEARCH, false); + boolean addToBackStack = intent.getBooleanExtra(EXTRA_ADD_TO_BACK_STACK, false); + if (startedFromSearch || addToBackStack) { loadChildFragment(FeedItemlistFragment.newInstance(feedId)); } else { loadFeedFragmentById(feedId, args); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/SelectSubscriptionActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/SelectSubscriptionActivity.java index 4ffed949e..52293091e 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/SelectSubscriptionActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/SelectSubscriptionActivity.java @@ -118,7 +118,7 @@ public class SelectSubscriptionActivity extends AppCompatActivity { Glide.with(this) .asBitmap() .load(feed.getImageUrl()) - .apply(new RequestOptions().override(iconSize, iconSize)) + .apply(RequestOptions.overrideOf(iconSize, iconSize)) .listener(new RequestListener<Bitmap>() { @Override public boolean onLoadFailed(@Nullable GlideException e, Object model, diff --git a/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java index ecf490f48..271bdd7f6 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.activity; import android.content.Intent; import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; @@ -33,7 +34,8 @@ public class SplashActivity extends AppCompatActivity { DrawableCompat.setTint(wrapDrawable, 0xffffffff); progressBar.setIndeterminateDrawable(DrawableCompat.unwrap(wrapDrawable)); } else { - progressBar.getIndeterminateDrawable().setColorFilter(0xffffffff, PorterDuff.Mode.SRC_IN); + progressBar.getIndeterminateDrawable().setColorFilter( + new PorterDuffColorFilter(0xffffffff, PorterDuff.Mode.SRC_IN)); } Completable.create(subscriber -> { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java index 82b1c0d00..20a50308f 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java @@ -108,7 +108,7 @@ public class ChaptersListAdapter extends RecyclerView.Adapter<ChaptersListAdapte .apply(new RequestOptions() .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .dontAnimate() - .transforms(new FitCenter(), new RoundedCorners((int) + .transform(new FitCenter(), new RoundedCorners((int) (4 * context.getResources().getDisplayMetrics().density)))) .into(holder.image); } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java index 34726e248..d60b0f673 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java @@ -1,8 +1,10 @@ package de.danoeh.antennapod.adapter; +import android.content.Context; import android.graphics.drawable.Drawable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import androidx.core.graphics.ColorUtils; import androidx.palette.graphics.Palette; @@ -124,7 +126,7 @@ public class CoverLoader { @Override public void onLoadFailed(Drawable errorDrawable) { - + setPlaceholderVisibility(this.placeholder.get(), true, null); } @Override @@ -146,7 +148,9 @@ public class CoverLoader { boolean showTitle = UserPreferences.shouldShowSubscriptionTitle(); if (placeholder != null) { if (textAndImageCombined || showTitle) { - int bgColor = placeholder.getContext().getResources().getColor(R.color.feed_text_bg); + final Context context = placeholder.getContext(); + placeholder.setVisibility(View.VISIBLE); + int bgColor = ContextCompat.getColor(context, R.color.feed_text_bg); if (palette == null || !showTitle) { placeholder.setBackgroundColor(bgColor); placeholder.setTextColor(ThemeUtils.getColorFromAttr(placeholder.getContext(), @@ -154,9 +158,9 @@ public class CoverLoader { return; } int dominantColor = palette.getDominantColor(bgColor); - int textColor = placeholder.getContext().getResources().getColor(R.color.white); + int textColor = ContextCompat.getColor(context, R.color.white); if (ColorUtils.calculateLuminance(dominantColor) > 0.5) { - textColor = placeholder.getContext().getResources().getColor(R.color.black); + textColor = ContextCompat.getColor(context, R.color.black); } placeholder.setTextColor(textColor); placeholder.setBackgroundColor(dominantColor); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java index 7c3166043..a7986e144 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java @@ -22,6 +22,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.content.res.AppCompatResources; +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; @@ -79,7 +80,8 @@ public class SubscriptionsRecyclerAdapter extends SelectableAdapter<Subscription if (viewType == COVER_WITH_TITLE) { topAndBottomItemId = 0; belowItemId = R.id.imgvCover; - feedTitle.setBackgroundColor(feedTitle.getContext().getResources().getColor(R.color.feed_text_bg)); + feedTitle.setBackgroundColor( + ContextCompat.getColor(feedTitle.getContext(), R.color.feed_text_bg)); int padding = (int) convertDpToPixel(feedTitle.getContext(), 6); feedTitle.setPadding(padding, padding, padding, padding); } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java deleted file mode 100644 index a125515cc..000000000 --- a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java +++ /dev/null @@ -1,83 +0,0 @@ -package de.danoeh.antennapod.adapter.gpodnet; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ArrayAdapter; -import android.widget.ImageView; -import android.widget.TextView; - -import com.bumptech.glide.Glide; - -import com.bumptech.glide.load.resource.bitmap.FitCenter; -import com.bumptech.glide.load.resource.bitmap.RoundedCorners; -import com.bumptech.glide.request.RequestOptions; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetPodcast; -import org.apache.commons.lang3.StringUtils; - - -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.glide.ApGlideSettings; - -import java.util.List; - -/** - * Adapter for displaying a list of GPodnetPodcast-Objects. - */ -public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> { - - public PodcastListAdapter(Context context, int resource, List<GpodnetPodcast> objects) { - super(context, resource, objects); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - Holder holder; - - GpodnetPodcast podcast = getItem(position); - - // Inflate Layout - if (convertView == null) { - holder = new Holder(); - LayoutInflater inflater = (LayoutInflater) getContext() - .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - convertView = inflater.inflate(R.layout.gpodnet_podcast_listitem, parent, false); - holder.image = convertView.findViewById(R.id.imgvCover); - holder.title = convertView.findViewById(R.id.txtvTitle); - holder.subscribers = convertView.findViewById(R.id.txtvSubscribers); - holder.author = convertView.findViewById(R.id.txtvAuthor); - convertView.setTag(holder); - } else { - holder = (Holder) convertView.getTag(); - } - - if (StringUtils.isNotBlank(podcast.getLogoUrl())) { - Glide.with(convertView.getContext()) - .load(podcast.getLogoUrl()) - .apply(new RequestOptions() - .placeholder(R.color.light_gray) - .error(R.color.light_gray) - .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) - .transforms(new FitCenter(), - new RoundedCorners((int) (4 * convertView.getContext() - .getResources().getDisplayMetrics().density))) - .dontAnimate()) - .into(holder.image); - } - - holder.title.setText(podcast.getTitle()); - holder.subscribers.setText(String.valueOf(podcast.getSubscribers())); - holder.author.setText(podcast.getAuthor()); - - return convertView; - } - - static class Holder { - ImageView image; - TextView title; - TextView subscribers; - TextView author; - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java deleted file mode 100644 index b0441688d..000000000 --- a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java +++ /dev/null @@ -1,54 +0,0 @@ -package de.danoeh.antennapod.adapter.gpodnet; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ArrayAdapter; -import android.widget.TextView; - -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetTag; - -import java.util.List; - -/** - * Adapter for displaying a list of GPodnetPodcast-Objects. - */ -public class TagListAdapter extends ArrayAdapter<GpodnetTag> { - - public TagListAdapter(Context context, int resource, List<GpodnetTag> objects) { - super(context, resource, objects); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - Holder holder; - - GpodnetTag tag = getItem(position); - - // Inflate Layout - if (convertView == null) { - holder = new Holder(); - LayoutInflater inflater = (LayoutInflater) getContext() - .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - convertView = inflater.inflate(R.layout.gpodnet_tag_listitem, parent, false); - holder.title = convertView.findViewById(R.id.txtvTitle); - holder.usage = convertView.findViewById(R.id.txtvUsage); - convertView.setTag(holder); - } else { - holder = (Holder) convertView.getTag(); - } - - holder.title.setText(tag.getTitle()); - holder.usage.setText(String.valueOf(tag.getUsage())); - - return convertView; - } - - static class Holder { - TextView title; - TextView usage; - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java index 40c2029d6..9b514dd98 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java @@ -85,7 +85,7 @@ public class ItunesAdapter extends ArrayAdapter<PodcastSearchResult> { .apply(new RequestOptions() .placeholder(R.color.light_gray) .diskCacheStrategy(DiskCacheStrategy.NONE) - .transforms(new FitCenter(), + .transform(new FitCenter(), new RoundedCorners((int) (4 * context.getResources().getDisplayMetrics().density))) .dontAnimate()) .into(viewHolder.coverView); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java index d2a2e6de8..fce5b0ddc 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java @@ -35,9 +35,9 @@ import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.model.feed.SortOrder; import de.danoeh.antennapod.databinding.AddfeedBinding; import de.danoeh.antennapod.databinding.EditTextDialogBinding; -import de.danoeh.antennapod.fragment.gpodnet.GpodnetMainFragment; import de.danoeh.antennapod.net.discovery.CombinedSearcher; import de.danoeh.antennapod.net.discovery.FyydPodcastSearcher; +import de.danoeh.antennapod.net.discovery.GpodnetPodcastSearcher; import de.danoeh.antennapod.net.discovery.ItunesPodcastSearcher; import de.danoeh.antennapod.net.discovery.PodcastIndexPodcastSearcher; import io.reactivex.Observable; @@ -84,7 +84,7 @@ public class AddFeedFragment extends Fragment { viewBinding.searchFyydButton.setOnClickListener(v -> activity.loadChildFragment(OnlineSearchFragment.newInstance(FyydPodcastSearcher.class))); viewBinding.searchGPodderButton.setOnClickListener(v - -> activity.loadChildFragment(new GpodnetMainFragment())); + -> activity.loadChildFragment(OnlineSearchFragment.newInstance(GpodnetPodcastSearcher.class))); viewBinding.searchPodcastIndexButton.setOnClickListener(v -> activity.loadChildFragment(OnlineSearchFragment.newInstance(PodcastIndexPodcastSearcher.class))); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index 2d448faa8..5b030f0c2 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -310,7 +310,7 @@ public class CoverFragment extends Fragment { RequestOptions options = new RequestOptions() .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .dontAnimate() - .transforms(new FitCenter(), + .transform(new FitCenter(), new RoundedCorners((int) (16 * getResources().getDisplayMetrics().density))); RequestBuilder<Drawable> cover = Glide.with(this) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/InboxFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/InboxFragment.java index 067e7466c..9d5376c2a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/InboxFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/InboxFragment.java @@ -49,9 +49,9 @@ public class InboxFragment extends EpisodesListFragment implements Toolbar.OnMen @NonNull @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View inboxContainer = View.inflate(getContext(), R.layout.inbox_fragment, null); + View inboxContainer = View.inflate(getContext(), R.layout.list_container_fragment, null); View root = super.onCreateView(inflater, container, savedInstanceState); - ((FrameLayout) inboxContainer.findViewById(R.id.inboxContent)).addView(root); + ((FrameLayout) inboxContainer.findViewById(R.id.listContent)).addView(root); emptyView.setTitle(R.string.no_inbox_head_label); emptyView.setMessage(R.string.no_inbox_label); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 974cbb370..3bdc0e49f 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -270,7 +270,7 @@ public class ItemFragment extends Fragment { } private void onFragmentLoaded() { - if (webviewData != null) { + if (webviewData != null && !itemsLoaded) { webvDescription.loadDataWithBaseURL("https://127.0.0.1", webviewData, "text/html", "utf-8", "about:blank"); } updateAppearance(); @@ -293,7 +293,7 @@ public class ItemFragment extends Fragment { RequestOptions options = new RequestOptions() .error(R.color.light_gray) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) - .transforms(new FitCenter(), + .transform(new FitCenter(), new RoundedCorners((int) (4 * getResources().getDisplayMetrics().density))) .dontAnimate(); @@ -420,8 +420,8 @@ public class ItemFragment extends Fragment { .subscribe(result -> { progbarLoading.setVisibility(View.GONE); item = result; - itemsLoaded = true; onFragmentLoaded(); + itemsLoaded = true; }, error -> Log.e(TAG, Log.getStackTraceString(error))); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java index 857b59967..8bcef4181 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java @@ -1,57 +1,36 @@ package de.danoeh.antennapod.fragment; import android.os.Bundle; -import android.util.Log; import android.view.ContextMenu; -import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.widget.ProgressBar; +import android.widget.FrameLayout; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; -import androidx.fragment.app.Fragment; + import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.adapter.EpisodeItemListAdapter; -import de.danoeh.antennapod.core.event.DownloadEvent; -import de.danoeh.antennapod.core.event.DownloaderUpdate; import de.danoeh.antennapod.core.menuhandler.MenuItemUtils; -import de.danoeh.antennapod.event.FeedItemEvent; import de.danoeh.antennapod.event.playback.PlaybackHistoryEvent; -import de.danoeh.antennapod.event.playback.PlaybackPositionEvent; import de.danoeh.antennapod.event.PlayerStatusEvent; import de.danoeh.antennapod.event.UnreadItemsUpdateEvent; import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; -import de.danoeh.antennapod.core.util.FeedItemUtil; -import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; -import de.danoeh.antennapod.view.EmptyViewHandler; -import de.danoeh.antennapod.view.EpisodeItemListRecyclerView; -import de.danoeh.antennapod.view.viewholder.EpisodeItemViewHolder; -import io.reactivex.Observable; -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.disposables.Disposable; -import io.reactivex.schedulers.Schedulers; -import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.List; -public class PlaybackHistoryFragment extends Fragment implements Toolbar.OnMenuItemClickListener { +public class PlaybackHistoryFragment extends EpisodesListFragment implements Toolbar.OnMenuItemClickListener { public static final String TAG = "PlaybackHistoryFragment"; private static final String KEY_UP_ARROW = "up_arrow"; - private List<FeedItem> playbackHistory; - private PlaybackHistoryListAdapter adapter; - private Disposable disposable; - private EpisodeItemListRecyclerView recyclerView; - private EmptyViewHandler emptyView; - private ProgressBar progressBar; private Toolbar toolbar; private boolean displayUpArrow; @@ -64,8 +43,12 @@ public class PlaybackHistoryFragment extends Fragment implements Toolbar.OnMenuI @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - View root = inflater.inflate(R.layout.simple_list_fragment, container, false); - toolbar = root.findViewById(R.id.toolbar); + View historyContainer = View.inflate(getContext(), R.layout.list_container_fragment, null); + View root = super.onCreateView(inflater, container, savedInstanceState); + + ((FrameLayout) historyContainer.findViewById(R.id.listContent)).addView(root); + + toolbar = historyContainer.findViewById(R.id.toolbar); toolbar.setTitle(R.string.playback_history_label); toolbar.setOnMenuItemClickListener(this); displayUpArrow = getParentFragmentManager().getBackStackEntryCount() != 0; @@ -76,34 +59,14 @@ public class PlaybackHistoryFragment extends Fragment implements Toolbar.OnMenuI toolbar.inflateMenu(R.menu.playback_history); refreshToolbarState(); - recyclerView = root.findViewById(R.id.recyclerView); - recyclerView.setRecycledViewPool(((MainActivity) getActivity()).getRecycledViewPool()); - adapter = new PlaybackHistoryListAdapter((MainActivity) getActivity()); - recyclerView.setAdapter(adapter); - progressBar = root.findViewById(R.id.progLoading); + listAdapter = new PlaybackHistoryListAdapter((MainActivity) getActivity()); + recyclerView.setAdapter(listAdapter); - emptyView = new EmptyViewHandler(getActivity()); emptyView.setIcon(R.drawable.ic_history); emptyView.setTitle(R.string.no_history_head_label); emptyView.setMessage(R.string.no_history_label); - emptyView.attachToRecyclerView(recyclerView); - return root; - } - - @Override - public void onStart() { - super.onStart(); - EventBus.getDefault().register(this); - loadItems(); - } - @Override - public void onStop() { - super.onStop(); - EventBus.getDefault().unregister(this); - if (disposable != null) { - disposable.dispose(); - } + return historyContainer; } @Override @@ -112,55 +75,8 @@ public class PlaybackHistoryFragment extends Fragment implements Toolbar.OnMenuI super.onSaveInstanceState(outState); } - @Subscribe(threadMode = ThreadMode.MAIN) - public void onEventMainThread(FeedItemEvent event) { - Log.d(TAG, "onEventMainThread() called with: " + "event = [" + event + "]"); - if (playbackHistory == null) { - return; - } else if (adapter == null) { - loadItems(); - return; - } - for (int i = 0, size = event.items.size(); i < size; i++) { - FeedItem item = event.items.get(i); - int pos = FeedItemUtil.indexOfItemWithId(playbackHistory, item.getId()); - if (pos >= 0) { - playbackHistory.remove(pos); - playbackHistory.add(pos, item); - adapter.notifyItemChangedCompat(pos); - } - } - } - - @Subscribe(sticky = true, threadMode = ThreadMode.MAIN) - public void onEventMainThread(DownloadEvent event) { - Log.d(TAG, "onEventMainThread() called with: " + "event = [" + event + "]"); - DownloaderUpdate update = event.update; - if (adapter != null && update.mediaIds.length > 0) { - for (long mediaId : update.mediaIds) { - int pos = FeedItemUtil.indexOfItemWithMediaId(playbackHistory, mediaId); - if (pos >= 0) { - adapter.notifyItemChangedCompat(pos); - } - } - } - } - - @Subscribe(threadMode = ThreadMode.MAIN) - public void onEventMainThread(PlaybackPositionEvent event) { - if (adapter != null) { - for (int i = 0; i < adapter.getItemCount(); i++) { - EpisodeItemViewHolder holder = (EpisodeItemViewHolder) recyclerView.findViewHolderForAdapterPosition(i); - if (holder != null && holder.isCurrentlyPlayingItem()) { - holder.notifyPlaybackPositionUpdated(event); - break; - } - } - } - } - public void refreshToolbarState() { - boolean hasHistory = playbackHistory != null && !playbackHistory.isEmpty(); + boolean hasHistory = episodes != null && !episodes.isEmpty(); toolbar.getMenu().findItem(R.id.clear_history_item).setVisible(hasHistory); } @@ -173,33 +89,6 @@ public class PlaybackHistoryFragment extends Fragment implements Toolbar.OnMenuI return false; } - @Override - public boolean onContextItemSelected(@NonNull MenuItem item) { - FeedItem selectedItem = adapter.getLongPressedItem(); - if (selectedItem == null) { - Log.i(TAG, "Selected item at current position was null, ignoring selection"); - return super.onContextItemSelected(item); - } - return FeedItemMenuHandler.onMenuItemClicked(this, item.getItemId(), selectedItem); - } - - @Subscribe(threadMode = ThreadMode.MAIN) - public void onKeyUp(KeyEvent event) { - if (!isAdded() || !isVisible() || !isMenuVisible()) { - return; - } - switch (event.getKeyCode()) { - case KeyEvent.KEYCODE_T: - recyclerView.smoothScrollToPosition(0); - break; - case KeyEvent.KEYCODE_B: - recyclerView.smoothScrollToPosition(adapter.getItemCount() - 1); - break; - default: - break; - } - } - @Subscribe(threadMode = ThreadMode.MAIN) public void onHistoryUpdated(PlaybackHistoryEvent event) { loadItems(); @@ -212,41 +101,20 @@ public class PlaybackHistoryFragment extends Fragment implements Toolbar.OnMenuI refreshToolbarState(); } + @Override @Subscribe(threadMode = ThreadMode.MAIN) public void onUnreadItemsChanged(UnreadItemsUpdateEvent event) { loadItems(); refreshToolbarState(); } - private void onFragmentLoaded() { - adapter.notifyDataSetChanged(); + @Override + protected void onFragmentLoaded(List<FeedItem> episodes) { + super.onFragmentLoaded(episodes); + listAdapter.notifyDataSetChanged(); refreshToolbarState(); } - private void loadItems() { - if (disposable != null) { - disposable.dispose(); - } - progressBar.setVisibility(View.VISIBLE); - emptyView.hide(); - disposable = Observable.fromCallable(this::loadData) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(result -> { - progressBar.setVisibility(View.GONE); - playbackHistory = result; - adapter.updateItems(playbackHistory); - onFragmentLoaded(); - }, error -> Log.e(TAG, Log.getStackTraceString(error))); - } - - @NonNull - private List<FeedItem> loadData() { - List<FeedItem> history = DBReader.getPlaybackHistory(); - DBReader.loadAdditionalFeedItemListData(history); - return history; - } - private class PlaybackHistoryListAdapter extends EpisodeItemListAdapter { public PlaybackHistoryListAdapter(MainActivity mainActivity) { @@ -254,17 +122,26 @@ public class PlaybackHistoryFragment extends Fragment implements Toolbar.OnMenuI } @Override - protected void afterBindViewHolder(EpisodeItemViewHolder holder, int pos) { - // played items shouldn't be transparent for this fragment since, *all* items - // in this fragment will, by definition, be played. So it serves no purpose and can make - // it harder to read. - holder.itemView.setAlpha(1.0f); - } - - @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuItemUtils.setOnClickListeners(menu, PlaybackHistoryFragment.this::onContextItemSelected); } } + + @NonNull + @Override + protected List<FeedItem> loadData() { + return DBReader.getPlaybackHistory(0, page * EPISODES_PER_PAGE); + } + + @NonNull + @Override + protected List<FeedItem> loadMoreData(int page) { + return DBReader.getPlaybackHistory((page - 1) * EPISODES_PER_PAGE, EPISODES_PER_PAGE); + } + + @Override + protected int loadTotalItemCount() { + return (int) DBReader.getPlaybackHistoryLength(); + } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java deleted file mode 100644 index fc2f1fa47..000000000 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java +++ /dev/null @@ -1,112 +0,0 @@ -package de.danoeh.antennapod.fragment.gpodnet; - -import android.app.Activity; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.NonNull; -import androidx.appcompat.widget.SearchView; -import androidx.appcompat.widget.Toolbar; -import androidx.fragment.app.Fragment; -import androidx.viewpager2.adapter.FragmentStateAdapter; -import androidx.viewpager2.widget.ViewPager2; - -import com.google.android.material.tabs.TabLayout; -import com.google.android.material.tabs.TabLayoutMediator; - -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.fragment.OnlineSearchFragment; -import de.danoeh.antennapod.net.discovery.GpodnetPodcastSearcher; - -/** - * Main navigation hub for gpodder.net podcast directory - */ -public class GpodnetMainFragment extends Fragment { - - private static final int NUM_PAGES = 2; - private static final int POS_TOPLIST = 0; - private static final int POS_TAGS = 1; - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - super.onCreateView(inflater, container, savedInstanceState); - View root = inflater.inflate(R.layout.pager_fragment, container, false); - setupToolbar(root.findViewById(R.id.toolbar)); - - ViewPager2 viewPager = root.findViewById(R.id.viewpager); - GpodnetPagerAdapter pagerAdapter = new GpodnetPagerAdapter(this); - viewPager.setAdapter(pagerAdapter); - - // Give the TabLayout the ViewPager - TabLayout tabLayout = root.findViewById(R.id.sliding_tabs); - - new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> { - switch (position) { - case POS_TAGS: - tab.setText(R.string.gpodnet_taglist_header); - break; - case POS_TOPLIST: // Fall-through - default: - tab.setText(R.string.gpodnet_toplist_header); - break; - } - }).attach(); - - return root; - } - - private void setupToolbar(Toolbar toolbar) { - toolbar.setTitle(R.string.gpodnet_main_label); - toolbar.setNavigationOnClickListener(v -> getParentFragmentManager().popBackStack()); - - toolbar.inflateMenu(R.menu.search); - MenuItem searchItem = toolbar.getMenu().findItem(R.id.action_search); - final SearchView sv = (SearchView) searchItem.getActionView(); - sv.setQueryHint(getString(R.string.gpodnet_search_hint)); - sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() { - @Override - public boolean onQueryTextSubmit(String query) { - Activity activity = getActivity(); - if (activity != null) { - searchItem.collapseActionView(); - ((MainActivity) activity).loadChildFragment( - OnlineSearchFragment.newInstance(GpodnetPodcastSearcher.class, query)); - } - return true; - } - - @Override - public boolean onQueryTextChange(String s) { - return false; - } - }); - } - - public static class GpodnetPagerAdapter extends FragmentStateAdapter { - - GpodnetPagerAdapter(@NonNull Fragment fragment) { - super(fragment); - } - - @NonNull - @Override - public Fragment createFragment(int position) { - switch (position) { - case POS_TAGS: - return new TagListFragment(); - case POS_TOPLIST: // Fall-through - default: - return new PodcastTopListFragment(); - } - } - - @Override - public int getItemCount() { - return NUM_PAGES; - } - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java deleted file mode 100644 index c2c5adc9a..000000000 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java +++ /dev/null @@ -1,110 +0,0 @@ -package de.danoeh.antennapod.fragment.gpodnet; - -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.GridView; -import android.widget.ProgressBar; -import android.widget.TextView; -import androidx.fragment.app.Fragment; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.activity.OnlineFeedViewActivity; -import de.danoeh.antennapod.adapter.gpodnet.PodcastListAdapter; -import de.danoeh.antennapod.core.sync.SynchronizationCredentials; -import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetService; -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetServiceException; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetPodcast; -import io.reactivex.Observable; -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.disposables.Disposable; -import io.reactivex.schedulers.Schedulers; - -import java.util.List; - -/** - * Displays a list of GPodnetPodcast-Objects in a GridView - */ -public abstract class PodcastListFragment extends Fragment { - private static final String TAG = "PodcastListFragment"; - - private GridView gridView; - private ProgressBar progressBar; - private TextView txtvError; - private Button butRetry; - private Disposable disposable; - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View root = inflater.inflate(R.layout.gpodnet_podcast_list, container, false); - gridView = root.findViewById(R.id.gridView); - progressBar = root.findViewById(R.id.progressBar); - txtvError = root.findViewById(R.id.txtvError); - butRetry = root.findViewById(R.id.butRetry); - - gridView.setOnItemClickListener((parent, view, position, id) -> - onPodcastSelected((GpodnetPodcast) gridView.getAdapter().getItem(position))); - butRetry.setOnClickListener(v -> loadData()); - - loadData(); - return root; - } - - private void onPodcastSelected(GpodnetPodcast selection) { - Log.d(TAG, "Selected podcast: " + selection.toString()); - Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class); - intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, selection.getUrl()); - intent.putExtra(MainActivity.EXTRA_STARTED_FROM_SEARCH, true); - startActivity(intent); - } - - protected abstract List<GpodnetPodcast> loadPodcastData(GpodnetService service) throws GpodnetServiceException; - - final void loadData() { - if (disposable != null) { - disposable.dispose(); - } - gridView.setVisibility(View.GONE); - progressBar.setVisibility(View.VISIBLE); - txtvError.setVisibility(View.GONE); - butRetry.setVisibility(View.GONE); - disposable = Observable.fromCallable( - () -> { - GpodnetService service = new GpodnetService(AntennapodHttpClient.getHttpClient(), - SynchronizationCredentials.getHosturl(), SynchronizationCredentials.getDeviceID(), - SynchronizationCredentials.getUsername(), SynchronizationCredentials.getPassword()); - return loadPodcastData(service); - }) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe( - podcasts -> { - progressBar.setVisibility(View.GONE); - butRetry.setVisibility(View.GONE); - - if (podcasts.size() > 0) { - PodcastListAdapter listAdapter = new PodcastListAdapter(getContext(), 0, podcasts); - gridView.setAdapter(listAdapter); - listAdapter.notifyDataSetChanged(); - gridView.setVisibility(View.VISIBLE); - txtvError.setVisibility(View.GONE); - } else { - gridView.setVisibility(View.GONE); - txtvError.setText(getString(R.string.search_status_no_results)); - txtvError.setVisibility(View.VISIBLE); - } - }, error -> { - gridView.setVisibility(View.GONE); - progressBar.setVisibility(View.GONE); - txtvError.setText(error.getMessage()); - txtvError.setVisibility(View.VISIBLE); - butRetry.setVisibility(View.VISIBLE); - Log.e(TAG, Log.getStackTraceString(error)); - }); - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java deleted file mode 100644 index f51ab032f..000000000 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java +++ /dev/null @@ -1,16 +0,0 @@ -package de.danoeh.antennapod.fragment.gpodnet; - -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetService; -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetServiceException; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetPodcast; - -import java.util.List; - -public class PodcastTopListFragment extends PodcastListFragment { - private static final int PODCAST_COUNT = 50; - - @Override - protected List<GpodnetPodcast> loadPodcastData(GpodnetService service) throws GpodnetServiceException { - return service.getPodcastToplist(PODCAST_COUNT); - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagFragment.java deleted file mode 100644 index 655cd6ed4..000000000 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagFragment.java +++ /dev/null @@ -1,45 +0,0 @@ -package de.danoeh.antennapod.fragment.gpodnet; - -import android.os.Bundle; -import androidx.annotation.NonNull; - -import java.util.List; - -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetService; -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetServiceException; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetPodcast; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetTag; - -/** - * Shows all podcasts from gpodder.net that belong to a specific tag. - * Use the newInstance method of this class to create a new TagFragment. - */ -public class TagFragment extends PodcastListFragment { - private static final int PODCAST_COUNT = 50; - - private GpodnetTag tag; - - public static TagFragment newInstance(@NonNull GpodnetTag tag) { - TagFragment fragment = new TagFragment(); - Bundle args = new Bundle(); - args.putParcelable("tag", tag); - fragment.setArguments(args); - return fragment; - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - Bundle args = getArguments(); - if (args == null || args.getParcelable("tag") == null) { - throw new IllegalArgumentException("Arguments not given"); - } - tag = args.getParcelable("tag"); - } - - @Override - protected List<GpodnetPodcast> loadPodcastData(GpodnetService service) throws GpodnetServiceException { - return service.getPodcastsForTag(tag, PODCAST_COUNT); - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java deleted file mode 100644 index abdfab941..000000000 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java +++ /dev/null @@ -1,73 +0,0 @@ -package de.danoeh.antennapod.fragment.gpodnet; - -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.widget.TextView; -import androidx.annotation.NonNull; -import androidx.fragment.app.ListFragment; -import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.adapter.gpodnet.TagListAdapter; -import de.danoeh.antennapod.core.sync.SynchronizationCredentials; -import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; -import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetService; -import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetTag; -import io.reactivex.Observable; -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.disposables.Disposable; -import io.reactivex.schedulers.Schedulers; - -public class TagListFragment extends ListFragment { - private static final int COUNT = 50; - private static final String TAG = "TagListFragment"; - private Disposable disposable; - - @Override - public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - getListView().setOnItemClickListener((parent, view1, position, id) -> { - GpodnetTag tag = (GpodnetTag) getListAdapter().getItem(position); - ((MainActivity) getActivity()).loadChildFragment(TagFragment.newInstance(tag)); - }); - - startLoadTask(); - } - - @Override - public void onDestroyView() { - super.onDestroyView(); - - if (disposable != null) { - disposable.dispose(); - } - } - - private void startLoadTask() { - if (disposable != null) { - disposable.dispose(); - } - setListShown(false); - disposable = Observable.fromCallable( - () -> { - GpodnetService service = new GpodnetService(AntennapodHttpClient.getHttpClient(), - SynchronizationCredentials.getHosturl(), SynchronizationCredentials.getDeviceID(), - SynchronizationCredentials.getUsername(), SynchronizationCredentials.getPassword()); - return service.getTopTags(COUNT); - }) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe( - tags -> { - setListAdapter(new TagListAdapter(getContext(), android.R.layout.simple_list_item_1, tags)); - setListShown(true); - }, error -> { - TextView txtvError = new TextView(getActivity()); - txtvError.setText(error.getMessage()); - getListView().setEmptyView(txtvError); - setListShown(true); - Log.e(TAG, Log.getStackTraceString(error)); - }); - } -} - diff --git a/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java b/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java index 22744eee6..3f4cc17ae 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java +++ b/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java @@ -67,7 +67,6 @@ public class ShownotesWebView extends WebView implements View.OnLongClickListene getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); } getSettings().setUseWideViewPort(false); - getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); getSettings().setLoadWithOverviewMode(true); setOnLongClickListener(this); diff --git a/app/src/main/res/layout/addfeed.xml b/app/src/main/res/layout/addfeed.xml index a6e0fc9ea..8e2fb99fa 100644 --- a/app/src/main/res/layout/addfeed.xml +++ b/app/src/main/res/layout/addfeed.xml @@ -1,153 +1,157 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> <androidx.appcompat.widget.Toolbar - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="?attr/actionBarSize" - android:theme="?attr/actionBarTheme" - app:title="@string/add_feed_label" - app:navigationIcon="?homeAsUpIndicator" - android:id="@+id/toolbar"/> + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?attr/actionBarSize" + android:theme="?attr/actionBarTheme" + app:title="@string/add_feed_label" + app:navigationIcon="?homeAsUpIndicator" /> <androidx.cardview.widget.CardView - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:cardCornerRadius="4dp" - app:cardElevation="4dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + app:cardCornerRadius="4dp" + app:cardElevation="4dp"> <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> <ImageView - android:layout_width="40dp" - android:layout_height="match_parent" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:contentDescription="@string/search_podcast_hint" - app:srcCompat="@drawable/ic_search" - android:id="@+id/searchButton" - android:scaleType="center"/> + android:id="@+id/searchButton" + android:layout_width="40dp" + android:layout_height="match_parent" + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" + android:contentDescription="@string/search_podcast_hint" + android:scaleType="center" + app:srcCompat="@drawable/ic_search" /> <EditText - android:id="@+id/combinedFeedSearchEditText" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:inputType="text" - android:imeOptions="actionSearch" - android:importantForAutofill="no" - android:layout_marginStart="0dp" - android:layout_marginLeft="0dp" - android:layout_marginRight="8dp" - android:layout_marginEnd="8dp" - android:paddingTop="16dp" - android:paddingBottom="16dp" - android:hint="@string/search_podcast_hint" - android:background="@null"/> + android:id="@+id/combinedFeedSearchEditText" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:inputType="text" + android:imeOptions="actionSearch" + android:importantForAutofill="no" + android:layout_marginStart="0dp" + android:layout_marginLeft="0dp" + android:layout_marginRight="8dp" + android:layout_marginEnd="8dp" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:hint="@string/search_podcast_hint" + android:background="@null" /> </LinearLayout> + </androidx.cardview.widget.CardView> <ScrollView - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1" - android:scrollbars="vertical"> + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:scrollbars="vertical"> <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:focusableInTouchMode="true" - android:padding="16dp"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:focusableInTouchMode="true" + android:padding="16dp"> <androidx.fragment.app.FragmentContainerView - android:id="@+id/quickFeedDiscovery" - android:name="de.danoeh.antennapod.fragment.QuickFeedDiscoveryFragment" - android:layout_width="match_parent" - android:layout_height="wrap_content"/> + android:id="@+id/quickFeedDiscovery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:name="de.danoeh.antennapod.fragment.QuickFeedDiscoveryFragment" /> <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/advanced" - android:textSize="18sp" - android:layout_marginTop="16dp" - android:layout_marginBottom="8dp" - android:textColor="?android:attr/textColorPrimary"/> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/advanced" + android:textSize="18sp" + android:layout_marginTop="16dp" + android:layout_marginBottom="8dp" + android:textColor="?android:attr/textColorPrimary" /> <TextView - android:id="@+id/addViaUrlButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:drawableStartCompat="@drawable/ic_feed" - app:drawableLeftCompat="@drawable/ic_feed" - style="@style/AddPodcastTextView" - android:text="@string/add_podcast_by_url"/> + android:id="@+id/addViaUrlButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/add_podcast_by_url" + app:drawableStartCompat="@drawable/ic_feed" + app:drawableLeftCompat="@drawable/ic_feed" + style="@style/AddPodcastTextView" /> <TextView - android:id="@+id/addLocalFolderButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:drawableStartCompat="@drawable/ic_folder" - app:drawableLeftCompat="@drawable/ic_folder" - style="@style/AddPodcastTextView" - android:text="@string/add_local_folder"/> + android:id="@+id/addLocalFolderButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/add_local_folder" + app:drawableStartCompat="@drawable/ic_folder" + app:drawableLeftCompat="@drawable/ic_folder" + style="@style/AddPodcastTextView" /> <TextView - android:id="@+id/searchItunesButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:drawableStartCompat="@drawable/ic_search" - app:drawableLeftCompat="@drawable/ic_search" - style="@style/AddPodcastTextView" - android:text="@string/search_itunes_label"/> + android:id="@+id/searchItunesButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/search_itunes_label" + app:drawableStartCompat="@drawable/ic_search" + app:drawableLeftCompat="@drawable/ic_search" + style="@style/AddPodcastTextView" /> <TextView - android:id="@+id/searchFyydButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:drawableStartCompat="@drawable/ic_search" - app:drawableLeftCompat="@drawable/ic_search" - style="@style/AddPodcastTextView" - android:text="@string/search_fyyd_label"/> + android:id="@+id/searchFyydButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/search_fyyd_label" + app:drawableStartCompat="@drawable/ic_search" + app:drawableLeftCompat="@drawable/ic_search" + style="@style/AddPodcastTextView" /> <TextView - android:id="@+id/searchGPodderButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:drawableStartCompat="@drawable/ic_search" - app:drawableLeftCompat="@drawable/ic_search" - style="@style/AddPodcastTextView" - android:text="@string/browse_gpoddernet_label"/> + android:id="@+id/searchGPodderButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/gpodnet_search_hint" + app:drawableStartCompat="@drawable/ic_search" + app:drawableLeftCompat="@drawable/ic_search" + style="@style/AddPodcastTextView" /> <TextView - android:id="@+id/searchPodcastIndexButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:drawableStartCompat="@drawable/ic_search" - app:drawableLeftCompat="@drawable/ic_search" - style="@style/AddPodcastTextView" - android:text="@string/search_podcastindex_label"/> + android:id="@+id/searchPodcastIndexButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/search_podcastindex_label" + app:drawableStartCompat="@drawable/ic_search" + app:drawableLeftCompat="@drawable/ic_search" + style="@style/AddPodcastTextView" /> <TextView - android:id="@+id/opmlImportButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:drawableStartCompat="@drawable/ic_download" - app:drawableLeftCompat="@drawable/ic_download" - style="@style/AddPodcastTextView" - android:text="@string/opml_add_podcast_label"/> + android:id="@+id/opmlImportButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/opml_add_podcast_label" + app:drawableStartCompat="@drawable/ic_download" + app:drawableLeftCompat="@drawable/ic_download" + style="@style/AddPodcastTextView" /> + </LinearLayout> + </ScrollView> + </LinearLayout> diff --git a/app/src/main/res/layout/fragment_itunes_search.xml b/app/src/main/res/layout/fragment_itunes_search.xml index 6e00bdf0d..b20016f68 100644 --- a/app/src/main/res/layout/fragment_itunes_search.xml +++ b/app/src/main/res/layout/fragment_itunes_search.xml @@ -1,23 +1,26 @@ +<?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:app="http://schemas.android.com/apk/res-auto"> + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent"> <LinearLayout + android:id="@+id/browsing" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:id="@+id/browsing" android:layout_alignParentTop="true"> + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" android:theme="?attr/actionBarTheme" app:navigationIcon="?homeAsUpIndicator" - app:title="@string/discover" - android:id="@+id/toolbar"/> + app:title="@string/discover" /> <android.widget.Spinner android:id="@+id/spinner_country" @@ -29,13 +32,14 @@ android:minHeight="?attr/actionBarSize" android:spinnerMode="dropdown" android:textAlignment="textEnd" /> + </LinearLayout> <GridView - android:layout_below="@id/browsing" android:id="@+id/gridView" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_below="@id/browsing" android:clipToPadding="false" android:columnWidth="400dp" android:gravity="center" @@ -45,7 +49,7 @@ android:paddingTop="@dimen/list_vertical_padding" android:stretchMode="columnWidth" android:verticalSpacing="8dp" - tools:listitem="@layout/gpodnet_podcast_listitem" /> + tools:listitem="@layout/itunes_podcast_listitem" /> <TextView android:id="@android:id/empty" @@ -62,7 +66,7 @@ android:layout_height="wrap_content" android:layout_centerInParent="true" android:indeterminateOnly="true" - android:visibility="gone"/> + android:visibility="gone" /> <TextView android:id="@+id/txtvError" @@ -101,5 +105,6 @@ android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_alignParentEnd="true" - android:textAlignment="textEnd"/> + android:textAlignment="textEnd" /> + </RelativeLayout> diff --git a/app/src/main/res/layout/gpodnet_podcast_list.xml b/app/src/main/res/layout/gpodnet_podcast_list.xml deleted file mode 100644 index a6918f8d4..000000000 --- a/app/src/main/res/layout/gpodnet_podcast_list.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?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"> - - <GridView - android:id="@+id/gridView" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:clipToPadding="false" - android:columnWidth="400dp" - android:gravity="center" - android:horizontalSpacing="8dp" - android:numColumns="auto_fit" - android:paddingBottom="@dimen/list_vertical_padding" - android:paddingTop="@dimen/list_vertical_padding" - android:stretchMode="columnWidth" - android:verticalSpacing="8dp" - android:layout_alignParentTop="true" - tools:listitem="@layout/gpodnet_podcast_listitem" /> - - <ProgressBar - android:id="@+id/progressBar" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerInParent="true" - android:indeterminateOnly="true" /> - - <TextView - android:id="@+id/txtvError" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerInParent="true" - android:layout_margin="16dp" - android:textAlignment="center" - android:textSize="@dimen/text_size_small" - android:visibility="gone" - tools:visibility="visible" - tools:text="Error message" - tools:background="@android:color/holo_red_light" /> - - <Button - android:id="@+id/butRetry" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/txtvError" - android:layout_centerHorizontal="true" - android:layout_margin="16dp" - android:text="@string/retry_label" - android:visibility="gone" - tools:visibility="visible" - tools:background="@android:color/holo_red_light" /> -</RelativeLayout> diff --git a/app/src/main/res/layout/gpodnet_podcast_listitem.xml b/app/src/main/res/layout/gpodnet_podcast_listitem.xml deleted file mode 100644 index 56d351d62..000000000 --- a/app/src/main/res/layout/gpodnet_podcast_listitem.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="8dp" - android:paddingLeft="16dp" - android:paddingRight="16dp" - android:paddingBottom="8dp" - tools:background="@android:color/darker_gray"> - - <ImageView - android:id="@+id/imgvCover" - android:layout_width="@dimen/thumbnail_length_itemlist" - android:layout_height="@dimen/thumbnail_length_itemlist" - android:layout_alignParentLeft="true" - android:layout_alignParentStart="true" - android:layout_alignParentTop="true" - android:layout_marginRight="16dp" - android:layout_marginEnd="16dp" - android:adjustViewBounds="true" - android:importantForAccessibility="no" - android:cropToPadding="true" - android:scaleType="fitXY" - tools:src="@tools:sample/avatars" - tools:background="@android:color/holo_green_dark"/> - - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toRightOf="@id/imgvCover" - android:layout_toEndOf="@id/imgvCover" - android:orientation="vertical"> - - <TextView - android:id="@+id/txtvTitle" - style="@style/AntennaPod.TextView.ListItemPrimaryTitle2" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="2" - android:includeFontPadding="false" - tools:text="Title" - tools:background="@android:color/holo_green_dark"/> - - <TextView - android:id="@+id/txtvAuthor" - style="android:style/TextAppearance.Small" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textSize="14sp" - android:textColor="?android:attr/textColorSecondary" - android:ellipsize="middle" - android:maxLines="2" - tools:text="author" - tools:background="@android:color/holo_green_dark"/> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:gravity="center_vertical"> - <ImageView - android:layout_width="14sp" - android:layout_height="14sp" - app:srcCompat="@drawable/ic_feed"/> - <TextView - android:id="@+id/txtvSubscribers" - style="@style/AntennaPod.TextView.ListItemSecondaryTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:lines="1" - tools:text="150" - tools:background="@android:color/holo_green_dark"/> - </LinearLayout> - - </LinearLayout> -</RelativeLayout> diff --git a/app/src/main/res/layout/gpodnet_tag_listitem.xml b/app/src/main/res/layout/gpodnet_tag_listitem.xml deleted file mode 100644 index a377f9ba1..000000000 --- a/app/src/main/res/layout/gpodnet_tag_listitem.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?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="wrap_content" - android:gravity="center_vertical" - tools:background="@android:color/darker_gray"> - - <TextView - android:id="@+id/txtvTitle" - style="@style/AntennaPod.TextView.ListItemPrimaryTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="@dimen/listitem_threeline_horizontalpadding" - android:layout_marginStart="@dimen/listitem_threeline_horizontalpadding" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" - android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" - android:lines="1" - tools:text="Tag Title" - tools:background="@android:color/holo_green_dark" /> - - <TextView - android:id="@+id/txtvUsage" - style="@style/AntennaPod.TextView.ListItemSecondaryTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_alignParentEnd="true" - android:layout_marginRight="@dimen/listitem_threeline_horizontalpadding" - android:layout_marginEnd="@dimen/listitem_threeline_horizontalpadding" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" - android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" - tools:text="301" - tools:background="@android:color/holo_green_dark"/> - -</RelativeLayout> diff --git a/app/src/main/res/layout/inbox_fragment.xml b/app/src/main/res/layout/list_container_fragment.xml index fbacf7827..1b6debb13 100644 --- a/app/src/main/res/layout/inbox_fragment.xml +++ b/app/src/main/res/layout/list_container_fragment.xml @@ -9,13 +9,13 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_alignParentTop="true" android:minHeight="?attr/actionBarSize" android:theme="?attr/actionBarTheme" - android:layout_alignParentTop="true" app:title="@string/inbox_label" /> <FrameLayout - android:id="@+id/inboxContent" + android:id="@+id/listContent" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/toolbar" /> |