PhilippC / PhilippC/keepass2android

[BUG] Keyboard settings screen is in dark mode

Open
#2,923 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.2k
Forks
478
Avg merge
1h 4m
Merged PRs (30d)
2

Description

Checks
  • I have read the FAQ section, searched the open issues, and still think this is a new bug.
Describe the bug you encountered:

The settings -> app settings -> keyboard settings screen is, by default, in dark mode even when the phone and the rest of the app is in light mode. For those of us who can't use dark mode due to eye problems this makes it very painful to use.

This occurs if the app theme (settings -> app settings -> Display -> Design) is set to the default (System settings), due to this not being in the logic when it decides the theme for just that screen.

Exert from /src/java/KP2ASoftkeyboard_AS/app/src/main/java/keepass2android/softkeyboard/Design.java:

public class Design {
	@SuppressLint("InlinedApi")
	public static void updateTheme(Activity activity, SharedPreferences prefs) {
		
		if (android.os.Build.VERSION.SDK_INT >= 11
            /* android.os.Build.VERSION_CODES.HONEYCOMB */) {
            String design = prefs.getString("design_key", "Light");
            
            if (design.equals("Light")) {
            	activity.setTheme(android.R.style.Theme_Holo_Light);
            } else {
            	activity.setTheme(android.R.style.Theme_Holo);
            }
        }
    }
}

If design_key != 'Light' then the theme will be set to dark mode. Of course, the default will be "System settings" and it will chose dark mode.

Describe what you expected to happen:

That the keyboard settings screen follows the system theme mode (in my case light mode).

What version of Keepass2Android are you using?

1.12-r5

Which version of Android are you on?

Occurs on Android 14 and 15

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/java/KP2ASoftkeyboard_AS/app/src/main/java/keepass2android/softkeyboard/Design.java and its updateTheme method, then reproduce the keyboard settings path with the app theme set to System settings. Done means the keyboard settings screen follows the system light or dark theme instead of defaulting to dark mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
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.