share_to_apps.xml (5185B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- This Source Code Form is subject to the terms of the Mozilla Public 3 - License, v. 2.0. If a copy of the MPL was not distributed with this 4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 5 <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" 6 xmlns:app="http://schemas.android.com/apk/res-auto" 7 android:layout_width="match_parent" 8 android:layout_height="wrap_content" 9 android:layout_gravity="center_horizontal"> 10 11 <androidx.constraintlayout.widget.ConstraintLayout 12 android:id="@+id/apps_layout" 13 android:layout_width="wrap_content" 14 android:layout_height="wrap_content"> 15 16 <ProgressBar 17 android:id="@+id/progressBar" 18 android:layout_width="76dp" 19 android:layout_height="37dp" 20 android:layout_marginTop="@dimen/share_progress_bar_margin" 21 android:layout_marginBottom="@dimen/share_progress_bar_margin" 22 app:layout_constraintBottom_toBottomOf="parent" 23 app:layout_constraintEnd_toEndOf="parent" 24 app:layout_constraintStart_toStartOf="parent" 25 app:layout_constraintTop_toBottomOf="@id/apps_link_header" /> 26 27 <LinearLayout 28 android:id="@+id/recentAppsContainer" 29 android:layout_width="wrap_content" 30 android:layout_height="wrap_content" 31 android:layout_marginStart="@dimen/share_recent_apps_margin" 32 android:layout_marginTop="@dimen/share_recent_apps_margin" 33 android:layout_marginBottom="@dimen/share_recent_apps_margin" 34 android:background="@drawable/recent_apps_background" 35 android:orientation="vertical" 36 android:paddingTop="@dimen/share_recent_apps_padding" 37 android:visibility="gone" 38 app:layout_constraintStart_toStartOf="parent" 39 app:layout_constraintTop_toTopOf="parent"> 40 41 <TextView 42 android:id="@+id/recent_apps_link_header" 43 style="@style/ShareHeaderTextStyle" 44 android:layout_width="wrap_content" 45 android:layout_height="wrap_content" 46 android:paddingStart="@dimen/share_recent_apps_padding" 47 android:paddingEnd="@dimen/share_recent_apps_padding" 48 android:text="@string/share_link_recent_apps_subheader" /> 49 50 <androidx.recyclerview.widget.RecyclerView 51 android:id="@+id/recentAppsList" 52 android:layout_width="wrap_content" 53 android:layout_height="wrap_content" 54 android:layout_gravity="center" 55 android:clipToPadding="false" 56 android:minHeight="@dimen/share_list_min_height" 57 android:orientation="horizontal" 58 app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" 59 app:spanCount="2" /> 60 61 </LinearLayout> 62 63 <TextView 64 android:id="@+id/apps_link_header" 65 style="@style/ShareHeaderTextStyle" 66 android:layout_width="wrap_content" 67 android:layout_height="wrap_content" 68 android:layout_marginStart="@dimen/share_all_apps_header_margin" 69 android:layout_marginTop="@dimen/share_all_apps_header_margin" 70 android:text="@string/share_link_all_apps_subheader" 71 app:layout_constraintStart_toEndOf="@+id/recentAppsContainer" 72 app:layout_constraintTop_toTopOf="parent" /> 73 74 <!-- Having the RecyclerView inside a RelativeLayout means 75 the RecyclerView will load all items at once and never recycle. 76 This is a conscious choice since we use HorizontalScrollView to scroll all 77 children horizontally and so prevent scrolling in the RecyclerViews. --> 78 <RelativeLayout 79 android:layout_width="wrap_content" 80 android:layout_height="wrap_content" 81 app:layout_constraintBottom_toBottomOf="parent" 82 app:layout_constraintEnd_toEndOf="parent" 83 app:layout_constraintStart_toEndOf="@+id/recentAppsContainer" 84 app:layout_constraintTop_toBottomOf="@id/apps_link_header"> 85 86 <androidx.recyclerview.widget.RecyclerView 87 android:id="@+id/appsList" 88 android:layout_width="wrap_content" 89 android:layout_height="wrap_content" 90 android:layout_marginBottom="@dimen/share_all_apps_list_margin" 91 android:clipToPadding="false" 92 android:minHeight="@dimen/share_list_min_height" 93 android:orientation="horizontal" 94 android:visibility="gone" 95 app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" 96 app:layout_constraintBottom_toBottomOf="parent" 97 app:layout_constraintEnd_toEndOf="parent" 98 app:layout_constraintStart_toStartOf="parent" 99 app:layout_constraintTop_toTopOf="parent" 100 app:spanCount="2" /> 101 </RelativeLayout> 102 </androidx.constraintlayout.widget.ConstraintLayout> 103 </HorizontalScrollView>