Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[media.ccc.de] Add "live" kiosk #5286

Merged
merged 2 commits into from
Dec 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ dependencies {

// NewPipe dependencies
// You can use a local version by uncommenting a few lines in settings.gradle
implementation 'com.github.TeamNewPipe:NewPipeExtractor:b2837698f55296e00aeca5cb1847755dd1174af4'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:b4e191397117447364d137791ec4b1ca3672d75b'
implementation "com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751"

implementation "org.jsoup:jsoup:1.13.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public void updateFromItem(final InfoItem infoItem,
} else {
itemProgressView.setVisibility(View.GONE);
}
} else if (item.getStreamType() == StreamType.LIVE_STREAM) {
} else if (item.getStreamType() == StreamType.LIVE_STREAM
|| item.getStreamType() == StreamType.AUDIO_LIVE_STREAM) {
itemDurationView.setText(R.string.duration_live);
itemDurationView.setBackgroundColor(ContextCompat.getColor(itemBuilder.getContext(),
R.color.live_duration_background_color));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public static String getTranslatedKioskName(final String kioskId, final Context
return c.getString(R.string.most_liked);
case "conferences":
return c.getString(R.string.conferences);
case "recent":
return c.getString(R.string.recent);
case "live":
return c.getString(R.string.duration_live);
default:
return kioskId;
}
Expand All @@ -59,9 +63,12 @@ public static int getKioskIcon(final String kioskId, final Context c) {
case "Local":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_local);
case "Recently added":
case "recent":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_recent);
case "Most liked":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_thumb_up);
case "live":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_live_tv);
default:
return 0;
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_live_tv_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="24dp"
android:tint="?attr/colorControlNormal" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/black" android:pathData="M21,6h-7.59l3.29,-3.29L16,2l-4,4 -4,-4 -0.71,0.71L10.59,6L3,6c-1.1,0 -2,0.89 -2,2v12c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,8c0,-1.11 -0.9,-2 -2,-2zM21,20L3,20L3,8h18v12zM9,10v8l7,-4z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_live_tv_white_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="24dp"
android:tint="#FFFFFF" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M21,6h-7.59l3.29,-3.29L16,2l-4,4 -4,-4 -0.71,0.71L10.59,6L3,6c-1.1,0 -2,0.89 -2,2v12c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,8c0,-1.11 -0.9,-2 -2,-2zM21,20L3,20L3,8h18v12zM9,10v8l7,-4z"/>
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<attr name="ic_sort" format="reference" />
<attr name="ic_help" format="reference" />
<attr name="ic_arrow_back" format="reference" />
<attr name="ic_live_tv" format="reference" />

<attr name="progress_horizontal_drawable" format="reference" />
<!-- Can't refer to colors directly in drawable's xml-->
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -691,4 +691,5 @@
<string name="playlist_page_summary">Playlist page</string>
<string name="show_thumbnail_title">Show thumbnail</string>
<string name="show_thumbnail_summary">Use thumbnail for both lock screen background and notifications</string>
<string name="recent">Recent</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<item name="ic_kiosk_local">@drawable/ic_home_black_24dp</item>
<item name="ic_kiosk_recent">@drawable/ic_add_circle_outline_black_24dp</item>
<item name="ic_channel">@drawable/ic_tv_black_24dp</item>
<item name="ic_live_tv">@drawable/ic_live_tv_black_24dp</item>
<item name="ic_bookmark">@drawable/ic_bookmark_black_24dp</item>
<item name="ic_playlist_add">@drawable/ic_playlist_add_black_24dp</item>
<item name="ic_playlist_check">@drawable/ic_playlist_add_check_black_24dp</item>
Expand Down Expand Up @@ -156,6 +157,7 @@
<item name="ic_kiosk_local">@drawable/ic_home_white_24dp</item>
<item name="ic_kiosk_recent">@drawable/ic_add_circle_outline_white_24dp</item>
<item name="ic_channel">@drawable/ic_tv_white_24dp</item>
<item name="ic_live_tv">@drawable/ic_live_tv_white_24dp</item>
<item name="ic_bookmark">@drawable/ic_bookmark_white_24dp</item>
<item name="ic_playlist_add">@drawable/ic_playlist_add_white_24dp</item>
<item name="ic_playlist_check">@drawable/ic_playlist_add_check_white_24dp</item>
Expand Down