Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void onCreate(Bundle savedInstanceState) {

// App version
Preference versionPref = findPreference(getString(R.string.pref_key_app_version));
versionPref.setSummary(Utils.getVersionName() + " (" + Utils.getVersionCode() + ")");
versionPref.setSummary(Utils.getVersionName());
}

Comment on lines +103 to 105
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The change does not achieve the stated goal of showing only the version name. Looking at the implementation of Utils.getVersionName() (line 347 in Utils.java), it returns packageInfo.versionName + "." + packageInfo.versionCode, which means the version code is still included in the display. The version code was previously shown in parentheses (e.g., "2.3.13 (56)"), and now it will be shown as a dot-separated suffix (e.g., "2.3.13.56"). To truly show only the version name without the version code, the Utils.getVersionName() method needs to be modified to return only packageInfo.versionName, or a separate method should be used here.

Suggested change
versionPref.setSummary(Utils.getVersionName());
}
versionPref.setSummary(getAppVersionNameOnly());
}
/**
* Returns only the version name portion, stripping any appended version code
* that may be added by {@link Utils#getVersionName()} (e.g. "2.3.13.56" -> "2.3.13").
*/
private String getAppVersionNameOnly() {
String fullVersion = Utils.getVersionName();
if (fullVersion == null || fullVersion.isEmpty()) {
return fullVersion;
}
int lastDot = fullVersion.lastIndexOf('.');
if (lastDot > 0) {
return fullVersion.substring(0, lastDot);
}
return fullVersion;
}

Copilot uses AI. Check for mistakes.
@Override
Expand Down
Loading