Skip to content

Commit 39a3f03

Browse files
fynngodauTobiGr
authored andcommitted
Bandcamp support
1 parent 404a6c1 commit 39a3f03

7 files changed

Lines changed: 56 additions & 0 deletions

File tree

app/src/main/AndroidManifest.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,22 @@
317317
<data android:pathPrefix="/accounts/" />
318318
<data android:pathPrefix="/video-channels/" />
319319
</intent-filter>
320+
321+
<!-- Bandcamp filter -->
322+
<intent-filter>
323+
<action android:name="android.intent.action.VIEW"/>
324+
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
325+
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
326+
327+
<category android:name="android.intent.category.DEFAULT"/>
328+
<category android:name="android.intent.category.BROWSABLE"/>
329+
330+
<data android:scheme="http"/>
331+
<data android:scheme="https"/>
332+
<data android:host="bandcamp.com"/>
333+
<data android:host="*.bandcamp.com"/>
334+
<data android:pathPrefix="/"/>
335+
</intent-filter>
320336
</activity>
321337
<service
322338
android:name=".RouterActivity$FetcherService"

app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public static String getTranslatedKioskName(final String kioskId, final Context
4848
return c.getString(R.string.recent);
4949
case "live":
5050
return c.getString(R.string.duration_live);
51+
case "Featured":
52+
return c.getString(R.string.featured);
53+
case "Radio":
54+
return c.getString(R.string.radio);
5155
default:
5256
return kioskId;
5357
}
@@ -69,6 +73,10 @@ public static int getKioskIcon(final String kioskId, final Context c) {
6973
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_thumb_up);
7074
case "live":
7175
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_live_tv);
76+
case "Featured":
77+
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_stars);
78+
case "Radio":
79+
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_radio);
7280
default:
7381
return 0;
7482
}

app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public static int getIcon(final int serviceId) {
3838
return R.drawable.place_holder_gadse;
3939
case 3:
4040
return R.drawable.place_holder_peertube;
41+
case 4:
42+
return R.drawable.place_holder_bandcamp;
4143
default:
4244
return R.drawable.place_holder_circle;
4345
}
6.73 KB
Loading

app/src/main/res/values/colors_services.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,13 @@
4444
<color name="dark_media_ccc_accent_color">#FFFFFF</color>
4545
<color name="dark_media_ccc_statusbar_color">#9e9e9e</color>
4646

47+
<!-- Bandcamp -->
48+
<color name="light_bandcamp_primary_color">#17a0c4</color>
49+
<color name="light_bandcamp_accent_color">#000000</color>
50+
<color name="light_bandcamp_statusbar_color">#17a0c4</color>
51+
52+
<color name="dark_bandcamp_primary_color">#17a0c4</color>
53+
<color name="dark_bandcamp_accent_color">#FFFFFF</color>
54+
<color name="dark_bandcamp_statusbar_color">#17a0c4</color>
55+
4756
</resources>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,4 +707,6 @@
707707
<string name="private_content">This content is private, so it cannot be streamed or downloaded by NewPipe.</string>
708708
<string name="youtube_music_premium_content">This video is available only to YouTube Music Premium members, so it cannot be streamed or downloaded by NewPipe.</string>
709709
<string name="paid_content">This content is only available to users who have paid, so it cannot be streamed or downloaded by NewPipe.</string>
710+
<string name="featured">Featured</string>
711+
<string name="radio">Radio</string>
710712
</resources>

app/src/main/res/values/styles_services.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,23 @@
7070
<item name="colorAccent">@color/dark_media_ccc_accent_color</item>
7171
</style>
7272

73+
<!-- Bandcamp -->
74+
<style name="LightTheme.Bandcamp" parent="LightTheme">
75+
<item name="colorPrimary">@color/light_bandcamp_primary_color</item>
76+
<item name="colorPrimaryDark">@color/light_bandcamp_statusbar_color</item>
77+
<item name="colorAccent">@color/light_bandcamp_accent_color</item>
78+
</style>
79+
80+
<style name="DarkTheme.Bandcamp" parent="DarkTheme">
81+
<item name="colorPrimary">@color/dark_bandcamp_primary_color</item>
82+
<item name="colorPrimaryDark">@color/dark_bandcamp_statusbar_color</item>
83+
<item name="colorAccent">@color/dark_bandcamp_accent_color</item>
84+
</style>
85+
86+
<style name="BlackTheme.Bandcamp" parent="BlackTheme">
87+
<item name="colorPrimary">@color/dark_bandcamp_primary_color</item>
88+
<item name="colorPrimaryDark">@color/dark_bandcamp_statusbar_color</item>
89+
<item name="colorAccent">@color/dark_bandcamp_accent_color</item>
90+
</style>
91+
7392
</resources>

0 commit comments

Comments
 (0)