1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-11-15 22:57:12 +00:00

Implement new feed and subscriptions groups

- Introduce Groupie for easier lists implementations
- Use some of the new components of the Android Architecture libraries
- Add a bunch of icons for groups, using vectors, which still is
compatible with older APIs through the compatibility layer
This commit is contained in:
Mauricio Colli
2019-04-28 17:43:54 -03:00
parent e8ab5aacc7
commit 20a4bb0936
143 changed files with 4099 additions and 1370 deletions

View File

@@ -0,0 +1,30 @@
package org.schabi.newpipe.local.subscription
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
class FeedGroupIconTest {
@Test
fun `No gaps and repeated ids`() {
val usedIds = HashSet<Int>()
for ((shouldBeId, currentIcon) in FeedGroupIcon.values().withIndex()) {
val added = usedIds.add(currentIcon.id)
assertTrue("Repeated ids (current item: ${currentIcon.name} - ${currentIcon.id})", added)
assertEquals("Gap between ids detected (current item: ${currentIcon.name} - ${currentIcon.id} → should be: $shouldBeId)",
shouldBeId, currentIcon.id)
}
}
@Test
fun `No icons pointing to the same attr`() {
val usedIcons = HashSet<Int>()
for (groupIcon in FeedGroupIcon.values()) {
val added = usedIcons.add(groupIcon.drawableResourceAttr)
assertTrue("Repeated icon (current item: ${groupIcon.name} - ${groupIcon.id})", added)
}
}
}

View File

@@ -3,7 +3,6 @@ package org.schabi.newpipe.local.subscription.services;
import org.junit.Test;
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
import org.schabi.newpipe.extractor.subscription.SubscriptionItem;
import org.schabi.newpipe.local.subscription.ImportExportJsonHelper;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;