Skip to content

Commit 687f375

Browse files
feat: Standardize CodeView font size and refactor CodeHighlighter
This commit introduces a consistent font size for all CodeView instances and refactors the CodeHighlighter class. - `CodeViewUtils.java`: The text size for CodeView instances is now set to a uniform 14f. Previously, the line number text size was set to match the view's text size, which could lead to inconsistencies. - `CodeHighlighter.java`: The private constructor has been removed. This change doesn't alter the class's functionality as it's a utility class with static methods, but it simplifies the class structure.
1 parent b636935 commit 687f375

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

app/src/main/java/com/d4rk/androidtutorials/java/utils/CodeHighlighter.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
*/
1212
public class CodeHighlighter {
1313

14-
private CodeHighlighter() {
15-
// Utility class
16-
}
17-
1814
/**
1915
* Apply a basic Java highlighting theme to the given CodeView.
2016
*/

app/src/main/java/com/d4rk/androidtutorials/java/utils/CodeViewUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public static void applyDefaults(Typeface typeface, CodeView... views) {
1919
for (CodeView view : views) {
2020
if (view == null) continue;
2121
view.setTypeface(typeface);
22-
view.setLineNumberTextSize(view.getTextSize());
22+
view.setTextSize(14f);
23+
view.setLineNumberTextSize(14f);
2324
view.setEnableLineNumber(false);
2425
view.setHorizontallyScrolling(false);
2526
view.setKeyListener(null);

0 commit comments

Comments
 (0)