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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user