Skip to content

Commit

Permalink
Merge branch 'trunk' into feat/automatically-retry-pending-media-uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
derekblank authored Dec 27, 2023
2 parents 3fb85a3 + 70eb2d9 commit d459991
Show file tree
Hide file tree
Showing 135 changed files with 1,435 additions and 1,369 deletions.
3 changes: 2 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
24.0
-----
* [*] Filter media types when sharing files to the editor [https://github.com/wordpress-mobile/WordPress-Android/pull/19754]
* [**] The block editor now automatically retries failed media uploads when network connectivity is re-established. [https://github.com/wordpress-mobile/WordPress-Android/pull/19803]
* [***] [Jetpack-only] Plans: Upgrade to a Plan from domains dashboard in Jetpack app [https://github.com/wordpress-mobile/WordPress-Android/pull/19818]
* [**] [internal] Removes unused resources and code [https://github.com/wordpress-mobile/WordPress-Android/pull/19788]

23.9
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ private void navigateMySite() {

waitForElementToBeDisplayedWithoutFailure(R.id.recycler_view);

if (isElementDisplayed(R.id.tooltip_message)) {
clickOn(R.id.tooltip_message);
}

takeScreenshot("4-keep-tabs-on-your-site");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -23,11 +24,11 @@ import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.fragment.app.Fragment
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.fragment.app.viewModels
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.isActive
import org.wordpress.android.R
import org.wordpress.android.ui.accounts.login.components.JetpackLogo
import org.wordpress.android.ui.accounts.login.components.WordpressJetpackLogo
import org.wordpress.android.ui.accounts.login.components.LoopingTextWithBackground
import org.wordpress.android.ui.accounts.login.components.PrimaryButton
import org.wordpress.android.ui.accounts.login.components.SecondaryButton
Expand All @@ -42,6 +43,7 @@ val LocalPosition = compositionLocalOf { 0f }
@AndroidEntryPoint
class LoginPrologueRevampedFragment : Fragment() {
private lateinit var loginPrologueListener: LoginPrologueListener
private val viewModel by viewModels<LoginPrologueRevampedViewModel>()

override fun onCreateView(
inflater: LayoutInflater,
Expand All @@ -50,10 +52,16 @@ class LoginPrologueRevampedFragment : Fragment() {
) = ComposeView(requireContext()).apply {
setContent {
AppTheme {
PositionProvider {
PositionProvider(viewModel) {
LoginScreenRevamped(
onWpComLoginClicked = loginPrologueListener::showEmailLoginScreen,
onSiteAddressLoginClicked = loginPrologueListener::loginViaSiteAddress,
onWpComLoginClicked = {
viewModel.onWpComLoginClicked()
loginPrologueListener.showEmailLoginScreen()
},
onSiteAddressLoginClicked = {
viewModel.onSiteAddressLoginClicked()
loginPrologueListener.loginViaSiteAddress()
},
)
}
}
Expand Down Expand Up @@ -88,7 +96,7 @@ class LoginPrologueRevampedFragment : Fragment() {
*/
@Composable
private fun PositionProvider(
viewModel: LoginPrologueRevampedViewModel = viewModel(),
viewModel: LoginPrologueRevampedViewModel,
content: @Composable () -> Unit
) {
val position = viewModel.positionData.observeAsState(0f)
Expand Down Expand Up @@ -118,10 +126,10 @@ private fun LoginScreenRevamped(
Box {
LoopingTextWithBackground()
TopLinearGradient()
JetpackLogo(
WordpressJetpackLogo(
modifier = Modifier
.padding(top = 60.dp)
.size(60.dp)
.padding(top = 135.dp)
.width(132.dp)
.align(Alignment.TopCenter)
)
ColumnWithFrostedGlassBackground(
Expand All @@ -141,6 +149,7 @@ private fun LoginScreenRevamped(

@Preview(showBackground = true, device = Devices.PIXEL_4_XL)
@Preview(showBackground = true, device = Devices.PIXEL_4_XL, uiMode = UI_MODE_NIGHT_YES)
@Preview(showBackground = true, device = Devices.TABLET)
@Composable
fun PreviewLoginScreenRevamped() {
AppTheme {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import dagger.hilt.android.qualifiers.ApplicationContext
import org.wordpress.android.analytics.AnalyticsTracker.Stat.LOGIN_PROLOGUE_VIEWED
import org.wordpress.android.ui.accounts.UnifiedLoginTracker
import org.wordpress.android.ui.accounts.UnifiedLoginTracker.Click
import org.wordpress.android.ui.accounts.UnifiedLoginTracker.Flow
import org.wordpress.android.ui.accounts.UnifiedLoginTracker.Step
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import javax.inject.Inject
import kotlin.math.PI

Expand All @@ -33,6 +39,8 @@ private const val DEFAULT_PITCH = (-30 * PI / 180).toFloat()

@HiltViewModel
class LoginPrologueRevampedViewModel @Inject constructor(
private val unifiedLoginTracker: UnifiedLoginTracker,
analyticsTrackerWrapper: AnalyticsTrackerWrapper,
@ApplicationContext appContext: Context,
) : ViewModel() {
private val accelerometerData = FloatArray(3)
Expand All @@ -41,6 +49,11 @@ class LoginPrologueRevampedViewModel @Inject constructor(
private val orientationAngles = floatArrayOf(0f, DEFAULT_PITCH, 0f)
private var position = 0f

init {
analyticsTrackerWrapper.track(stat = LOGIN_PROLOGUE_VIEWED)
unifiedLoginTracker.track(flow = Flow.PROLOGUE, step = Step.PROLOGUE)
}

/**
* This function updates the physics model for the interactive animation by applying the elapsed time (in seconds)
* to update the velocity and position.
Expand All @@ -62,6 +75,14 @@ class LoginPrologueRevampedViewModel @Inject constructor(
}
}

fun onWpComLoginClicked() {
unifiedLoginTracker.trackClick(Click.CONTINUE_WITH_WORDPRESS_COM)
}

fun onSiteAddressLoginClicked() {
unifiedLoginTracker.trackClick(Click.LOGIN_WITH_SITE_ADDRESS)
}

/**
* This LiveData responds to orientation data to calculate the pitch of the device. This is then used to update the
* velocity and position for each frame.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.wordpress.android.R
import org.wordpress.android.ui.compose.unit.Margin

Expand All @@ -38,9 +39,8 @@ fun PrimaryButton(
) {
Text(
text = stringResource(R.string.continue_with_wpcom_no_signup),
style = TextStyle(
fontWeight = FontWeight.SemiBold,
),
style = TextStyle(fontWeight = FontWeight.Medium, fontSize = 16.sp),
modifier = Modifier.padding(vertical = 8.dp),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.wordpress.android.R

@Composable
Expand All @@ -38,9 +39,8 @@ fun SecondaryButton(
) {
Text(
text = stringResource(R.string.enter_your_site_address),
style = TextStyle(
fontWeight = FontWeight.Medium,
),
style = TextStyle(fontWeight = FontWeight.Normal, fontSize = 16.sp),
modifier = Modifier.padding(vertical = 8.dp),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fun TopLinearGradient(modifier: Modifier = Modifier) {
contentScale = ContentScale.FillBounds,
modifier = modifier
.fillMaxWidth()
.fillMaxHeight(0.62f)
.fillMaxHeight(0.82f)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import androidx.compose.ui.res.stringResource
import org.wordpress.android.R

@Composable
fun JetpackLogo(modifier: Modifier = Modifier) {
fun WordpressJetpackLogo(modifier: Modifier = Modifier) {
Image(
painter = painterResource(R.drawable.ic_jetpack_logo_green_24dp),
painter = painterResource(R.drawable.ic_wordpress_jetpack_welcome),
contentDescription = stringResource(
R.string.login_prologue_revamped_content_description_jetpack_logo
),
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="133dp"
android:height="80dp"
android:viewportWidth="133"
android:viewportHeight="80">
<path
android:pathData="M40,0L40,0A40,40 0,0 1,79.99 40L79.99,40A40,40 0,0 1,40 80L40,80A40,40 0,0 1,0 40L0,40A40,40 0,0 1,40 0z"
android:fillColor="#3858E9"/>
<path
android:pathData="m50.48,58.04 l6.38,-18.45c1.19,-2.98 1.59,-5.36 1.59,-7.48 0,-0.77 -0.05,-1.48 -0.14,-2.15 1.63,2.97 2.56,6.39 2.56,10.02 0,7.71 -4.18,14.44 -10.39,18.06v0zM42.85,30.18c1.26,-0.07 2.39,-0.2 2.39,-0.2 1.12,-0.13 0.99,-1.79 -0.13,-1.72 0,0 -3.38,0.26 -5.57,0.26 -2.06,0 -5.5,-0.26 -5.5,-0.26 -1.13,-0.07 -1.26,1.66 -0.13,1.72 0,0 1.07,0.13 2.19,0.2l3.25,8.92 -4.57,13.72 -7.61,-22.64c1.26,-0.07 2.39,-0.2 2.39,-0.2 1.12,-0.13 0.99,-1.79 -0.13,-1.72 0,0 -3.38,0.26 -5.57,0.26 -0.39,0 -0.85,-0.01 -1.35,-0.02 3.74,-5.66 10.16,-9.41 17.46,-9.41 5.44,0 10.39,2.08 14.11,5.49 -0.09,-0 -0.18,-0.02 -0.27,-0.02 -2.06,0 -3.51,1.79 -3.51,3.71 0,1.72 0.99,3.18 2.06,4.9 0.79,1.39 1.72,3.18 1.72,5.76 0,1.79 -0.53,4.04 -1.59,6.76l-2.09,6.97 -7.55,-22.46v-0.01h-0zM39.97,60.88c-2.05,0 -4.03,-0.31 -5.9,-0.85l6.27,-18.22 6.43,17.6c0.04,0.1 0.09,0.2 0.15,0.29 -2.17,0.76 -4.51,1.18 -6.94,1.18h-0zM19.08,39.97c0,-3.03 0.65,-5.9 1.81,-8.51l9.97,27.31c-6.97,-3.39 -11.77,-10.53 -11.77,-18.81zM39.97,16.74c-12.81,0 -23.24,10.43 -23.24,23.24 0,12.81 10.43,23.24 23.24,23.24s23.24,-10.43 23.24,-23.24c0,-12.81 -10.42,-23.24 -23.24,-23.24z"
android:fillColor="#fff"
android:fillType="evenOdd"
tools:ignore="VectorPath"/>
<path
android:pathData="M92.35,0L92.35,0A40,40 0,0 1,132.35 40L132.35,40A40,40 0,0 1,92.35 80L92.35,80A40,40 0,0 1,52.35 40L52.35,40A40,40 0,0 1,92.35 0z"
android:fillColor="#069E08"/>
<path
android:pathData="M92.35,11.77L92.35,11.77A28.23,28.23 0,0 1,120.58 40L120.58,40A28.23,28.23 0,0 1,92.35 68.24L92.35,68.24A28.23,28.23 0,0 1,64.11 40L64.11,40A28.23,28.23 0,0 1,92.35 11.77z"
android:fillColor="#069E08"/>
<path
android:pathData="m92.3,16.71c-12.8,0 -23.24,10.41 -23.24,23.24 0,12.83 10.41,23.24 23.24,23.24 12.83,0 23.24,-10.41 23.24,-23.24 0,-12.83 -10.41,-23.24 -23.24,-23.24zM91.1,43.8h-11.58l11.58,-22.53v22.53zM93.47,58.57v-22.53h11.55l-11.55,22.53z"
android:fillColor="#fff"/>
</vector>
20 changes: 10 additions & 10 deletions WordPress/src/jetpack/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
<color name="site_creation_skip_button_text">@color/jetpack_green_40</color>

<!-- Login Prologue Revamped -->
<color name="bg_jetpack_login_splash">@color/jetpack_green_100</color>
<color name="bg_jetpack_login_splash">@color/wordpress_blue_100</color>

<color name="bg_jetpack_login_splash_primary_button">@color/jetpack_green_0</color>
<color name="text_color_jetpack_login_splash_primary_button">@color/jetpack_green_80</color>
<color name="bg_jetpack_login_splash_primary_button">#3858E9</color>
<color name="text_color_jetpack_login_splash_primary_button">@color/white</color>
<color name="text_color_jetpack_login_splash_secondary_button">@color/white</color>

<color name="bg_jetpack_login_splash_bottom_panel">#99011D0A</color>
<color name="bg_jetpack_login_splash_bottom_panel">#CC050A21</color>
<color name="border_top_jetpack_login_splash_bottom_panel">#08FFFFFF</color>

<color name="bg_jetpack_login_splash_top_gradient_1">#FC001C09</color>
<color name="bg_jetpack_login_splash_top_gradient_2">#FA001C09</color>
<color name="bg_jetpack_login_splash_top_gradient_3">#D9001C09</color>
<color name="bg_jetpack_login_splash_top_gradient_4">#00001C09</color>
<color name="bg_jetpack_login_splash_top_gradient_1">#050A21</color>
<color name="bg_jetpack_login_splash_top_gradient_2">#E6050A21</color>
<color name="bg_jetpack_login_splash_top_gradient_3">#E6050A21</color>
<color name="bg_jetpack_login_splash_top_gradient_4">#00050A21</color>

<color name="text_color_jetpack_login_label_primary">@color/jetpack_green_20</color>
<color name="text_color_jetpack_login_label_secondary">@color/jetpack_green_50</color>
<color name="text_color_jetpack_login_label_primary">#3858E9</color>
<color name="text_color_jetpack_login_label_secondary">@color/jetpack_green_40</color>
</resources>
18 changes: 9 additions & 9 deletions WordPress/src/jetpack/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
<!-- Login Prologue Revamped -->
<color name="bg_jetpack_login_splash">@color/jetpack_green_0</color>

<color name="bg_jetpack_login_splash_primary_button">@color/jetpack_green_50</color>
<color name="bg_jetpack_login_splash_primary_button">#3858E9</color>
<color name="text_color_jetpack_login_splash_primary_button">@color/white</color>
<color name="text_color_jetpack_login_splash_secondary_button">@color/jetpack_green_90</color>
<color name="text_color_jetpack_login_splash_secondary_button">@color/wordpress_blue_100</color>

<color name="bg_jetpack_login_splash_bottom_panel">#99F1F3EC</color>
<color name="bg_jetpack_login_splash_bottom_panel">#CCF1F3EC</color>
<color name="border_top_jetpack_login_splash_bottom_panel">#0D000000</color>

<color name="bg_jetpack_login_splash_top_gradient_1">#FCF1F3EC</color>
<color name="bg_jetpack_login_splash_top_gradient_2">#FAF1F3EC</color>
<color name="bg_jetpack_login_splash_top_gradient_3">#D9F1F3EC</color>
<color name="bg_jetpack_login_splash_top_gradient_4">#00F1F3EC</color>
<color name="bg_jetpack_login_splash_top_gradient_1">#FCFFFFFF</color>
<color name="bg_jetpack_login_splash_top_gradient_2">#FAFFFFFF</color>
<color name="bg_jetpack_login_splash_top_gradient_3">#D9FFFFFF</color>
<color name="bg_jetpack_login_splash_top_gradient_4">#00FFFFFF</color>

<color name="text_color_jetpack_login_label_primary">#80008710</color>
<color name="text_color_jetpack_login_label_secondary">@color/jetpack_green_50</color>
<color name="text_color_jetpack_login_label_primary">#3858E9</color>
<color name="text_color_jetpack_login_label_secondary">@color/jetpack_green_40</color>

</resources>
8 changes: 6 additions & 2 deletions WordPress/src/jetpack/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
<string name="login_prologue_revamped_jetpack_feature_text_6">Respond to comments</string>
<string name="login_prologue_revamped_jetpack_feature_text_7">Restore a backup</string>
<string name="login_prologue_revamped_jetpack_feature_text_8">Search for plugins</string>
<string name="login_prologue_revamped_jetpack_feature_text_9">Share on Facebook</string>
<string name="login_prologue_revamped_jetpack_feature_text_9">Share on social</string>
<string name="login_prologue_revamped_jetpack_feature_text_10">Fix a security issue</string>
<string name="login_prologue_revamped_jetpack_feature_text_11">Post a photo</string>
<string name="login_prologue_revamped_jetpack_feature_text_12">Add an author</string>
<string name="login_prologue_revamped_jetpack_feature_text_12">Read other blogs</string>
<string name="login_prologue_revamped_jetpack_feature_text_13">Build an audience</string>
<string name="login_prologue_revamped_jetpack_feature_text_14">Post a photo</string>
<string name="login_prologue_revamped_jetpack_feature_text_15">Write from anywhere</string>
<string name="login_prologue_revamped_jetpack_feature_text_16">Manage your domains</string>

<!-- Login Magic Link -->
<string name="login_magic_links_sent_label">Check your email on this device and tap the link in the email you received from Jetpack.com.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@
<item>@string/login_prologue_revamped_jetpack_feature_text_10</item>
<item>@string/login_prologue_revamped_jetpack_feature_text_11</item>
<item>@string/login_prologue_revamped_jetpack_feature_text_12</item>
<item>@string/login_prologue_revamped_jetpack_feature_text_13</item>
<item>@string/login_prologue_revamped_jetpack_feature_text_14</item>
<item>@string/login_prologue_revamped_jetpack_feature_text_15</item>
<item>@string/login_prologue_revamped_jetpack_feature_text_16</item>
</string-array>
</resources>
Loading

0 comments on commit d459991

Please sign in to comment.