Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
f89fbdd
Added shell for JetpackConnectionViewModel
nbradbury Jul 29, 2025
f24afa8
Added shell for JetpackConnectionScreen
nbradbury Jul 29, 2025
1da8df5
Fleshed out JetpackConnectionScreen
nbradbury Jul 29, 2025
f109c50
Minor tweaks
nbradbury Jul 29, 2025
48e308f
Added canInitiateJetpackConnection
nbradbury Jul 29, 2025
3028d88
Updated comment
nbradbury Jul 29, 2025
0490195
Renamed const
nbradbury Jul 30, 2025
a353224
Removed wpApiClient
nbradbury Jul 30, 2025
bd38b37
Added activity shell
nbradbury Jul 30, 2025
d6d3406
Added activity to manifest
nbradbury Jul 30, 2025
57cb010
Handle close
nbradbury Jul 30, 2025
359587f
Pass states rather than the view model
nbradbury Jul 30, 2025
77dd79b
Pass states rather than the view model,p2
nbradbury Jul 30, 2025
07a466f
Dummy code to simulate login
nbradbury Jul 30, 2025
549f36a
Dummy code to simulate login, p2
nbradbury Jul 30, 2025
4914451
Added done button
nbradbury Jul 30, 2025
4e38997
Animate Done button, added Failed status
nbradbury Jul 30, 2025
340f0c6
Use light MaterialTheme.colorScheme.error color background for failed…
nbradbury Jul 30, 2025
266e22e
Animate changes to ConnectionStepItem
nbradbury Jul 30, 2025
08d29b5
Added startNextStep
nbradbury Jul 30, 2025
3522109
Added startNextStep, p2
nbradbury Jul 30, 2025
7526ab3
Added startNextStep, p3
nbradbury Jul 30, 2025
1c57bee
Fixed UI testing
nbradbury Jul 30, 2025
a216f2b
Fixed UI testing, p2
nbradbury Jul 31, 2025
ad9c80c
Changed color for completed and in-progress cards
nbradbury Jul 31, 2025
0cd32b1
Changed color for completed and in-progress cards again
nbradbury Jul 31, 2025
d51e593
Removed elevation and changed card to column
nbradbury Jul 31, 2025
cfb9de5
First pass at Retry
nbradbury Jul 31, 2025
8e22f85
Second pass at Retry
nbradbury Jul 31, 2025
7c8a693
Third pass at Retry
nbradbury Jul 31, 2025
1d727bf
Added error states
nbradbury Jul 31, 2025
f3c01fd
Combined states
nbradbury Jul 31, 2025
2a2bb04
Fixed Detekt errors
nbradbury Jul 31, 2025
910ca9d
Replaced hard-coded hex color values
nbradbury Jul 31, 2025
3018bb8
Minor formatting changes
nbradbury Jul 31, 2025
72d1fae
Minor formatting changes, p2
nbradbury Jul 31, 2025
aca40c2
Minor formatting changes, p3
nbradbury Jul 31, 2025
8067bf9
Updated preview to use JetpackConnectionScreen
nbradbury Jul 31, 2025
371cf40
Simplified ConnectionStepItem
nbradbury Jul 31, 2025
baef6d8
Moved Screen to ScreenWithTopAppBarM3
nbradbury Jul 31, 2025
fcd8289
Added modifier
nbradbury Jul 31, 2025
704d272
Changed two icons
nbradbury Jul 31, 2025
f38f9cf
Fix the done/retry button to the bottom
nbradbury Jul 31, 2025
0f02457
Merge branch 'trunk' into feature/jetpack-connection-ui
nbradbury Jul 31, 2025
abfe805
Removed the heading and changed the screen title
nbradbury Jul 31, 2025
f971848
Merge remote-tracking branch 'origin/feature/jetpack-connection-ui' i…
nbradbury Jul 31, 2025
b622aaf
Increase elevation of in-progress step, remove elevation animation
nbradbury Jul 31, 2025
102a1a2
First pass at confirming cancellation
nbradbury Jul 31, 2025
299fdd7
Second pass at confirming cancellation
nbradbury Jul 31, 2025
b27d45b
Fixed detekt warnings
nbradbury Jul 31, 2025
9c61b93
Fixed detekt warnings
nbradbury Jul 31, 2025
2abbd25
Changed fun name
nbradbury Jul 31, 2025
51a419d
Fixed isActive check
nbradbury Jul 31, 2025
2cc50af
Use ErrorEvent instead of a string
nbradbury Jul 31, 2025
73c615c
Fixed new Detekt warnings
nbradbury Jul 31, 2025
aacf82a
Merge branch 'trunk' into feature/jetpack-connection-ui
nbradbury Jul 31, 2025
06617e0
Renamed variable
nbradbury Jul 31, 2025
dda4f02
Merge branch 'trunk' into feature/jetpack-connection-ui
nbradbury Aug 1, 2025
01a5bcf
Merge branch 'trunk' into feature/jetpack-connection-ui
nbradbury Aug 1, 2025
7b0d8c5
Retry starts at the failed step
nbradbury Aug 1, 2025
085cd57
Moved getNextStep to its own fun
nbradbury Aug 1, 2025
c95b791
Simplified retrying from step
nbradbury Aug 1, 2025
b09e14b
Added optional message to ErrorType
nbradbury Aug 1, 2025
b6ad52c
Updated wp.com error message
nbradbury Aug 1, 2025
4ff348e
Merge branch 'trunk' into feature/jetpack-connection-ui
nbradbury Aug 1, 2025
76b1ebe
Merge remote-tracking branch 'origin/feature/jetpack-connection-ui' i…
nbradbury Aug 1, 2025
29a38d0
Moved color constants to color resources
nbradbury Aug 1, 2025
2ef4e7b
Use existing color resources for in-progress step
nbradbury Aug 1, 2025
b78c454
Don't use !! for selected site
nbradbury Aug 1, 2025
5779ac6
Replaced throwing exception with error() to resolve Detekt warning
nbradbury Aug 1, 2025
9aa7294
Simplified JetpackConnectionViewModel
nbradbury Aug 1, 2025
0506904
Simplified JetpackConnectionScreen
nbradbury Aug 1, 2025
ff65164
Simplified JetpackConnectionActivity
nbradbury Aug 1, 2025
ea9f9e2
Merge branch 'trunk' into feature/jetpack-connection-ui
nbradbury Aug 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions WordPress/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,11 @@
android:name=".ui.jetpackplugininstall.fullplugin.install.JetpackFullPluginInstallActivity"
android:theme="@style/WordPress.NoActionBar" />

