Align Android terminal themes with server
This commit is contained in:
@@ -181,7 +181,7 @@ public final class MainActivity extends Activity {
|
|||||||
private float terminalFontSizeSp = 11f;
|
private float terminalFontSizeSp = 11f;
|
||||||
private float terminalLineHeight = 1.05f;
|
private float terminalLineHeight = 1.05f;
|
||||||
private String terminalFontFamily = "monospace";
|
private String terminalFontFamily = "monospace";
|
||||||
private String terminalThemeId = "dark";
|
private String terminalThemeId = "graphite";
|
||||||
private float terminalTouchStartY;
|
private float terminalTouchStartY;
|
||||||
private int terminalTouchStartScrollY;
|
private int terminalTouchStartScrollY;
|
||||||
private int terminalReconnectAttempt;
|
private int terminalReconnectAttempt;
|
||||||
@@ -2894,7 +2894,8 @@ public final class MainActivity extends Activity {
|
|||||||
String currentFamily = prefs.getString("terminal_font_family:" + key,
|
String currentFamily = prefs.getString("terminal_font_family:" + key,
|
||||||
prefs.getString("terminal_font_family:default", "monospace"));
|
prefs.getString("terminal_font_family:default", "monospace"));
|
||||||
String currentTheme = prefs.getString("terminal_theme:" + key,
|
String currentTheme = prefs.getString("terminal_theme:" + key,
|
||||||
prefs.getString("terminal_theme:default", "dark"));
|
prefs.getString("terminal_theme:default", "graphite"));
|
||||||
|
currentTheme = normalizeTerminalTheme(currentTheme);
|
||||||
|
|
||||||
Dialog dialog = new Dialog(this);
|
Dialog dialog = new Dialog(this);
|
||||||
LinearLayout sheet = bottomSheetContent(
|
LinearLayout sheet = bottomSheetContent(
|
||||||
@@ -2947,10 +2948,10 @@ public final class MainActivity extends Activity {
|
|||||||
String[] selectedTheme = {currentTheme};
|
String[] selectedTheme = {currentTheme};
|
||||||
LinearLayout themeRow = new LinearLayout(this);
|
LinearLayout themeRow = new LinearLayout(this);
|
||||||
themeRow.setOrientation(LinearLayout.HORIZONTAL);
|
themeRow.setOrientation(LinearLayout.HORIZONTAL);
|
||||||
Button dark = settingChoice("Dark", "dark", selectedTheme);
|
Button graphite = settingChoice("Graphite", "graphite", selectedTheme);
|
||||||
Button oled = settingChoice("OLED", "oled", selectedTheme);
|
Button ink = settingChoice("Ink", "ink", selectedTheme);
|
||||||
Button[] themeButtons = {dark, oled};
|
Button[] themeButtons = {graphite, ink};
|
||||||
String[] themeValues = {"dark", "oled"};
|
String[] themeValues = {"graphite", "ink"};
|
||||||
for (int index = 0; index < themeButtons.length; index++) {
|
for (int index = 0; index < themeButtons.length; index++) {
|
||||||
Button button = themeButtons[index];
|
Button button = themeButtons[index];
|
||||||
String value = themeValues[index];
|
String value = themeValues[index];
|
||||||
@@ -3041,7 +3042,8 @@ public final class MainActivity extends Activity {
|
|||||||
terminalFontFamily = prefs.getString("terminal_font_family:" + key,
|
terminalFontFamily = prefs.getString("terminal_font_family:" + key,
|
||||||
prefs.getString("terminal_font_family:default", "monospace"));
|
prefs.getString("terminal_font_family:default", "monospace"));
|
||||||
terminalThemeId = prefs.getString("terminal_theme:" + key,
|
terminalThemeId = prefs.getString("terminal_theme:" + key,
|
||||||
prefs.getString("terminal_theme:default", "dark"));
|
prefs.getString("terminal_theme:default", "graphite"));
|
||||||
|
terminalThemeId = normalizeTerminalTheme(terminalThemeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyTerminalDisplaySettings() {
|
private void applyTerminalDisplaySettings() {
|
||||||
@@ -3078,7 +3080,17 @@ public final class MainActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int terminalBackgroundColor() {
|
private int terminalBackgroundColor() {
|
||||||
return "oled".equals(terminalThemeId) ? Color.BLACK : COLOR_TERMINAL_BG;
|
return "ink".equals(terminalThemeId) ? Color.rgb(7, 8, 10) : Color.rgb(17, 17, 17);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String normalizeTerminalTheme(String theme) {
|
||||||
|
if ("oled".equals(theme)) {
|
||||||
|
return "ink";
|
||||||
|
}
|
||||||
|
if ("dark".equals(theme) || theme == null || theme.isEmpty()) {
|
||||||
|
return "graphite";
|
||||||
|
}
|
||||||
|
return theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextView settingValue(String text) {
|
private TextView settingValue(String text) {
|
||||||
|
|||||||
Reference in New Issue
Block a user