Skip to content

Conversation

@hamorillo
Copy link
Contributor

@hamorillo hamorillo commented Oct 31, 2024

Closes #424

Description

To simplify the integration we need to remove the limitation of using the QuickEditor from an activity using the launchMode="singleTask".

The approach is to create an intermediate activity that can assume the complexity and the launch mode required by the QE. The behavior should be as much as possible as it is using the Composable directly.

Kapture.2024-11-13.at.15.31.45.mp4

Testing Steps

  • In the demo-app manifest uncomment the Gravatar QE Activity part and comment the intent filter in MainActivity (or apply this patch)
  • Launch the demo-app
  • Tap over Test with Activity without Compose
  • Tap over the second button, Update Avatar with QuickEditor Activity
  • Verify everything works as expected.
    • OAuth flow with different browsers and using custom tabs (Firefox would be nice)
    • Avatar switch (Note that with this approach, we only notify the avatar change when our activity finishes)
    • Close the bottom sheet without switching avatars
    • You can also test rotating the device orientation with the bottom sheet (GravatarQuickEditorActivity) visible

@hamorillo hamorillo added Enhance Enhancement [Feature] Gravatar-Quickeditor Gravatar Quick Editor module labels Oct 31, 2024
@hamorillo hamorillo added this to the 2.1.0 milestone Oct 31, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 31, 2024

📲 You can test the changes from this Pull Request in Gravatar Demo by scanning the QR code below to install the corresponding build.
App Name Gravatar Demo
Commit40f7500
Direct Downloadgravatar-demo-prototype-build-pr425-40f7500.apk

@wpmobilebot
Copy link
Collaborator

Project dependencies changes

The following changes in project dependencies were detected (configuration releaseRuntimeClasspath):

list
Upgraded Dependencies
org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.9.25, (changed from 1.9.22)
org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.25, (changed from 1.9.22)
tree
-\--- io.github.osipxd:security-crypto-datastore-preferences:1.1.1-beta03
-     \--- io.github.osipxd:encrypted-datastore-preferences:1.1.1-beta03
-          \--- io.github.osipxd:encrypted-datastore:1.1.1-beta03
-               \--- androidx.datastore:datastore-core:1.1.1
-                    \--- androidx.datastore:datastore-core-android:1.1.1
-                         \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.22
-                              +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 -> 2.0.10 (*)
-                              \--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.9.22
-                                   \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 -> 2.0.10 (*)
++--- project :gravatar
+|    \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.25
+|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 -> 2.0.10 (*)
+|         \--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.9.25
+|              \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 -> 2.0.10 (*)
++--- io.github.osipxd:security-crypto-datastore-preferences:1.1.1-beta03
+|    \--- io.github.osipxd:encrypted-datastore-preferences:1.1.1-beta03
+|         \--- io.github.osipxd:encrypted-datastore:1.1.1-beta03
+|              \--- androidx.datastore:datastore-core:1.1.1
+|                   \--- androidx.datastore:datastore-core-android:1.1.1
+|                        \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.22 -> 1.9.25 (*)
+\--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.25 (*)

@hamorillo hamorillo force-pushed the hamorillo/424-qe-activity branch from 65f7251 to f8a2614 Compare October 31, 2024 15:39
@hamorillo hamorillo force-pushed the hamorillo/424-qe-activity branch 2 times, most recently from ffe9d0a to 2090953 Compare November 13, 2024 13:05
@hamorillo hamorillo marked this pull request as ready for review November 13, 2024 14:32
Copy link
Contributor

@AdamGrzybkowski AdamGrzybkowski left a comment

Choose a reason for hiding this comment

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

Great work! 🎉
I tested it with: Opera, Chrome, Firefox, DuckDuckGo, and Brave. All worked fine.

Left some minor comments, but the functionality itself is 🟢

To simplify the integration we need to remove the limitation of using the QuickEditor from an activity using the launchMode="singleTask".

The approach is to create an intermediate activity that can assume the complexity and the launch mode required by the QE. The behavior should be as much as possible as it is using the Composable directly.

In this commit, we are losing the "callback" part, so the app can't notice when the QE is closed or when the avatar changes. We'll need to add some ways to inform you about those events.

# Conflicts:
#	gravatar-quickeditor/build.gradle.kts
#	gravatar/build.gradle.kts
@hamorillo hamorillo force-pushed the hamorillo/424-qe-activity branch from 5679f87 to be1e107 Compare November 14, 2024 10:53
@hamorillo hamorillo changed the base branch from trunk to release/2.1.0 November 14, 2024 10:53
@hamorillo hamorillo changed the base branch from release/2.1.0 to trunk November 14, 2024 11:07
@hamorillo hamorillo changed the base branch from trunk to release/2.1.0 November 14, 2024 11:07
@hamorillo hamorillo force-pushed the hamorillo/424-qe-activity branch from be1e107 to 40f7500 Compare November 14, 2024 11:24
@hamorillo hamorillo merged commit 7b91715 into release/2.1.0 Nov 14, 2024
17 checks passed
@hamorillo hamorillo deleted the hamorillo/424-qe-activity branch November 14, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhance Enhancement [Feature] Gravatar-Quickeditor Gravatar Quick Editor module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QuickEditor: Remove the singleTask launchMode limitation from the QE

4 participants