Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into merge/25.0-final-int…
Browse files Browse the repository at this point in the history
…o-trunk
  • Loading branch information
oguzkocer committed Jun 7, 2024
2 parents a7adeb7 + e56dcc8 commit a258fa0
Show file tree
Hide file tree
Showing 95 changed files with 1,637 additions and 757 deletions.
2 changes: 1 addition & 1 deletion .buildkite/beta-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.17.0
- automattic/a8c-ci-toolkit#3.4.2

steps:
#################
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.17.0
- automattic/a8c-ci-toolkit#3.4.2

steps:
- label: "Code Freeze"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/complete-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.17.0
- automattic/a8c-ci-toolkit#3.4.2

steps:
- label: "Complete Code Freeze"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/finalize-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.17.0
- automattic/a8c-ci-toolkit#3.4.2

steps:
- label: "Finalize release"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/new-beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.17.0
- automattic/a8c-ci-toolkit#3.4.2

steps:
- label: "New Beta Release"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &ci_toolkit
automattic/a8c-ci-toolkit#2.18.2
automattic/a8c-ci-toolkit#3.4.2
- &test_collector
test-collector#v1.8.0
- &test_collector_common_params
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.17.0
- automattic/a8c-ci-toolkit#3.4.2

steps:
#################
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/update-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.17.0
- automattic/a8c-ci-toolkit#3.4.2

steps:
- label: "Update release notes"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
dangermattic:
if: ${{ (github.event.pull_request.draft == false) }}
uses: Automattic/dangermattic/.github/workflows/[email protected].0
uses: Automattic/dangermattic/.github/workflows/[email protected].2
with:
org-slug: "automattic"
pipeline-slug: "wordpress-android"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
check-labels-on-issues:
uses: Automattic/dangermattic/.github/workflows/reusable-check-labels-on-issues.yml@v1.0.0
uses: Automattic/dangermattic/.github/workflows/reusable-check-labels-on-issues.yml@v1.1.2
with:
label-format-list: '[
"^\[.+\]",
Expand Down
20 changes: 11 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ GEM
no_proxy_fix
octokit (>= 4.0)
terminal-table (>= 1, < 4)
danger-dangermattic (1.0.2)
danger-dangermattic (1.1.1)
danger (~> 9.4)
danger-plugin-api (~> 1.0)
danger-rubocop (~> 0.12)
rubocop (~> 1.61)
danger-rubocop (~> 0.13)
rubocop (~> 1.63)
danger-plugin-api (1.0.0)
danger (> 2.0)
danger-rubocop (0.12.0)
danger-rubocop (0.13.0)
danger
rubocop (~> 1.0)
declarative (0.0.20)
Expand Down Expand Up @@ -259,30 +259,31 @@ GEM
optparse (0.4.0)
os (1.1.4)
parallel (1.24.0)
parser (3.3.1.0)
parser (3.3.2.0)
ast (~> 2.4.1)
racc
plist (3.7.1)
progress_bar (1.3.3)
highline (>= 1.6, < 3)
options (~> 2.3.0)
public_suffix (5.0.5)
racc (1.7.3)
racc (1.8.0)
rainbow (3.1.1)
rake (13.2.1)
rake-compiler (1.2.7)
rake
rchardet (1.8.0)
regexp_parser (2.9.1)
regexp_parser (2.9.2)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.6)
rexml (3.2.8)
strscan (>= 3.0.9)
rmagick (4.3.0)
rouge (2.0.7)
rubocop (1.63.5)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -310,6 +311,7 @@ GEM
simctl (1.6.10)
CFPropertyList
naturally
strscan (3.1.0)
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand Down
40 changes: 7 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,8 @@ If you're a developer wanting to contribute, read on.

Notes:

* 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.
* 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.


## OAuth2 Authentication ##

In order to use WordPress.com functions you will need a client ID and
a client secret key. These details will be used to authenticate your
application and verify that the API calls being made are valid. You can
create an application or view details for your existing applications with
our [WordPress.com applications manager][5].

When creating your application, you should select "Native client" for the application type.
The "**Website URL**", "**Redirect URLs**", and "**Javascript Origins**" fields are required but not used for
the mobile apps. Just use "**[https://localhost](https://localhost)**".

Once you've created your application in the [applications manager][5], you'll
need to edit the `./gradle.properties` file and change the
`wp.oauth.app_id` and `wp.oauth.app_secret` fields. Then you can compile and
run the app on a device or an emulator and try to login with a WordPress.com
account. Note that authenticating to WordPress.com via Google is not supported
in development builds of the app, only in the official release.

