Skip to content

Commit

Permalink
Fixing TV-app layout in landscape mode (#25209)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cliffamzn authored Feb 22, 2023
1 parent 957dd26 commit 7cb57a0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 23 deletions.
1 change: 0 additions & 1 deletion examples/tv-app/android/App/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,38 @@
android:layout_height="match_parent"
tools:context="com.matter.tv.server.MainActivity">

<androidx.fragment.app.FragmentContainerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fragment_container_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.fragment.app.FragmentContainerView>

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent">

<ScrollView
android:id="@+id/scrollView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="@+id/bottom_navigation">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_container_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.matter.tv.server.fragments.QrCodeFragment"
tools:layout="@layout/fragment_qr_code" />
</ScrollView>

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation"
android:gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom= "true"
app:menu="@layout/bottom_navigation_menu" />
android:layout_alignParentBottom="true"
android:gravity="bottom"
app:menu="@menu/bottom_navigation_menu" />

</RelativeLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".fragments.QrCodeFragment">

<TextView
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" />

<ImageView
android:id="@+id/qrCodeImg"
Expand Down Expand Up @@ -44,7 +45,7 @@

<Button
android:id="@+id/OnOffBtn"
android:text="OnOff"
android:text="On / Off"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/resetBtn"
Expand All @@ -57,9 +58,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/OnOffBtn"
android:layout_marginTop="20dp"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_margin="20dp"
android:maxHeight="2dp"
android:minHeight="2dp"
android:max="100"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 7cb57a0

Please sign in to comment.