From 17391fa4fb31b0332846a913e8381c3908c9d930 Mon Sep 17 00:00:00 2001 From: FongMi Date: Thu, 13 Oct 2022 23:25:52 +0800 Subject: [PATCH] support live - part 1 --- app/src/leanback/AndroidManifest.xml | 5 ++ .../android/tv/ui/activity/LiveActivity.java | 15 +++++ .../res/drawable/selector_live_channel.xml | 4 ++ .../res/drawable/selector_live_group.xml | 4 ++ app/src/leanback/res/drawable/shape_live.xml | 12 ++++ .../res/drawable/shape_live_channel.xml | 11 ++++ .../res/drawable/shape_live_group.xml | 7 +++ .../leanback/res/layout/activity_detail.xml | 16 ++---- app/src/leanback/res/layout/activity_live.xml | 55 +++++++++++++++++++ .../res/layout/adapter_live_channel.xml | 46 ++++++++++++++++ .../res/layout/adapter_live_group.xml | 32 +++++++++++ app/src/leanback/res/values/styles.xml | 15 +++++ 12 files changed, 210 insertions(+), 12 deletions(-) create mode 100644 app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java create mode 100644 app/src/leanback/res/drawable/selector_live_channel.xml create mode 100644 app/src/leanback/res/drawable/selector_live_group.xml create mode 100644 app/src/leanback/res/drawable/shape_live.xml create mode 100644 app/src/leanback/res/drawable/shape_live_channel.xml create mode 100644 app/src/leanback/res/drawable/shape_live_group.xml create mode 100644 app/src/leanback/res/layout/activity_live.xml create mode 100644 app/src/leanback/res/layout/adapter_live_channel.xml create mode 100644 app/src/leanback/res/layout/adapter_live_group.xml diff --git a/app/src/leanback/AndroidManifest.xml b/app/src/leanback/AndroidManifest.xml index fe87c260f..28ac4ec5a 100644 --- a/app/src/leanback/AndroidManifest.xml +++ b/app/src/leanback/AndroidManifest.xml @@ -59,6 +59,11 @@ android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation" android:screenOrientation="sensorLandscape" /> + + + + + \ No newline at end of file diff --git a/app/src/leanback/res/drawable/selector_live_group.xml b/app/src/leanback/res/drawable/selector_live_group.xml new file mode 100644 index 000000000..ee00a4d93 --- /dev/null +++ b/app/src/leanback/res/drawable/selector_live_group.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/leanback/res/drawable/shape_live.xml b/app/src/leanback/res/drawable/shape_live.xml new file mode 100644 index 000000000..10ffe56fd --- /dev/null +++ b/app/src/leanback/res/drawable/shape_live.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/src/leanback/res/drawable/shape_live_channel.xml b/app/src/leanback/res/drawable/shape_live_channel.xml new file mode 100644 index 000000000..3957864c6 --- /dev/null +++ b/app/src/leanback/res/drawable/shape_live_channel.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/leanback/res/drawable/shape_live_group.xml b/app/src/leanback/res/drawable/shape_live_group.xml new file mode 100644 index 000000000..e786aab05 --- /dev/null +++ b/app/src/leanback/res/drawable/shape_live_group.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/app/src/leanback/res/layout/activity_detail.xml b/app/src/leanback/res/layout/activity_detail.xml index 750ac28be..c92772efd 100644 --- a/app/src/leanback/res/layout/activity_detail.xml +++ b/app/src/leanback/res/layout/activity_detail.xml @@ -20,27 +20,19 @@ + app:surface_type="surface_view" /> + app:surface_type="texture_view" /> + + + + + + + + + + + + + + + + + diff --git a/app/src/leanback/res/layout/adapter_live_channel.xml b/app/src/leanback/res/layout/adapter_live_channel.xml new file mode 100644 index 000000000..2ef7b1ba0 --- /dev/null +++ b/app/src/leanback/res/layout/adapter_live_channel.xml @@ -0,0 +1,46 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/leanback/res/layout/adapter_live_group.xml b/app/src/leanback/res/layout/adapter_live_group.xml new file mode 100644 index 000000000..1150c36a3 --- /dev/null +++ b/app/src/leanback/res/layout/adapter_live_group.xml @@ -0,0 +1,32 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/leanback/res/values/styles.xml b/app/src/leanback/res/values/styles.xml index 4fd95c061..6a67aa1ad 100644 --- a/app/src/leanback/res/values/styles.xml +++ b/app/src/leanback/res/values/styles.xml @@ -19,4 +19,19 @@ @style/AppTheme + + + +