1<?xml version="1.0" encoding="utf-8"?> 2<!-- Copyright (C) 2013 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15--> 16 17<!-- 18 A SlidingPaneLayout is indended to be used as the top-level content view 19 using match_parent for both width and height to consume the full space available. 20--> 21<androidx.slidingpanelayout.widget.SlidingPaneLayout 22 xmlns:android="http://schemas.android.com/apk/res/android" 23 android:id="@+id/sliding_pane_layout" 24 android:layout_width="match_parent" 25 android:layout_height="match_parent"> 26 <!-- The first child view becomes the left pane. When the combined 27 desired width (expressed using android:layout_width) would 28 not fit on-screen at once, the right pane is permitted to 29 overlap the left. --> 30 <ListView android:id="@+id/left_pane" 31 android:layout_width="280dp" 32 android:layout_height="match_parent" 33 android:layout_gravity="left"/> 34 <!-- The second child becomes the right (content) pane. In this 35 example, android:layout_weight is used to express that this 36 pane should grow to consume leftover available space when the 37 window is wide enough. This allows the content pane to 38 responsively grow in width on larger screens while still 39 requiring at least the minimum width expressed by 40 android:layout_width. --> 41 <ScrollView 42 android:layout_width="300dp" 43 android:layout_height="match_parent" 44 android:layout_weight="1" 45 android:paddingLeft="16dp" 46 android:paddingRight="16dp" 47 android:scrollbarStyle="outsideOverlay" 48 android:background="#ff333333"> 49 <TextView android:id="@+id/content_text" 50 android:layout_width="match_parent" 51 android:layout_height="match_parent" 52 android:text="@string/sliding_pane_layout_summary" 53 android:textAppearance="?android:attr/textAppearanceMedium"/> 54 </ScrollView> 55</androidx.slidingpanelayout.widget.SlidingPaneLayout> 56 57