diff --git a/changelog.d/6958.feature b/changelog.d/6958.feature new file mode 100644 index 0000000000..b508ff19a9 --- /dev/null +++ b/changelog.d/6958.feature @@ -0,0 +1 @@ +[App Layout] New App Layout is enabled by default diff --git a/vector/src/androidTest/java/im/vector/app/ui/robot/ElementRobot.kt b/vector/src/androidTest/java/im/vector/app/ui/robot/ElementRobot.kt index b6fbfc23ab..528589d616 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/robot/ElementRobot.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/robot/ElementRobot.kt @@ -33,12 +33,16 @@ import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickD import com.adevinta.android.barista.interaction.BaristaDrawerInteractions.openDrawer import im.vector.app.EspressoHelper import im.vector.app.R +import im.vector.app.espresso.tools.clickOnPreference import im.vector.app.espresso.tools.waitUntilActivityVisible import im.vector.app.espresso.tools.waitUntilDialogVisible import im.vector.app.espresso.tools.waitUntilViewVisible +import im.vector.app.features.DefaultVectorFeatures +import im.vector.app.features.VectorFeatures import im.vector.app.features.createdirect.CreateDirectRoomActivity import im.vector.app.features.home.HomeActivity import im.vector.app.features.onboarding.OnboardingActivity +import im.vector.app.features.settings.VectorSettingsActivity import im.vector.app.initialSyncIdlingResource import im.vector.app.ui.robot.settings.SettingsRobot import im.vector.app.ui.robot.settings.labs.LabFeature @@ -48,6 +52,8 @@ import timber.log.Timber class ElementRobot { + var features: VectorFeatures = DefaultVectorFeatures() + fun onboarding(block: OnboardingRobot.() -> Unit) { block(OnboardingRobot()) } @@ -73,7 +79,7 @@ class ElementRobot { val activity = EspressoHelper.getCurrentActivity()!! val uiSession = (activity as HomeActivity).activeSessionHolder.getActiveSession() withIdlingResource(initialSyncIdlingResource(uiSession)) { - waitUntilViewVisible(withId(R.id.bottomNavigationView)) + waitUntilViewVisible(withId(R.id.roomListContainer)) } } @@ -82,7 +88,7 @@ class ElementRobot { clickOn(R.id.homeDrawerHeaderSettingsView) block(SettingsRobot()) if (shouldGoBack) pressBack() - waitUntilViewVisible(withId(R.id.bottomNavigationView)) + waitUntilViewVisible(withId(R.id.roomListContainer)) } fun newDirectMessage(block: NewDirectMessageRobot.() -> Unit) { @@ -94,19 +100,19 @@ class ElementRobot { closeSoftKeyboard() block(NewDirectMessageRobot()) pressBack() - waitUntilViewVisible(withId(R.id.bottomNavigationView)) + waitUntilViewVisible(withId(R.id.roomListContainer)) } fun newRoom(block: NewRoomRobot.() -> Unit) { clickOn(R.id.bottom_action_rooms) RoomListRobot().newRoom { block() } - waitUntilViewVisible(withId(R.id.bottomNavigationView)) + waitUntilViewVisible(withId(R.id.roomListContainer)) } fun roomList(block: RoomListRobot.() -> Unit) { clickOn(R.id.bottom_action_rooms) block(RoomListRobot()) - waitUntilViewVisible(withId(R.id.bottomNavigationView)) + waitUntilViewVisible(withId(R.id.roomListContainer)) } fun toggleLabFeature(labFeature: LabFeature) { @@ -146,8 +152,17 @@ class ElementRobot { } fun signout(expectSignOutWarning: Boolean) { - clickOn(R.id.groupToolbarAvatarImageView) - clickOn(R.id.homeDrawerHeaderSignoutView) + if (features.isNewAppLayoutEnabled()) { + onView(withId((R.id.avatar))) + .perform(click()) + waitUntilActivityVisible { + clickOn(R.string.settings_general_title) + } + clickOnPreference(R.string.action_sign_out) + } else { + clickOn(R.id.groupToolbarAvatarImageView) + clickOn(R.id.homeDrawerHeaderSignoutView) + } val isShowingSignOutWarning = kotlin.runCatching { waitUntilViewVisible(withId(R.id.exitAnywayButton)) diff --git a/vector/src/main/java/im/vector/app/features/VectorFeatures.kt b/vector/src/main/java/im/vector/app/features/VectorFeatures.kt index e60b225689..951cca6735 100644 --- a/vector/src/main/java/im/vector/app/features/VectorFeatures.kt +++ b/vector/src/main/java/im/vector/app/features/VectorFeatures.kt @@ -50,6 +50,6 @@ class DefaultVectorFeatures : VectorFeatures { override fun isLocationSharingEnabled() = Config.ENABLE_LOCATION_SHARING override fun forceUsageOfOpusEncoder(): Boolean = false override fun shouldStartDmOnFirstMessage(): Boolean = false - override fun isNewAppLayoutEnabled(): Boolean = false + override fun isNewAppLayoutEnabled(): Boolean = true override fun isNewDeviceManagementEnabled(): Boolean = false }