Skip to content

Commit 3e419fc

Browse files
authored
Release 200924
Merged PR 191: Release 200924
2 parents 1e06f27 + 683394b commit 3e419fc

File tree

128 files changed

+1065
-994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1065
-994
lines changed

CompanionPane/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ android {
1313
buildToolsVersion rootProject.ext.buildToolsVersion
1414

1515
defaultConfig {
16-
applicationId "com.microsoft.device.display.samples.complementarycontext"
16+
applicationId "com.microsoft.device.display.samples.companionpane"
1717
minSdkVersion rootProject.ext.minSdkVersion
1818
targetSdkVersion rootProject.ext.targetSdkVersion
1919
versionCode 1
@@ -27,15 +27,15 @@ dependencies {
2727
implementation kotlinDependencies.kotlinStdlib
2828
implementation androidxDependencies.appCompat
2929
implementation androidxDependencies.constraintLayout
30-
implementation androidxDependencies.recyclerView
31-
implementation androidxDependencies.cardView
32-
implementation androidxDependencies.viewPager2
3330
implementation androidxDependencies.ktxCore
3431
implementation androidxDependencies.ktxFragment
3532

3633
implementation microsoftDependencies.dualScreenLayout
3734

3835
testImplementation testDependencies.junit
36+
3937
androidTestImplementation instrumentationTestDependencies.junit
4038
androidTestImplementation instrumentationTestDependencies.espressoCore
39+
androidTestImplementation instrumentationTestDependencies.uiAutomator
40+
androidTestImplementation instrumentationTestDependencies.testRules
4141
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License.
4+
*
5+
*/
6+
7+
package com.microsoft.device.display.samples.companionpane
8+
9+
import androidx.test.espresso.Espresso.onView
10+
import androidx.test.espresso.assertion.ViewAssertions.matches
11+
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
12+
import androidx.test.espresso.matcher.ViewMatchers.withId
13+
import androidx.test.filters.LargeTest
14+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
15+
import androidx.test.platform.app.InstrumentationRegistry
16+
import androidx.test.rule.ActivityTestRule
17+
import androidx.test.uiautomator.UiDevice
18+
import org.junit.After
19+
import org.junit.Rule
20+
import org.junit.Test
21+
import org.junit.runner.RunWith
22+
23+
@RunWith(AndroidJUnit4ClassRunner::class)
24+
@LargeTest
25+
class LayoutOrientationTest {
26+
27+
private val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
28+
29+
@get:Rule
30+
val activityRule = ActivityTestRule<MainActivity>(MainActivity::class.java)
31+
32+
@After
33+
fun resetOrientation() {
34+
device.setOrientationNatural()
35+
device.unfreezeRotation()
36+
}
37+
38+
@Test
39+
fun shouldFindLayout_whenInSinglePortrait() {
40+
onView(withId(R.id.single_screen_container_id)).check(matches(isDisplayed()))
41+
onView(withId(R.id.single_screen_layout_port)).check(matches(isDisplayed()))
42+
}
43+
44+
@Test
45+
fun shouldFindLayout_whenInSingleLandscape() {
46+
rotateDevice()
47+
48+
onView(withId(R.id.single_screen_container_id)).check(matches(isDisplayed()))
49+
onView(withId(R.id.single_screen_layout_land)).check(matches(isDisplayed()))
50+
}
51+
52+
@Test
53+
fun shouldFindLayouts_whenInDoublePortrait() {
54+
spanApplication()
55+
56+
onView(withId(R.id.dual_screen_start_container_id)).check(matches(isDisplayed()))
57+
onView(withId(R.id.picture_dual_layout)).check(matches(isDisplayed()))
58+
59+
onView(withId(R.id.dual_screen_end_container_id)).check(matches(isDisplayed()))
60+
onView(withId(R.id.tools_dual_layout_land)).check(matches(isDisplayed()))
61+
}
62+
63+
@Test
64+
fun shouldFindLayouts_whenInDoubleLandscape() {
65+
spanApplication()
66+
rotateDevice()
67+
68+
onView(withId(R.id.dual_screen_start_container_id)).check(matches(isDisplayed()))
69+
onView(withId(R.id.picture_dual_layout)).check(matches(isDisplayed()))
70+
71+
onView(withId(R.id.dual_screen_end_container_id)).check(matches(isDisplayed()))
72+
onView(withId(R.id.tools_dual_layout_port)).check(matches(isDisplayed()))
73+
}
74+
75+
@Test
76+
fun shouldFindLayouts_whenSpanningInDoubleLandscape() {
77+
rotateDevice()
78+
spanLandscapeApplication()
79+
80+
onView(withId(R.id.dual_screen_start_container_id)).check(matches(isDisplayed()))
81+
onView(withId(R.id.picture_dual_layout)).check(matches(isDisplayed()))
82+
83+
onView(withId(R.id.dual_screen_end_container_id)).check(matches(isDisplayed()))
84+
onView(withId(R.id.tools_dual_layout_port)).check(matches(isDisplayed()))
85+
}
86+
87+
private fun spanApplication() {
88+
device.swipe(675, 1780, 1350, 900, 400)
89+
}
90+
91+
private fun spanLandscapeApplication() {
92+
device.swipe(1780, 2100, 1350, 1500, 400)
93+
}
94+
95+
private fun rotateDevice() {
96+
device.setOrientationLeft()
97+
}
98+
}

CompanionPane/src/androidTest/java/com/microsoft/device/display/samples/complementarycontext/ExampleInstrumentedTest.kt

Lines changed: 0 additions & 27 deletions
This file was deleted.

CompanionPane/src/main/AndroidManifest.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@
66
-->
77

88
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
9-
xmlns:tools="http://schemas.android.com/tools"
10-
package="com.microsoft.device.display.samples.complementarycontext"
11-
tools:ignore="GoogleAppIndexingWarning">
9+
package="com.microsoft.device.display.samples.companionpane">
1210

1311
<application
1412
android:allowBackup="true"
1513
android:icon="@mipmap/ic_launcher"
1614
android:label="@string/app_name"
1715
android:roundIcon="@mipmap/ic_launcher_round"
1816
android:supportsRtl="true"
19-
android:theme="@style/AppTheme"
20-
tools:ignore="AllowBackup">
21-
<activity android:name=".MainActivity">
17+
android:theme="@style/AppTheme">
18+
<activity android:name="com.microsoft.device.display.samples.companionpane.MainActivity">
2219
<intent-filter>
2320
<action android:name="android.intent.action.MAIN" />
2421

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*/
66

7-
package com.microsoft.device.display.samples.complementarycontextlevel2
7+
package com.microsoft.device.display.samples.companionpane
88

99
import android.os.Bundle
1010
import androidx.appcompat.app.AppCompatActivity

CompanionPane/src/main/java/com/microsoft/device/display/samples/complementarycontext/MainActivity.kt

Lines changed: 0 additions & 70 deletions
This file was deleted.

CompanionPane/src/main/java/com/microsoft/device/display/samples/complementarycontext/adapters/Comparator.kt

Lines changed: 0 additions & 20 deletions
This file was deleted.

CompanionPane/src/main/java/com/microsoft/device/display/samples/complementarycontext/adapters/NotesAdapter.kt

Lines changed: 0 additions & 64 deletions
This file was deleted.

CompanionPane/src/main/java/com/microsoft/device/display/samples/complementarycontext/adapters/SlidesAdapter.kt

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)