Skip to content

feat(Twitter): Add Dynamic color switch toggle - #1582

Merged
swakwork merged 4 commits into
crimera:devfrom
naoverse06:feat/twitter-dynamic-color-switch
Aug 2, 2026
Merged

feat(Twitter): Add Dynamic color switch toggle#1582
swakwork merged 4 commits into
crimera:devfrom
naoverse06:feat/twitter-dynamic-color-switch

Conversation

@naoverse06

@naoverse06 naoverse06 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Adds a dynamic color switch under customize. also fixes the following issues:

  • Dynamic color not working correctly with twitter's dim theme
  • Piko settings using incorrect colors when twitter is set to use device settings

Testing

  • .\gradlew.bat :extensions:twitter:compileDebugSources :patches:compileKotlin :patches:checkStringResources --console=plain
  • Tested on Twitter v12.7.1-release.0 with Piko v3.8.0
  • Tested on Samsung Galaxy S26

Closes #1588

@naoverse06
naoverse06 force-pushed the feat/twitter-dynamic-color-switch branch from 75be758 to 4366a59 Compare July 25, 2026 18:11
@naoverse06
naoverse06 force-pushed the feat/twitter-dynamic-color-switch branch 2 times, most recently from 3b8db4f to 08ffff9 Compare July 26, 2026 09:52
@naoverse06
naoverse06 marked this pull request as draft July 26, 2026 18:10
@naoverse06
naoverse06 marked this pull request as ready for review July 26, 2026 19:47
@swakwork

Copy link
Copy Markdown
Collaborator

I priority fixes over this. Will include on the next one

@kitadai31

kitadai31 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This patch uses a custom app icon patch, but afaik there is a bug with custom app icons in the recent version of X.
The bug is that it causes all icons (activity-aliases) to become enabled, resulting in app drawer getting messed up and cannot launch piko.

Won't this issue occur by dynamic color toggle also changing the app icon?

@naoverse06
naoverse06 force-pushed the feat/twitter-dynamic-color-switch branch from 36abcdf to b660f69 Compare July 29, 2026 00:20
),
),
custom = { methodDef, _ ->
AccessFlags.STATIC.isSet(methodDef.accessFlags) &&

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess you can add access flags as separate parameters which accepts a list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The accessFlags parameter performs an exact comparison with method.accessFlags, while the target method may have additional flags. the custom predicate intentionally checks only whether STATIC is present. it is also needed to express the non-static condition for ComponentFactoryActivityFingerprint

name = "Dynamic color",
description = "Adds an option to replace Twitter Blue with the user's Material You palette.",
default = false,
default = true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Set the default to false, many may not want this by default

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this patch no longer makes permanent resource changes, it can be default
Just like many other patches those have a toggle in Piko settings

@kitadai31

kitadai31 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

I fixed change custom icon patch in #1624
You can restore the material you icon process

But rather than linking the app icon to the dynamic color toggle, I think it would be better to add it as a new option to the existing “Change app icon” patch.

Reason:

  • Users may want to use custom app icons while also using the dynamic color within the app
  • Changing app icon is unstable on some OEM launcher
  • Minimize issues when the patch is excluded
    • If dynamic color is enabled in settings and user repatched the app without the dynamic color patch, the activity-alias will be missing and the user cannot launch the app, even if the "Change app icon" patch is included
  • A single "Change app icon" patch bear a responsibility for handling the app icon change

If you adopt this approach, I think a guidance for changing app icon can be added to the summary of the toggle.
Like this: Applies the user's Material You palette to the app-wide theme. To apply dynamic colors to the app icon, go to Piko settings > Customize > Change app icon

@swakwork
swakwork marked this pull request as draft August 1, 2026 03:56
@naoverse06
naoverse06 marked this pull request as ready for review August 1, 2026 11:13
@swakwork
swakwork merged commit c3de8d8 into crimera:dev Aug 2, 2026
1 check passed
@naoverse06
naoverse06 deleted the feat/twitter-dynamic-color-switch branch August 2, 2026 10:23
github-actions Bot pushed a commit that referenced this pull request Aug 3, 2026
## [3.9.0-dev.3](v3.9.0-dev.2...v3.9.0-dev.3) (2026-08-03)

### 🐛 Bug Fixes

* **Instagram:** Check and add external downloader options in settings ([c6651df](c6651df))
* **instagram:** patch GRAY_1600 to fix Compose surfaces staying gray in AMOLED mode ([#1596](#1596)) ([07d08d4](07d08d4))
* **Twitter:** "Change app icon" is broken on recent X versions ([#1624](#1624)) ([350779d](350779d))
* **Twitter:** Fix check and add `more info on profile` preference ([97f9dca](97f9dca))
* **twitter:** replace ic_vector_x logo in Bring back twitter patch ([7b6c7e9](7b6c7e9))

### ✨ New Features

* **instagram:** add material you and amoled theme controls ([#1631](#1631)) ([840492a](840492a))
* **Instagram:** Added `Recommended flags` section ([ff31eda](ff31eda))
* **Instagram:** Added more options in profile options menu ([#1638](#1638)) ([ad61869](ad61869))
* **Twitter:** Add Dynamic color switch toggle ([#1582](#1582)) ([c3de8d8](c3de8d8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants