Skip to content

Commit 2fa2522

Browse files
committed
Merge branch 'trunk' of github.com:wordpress-mobile/WordPress-Android into analysis/detekt-fine-tune-default-rules
2 parents 7289664 + ed65f17 commit 2fa2522

85 files changed

Lines changed: 1380 additions & 1458 deletions

File tree

Some content is hidden

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

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/WordPress/src/androidTest/ @wordpress-mobile/mobile-ui-testing-squad

RELEASE-NOTES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
20.5
44
-----
5-
5+
* [*] Use larger thumbnail previews for recommended themes during site creation [https://github.com/wordpress-mobile/WordPress-Android/pull/16848]
6+
* [*] Jetpack App: Use the Jetpack green color for the skip buttons text in site creation [https://github.com/wordpress-mobile/WordPress-Android/pull/16994]
67

78
20.4
89
-----

WordPress/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ android {
109109
buildConfigField "boolean", "SITE_NAME", "false"
110110
buildConfigField "boolean", "LAND_ON_THE_EDITOR", "false"
111111
buildConfigField "boolean", "BLOGGING_PROMPTS", "false"
112-
buildConfigField "boolean", "MY_SITE_DEFAULT_TAB_EXPERIMENT", "false"
113-
buildConfigField "boolean", "MY_SITE_DEFAULT_TAB_EXPERIMENT_VARIANT_DASHBOARD", "false"
114112
buildConfigField "boolean", "STATS_REVAMP_V2", "false"
115113
buildConfigField "boolean", "QUICK_START_EXISTING_USERS_V2", "false"
116114
buildConfigField "boolean", "QRCODE_AUTH_FLOW", "false"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.wordpress.android
2+
3+
import androidx.lifecycle.ProcessLifecycleOwner
4+
import dagger.hilt.android.testing.HiltAndroidTest
5+
import org.junit.Assert.assertFalse
6+
import org.junit.Test
7+
import org.wordpress.android.AppInitializer.ApplicationLifecycleMonitor
8+
import org.wordpress.android.support.BaseTest
9+
10+
/**
11+
* This tests if [ProcessLifecycleOwner] observer works at the app startup.
12+
*
13+
* [WordPress.appIsInTheBackground] is set to false when [ApplicationLifecycleMonitor.onAppComesFromBackground] is
14+
* called.
15+
*/
16+
@HiltAndroidTest
17+
class AppInitializerTest : BaseTest() {
18+
@Test
19+
fun verifyOnAppComesFromBackgroundCalled() {
20+
assertFalse(WordPress.appIsInTheBackground)
21+
}
22+
}

WordPress/src/androidTest/java/org/wordpress/android/e2e/pages/MySitesPage.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public void goToBackup() {
175175
public StatsPage goToStats() {
176176
goToMenuTab();
177177
clickQuickActionOrSiteMenuItem(R.id.quick_action_stats_button, R.string.stats);
178+
idleFor(4000);
178179
dismissJetpackAdIfPresent();
179180
waitForElementToBeDisplayedWithoutFailure(R.id.tabLayout);
180181

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="UnusedResources">
4+
5+
<!-- Site creation -->
6+
<color name="site_creation_skip_button_text">@color/jetpack_green_40</color>
7+
</resources>

WordPress/src/jetpack/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@
2626

2727
<!-- About button in Me -->
2828
<string name="me_btn_about">About Jetpack</string>
29+
30+
<!-- My Site Initial Tab Default value -->
31+
<string name="initial_screen_entry_value_default_key" translatable="false">@string/initial_screen_entry_value_home</string>
2932
</resources>

WordPress/src/main/java/org/wordpress/android/AppInitializer.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import org.wordpress.android.support.ZendeskHelper
8181
import org.wordpress.android.ui.ActivityId
8282
import org.wordpress.android.ui.debug.cookies.DebugCookieManager
8383
import org.wordpress.android.ui.mysite.SelectedSiteRepository
84-
import org.wordpress.android.ui.mysite.tabs.MySiteDefaultTabExperiment
8584
import org.wordpress.android.ui.notifications.SystemNotificationsTracker
8685
import org.wordpress.android.ui.notifications.services.NotificationsUpdateServiceStarter
8786
import org.wordpress.android.ui.notifications.utils.NotificationsUtils
@@ -153,7 +152,6 @@ class AppInitializer @Inject constructor(
153152
@Inject lateinit var debugCookieManager: DebugCookieManager
154153
@Inject @Named(APPLICATION_SCOPE) lateinit var appScope: CoroutineScope
155154
@Inject lateinit var selectedSiteRepository: SelectedSiteRepository
156-
@Inject lateinit var mySiteDefaultTabExperiment: MySiteDefaultTabExperiment
157155

158156
// For development and production `AnalyticsTrackerNosara`, for testing a mocked `Tracker` will be injected.
159157
@Inject lateinit var tracker: Tracker
@@ -307,8 +305,6 @@ class AppInitializer @Inject constructor(
307305

308306
debugCookieManager.sync()
309307

310-
initAnalyticsExperimentPropertiesIfNeeded()
311-
312308
initialized = true
313309
}
314310

@@ -682,11 +678,6 @@ class AppInitializer @Inject constructor(
682678
EmojiCompat.init(config)
683679
}
684680

685-
/* If default tab experiment is running, pass along to tracker */
686-
private fun initAnalyticsExperimentPropertiesIfNeeded() {
687-
mySiteDefaultTabExperiment.checkAndSetTrackingPropertiesIfNeeded()
688-
}
689-
690681
@Suppress("unused")
691682
@OnLifecycleEvent(Lifecycle.Event.ON_START)
692683
fun onAppComesFromBackground() {

WordPress/src/main/java/org/wordpress/android/ui/accounts/LoginEpilogueViewModel.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import androidx.lifecycle.LiveData
44
import androidx.lifecycle.MediatorLiveData
55
import androidx.lifecycle.ViewModel
66
import org.wordpress.android.fluxc.store.SiteStore
7-
import org.wordpress.android.ui.mysite.tabs.MySiteDefaultTabExperiment
87
import org.wordpress.android.ui.prefs.AppPrefsWrapper
98
import org.wordpress.android.util.BuildConfigWrapper
109
import org.wordpress.android.viewmodel.Event
@@ -14,8 +13,7 @@ import javax.inject.Inject
1413
class LoginEpilogueViewModel @Inject constructor(
1514
private val appPrefsWrapper: AppPrefsWrapper,
1615
private val buildConfigWrapper: BuildConfigWrapper,
17-
private val siteStore: SiteStore,
18-
private val mySiteDefaultTabExperiment: MySiteDefaultTabExperiment
16+
private val siteStore: SiteStore
1917
) : ViewModel() {
2018
private val _navigationEvents = MediatorLiveData<Event<LoginNavigationEvents>>()
2119
val navigationEvents: LiveData<Event<LoginNavigationEvents>> = _navigationEvents
@@ -32,10 +30,6 @@ class LoginEpilogueViewModel @Inject constructor(
3230
if (!siteStore.hasSite()) handleNoSitesFound() else handleSitesFound()
3331
}
3432

35-
fun checkAndSetVariantForMySiteDefaultTabExperiment() {
36-
mySiteDefaultTabExperiment.checkAndSetVariantIfNeeded()
37-
}
38-
3933
private fun handleNoSitesFound() {
4034
if (buildConfigWrapper.isJetpackApp && !buildConfigWrapper.isSiteCreationEnabled) {
4135
_navigationEvents.postValue(Event(LoginNavigationEvents.ShowNoJetpackSites))

WordPress/src/main/java/org/wordpress/android/ui/accounts/login/LoginEpilogueFragment.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
173173
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
174174
super.onActivityCreated(savedInstanceState);
175175
if (savedInstanceState == null) {
176-
mParentViewModel.checkAndSetVariantForMySiteDefaultTabExperiment();
177176
AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_EPILOGUE_VIEWED);
178177
mUnifiedLoginTracker.track(Step.SUCCESS);
179178
}

0 commit comments

Comments
 (0)