Note that credentials created with our [WordPress.com applications manager][5]
allow login only and not signup. New accounts must be created using the [official app][1]
or [on the web](https://wordpress.com/start). Login is restricted to the WordPress.com
account with which the credentials were created. In other words, if the credentials
were created with [email protected], you will only be able to login with [email protected].
Using another account like [email protected] will cause the `Client cannot use "password" grant_type` error.

For security reasons, some account-related actions aren't supported for development
builds when using a WordPress.com account with 2-factor authentication enabled.

Read more about [OAuth2][6] and the [WordPress.com REST endpoint][7].

## Build and Test ##

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

## Running the app ##

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/.
On the app start up screen, choose "Enter your existing site address" and enter the URL of your site and your credentials.

Note: Access to WordPress.com features is temporarily disabled in the development environment.

## Directory structure ##
.
├── libs # dependencies used to build debug variants
Expand Down
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

25.1
-----

* [*] [internal] Block editor: Add onContentUpdate bridge functionality [https://github.com/wordpress-mobile/gutenberg-mobile/pull/20852]

25.0
-----
Expand Down
6 changes: 3 additions & 3 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,15 @@ dependencies {
implementation (project(path:':libs:editor')) {
exclude group: 'org.wordpress', module: 'utils'
}
implementation("$gradle.ext.fluxCBinaryPath") {
implementation("$gradle.ext.fluxCBinaryPath:$wordPressFluxCVersion") {
version {
strictly wordPressFluxCVersion
}
exclude group: "com.android.volley"
exclude group: 'org.wordpress', module: 'utils'
exclude group: 'com.android.support', module: 'support-annotations'
}
implementation ("$gradle.ext.wputilsBinaryPath") {
implementation ("$gradle.ext.wputilsBinaryPath:$wordPressUtilsVersion") {
version {
strictly wordPressUtilsVersion
}
Expand All @@ -384,7 +384,7 @@ dependencies {
}
implementation "$gradle.ext.aboutAutomatticBinaryPath:$automatticAboutVersion"

implementation("$gradle.ext.tracksBinaryPath") {
implementation("$gradle.ext.tracksBinaryPath:$automatticTracksVersion") {
version {
strictly automatticTracksVersion
}
Expand Down
3 changes: 3 additions & 0 deletions WordPress/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
android:name="android.permission.DUMP"
tools:ignore="ProtectedPermissions" />

<!-- Adds this permission temporarily here until Voice to content project is released -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<application
android:name=".WordPressDebug"
android:supportsRtl="true"
Expand Down
1 change: 1 addition & 0 deletions WordPress/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<!-- Required for storing and retrieving screenshots, taking photos, accessing media files -->
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ import org.wordpress.android.util.config.OpenWebLinksWithJetpackFlowFeatureConfi
import org.wordpress.android.util.enqueuePeriodicUploadWorkRequestForAllSites
import org.wordpress.android.util.experiments.ExPlat
import org.wordpress.android.util.image.ImageManager
import org.wordpress.android.widgets.AppRatingDialog
import org.wordpress.android.widgets.AppReviewManager
import org.wordpress.android.workers.WordPressWorkersFactory
import java.io.File
import java.io.IOException
Expand Down Expand Up @@ -303,7 +303,7 @@ class AppInitializer @Inject constructor(
initWpDb()
context?.let { enableHttpResponseCache(it) }

AppRatingDialog.init(application)
AppReviewManager.init(application)

if (!initialized) {
// EventBus setup
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.wordpress.android.datasets

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

/**
* Helper class to handle async tasks by using coroutines
* @see <a href="https://github.com/wordpress-mobile/WordPress-Android/pull/20937">Introduction</a>
*/
object AsyncTaskHandler {
/**
* Load data in the background and handle the result on the main thread
*/
@JvmStatic
fun <T> load(backgroundTask: () -> T, callback: AsyncTaskCallback<T>) {
CoroutineScope(Dispatchers.IO).launch {
// handle the background task
val result = backgroundTask()

withContext(Dispatchers.Main) {
// handle the result on the main thread
callback.onTaskFinished(result)
}
}
}

interface AsyncTaskCallback<T> {
fun onTaskFinished(result: T)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
import org.wordpress.android.ui.sitecreation.SiteCreationStep;
import org.wordpress.android.ui.sitecreation.SiteCreationStepsProvider;
import org.wordpress.android.util.BuildConfigWrapper;
import org.wordpress.android.util.audio.AudioRecorder;
import org.wordpress.android.util.audio.IAudioRecorder;
import org.wordpress.android.util.audio.RecordingStrategy;
import org.wordpress.android.util.audio.RecordingStrategy.VoiceToContentRecordingStrategy;
import org.wordpress.android.util.audio.VoiceToContentStrategy;
import org.wordpress.android.util.config.InAppUpdatesFeatureConfig;
import org.wordpress.android.util.config.RemoteConfigWrapper;
import org.wordpress.android.util.wizard.WizardManager;
Expand Down Expand Up @@ -127,4 +132,19 @@ public static ActivityNavigator provideActivityNavigator(@ApplicationContext Con
public static SensorManager provideSensorManager(@ApplicationContext Context context) {
return (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
}

@VoiceToContentStrategy
@Provides
public static IAudioRecorder provideAudioRecorder(
@ApplicationContext Context context,
@VoiceToContentStrategy RecordingStrategy recordingStrategy
) {
return new AudioRecorder(context, recordingStrategy);
}

@VoiceToContentStrategy
@Provides
public static RecordingStrategy provideVoiceToContentRecordingStrategy() {
return new VoiceToContentRecordingStrategy();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import org.wordpress.android.ui.reader.viewmodels.ReaderPostListViewModel;
import org.wordpress.android.ui.reader.viewmodels.ReaderViewModel;
import org.wordpress.android.ui.reader.viewmodels.SubfilterPageViewModel;
import org.wordpress.android.ui.review.ReviewViewModel;
import org.wordpress.android.ui.stats.refresh.lists.DaysListViewModel;
import org.wordpress.android.ui.stats.refresh.lists.InsightsDetailListViewModel;
import org.wordpress.android.ui.stats.refresh.lists.InsightsListViewModel;
Expand Down Expand Up @@ -461,11 +460,6 @@ abstract class ViewModelModule {
@ViewModelKey(UnifiedCommentListViewModel.class)
abstract ViewModel unifiedCommentListViewModel(UnifiedCommentListViewModel viewModel);

@Binds
@IntoMap
@ViewModelKey(ReviewViewModel.class)
abstract ViewModel reviewViewModel(ReviewViewModel viewModel);

@Binds
@IntoMap
@ViewModelKey(BloggingRemindersViewModel.class)
Expand Down
Loading

0 comments on commit a258fa0

Please sign in to comment.