diff --git a/README.md b/README.md index bee3f745..5891f842 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ - [Invidious companion support.](./docs/DOCKER.md#invidious-companion-support) - [Invidious API extended integration.](https://github.com/Materialious/api-extended) - [YouTube.js](https://github.com/LuanRT/YouTube.js) fallback if Invidious fails loading videos for Desktop & Android. +- Android TV support - Support for disabling certificate validation for homelab users. - Sync your watch progress between Invidious sessions. - Watch sync parties. @@ -203,6 +204,9 @@ Help [translate Materialious via Weblate](https://toolate.othing.xyz/projects/ma ## Mobile +## Android TV +![Preview of subscriptions page on Android TV](./previews/android-tv.png) + ## Player ![Preview of player](./previews/player-preview.png) diff --git a/branding/tv-banner.png b/branding/tv-banner.png new file mode 100644 index 00000000..de293639 Binary files /dev/null and b/branding/tv-banner.png differ diff --git a/materialious/android/app/src/main/AndroidManifest.xml b/materialious/android/app/src/main/AndroidManifest.xml index 6d1a5207..927d681e 100644 --- a/materialious/android/app/src/main/AndroidManifest.xml +++ b/materialious/android/app/src/main/AndroidManifest.xml @@ -3,6 +3,7 @@ Promise; } -const androidTv = registerPlugin('AndroidTv'); +export class AndroidTvWeb extends WebPlugin implements AndroidTV { + async isAndroidTv(): Promise { + return false; + } +} + +const androidTv = registerPlugin('AndroidTv', { + web: new AndroidTvWeb() +}); export default androidTv; diff --git a/materialious/src/lib/android/plugins/colorTheme.ts b/materialious/src/lib/android/plugins/colorTheme.ts index 5c4778f6..b51b3e54 100644 --- a/materialious/src/lib/android/plugins/colorTheme.ts +++ b/materialious/src/lib/android/plugins/colorTheme.ts @@ -1,28 +1,27 @@ -import { registerPlugin } from "@capacitor/core"; +import { registerPlugin } from '@capacitor/core'; export interface ColorTheme { - getColorPalette: () => Promise<{ - primary: number; - onPrimary: number; - secondary: number; - accent: number; - }>; + getColorPalette: () => Promise<{ + primary: number; + onPrimary: number; + secondary: number; + accent: number; + }>; } export function convertToHexColorCode(color: number): string { - // Convert the negative number to a positive unsigned integer - const unsignedColor = color < 0 ? color + 0x100000000 : color; + // Convert the negative number to a positive unsigned integer + const unsignedColor = color < 0 ? color + 0x100000000 : color; - // Extract the RGB components - const r = (unsignedColor >> 16) & 0xff; - const g = (unsignedColor >> 8) & 0xff; - const b = unsignedColor & 0xff; + // Extract the RGB components + const r = (unsignedColor >> 16) & 0xff; + const g = (unsignedColor >> 8) & 0xff; + const b = unsignedColor & 0xff; - // Convert to hex format and pad with zeros if necessary - return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase()}`; + // Convert to hex format and pad with zeros if necessary + return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase()}`; } - const colorTheme = registerPlugin('ColorTheme'); -export default colorTheme; \ No newline at end of file +export default colorTheme; diff --git a/materialious/src/lib/css/global.css b/materialious/src/lib/css/global.css index e2e3c937..cedc4e56 100644 --- a/materialious/src/lib/css/global.css +++ b/materialious/src/lib/css/global.css @@ -17,7 +17,7 @@ main.root { overflow-y: auto; } -main.root-not-tv { +.root-not-tv { padding-left: 7em !important; } diff --git a/materialious/src/routes/(app)/+layout.svelte b/materialious/src/routes/(app)/+layout.svelte index c1da5be0..7ba62872 100644 --- a/materialious/src/routes/(app)/+layout.svelte +++ b/materialious/src/routes/(app)/+layout.svelte @@ -351,7 +351,7 @@ {/if} -
+
{#if isAndroidTv}
{#each getPages() as navPage} diff --git a/previews/android-tv.png b/previews/android-tv.png new file mode 100644 index 00000000..fa3752ef Binary files /dev/null and b/previews/android-tv.png differ