Skip to content

Commit a258fa0

Browse files
committed
Merge remote-tracking branch 'origin/trunk' into merge/25.0-final-into-trunk
2 parents a7adeb7 + e56dcc8 commit a258fa0

File tree

95 files changed

+1637
-757
lines changed

Some content is hidden

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

95 files changed

+1637
-757
lines changed

.buildkite/beta-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
common_params:
66
# Common plugin settings to use with the `plugins` key.
77
- &common_plugins
8-
- automattic/a8c-ci-toolkit#2.17.0
8+
- automattic/a8c-ci-toolkit#3.4.2
99

1010
steps:
1111
#################

.buildkite/code-freeze.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
common_params:
33
# Common plugin settings to use with the `plugins` key.
44
- &common_plugins
5-
- automattic/a8c-ci-toolkit#2.17.0
5+
- automattic/a8c-ci-toolkit#3.4.2
66

77
steps:
88
- label: "Code Freeze"

.buildkite/complete-code-freeze.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
common_params:
33
# Common plugin settings to use with the `plugins` key.
44
- &common_plugins
5-
- automattic/a8c-ci-toolkit#2.17.0
5+
- automattic/a8c-ci-toolkit#3.4.2
66

77
steps:
88
- label: "Complete Code Freeze"

.buildkite/finalize-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
common_params:
33
# Common plugin settings to use with the `plugins` key.
44
- &common_plugins
5-
- automattic/a8c-ci-toolkit#2.17.0
5+
- automattic/a8c-ci-toolkit#3.4.2
66

77
steps:
88
- label: "Finalize release"

.buildkite/new-beta-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
common_params:
33
# Common plugin settings to use with the `plugins` key.
44
- &common_plugins
5-
- automattic/a8c-ci-toolkit#2.17.0
5+
- automattic/a8c-ci-toolkit#3.4.2
66

77
steps:
88
- label: "New Beta Release"

.buildkite/pipeline.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
common_params:
33
# Common plugin settings to use with the `plugins` key.
44
- &ci_toolkit
5-
automattic/a8c-ci-toolkit#2.18.2
5+
automattic/a8c-ci-toolkit#3.4.2
66
- &test_collector
77
test-collector#v1.8.0
88
- &test_collector_common_params

.buildkite/release-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
common_params:
66
# Common plugin settings to use with the `plugins` key.
77
- &common_plugins
8-
- automattic/a8c-ci-toolkit#2.17.0
8+
- automattic/a8c-ci-toolkit#3.4.2
99

1010
steps:
1111
#################

.buildkite/update-release-notes.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
common_params:
33
# Common plugin settings to use with the `plugins` key.
44
- &common_plugins
5-
- automattic/a8c-ci-toolkit#2.17.0
5+
- automattic/a8c-ci-toolkit#3.4.2
66

77
steps:
88
- label: "Update release notes"

.github/workflows/run-danger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
dangermattic:
99
if: ${{ (github.event.pull_request.draft == false) }}
10-
uses: Automattic/dangermattic/.github/workflows/[email protected].0
10+
uses: Automattic/dangermattic/.github/workflows/[email protected].2
1111
with:
1212
org-slug: "automattic"
1313
pipeline-slug: "wordpress-android"

.github/workflows/validate-issues.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
check-labels-on-issues:
9-
uses: Automattic/dangermattic/.github/workflows/reusable-check-labels-on-issues.yml@v1.0.0
9+
uses: Automattic/dangermattic/.github/workflows/reusable-check-labels-on-issues.yml@v1.1.2
1010
with:
1111
label-format-list: '[
1212
"^\[.+\]",

Gemfile.lock

