Skip to content

Convert reader post list activity to Kotlin #21842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 30, 2025

Conversation

nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Apr 29, 2025

Partially addresses CMM-307

I had intended to convert ReaderPostListActivity and ReaderPostListFragment to Kotlin in a single PR, but the latter turned out to be far more involved than expected. Because of this, I decided to handle them in separate PRs. In this PR, the activity is addressed.

Test A:

  • Go to the Reader tab
  • Tap a post
  • Tap the blog name in the post's header
  • Verify the list of posts works as expected

Test B

  • Go to the My Site tab
  • Under Prompts tap "View all responses"
  • Verify the list of posts works as expected

Notes:

  • I converted the activity to view binding, but could not remove a few calls to findViewById because they involve views not in the activity itself
  • I resolved all the deprecation issues except for onActivityResult. That had to remain because we use startActivityForResult outside of this activity (for example, in ReaderActivityLauncher)

@dangermattic
Copy link
Collaborator

dangermattic commented Apr 29, 2025

2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 29, 2025

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21842-2e6b55c
Commit2e6b55c
Direct Downloadjetpack-prototype-build-pr21842-2e6b55c.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 29, 2025

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21842-2e6b55c
Commit2e6b55c
Direct Downloadwordpress-prototype-build-pr21842-2e6b55c.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 29, 2025

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: wordpressVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/base_manifest.txt	2025-04-30 14:59:16.984390391 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/head_manifest.txt	2025-04-30 14:59:19.294391578 +0000
@@ -648,7 +648,7 @@
             android:theme="@style/WordPress.NoActionBar" />
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderSubsActivity"
-            android:theme="@style/WordPress.NoActionBar"
+            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
             android:windowSoftInputMode="stateHidden" />
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderPhotoViewerActivity"

Go to https://buildkite.com/automattic/wordpress-android/builds/21758/canvas?sid=01968731-d213-4a67-acfe-d2a9e19c6ba8, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 29, 2025

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: jetpackVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/base_manifest.txt	2025-04-30 14:59:32.277352360 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/head_manifest.txt	2025-04-30 14:59:34.297342427 +0000
@@ -675,7 +675,7 @@
             android:theme="@style/WordPress.NoActionBar" />
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderSubsActivity"
-            android:theme="@style/WordPress.NoActionBar"
+            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
             android:windowSoftInputMode="stateHidden" />
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderPhotoViewerActivity"

Go to https://buildkite.com/automattic/wordpress-android/builds/21758/canvas?sid=01968731-d214-4aea-8402-06e568e306d6, click on the Artifacts tab and audit the files.

Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.39%. Comparing base (fb127d8) to head (2e6b55c).
Report is 3 commits behind head on trunk.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #21842   +/-   ##
=======================================
  Coverage   39.39%   39.39%           
=======================================
  Files        2132     2132           
  Lines       99994    99994           
  Branches    15398    15398           
=======================================
  Hits        39397    39397           
  Misses      57115    57115           
  Partials     3482     3482           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nbradbury nbradbury requested a review from adalpari April 29, 2025 20:13
@nbradbury nbradbury marked this pull request as ready for review April 29, 2025 20:13
Copy link
Contributor

@adalpari adalpari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and works as expected!

Screen_recording_20250430_095744.mp4

@nbradbury nbradbury enabled auto-merge (squash) April 30, 2025 14:55
@nbradbury nbradbury merged commit 74102b1 into trunk Apr 30, 2025
21 of 26 checks passed
@nbradbury nbradbury deleted the issue/CMM-307-kotlin-reader-post-list-activity branch April 30, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants