Skip to content

Commit eba9cab

Browse files
authored
Merge pull request #188 from maxistar/codex/add-extra-large-font-size-option
Remove legacy Extra Large handling from font size selection
2 parents f89521a + 6e194f2 commit eba9cab

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

app/src/main/java/com/maxistar/textpad/activities/EditorActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ private void applyFontSize() {
463463
case (SettingsService.SETTING_HUGE):
464464
mText.setTextSize(28.0f);
465465
break;
466+
case (SettingsService.SETTING_EXTRA_HUGE):
467+
mText.setTextSize(56.0f);
468+
break;
466469
case (SettingsService.SETTING_MEDIUM):
467470
default:
468471
mText.setTextSize(20.0f);

app/src/main/java/com/maxistar/textpad/preferences/FontSizePreference.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public FontSizePreference(Context context, AttributeSet attrs) {
4949
break;
5050
case SettingsService.SETTING_HUGE:
5151
selected = 4;
52+
break;
53+
case SettingsService.SETTING_EXTRA_HUGE:
54+
selected = 5;
55+
break;
5256
}
5357
}
5458

@@ -72,10 +76,13 @@ public void onClick(DialogInterface dialog, int whichButton) {
7276
case 3:
7377
settingsService.setFontSize(SettingsService.SETTING_LARGE, getContext());
7478
break;
75-
case 4:
79+
case 4:
7680
settingsService.setFontSize(SettingsService.SETTING_HUGE, getContext());
7781
break;
78-
}
82+
case 5:
83+
settingsService.setFontSize(SettingsService.SETTING_EXTRA_HUGE, getContext());
84+
break;
85+
}
7986

8087
notifyChanged();
8188
}
@@ -88,7 +95,8 @@ public void onClick(DialogInterface dialog, int whichButton) {
8895
SettingsService.SETTING_SMALL,
8996
SettingsService.SETTING_MEDIUM,
9097
SettingsService.SETTING_LARGE,
91-
SettingsService.SETTING_HUGE
98+
SettingsService.SETTING_HUGE,
99+
SettingsService.SETTING_EXTRA_HUGE
92100
};
93101

94102
List<String> fonts = Arrays.asList(arrayOfFonts);
@@ -143,6 +151,9 @@ public View getView(int position, View convertView, @NonNull ViewGroup parent)
143151
break;
144152
case SettingsService.SETTING_HUGE:
145153
tv.setTextSize(28.0f);
154+
break;
155+
case SettingsService.SETTING_EXTRA_HUGE:
156+
tv.setTextSize(56.0f);
146157
}
147158
// general options
148159
tv.setTextColor(Color.BLACK);

app/src/main/java/com/maxistar/textpad/service/SettingsService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class SettingsService {
3838
public static final String SETTING_SMALL = "Small";
3939
public static final String SETTING_LARGE = "Large";
4040
public static final String SETTING_HUGE = "Huge";
41+
public static final String SETTING_EXTRA_HUGE = "Extra Huge";
4142

4243
public static final int DEFAULT_BACKGROUND_COLOR = 0xFFDDDDDD;
4344
public static final int DEFAULT_TEXT_COLOR = 0xFF000000;

0 commit comments

Comments
 (0)