+11-9
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ GEM
6969
no_proxy_fix
7070
octokit (>= 4.0)
7171
terminal-table (>= 1, < 4)
72-
danger-dangermattic (1.0.2)
72+
danger-dangermattic (1.1.1)
7373
danger (~> 9.4)
7474
danger-plugin-api (~> 1.0)
75-
danger-rubocop (~> 0.12)
76-
rubocop (~> 1.61)
75+
danger-rubocop (~> 0.13)
76+
rubocop (~> 1.63)
7777
danger-plugin-api (1.0.0)
7878
danger (> 2.0)
79-
danger-rubocop (0.12.0)
79+
danger-rubocop (0.13.0)
8080
danger
8181
rubocop (~> 1.0)
8282
declarative (0.0.20)
@@ -259,30 +259,31 @@ GEM
259259
optparse (0.4.0)
260260
os (1.1.4)
261261
parallel (1.24.0)
262-
parser (3.3.1.0)
262+
parser (3.3.2.0)
263263
ast (~> 2.4.1)
264264
racc
265265
plist (3.7.1)
266266
progress_bar (1.3.3)
267267
highline (>= 1.6, < 3)
268268
options (~> 2.3.0)
269269
public_suffix (5.0.5)
270-
racc (1.7.3)
270+
racc (1.8.0)
271271
rainbow (3.1.1)
272272
rake (13.2.1)
273273
rake-compiler (1.2.7)
274274
rake
275275
rchardet (1.8.0)
276-
regexp_parser (2.9.1)
276+
regexp_parser (2.9.2)
277277
representable (3.2.0)
278278
declarative (< 0.1.0)
279279
trailblazer-option (>= 0.1.1, < 0.2.0)
280280
uber (< 0.2.0)
281281
retriable (3.1.2)
282-
rexml (3.2.6)
282+
rexml (3.2.8)
283+
strscan (>= 3.0.9)
283284
rmagick (4.3.0)
284285
rouge (2.0.7)
285-
rubocop (1.63.5)
286+
rubocop (1.64.1)
286287
json (~> 2.3)
287288
language_server-protocol (>= 3.17.0)
288289
parallel (~> 1.10)
@@ -310,6 +311,7 @@ GEM
310311
simctl (1.6.10)
311312
CFPropertyList
312313
naturally
314+
strscan (3.1.0)
313315
terminal-notifier (2.0.0)
314316
terminal-table (3.0.2)
315317
unicode-display_width (>= 1.1.1, < 3)

README.md

+7-33
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,8 @@ If you're a developer wanting to contribute, read on.
1616

1717
Notes:
1818

19-
* To use WordPress.com features (login to WordPress.com, access Reader and Stats, etc) you need a WordPress.com OAuth2 ID and secret. Please read the [OAuth2 Authentication](#oauth2-authentication) section.
2019
* While loading/building the app in Android Studio ignore the prompt to update the gradle plugin version as that will probably introduce build errors. On the other hand, feel free to update if you are planning to work on ensuring the compatibility of the newer version.
2120

22-
23-
## OAuth2 Authentication ##
24-
25-
In order to use WordPress.com functions you will need a client ID and
26-
a client secret key. These details will be used to authenticate your
27-
application and verify that the API calls being made are valid. You can
28-
create an application or view details for your existing applications with
29-
our [WordPress.com applications manager][5].
30-
31-
When creating your application, you should select "Native client" for the application type.
32-
The "**Website URL**", "**Redirect URLs**", and "**Javascript Origins**" fields are required but not used for
33-
the mobile apps. Just use "**[https://localhost](https://localhost)**".
34-
35-
Once you've created your application in the [applications manager][5], you'll
36-
need to edit the `./gradle.properties` file and change the
37-
`wp.oauth.app_id` and `wp.oauth.app_secret` fields. Then you can compile and
38-
run the app on a device or an emulator and try to login with a WordPress.com
39-
account. Note that authenticating to WordPress.com via Google is not supported
40-
in development builds of the app, only in the official release.
41-
42-
Note that credentials created with our [WordPress.com applications manager][5]
43-
allow login only and not signup. New accounts must be created using the [official app][1]
44-
or [on the web](https://wordpress.com/start). Login is restricted to the WordPress.com
45-
account with which the credentials were created. In other words, if the credentials
46-
were created with [email protected], you will only be able to login with [email protected].
47-
Using another account like [email protected] will cause the `Client cannot use "password" grant_type` error.
48-
49-
For security reasons, some account-related actions aren't supported for development
50-
builds when using a WordPress.com account with 2-factor authentication enabled.
51-
52-
Read more about [OAuth2][6] and the [WordPress.com REST endpoint][7].
53-
5421
## Build and Test ##
5522

5623
To build, install, and test the project from the command line:
@@ -61,6 +28,13 @@ To build, install, and test the project from the command line:
6128
$ ./gradlew :WordPress:testWordPressVanillaDebugUnitTest # assemble, install and run unit tests
6229
$ ./gradlew :WordPress:connectedWordPressVanillaDebugAndroidTest # assemble, install and run Android tests
6330

31+
## Running the app ##
32+
33+
You can use your own WordPress site for developing and testing the app. If you don't have one, you can create a temporary test site for free at https://jurassic.ninja/.
34+
On the app start up screen, choose "Enter your existing site address" and enter the URL of your site and your credentials.
35+
36+
Note: Access to WordPress.com features is temporarily disabled in the development environment.
37+
6438
## Directory structure ##
6539
.
6640
├── libs # dependencies used to build debug variants

RELEASE-NOTES.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
25.1
44
-----
5-
5+
* [*] [internal] Block editor: Add onContentUpdate bridge functionality [https://github.com/wordpress-mobile/gutenberg-mobile/pull/20852]
66

77
25.0
88
-----

WordPress/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,15 @@ dependencies {
365365
implementation (project(path:':libs:editor')) {
366366
exclude group: 'org.wordpress', module: 'utils'
367367
}
368-
implementation("$gradle.ext.fluxCBinaryPath") {
368+
implementation("$gradle.ext.fluxCBinaryPath:$wordPressFluxCVersion") {
369369
version {
370370
strictly wordPressFluxCVersion
371371
}
372372
exclude group: "com.android.volley"
373373
exclude group: 'org.wordpress', module: 'utils'
374374
exclude group: 'com.android.support', module: 'support-annotations'
375375
}
376-
implementation ("$gradle.ext.wputilsBinaryPath") {
376+
implementation ("$gradle.ext.wputilsBinaryPath:$wordPressUtilsVersion") {
377377
version {
378378
strictly wordPressUtilsVersion
379379
}
@@ -384,7 +384,7 @@ dependencies {
384384
}
385385
implementation "$gradle.ext.aboutAutomatticBinaryPath:$automatticAboutVersion"
386386

387-
implementation("$gradle.ext.tracksBinaryPath") {
387+
implementation("$gradle.ext.tracksBinaryPath:$automatticTracksVersion") {
388388
version {
389389
strictly automatticTracksVersion
390390
}

WordPress/src/debug/AndroidManifest.xml

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
android:name="android.permission.DUMP"
2727
tools:ignore="ProtectedPermissions" />
2828

29+
<!-- Adds this permission temporarily here until Voice to content project is released -->
30+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
31+
2932
<application
3033
android:name=".WordPressDebug"
3134
android:supportsRtl="true"

WordPress/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<uses-permission android:name="android.permission.CAMERA" />
1818
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
1919
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
20+
2021
<!-- Required for storing and retrieving screenshots, taking photos, accessing media files -->
2122
<uses-permission
2223
android:name="android.permission.WRITE_EXTERNAL_STORAGE"

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ import org.wordpress.android.util.config.OpenWebLinksWithJetpackFlowFeatureConfi
110110
import org.wordpress.android.util.enqueuePeriodicUploadWorkRequestForAllSites
111111
import org.wordpress.android.util.experiments.ExPlat
112112
import org.wordpress.android.util.image.ImageManager
113-
import org.wordpress.android.widgets.AppRatingDialog
113+
import org.wordpress.android.widgets.AppReviewManager
114114
import org.wordpress.android.workers.WordPressWorkersFactory
115115
import java.io.File
116116
import java.io.IOException
@@ -303,7 +303,7 @@ class AppInitializer @Inject constructor(
303303
initWpDb()
304304
context?.let { enableHttpResponseCache(it) }
305305

306-
AppRatingDialog.init(application)
306+
AppReviewManager.init(application)
307307

308308
if (!initialized) {
309309
// EventBus setup
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package org.wordpress.android.datasets
2+
3+
import kotlinx.coroutines.CoroutineScope
4+
import kotlinx.coroutines.Dispatchers
5+
import kotlinx.coroutines.launch
6+
import kotlinx.coroutines.withContext
7+
8+
/**
9+
* Helper class to handle async tasks by using coroutines
10+
* @see <a href="https://github.com/wordpress-mobile/WordPress-Android/pull/20937">Introduction</a>
11+
*/
12+
object AsyncTaskHandler {
13+
/**
14+
* Load data in the background and handle the result on the main thread
15+
*/
16+
@JvmStatic
17+
fun <T> load(backgroundTask: () -> T, callback: AsyncTaskCallback<T>) {
18+
CoroutineScope(Dispatchers.IO).launch {
19+
// handle the background task
20+
val result = backgroundTask()
21+
22+
withContext(Dispatchers.Main) {
23+
// handle the result on the main thread
24+
callback.onTaskFinished(result)
25+
}
26+
}
27+
}
28+
29+
interface AsyncTaskCallback<T> {
30+
fun onTaskFinished(result: T)
31+
}
32+
}
33+

WordPress/src/main/java/org/wordpress/android/modules/ApplicationModule.java

+20
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
import org.wordpress.android.ui.sitecreation.SiteCreationStep;
2929
import org.wordpress.android.ui.sitecreation.SiteCreationStepsProvider;
3030
import org.wordpress.android.util.BuildConfigWrapper;
31+
import org.wordpress.android.util.audio.AudioRecorder;
32+
import org.wordpress.android.util.audio.IAudioRecorder;
33+
import org.wordpress.android.util.audio.RecordingStrategy;
34+
import org.wordpress.android.util.audio.RecordingStrategy.VoiceToContentRecordingStrategy;
35+
import org.wordpress.android.util.audio.VoiceToContentStrategy;
3136
import org.wordpress.android.util.config.InAppUpdatesFeatureConfig;
3237
import org.wordpress.android.util.config.RemoteConfigWrapper;
3338
import org.wordpress.android.util.wizard.WizardManager;
@@ -127,4 +132,19 @@ public static ActivityNavigator provideActivityNavigator(@ApplicationContext Con
127132
public static SensorManager provideSensorManager(@ApplicationContext Context context) {
128133
return (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
129134
}
135+
136+
@VoiceToContentStrategy
137+
@Provides
138+
public static IAudioRecorder provideAudioRecorder(
139+
@ApplicationContext Context context,
140+
@VoiceToContentStrategy RecordingStrategy recordingStrategy
141+
) {
142+
return new AudioRecorder(context, recordingStrategy);
143+
}
144+
145+
@VoiceToContentStrategy
146+
@Provides
147+
public static RecordingStrategy provideVoiceToContentRecordingStrategy() {
148+
return new VoiceToContentRecordingStrategy();
149+
}
130150
}

WordPress/src/main/java/org/wordpress/android/modules/ViewModelModule.java

-6
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import org.wordpress.android.ui.reader.viewmodels.ReaderPostListViewModel;
5555
import org.wordpress.android.ui.reader.viewmodels.ReaderViewModel;
5656
import org.wordpress.android.ui.reader.viewmodels.SubfilterPageViewModel;
57-
import org.wordpress.android.ui.review.ReviewViewModel;
5857
import org.wordpress.android.ui.stats.refresh.lists.DaysListViewModel;
5958
import org.wordpress.android.ui.stats.refresh.lists.InsightsDetailListViewModel;
6059
import org.wordpress.android.ui.stats.refresh.lists.InsightsListViewModel;
@@ -461,11 +460,6 @@ abstract class ViewModelModule {
461460
@ViewModelKey(UnifiedCommentListViewModel.class)
462461
abstract ViewModel unifiedCommentListViewModel(UnifiedCommentListViewModel viewModel);
463462

464-
@Binds
465-
@IntoMap
466-
@ViewModelKey(ReviewViewModel.class)
467-
abstract ViewModel reviewViewModel(ReviewViewModel viewModel);
468-
469463
@Binds
470464
@IntoMap
471465
@ViewModelKey(BloggingRemindersViewModel.class)

0 commit comments

Comments
 (0)