From 8c75d35325f841d82be2d664661b6dbbfd6ce961 Mon Sep 17 00:00:00 2001 From: Craig Dunn Date: Thu, 9 Apr 2020 13:45:18 -0700 Subject: [PATCH] add SurfaceDuoLayout preview (#10) --- CompanionPane/build.gradle | 2 +- .../src/main/res/layout/activity_main.xml | 5 ++- CompanionPaneLevel2/build.gradle | 2 +- .../src/main/res/layout/activity_main.xml | 6 ++- DragAndDrop/build.gradle | 2 +- .../src/main/res/layout/activity_main.xml | 5 ++- DualView/build.gradle | 2 +- .../src/main/res/layout/activity_main.xml | 11 ++++-- .../res/layout/dual_screen_end_layout.xml | 7 ++-- .../res/layout/dual_screen_start_layout.xml | 4 +- .../main/res/layout/fragment_item_detail.xml | 10 +++-- .../main/res/layout/fragment_items_list.xml | 6 ++- .../main/res/layout/single_screen_layout.xml | 7 ++-- ExtendCanvas/build.gradle | 1 + MasterDetail/build.gradle | 2 +- .../src/main/res/layout/activity_main.xml | 7 +++- .../main/res/layout/fragment_item_detail.xml | 3 +- .../main/res/layout/fragment_items_list.xml | 38 ++++++++++++++++--- MasterDetail/src/main/res/values/dimens.xml | 12 ++++++ MasterDetail/src/main/res/values/strings.xml | 1 + OrientationAndSpanning/build.gradle | 2 +- TwoPage/build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 11 +----- 23 files changed, 103 insertions(+), 45 deletions(-) create mode 100644 MasterDetail/src/main/res/values/dimens.xml diff --git a/CompanionPane/build.gradle b/CompanionPane/build.gradle index 548e1f9..dbef0b1 100644 --- a/CompanionPane/build.gradle +++ b/CompanionPane/build.gradle @@ -44,6 +44,6 @@ dependencies { implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.viewpager2:viewpager2:1.0.0' - implementation 'com.microsoft.device:dualscreen-layout:0.9.0' + implementation 'com.microsoft.device:dualscreen-layout:0.9.2' } diff --git a/CompanionPane/src/main/res/layout/activity_main.xml b/CompanionPane/src/main/res/layout/activity_main.xml index ba2c89a..edf1d20 100644 --- a/CompanionPane/src/main/res/layout/activity_main.xml +++ b/CompanionPane/src/main/res/layout/activity_main.xml @@ -10,6 +10,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:animateLayoutChanges="true" - app:dual_screen_end_layout_id="@layout/dual_screen_end_layout" + app:single_screen_layout_id="@layout/single_screen_layout" app:dual_screen_start_layout_id="@layout/single_screen_layout" - app:single_screen_layout_id="@layout/single_screen_layout" /> \ No newline at end of file + app:dual_screen_end_layout_id="@layout/dual_screen_end_layout" + app:tools_screen_mode="dual_screen"/> \ No newline at end of file diff --git a/CompanionPaneLevel2/build.gradle b/CompanionPaneLevel2/build.gradle index d6179f9..38f4e14 100644 --- a/CompanionPaneLevel2/build.gradle +++ b/CompanionPaneLevel2/build.gradle @@ -36,5 +36,5 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - implementation 'com.microsoft.device:dualscreen-layout:0.9.0' + implementation 'com.microsoft.device:dualscreen-layout:0.9.2' } diff --git a/CompanionPaneLevel2/src/main/res/layout/activity_main.xml b/CompanionPaneLevel2/src/main/res/layout/activity_main.xml index 57bd7ea..5c02adc 100644 --- a/CompanionPaneLevel2/src/main/res/layout/activity_main.xml +++ b/CompanionPaneLevel2/src/main/res/layout/activity_main.xml @@ -9,6 +9,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - app:dual_screen_end_layout_id="@layout/tools_dual_screen" + app:single_screen_layout_id="@layout/single_screen_layout" app:dual_screen_start_layout_id="@layout/picture_dual_screen" - app:single_screen_layout_id="@layout/single_screen_layout" /> + app:dual_screen_end_layout_id="@layout/tools_dual_screen" + app:tools_screen_mode="dual_screen" + app:tools_hinge_color="white" /> diff --git a/DragAndDrop/build.gradle b/DragAndDrop/build.gradle index c8442b4..f1279c3 100644 --- a/DragAndDrop/build.gradle +++ b/DragAndDrop/build.gradle @@ -58,5 +58,5 @@ dependencies { androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - implementation 'com.microsoft.device:dualscreen-layout:0.9.0' + implementation 'com.microsoft.device:dualscreen-layout:0.9.2' } diff --git a/DragAndDrop/src/main/res/layout/activity_main.xml b/DragAndDrop/src/main/res/layout/activity_main.xml index 5b1625d..17dd4aa 100644 --- a/DragAndDrop/src/main/res/layout/activity_main.xml +++ b/DragAndDrop/src/main/res/layout/activity_main.xml @@ -13,7 +13,10 @@ + app:single_screen_layout_id="@layout/single_screen" + app:show_in_dual_screen_start="@layout/drag_source_layout" + app:show_in_dual_screen_end="@layout/drop_target_layout" + app:tools_screen_mode="dual_screen"/> - + app:dual_screen_end_layout_id="@layout/dual_screen_end_layout" + app:show_in_single_screen="@layout/fragment_items_list" + app:show_in_dual_screen_start="@layout/fragment_items_list" + app:show_in_dual_screen_end="@layout/fragment_item_detail" + app:tools_screen_mode="dual_screen"/> diff --git a/DualView/src/main/res/layout/dual_screen_end_layout.xml b/DualView/src/main/res/layout/dual_screen_end_layout.xml index 3806ff5..a7cb104 100644 --- a/DualView/src/main/res/layout/dual_screen_end_layout.xml +++ b/DualView/src/main/res/layout/dual_screen_end_layout.xml @@ -6,9 +6,10 @@ ~ --> - \ No newline at end of file + android:name="com.microsoft.device.display.samples.contentcontext.MapFragment" + tools:layout="@layout/fragment_item_detail" /> \ No newline at end of file diff --git a/DualView/src/main/res/layout/dual_screen_start_layout.xml b/DualView/src/main/res/layout/dual_screen_start_layout.xml index 8134ba5..ea7c960 100644 --- a/DualView/src/main/res/layout/dual_screen_start_layout.xml +++ b/DualView/src/main/res/layout/dual_screen_start_layout.xml @@ -8,10 +8,12 @@ + android:name="com.microsoft.device.display.samples.contentcontext.MapPointListFragment" + tools:showIn="@layout/fragment_items_list" /> diff --git a/DualView/src/main/res/layout/fragment_item_detail.xml b/DualView/src/main/res/layout/fragment_item_detail.xml index dcfafa2..b4e3cb3 100644 --- a/DualView/src/main/res/layout/fragment_item_detail.xml +++ b/DualView/src/main/res/layout/fragment_item_detail.xml @@ -8,6 +8,7 @@ @@ -28,13 +29,16 @@ android:layout_width="0dp" android:layout_height="0dp" android:fillViewport="true" - android:padding="0dp" - android:scaleType="matrix" android:focusable="true" android:focusableInTouchMode="true" + android:padding="0dp" + android:scaleType="matrix" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/detail_toolbar" /> + app:layout_constraintTop_toBottomOf="@id/detail_toolbar" + app:layout_constraintVertical_bias="0.0" + tools:src="@drawable/san_francisco" /> diff --git a/DualView/src/main/res/layout/fragment_items_list.xml b/DualView/src/main/res/layout/fragment_items_list.xml index 3980df3..4cfef8e 100644 --- a/DualView/src/main/res/layout/fragment_items_list.xml +++ b/DualView/src/main/res/layout/fragment_items_list.xml @@ -9,6 +9,7 @@ @@ -32,7 +33,8 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/list_toolbar"> - + app:layout_constraintTop_toBottomOf="@id/list_toolbar" + tools:listitem="@android:layout/simple_selectable_list_item"> + diff --git a/DualView/src/main/res/layout/single_screen_layout.xml b/DualView/src/main/res/layout/single_screen_layout.xml index 0598700..5f717ef 100644 --- a/DualView/src/main/res/layout/single_screen_layout.xml +++ b/DualView/src/main/res/layout/single_screen_layout.xml @@ -6,9 +6,10 @@ ~ --> - + android:name="com.microsoft.device.display.samples.contentcontext.MapPointListFragment" + tools:layout="@layout/fragment_items_list" /> diff --git a/ExtendCanvas/build.gradle b/ExtendCanvas/build.gradle index dcd672d..d4e1b3b 100644 --- a/ExtendCanvas/build.gradle +++ b/ExtendCanvas/build.gradle @@ -50,6 +50,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.13' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } diff --git a/MasterDetail/build.gradle b/MasterDetail/build.gradle index 349560a..2d0cda6 100644 --- a/MasterDetail/build.gradle +++ b/MasterDetail/build.gradle @@ -57,5 +57,5 @@ dependencies { androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - implementation 'com.microsoft.device:dualscreen-layout:0.9.0' + implementation 'com.microsoft.device:dualscreen-layout:0.9.2' } diff --git a/MasterDetail/src/main/res/layout/activity_main.xml b/MasterDetail/src/main/res/layout/activity_main.xml index 0b69881..bac2a8c 100644 --- a/MasterDetail/src/main/res/layout/activity_main.xml +++ b/MasterDetail/src/main/res/layout/activity_main.xml @@ -6,5 +6,10 @@ --> + android:layout_height="match_parent" + app:show_in_dual_screen_start="@layout/fragment_items_list" + app:show_in_dual_screen_end="@layout/fragment_item_detail" + app:show_in_single_screen="@layout/fragment_items_list" + app:tools_screen_mode="dual_screen"/> diff --git a/MasterDetail/src/main/res/layout/fragment_item_detail.xml b/MasterDetail/src/main/res/layout/fragment_item_detail.xml index 9b6023e..3765265 100644 --- a/MasterDetail/src/main/res/layout/fragment_item_detail.xml +++ b/MasterDetail/src/main/res/layout/fragment_item_detail.xml @@ -9,7 +9,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical"> + xmlns:tools="http://schemas.android.com/tools"> diff --git a/MasterDetail/src/main/res/layout/fragment_items_list.xml b/MasterDetail/src/main/res/layout/fragment_items_list.xml index 0179ce6..bb29e8a 100644 --- a/MasterDetail/src/main/res/layout/fragment_items_list.xml +++ b/MasterDetail/src/main/res/layout/fragment_items_list.xml @@ -5,13 +5,39 @@ ~ Licensed under the MIT License. ~ --> - + android:layout_width="match_parent"> + + + + - + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toBottomOf="@+id/textView4" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + tools:listitem="@layout/support_simple_spinner_dropdown_item" /> + + diff --git a/MasterDetail/src/main/res/values/dimens.xml b/MasterDetail/src/main/res/values/dimens.xml new file mode 100644 index 0000000..62d0e89 --- /dev/null +++ b/MasterDetail/src/main/res/values/dimens.xml @@ -0,0 +1,12 @@ + + + + + 16sp + 16dp + \ No newline at end of file diff --git a/MasterDetail/src/main/res/values/strings.xml b/MasterDetail/src/main/res/values/strings.xml index 0d49d9a..d2f3165 100644 --- a/MasterDetail/src/main/res/values/strings.xml +++ b/MasterDetail/src/main/res/values/strings.xml @@ -10,4 +10,5 @@ Details: Title: Item image + Items List diff --git a/OrientationAndSpanning/build.gradle b/OrientationAndSpanning/build.gradle index bb3fa05..db6b0a1 100644 --- a/OrientationAndSpanning/build.gradle +++ b/OrientationAndSpanning/build.gradle @@ -39,5 +39,5 @@ dependencies { testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - implementation 'com.microsoft.device:dualscreen-layout:0.9.0' + implementation 'com.microsoft.device:dualscreen-layout:0.9.2' } diff --git a/TwoPage/build.gradle b/TwoPage/build.gradle index d65f2ab..e8291ee 100644 --- a/TwoPage/build.gradle +++ b/TwoPage/build.gradle @@ -56,5 +56,5 @@ dependencies { androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - implementation 'com.microsoft.device:dualscreen-layout:0.9.0' + implementation 'com.microsoft.device:dualscreen-layout:0.9.2' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6395737..7cda758 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,13 +1,6 @@ -# -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. -# -# - -#Wed Nov 13 13:53:34 CST 2019 +#Wed Apr 08 16:25:58 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip