Automattic / Automattic/pocket-casts-android

`const val` not being used in au.com.shiftyjelly.pocketcasts.ui.theme.ThemeColor.kt

Open
#1,566 1 comment 0 reactions 0 assignees View on GitHub
[Type] Enhancement [Type] Tech Debt
Dominant language
Kotlin
Stars
2.8k
Forks
308
Avg merge
1d 13h
Merged PRs (30d)
143

Description

### Description

I realized while doing some memory profiling that ThemeColor.kt uses a fairly big amount of memory for what is essentially a constants class. I believe a slight reduction in memory use could be obtained from prepending `const` to all the colors defined in ThemeColor.kt

### Step-by-step reproduction instructions

1. Open up Pocket Casts on Android Studio with profiling with complete data
2. Capture a heap dump
3. Observe that ThemeColor.kt will be one of the objects with the highest memory use

### Screenshots or screen recording

![image](https://github.com/Automattic/pocket-casts-android/assets/1772063/a23e0f72-3c71-4d62-aaf4-0740648f65bb)

### Did you search for existing bug reports?

- [X] I have searched for existing bug reports.

### Device, Operating system, and Pocket Casts app version

API level 34, Linux. Tested on Pixel 7 Pro emulator and a real Samsung S21

Contributor guide

Open the contributing guide

Research direction

Open ThemeColor.kt and inspect the color definitions that currently lack const. Apply the requested change to all applicable colors, then use the Android Studio memory profiler and a heap dump to check whether ThemeColor.kt uses less memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.