From d22cd2ca124a3fcdc350f34193eaa652bd97bc2c Mon Sep 17 00:00:00 2001 From: cliffamzn Date: Fri, 17 Feb 2023 11:44:07 -0800 Subject: [PATCH] Fixing TV-app layout in landscape mode The on/off button is hidden in landscape mode if there isn't a scrollview. Adding it here so that it is usable. Also making some minor fixes in some other areas of the layouts to make it a bit nicer. --- examples/tv-app/android/App/.idea/gradle.xml | 1 - .../src/main/res/layout/activity_main.xml | 40 +++++++++++-------- .../src/main/res/layout/fragment_qr_code.xml | 14 ++++--- .../bottom_navigation_menu.xml | 0 4 files changed, 32 insertions(+), 23 deletions(-) rename examples/tv-app/android/App/platform-app/src/main/res/{layout => menu}/bottom_navigation_menu.xml (100%) diff --git a/examples/tv-app/android/App/.idea/gradle.xml b/examples/tv-app/android/App/.idea/gradle.xml index 021d59beb6e1eb..c55cb656581f0b 100644 --- a/examples/tv-app/android/App/.idea/gradle.xml +++ b/examples/tv-app/android/App/.idea/gradle.xml @@ -14,7 +14,6 @@ - diff --git a/examples/tv-app/android/App/platform-app/src/main/res/layout/activity_main.xml b/examples/tv-app/android/App/platform-app/src/main/res/layout/activity_main.xml index 32ba7adc3e1af2..c7727d9f33ebb3 100644 --- a/examples/tv-app/android/App/platform-app/src/main/res/layout/activity_main.xml +++ b/examples/tv-app/android/App/platform-app/src/main/res/layout/activity_main.xml @@ -6,30 +6,38 @@ android:layout_height="match_parent" tools:context="com.matter.tv.server.MainActivity"> - - - + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="parent"> + + + + + android:layout_alignParentBottom="true" + android:gravity="bottom" + app:menu="@menu/bottom_navigation_menu" /> - \ No newline at end of file + diff --git a/examples/tv-app/android/App/platform-app/src/main/res/layout/fragment_qr_code.xml b/examples/tv-app/android/App/platform-app/src/main/res/layout/fragment_qr_code.xml index 12ef37602374e6..33ea01bbade8c8 100644 --- a/examples/tv-app/android/App/platform-app/src/main/res/layout/fragment_qr_code.xml +++ b/examples/tv-app/android/App/platform-app/src/main/res/layout/fragment_qr_code.xml @@ -2,7 +2,7 @@ @@ -10,9 +10,10 @@ android:id="@+id/qrCodeTxt" android:layout_width="wrap_content" android:layout_height="wrap_content" + app:layout_constraintTop_toTopOf="parent" + android:layout_marginTop="20dp" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - android:layout_marginTop="20dp" /> + app:layout_constraintStart_toStartOf="parent" /> - \ No newline at end of file + diff --git a/examples/tv-app/android/App/platform-app/src/main/res/layout/bottom_navigation_menu.xml b/examples/tv-app/android/App/platform-app/src/main/res/menu/bottom_navigation_menu.xml similarity index 100% rename from examples/tv-app/android/App/platform-app/src/main/res/layout/bottom_navigation_menu.xml rename to examples/tv-app/android/App/platform-app/src/main/res/menu/bottom_navigation_menu.xml