<!-- Jetpack connection -->
<activity
android:name=".ui.jetpackconnection.JetpackConnectionActivity"
android:theme="@style/WordPress.NoActionBar" />

<!-- Domain Management -->
<activity
android:name=".ui.domains.management.DomainManagementActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package org.wordpress.android.ui.compose.components

import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import org.wordpress.android.R
import org.wordpress.android.ui.compose.theme.AppThemeM3

/**
* Simple shell for a screen with a top app bar and a close button
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ScreenWithTopAppBarM3(
@StringRes titleRes: Int,
content: @Composable (ColumnScope.() -> Unit),
onCloseClick: () -> Unit,
modifier: Modifier = Modifier
) {
AppThemeM3 {
Scaffold(
topBar = {
TopAppBar(
title = { Text(stringResource(id = titleRes)) },
navigationIcon = {
IconButton(onClick = onCloseClick) {
Icon(Icons.Filled.Close, stringResource(R.string.close))
}
},
)
},
modifier = modifier,
) { contentPadding ->
Column(
modifier = Modifier
.fillMaxSize()
.imePadding()
.padding(contentPadding)
) {
content()
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package org.wordpress.android.ui.jetpackconnection

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.activity.viewModels
import androidx.compose.runtime.collectAsState
import androidx.lifecycle.lifecycleScope
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.launch
import org.wordpress.android.R
import org.wordpress.android.ui.main.BaseAppCompatActivity
import org.wordpress.android.util.extensions.setContent

@AndroidEntryPoint
class JetpackConnectionActivity : BaseAppCompatActivity() {
private val viewModel: JetpackConnectionViewModel by viewModels()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
JetpackConnectionScreen(
currentStep = viewModel.currentStep.collectAsState(),
stepStates = viewModel.stepStates.collectAsState(),
buttonType = viewModel.buttonType.collectAsState(),
onCloseClick = viewModel::onCloseClick,
onRetryClick = viewModel::onRetryClick
)
}

lifecycleScope.launch {
viewModel.uiEvent.filterNotNull().collect { event ->
when (event) {
JetpackConnectionViewModel.UiEvent.Close -> finish()
JetpackConnectionViewModel.UiEvent.ShowCancelConfirmation -> showCancelConfirmationDialog()
}
}
}
}

private fun showCancelConfirmationDialog() {
MaterialAlertDialogBuilder(this)
.setTitle(R.string.jetpack_connection_cancel_title)
.setMessage(R.string.jetpack_connection_cancel_message)
.setPositiveButton(R.string.yes) { _, _ -> viewModel.onCancelConfirmed() }
.setNegativeButton(R.string.no) { _, _ -> viewModel.onCancelDismissed() }
.setCancelable(false)
.show()
}

companion object {
@JvmStatic
fun createIntent(context: Context) =
Intent(context, JetpackConnectionActivity::class.java)
}
}
Loading