App 2.16.3: full screen stays with drop-downs and dialogs
Opening a drop-down or a dialog brought the car's bars back until it closed: each is a window of its own, and the system shows the bars when a window without the full-screen flags takes focus. - The drop-downs (upload frequency, tyre pressure unit, accent colour) are now single-choice buttons on the page: no extra window, one tap instead of two, full touch targets, the choice in the accent colour. - Dialogs (About, update, pairing, phone settings, trip reset, date picker) are shown unfocusable, given the activity's full-screen flags, and only then allowed focus. None of them takes typing, which an unfocusable window would block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
@@ -112,6 +112,11 @@ tyre pressures, GPS (lat, lon, elevation, heading) and the is_* flags. It does *
|
|||||||
INGEST_TOKEN) into git and pushed it. Commit amended and force-pushed; both values regenerated in
|
INGEST_TOKEN) into git and pushed it. Commit amended and force-pushed; both values regenerated in
|
||||||
the now gitignored `k8s/secrets.yaml` (since moved to `k8s/secrets/secrets.yaml`, outside
|
the now gitignored `k8s/secrets.yaml` (since moved to `k8s/secrets/secrets.yaml`, outside
|
||||||
`kubectl apply -f k8s/`). Filled-in secrets live only there from now on.
|
`kubectl apply -f k8s/`). Filled-in secrets live only there from now on.
|
||||||
|
- 2026-10-18 — App 2.16.3: full screen stays while choosing or reading a dialog. Drop-downs (upload
|
||||||
|
frequency, tyre unit, accent colour) are now buttons on the page: a drop-down is a window of its
|
||||||
|
own without the full-screen flags, so the car showed its bars while it was open. Dialogs are
|
||||||
|
shown unfocusable, given the activity's full-screen flags, then allowed focus
|
||||||
|
(`showKeepingFullScreen`); none of them takes typing.
|
||||||
- 2026-10-18 — From the car (2.16.2): screen 1920×720 px at 160 dpi with a 1778×720 px app
|
- 2026-10-18 — From the car (2.16.2): screen 1920×720 px at 160 dpi with a 1778×720 px app
|
||||||
window, so EVProfile's 1280×480 does not apply; colour probe found only `vehicle_type = AS28`.
|
window, so EVProfile's 1280×480 does not apply; colour probe found only `vehicle_type = AS28`.
|
||||||
FIRMWARE.md, mise.toml and SPECS.md say so.
|
FIRMWARE.md, mise.toml and SPECS.md say so.
|
||||||
|
|||||||
+2
-2
@@ -34,8 +34,8 @@ android {
|
|||||||
applicationId "com.stinnesbeck.nilsmg4"
|
applicationId "com.stinnesbeck.nilsmg4"
|
||||||
minSdk 27
|
minSdk 27
|
||||||
targetSdk 36
|
targetSdk 36
|
||||||
versionCode 86
|
versionCode 87
|
||||||
versionName "2.16.2"
|
versionName "2.16.3"
|
||||||
|
|
||||||
// Nothing about the server ships in the APK: its URL and ingest token are entered in
|
// Nothing about the server ships in the APK: its URL and ingest token are entered in
|
||||||
// the app's Server tab (ServerConfig), and the database is only reachable by the server.
|
// the app's Server tab (ServerConfig), and the database is only reachable by the server.
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
/** Upload page: live telemetry switch and cadence. */
|
/** Upload page: live telemetry switch and cadence. */
|
||||||
private SwitchMaterial liveTelemetrySwitch, boostSwitch, voiceKeySwitch, fullScreenSwitch;
|
private SwitchMaterial liveTelemetrySwitch, boostSwitch, voiceKeySwitch, fullScreenSwitch;
|
||||||
private TextView steeringKeysText;
|
private TextView steeringKeysText;
|
||||||
private android.widget.Spinner intervalSpinner;
|
private com.google.android.material.chip.ChipGroup intervalChoices;
|
||||||
private TextInputLayout lowSocLayout;
|
private TextInputLayout lowSocLayout;
|
||||||
private TextInputEditText lowSocInput;
|
private TextInputEditText lowSocInput;
|
||||||
|
|
||||||
@@ -305,6 +305,26 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
window.widthPixels, window.heightPixels, config.screenWidthDp, config.screenHeightDp));
|
window.widthPixels, window.heightPixels, config.screenWidthDp, config.screenHeightDp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows a dialog without bringing the car's bars back. A dialog is a window of its own, and
|
||||||
|
* the system shows the bars when a window without the full-screen flags takes focus. So it
|
||||||
|
* is shown unfocusable, given the activity's flags, and only then allowed focus. None of the
|
||||||
|
* dialogs here take typing, which an unfocusable window would block.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation") // the WindowInsetsController API starts at 30; this is 28
|
||||||
|
private void showKeepingFullScreen(android.app.Dialog dialog) {
|
||||||
|
android.view.Window window = dialog.getWindow();
|
||||||
|
if (window == null || !UploadSettings.fullScreen(prefs)) {
|
||||||
|
dialog.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.setFlags(android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
|
||||||
|
android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
||||||
|
dialog.show();
|
||||||
|
window.getDecorView().setSystemUiVisibility(getWindow().getDecorView().getSystemUiVisibility());
|
||||||
|
window.clearFlags(android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
||||||
|
}
|
||||||
|
|
||||||
private static final String STATE_PAGE = "page";
|
private static final String STATE_PAGE = "page";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -332,7 +352,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
.setView(content)
|
.setView(content)
|
||||||
.create();
|
.create();
|
||||||
content.<MaterialButton>findViewById(R.id.about_close).setOnClickListener(v -> dialog.dismiss());
|
content.<MaterialButton>findViewById(R.id.about_close).setOnClickListener(v -> dialog.dismiss());
|
||||||
dialog.show();
|
showKeepingFullScreen(dialog);
|
||||||
if (dialog.getWindow() != null) {
|
if (dialog.getWindow() != null) {
|
||||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
android.util.DisplayMetrics metrics = getResources().getDisplayMetrics();
|
android.util.DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||||
@@ -440,7 +460,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
.setView(panel)
|
.setView(panel)
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.create();
|
.create();
|
||||||
dialog.show();
|
showKeepingFullScreen(dialog);
|
||||||
UpdateHook.checkInBackground(this, new UpdateHook.Listener() {
|
UpdateHook.checkInBackground(this, new UpdateHook.Listener() {
|
||||||
@Override public void onProgress(int percent) {
|
@Override public void onProgress(int percent) {
|
||||||
if (percent < 0) {
|
if (percent < 0) {
|
||||||
@@ -457,11 +477,11 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
@Override public void onResult(String message) {
|
@Override public void onResult(String message) {
|
||||||
button.setEnabled(true);
|
button.setEnabled(true);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
new MaterialAlertDialogBuilder(MainActivity.this)
|
showKeepingFullScreen(new MaterialAlertDialogBuilder(MainActivity.this)
|
||||||
.setTitle(R.string.update_dialog_title)
|
.setTitle(R.string.update_dialog_title)
|
||||||
.setMessage(message)
|
.setMessage(message)
|
||||||
.setPositiveButton(android.R.string.ok, null)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show();
|
.create());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -796,7 +816,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
qr.setVisibility(View.GONE);
|
qr.setVisibility(View.GONE);
|
||||||
code.setVisibility(View.GONE);
|
code.setVisibility(View.GONE);
|
||||||
dialog.setOnDismissListener(d -> cancelled[0] = true);
|
dialog.setOnDismissListener(d -> cancelled[0] = true);
|
||||||
dialog.show();
|
showKeepingFullScreen(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Shows the request: QR code, the code in the sentence and below it. UI thread. */
|
/** Shows the request: QR code, the code in the sentence and below it. UI thread. */
|
||||||
@@ -1032,7 +1052,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
applyFullScreen();
|
applyFullScreen();
|
||||||
});
|
});
|
||||||
liveTelemetrySwitch = servicePane.findViewById(R.id.abrp_upload_switch);
|
liveTelemetrySwitch = servicePane.findViewById(R.id.abrp_upload_switch);
|
||||||
intervalSpinner = servicePane.findViewById(R.id.interval_spinner);
|
intervalChoices = servicePane.findViewById(R.id.interval_choices);
|
||||||
boostSwitch = servicePane.findViewById(R.id.boost_switch);
|
boostSwitch = servicePane.findViewById(R.id.boost_switch);
|
||||||
lowSocInput = servicePane.findViewById(R.id.low_soc_input);
|
lowSocInput = servicePane.findViewById(R.id.low_soc_input);
|
||||||
lowSocLayout = servicePane.findViewById(R.id.low_soc_layout);
|
lowSocLayout = servicePane.findViewById(R.id.low_soc_layout);
|
||||||
@@ -1105,47 +1125,52 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}, "abrp-test").start();
|
}, "abrp-test").start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A single choice as buttons on the page (choice_chip.xml), in place of a drop-down: a
|
||||||
|
* drop-down opens a window of its own that is not full screen, and the car's bars came back
|
||||||
|
* while it was open. Rebinding replaces the buttons, so it may be called again.
|
||||||
|
*/
|
||||||
|
private void bindChoices(com.google.android.material.chip.ChipGroup group, String[] labels, int selected,
|
||||||
|
java.util.function.IntConsumer onPick) {
|
||||||
|
group.setOnCheckedStateChangeListener(null);
|
||||||
|
group.removeAllViews();
|
||||||
|
for (int i = 0; i < labels.length; i++) {
|
||||||
|
com.google.android.material.chip.Chip chip = (com.google.android.material.chip.Chip)
|
||||||
|
getLayoutInflater().inflate(R.layout.choice_chip, group, false);
|
||||||
|
chip.setId(View.generateViewId());
|
||||||
|
chip.setText(labels[i]);
|
||||||
|
chip.setTag(i);
|
||||||
|
group.addView(chip);
|
||||||
|
if (i == selected) chip.setChecked(true);
|
||||||
|
}
|
||||||
|
group.setOnCheckedStateChangeListener((g, checkedIds) -> {
|
||||||
|
if (checkedIds.isEmpty()) return;
|
||||||
|
View chosen = g.findViewById(checkedIds.get(0));
|
||||||
|
if (chosen != null) onPick.accept((Integer) chosen.getTag());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** The accent colour; a change recreates the activity so every view takes it. */
|
/** The accent colour; a change recreates the activity so every view takes it. */
|
||||||
private void bindAccentColor() {
|
private void bindAccentColor() {
|
||||||
android.widget.Spinner spinner = settingsPane.findViewById(R.id.accent_spinner);
|
|
||||||
AccentColor[] colors = AccentColor.values();
|
AccentColor[] colors = AccentColor.values();
|
||||||
String[] labels = new String[colors.length];
|
String[] labels = new String[colors.length];
|
||||||
for (int i = 0; i < colors.length; i++) labels[i] = colors[i].label;
|
for (int i = 0; i < colors.length; i++) labels[i] = colors[i].label;
|
||||||
android.widget.ArrayAdapter<String> adapter = new android.widget.ArrayAdapter<>(
|
|
||||||
this, R.layout.spinner_value, labels);
|
|
||||||
adapter.setDropDownViewResource(R.layout.spinner_dropdown);
|
|
||||||
spinner.setAdapter(adapter);
|
|
||||||
AccentColor current = AccentColor.fromPref(prefs.getString(AccentColor.PREF_KEY, null));
|
AccentColor current = AccentColor.fromPref(prefs.getString(AccentColor.PREF_KEY, null));
|
||||||
spinner.setSelection(current.ordinal());
|
bindChoices(settingsPane.findViewById(R.id.accent_choices), labels, current.ordinal(), position -> {
|
||||||
spinner.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
if (colors[position] == current) return;
|
if (colors[position] == current) return;
|
||||||
prefs.edit().putString(AccentColor.PREF_KEY, colors[position].name()).apply();
|
prefs.edit().putString(AccentColor.PREF_KEY, colors[position].name()).apply();
|
||||||
recreate();
|
recreate();
|
||||||
}
|
|
||||||
@Override public void onNothingSelected(android.widget.AdapterView<?> parent) { }
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Tyre pressure unit: display only, read on every refresh of the Overview. */
|
/** Tyre pressure unit: display only, read on every refresh of the Overview. */
|
||||||
private void bindTireUnit() {
|
private void bindTireUnit() {
|
||||||
android.widget.Spinner spinner = settingsPane.findViewById(R.id.tire_unit_spinner);
|
|
||||||
PressureUnit[] units = PressureUnit.values();
|
PressureUnit[] units = PressureUnit.values();
|
||||||
String[] labels = new String[units.length];
|
String[] labels = new String[units.length];
|
||||||
for (int i = 0; i < units.length; i++) labels[i] = units[i].label;
|
for (int i = 0; i < units.length; i++) labels[i] = units[i].label;
|
||||||
android.widget.ArrayAdapter<String> adapter = new android.widget.ArrayAdapter<>(
|
int current = PressureUnit.fromPref(prefs.getString(PressureUnit.PREF_KEY, null)).ordinal();
|
||||||
this, R.layout.spinner_value, labels);
|
bindChoices(settingsPane.findViewById(R.id.tire_unit_choices), labels, current, position ->
|
||||||
adapter.setDropDownViewResource(R.layout.spinner_dropdown);
|
prefs.edit().putString(PressureUnit.PREF_KEY, units[position].name()).apply());
|
||||||
spinner.setAdapter(adapter);
|
|
||||||
spinner.setSelection(PressureUnit.fromPref(prefs.getString(PressureUnit.PREF_KEY, null)).ordinal());
|
|
||||||
spinner.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
prefs.edit().putString(PressureUnit.PREF_KEY, units[position].name()).apply();
|
|
||||||
}
|
|
||||||
@Override public void onNothingSelected(android.widget.AdapterView<?> parent) { }
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The service reads these settings on every tick, so a change applies without a restart. */
|
/** The service reads these settings on every tick, so a change applies without a restart. */
|
||||||
@@ -1161,19 +1186,9 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
: getResources().getQuantityString(R.plurals.interval_seconds, sec, sec);
|
: getResources().getQuantityString(R.plurals.interval_seconds, sec, sec);
|
||||||
if (sec == current.intervalSec) selected = i;
|
if (sec == current.intervalSec) selected = i;
|
||||||
}
|
}
|
||||||
android.widget.ArrayAdapter<String> adapter = new android.widget.ArrayAdapter<>(
|
bindChoices(intervalChoices, labels, selected, position ->
|
||||||
this, R.layout.spinner_value, labels);
|
|
||||||
adapter.setDropDownViewResource(R.layout.spinner_dropdown);
|
|
||||||
intervalSpinner.setAdapter(adapter);
|
|
||||||
intervalSpinner.setSelection(selected);
|
|
||||||
intervalSpinner.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
prefs.edit().putInt(UploadSettings.KEY_INTERVAL_SEC,
|
prefs.edit().putInt(UploadSettings.KEY_INTERVAL_SEC,
|
||||||
UploadSettings.INTERVAL_CHOICES_SEC[position]).apply();
|
UploadSettings.INTERVAL_CHOICES_SEC[position]).apply());
|
||||||
}
|
|
||||||
@Override public void onNothingSelected(android.widget.AdapterView<?> parent) { }
|
|
||||||
});
|
|
||||||
|
|
||||||
boostSwitch.setOnCheckedChangeListener(null);
|
boostSwitch.setOnCheckedChangeListener(null);
|
||||||
boostSwitch.setChecked(current.boostLowSoc);
|
boostSwitch.setChecked(current.boostLowSoc);
|
||||||
@@ -1462,13 +1477,14 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
if (consumptionPeriod != ConsumptionTracker.Period.TRIP_A && consumptionPeriod != ConsumptionTracker.Period.TRIP_B) return;
|
if (consumptionPeriod != ConsumptionTracker.Period.TRIP_A && consumptionPeriod != ConsumptionTracker.Period.TRIP_B) return;
|
||||||
String name = getString(consumptionPeriod == ConsumptionTracker.Period.TRIP_A
|
String name = getString(consumptionPeriod == ConsumptionTracker.Period.TRIP_A
|
||||||
? R.string.consumption_trip_a : R.string.consumption_trip_b);
|
? R.string.consumption_trip_a : R.string.consumption_trip_b);
|
||||||
new MaterialAlertDialogBuilder(this).setTitle(getString(R.string.trip_reset_title, name))
|
showKeepingFullScreen(new MaterialAlertDialogBuilder(this)
|
||||||
|
.setTitle(getString(R.string.trip_reset_title, name))
|
||||||
.setMessage(R.string.trip_reset_message)
|
.setMessage(R.string.trip_reset_message)
|
||||||
.setNegativeButton(R.string.pair_cancel, null)
|
.setNegativeButton(R.string.pair_cancel, null)
|
||||||
.setPositiveButton(R.string.trip_reset_confirm, (d, w) -> {
|
.setPositiveButton(R.string.trip_reset_confirm, (d, w) -> {
|
||||||
consumptionTracker.reset(consumptionPeriod);
|
consumptionTracker.reset(consumptionPeriod);
|
||||||
refreshConsumption();
|
refreshConsumption();
|
||||||
}).show();
|
}).create());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1671,7 +1687,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
dialog.getDatePicker().setMaxDate(System.currentTimeMillis());
|
dialog.getDatePicker().setMaxDate(System.currentTimeMillis());
|
||||||
dialog.getDatePicker().setMinDate(java.time.LocalDate.now().minusMonths(4)
|
dialog.getDatePicker().setMinDate(java.time.LocalDate.now().minusMonths(4)
|
||||||
.atStartOfDay(zone).toInstant().toEpochMilli());
|
.atStartOfDay(zone).toInstant().toEpochMilli());
|
||||||
dialog.show();
|
showKeepingFullScreen(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_checked="true" android:color="?attr/evAccentSurface" />
|
||||||
|
<item android:color="@color/ev_surface_raised" />
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_checked="true" android:color="?attr/evAccent" />
|
||||||
|
<item android:color="@color/ev_outline" />
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_checked="true" android:color="?attr/evAccent" />
|
||||||
|
<item android:color="@color/ev_text_primary" />
|
||||||
|
</selector>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="24dp" android:background="@drawable/bg_glass">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="24dp" android:background="@drawable/bg_glass">
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/design_service_timing" android:textAppearance="@style/Text.EV.Eyebrow" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/design_service_timing" android:textAppearance="@style/Text.EV.Eyebrow" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_frequency" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_frequency" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
||||||
<Spinner android:id="@+id/interval_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:layout_marginTop="12dp" android:background="@drawable/bg_input_panel" android:popupBackground="@color/ev_surface_raised" android:contentDescription="@string/label_frequency" android:spinnerMode="dropdown" />
|
<com.google.android.material.chip.ChipGroup android:id="@+id/interval_choices" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" app:singleSelection="true" app:selectionRequired="true" app:chipSpacingHorizontal="12dp" app:chipSpacingVertical="8dp" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hint_frequency" android:textAppearance="@style/Text.EV.Secondary" android:layout_marginTop="12dp" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hint_frequency" android:textAppearance="@style/Text.EV.Secondary" android:layout_marginTop="12dp" />
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/boost_switch" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:text="@string/label_boost_low_soc" android:textAppearance="@style/Text.EV.Body" android:paddingTop="8dp" android:paddingBottom="8dp" app:useMaterialThemeColors="true" app:thumbTint="@color/switch_thumb" app:trackTint="@color/switch_track" android:textColor="@color/ev_text_primary" />
|
<com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/boost_switch" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:text="@string/label_boost_low_soc" android:textAppearance="@style/Text.EV.Body" android:paddingTop="8dp" android:paddingBottom="8dp" app:useMaterialThemeColors="true" app:thumbTint="@color/switch_thumb" app:trackTint="@color/switch_track" android:textColor="@color/ev_text_primary" />
|
||||||
<com.google.android.material.textfield.TextInputLayout android:id="@+id/low_soc_layout" style="@style/Widget.EV.Input" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" android:hint="@string/label_low_soc_threshold">
|
<com.google.android.material.textfield.TextInputLayout android:id="@+id/low_soc_layout" style="@style/Widget.EV.Input" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" android:hint="@string/label_low_soc_threshold">
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
<com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/voice_key_switch" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:text="@string/label_voice_key" android:textAppearance="@style/Text.EV.Body" android:paddingTop="8dp" android:paddingBottom="8dp" app:useMaterialThemeColors="true" app:thumbTint="@color/switch_thumb" app:trackTint="@color/switch_track" android:textColor="@color/ev_text_primary" />
|
<com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/voice_key_switch" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:text="@string/label_voice_key" android:textAppearance="@style/Text.EV.Body" android:paddingTop="8dp" android:paddingBottom="8dp" app:useMaterialThemeColors="true" app:thumbTint="@color/switch_thumb" app:trackTint="@color/switch_track" android:textColor="@color/ev_text_primary" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hint_voice_key" android:textAppearance="@style/Text.EV.Secondary" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hint_voice_key" android:textAppearance="@style/Text.EV.Secondary" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_tire_unit" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_tire_unit" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
||||||
<Spinner android:id="@+id/tire_unit_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:layout_marginTop="12dp" android:background="@drawable/bg_input_panel" android:popupBackground="@color/ev_surface_raised" android:contentDescription="@string/label_tire_unit" android:spinnerMode="dropdown" />
|
<com.google.android.material.chip.ChipGroup android:id="@+id/tire_unit_choices" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" app:singleSelection="true" app:selectionRequired="true" app:chipSpacingHorizontal="12dp" app:chipSpacingVertical="8dp" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_accent" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_accent" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
||||||
<Spinner android:id="@+id/accent_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:layout_marginTop="12dp" android:background="@drawable/bg_input_panel" android:popupBackground="@color/ev_surface_raised" android:contentDescription="@string/label_accent" android:spinnerMode="dropdown" />
|
<com.google.android.material.chip.ChipGroup android:id="@+id/accent_choices" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" app:singleSelection="true" app:selectionRequired="true" app:chipSpacingHorizontal="12dp" app:chipSpacingVertical="8dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="24dp" android:background="@drawable/bg_glass" android:layout_marginTop="16dp">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="24dp" android:background="@drawable/bg_glass" android:layout_marginTop="16dp">
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/design_battery_settings_title" android:textAppearance="@style/Text.EV.Eyebrow" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/design_battery_settings_title" android:textAppearance="@style/Text.EV.Eyebrow" />
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- One option of an on-page choice (MainActivity.bindChoices). Chips rather than a drop-down:
|
||||||
|
a drop-down opens its own window, which is not full screen, so the car's bars came back
|
||||||
|
while it was open; and one tap is easier than two while driving. -->
|
||||||
|
<com.google.android.material.chip.Chip xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
style="@style/Widget.EV.Choice"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="24dp" android:background="@drawable/bg_glass" android:layout_marginTop="16dp">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="24dp" android:background="@drawable/bg_glass" android:layout_marginTop="16dp">
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/design_service_timing" android:textAppearance="@style/Text.EV.Eyebrow" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/design_service_timing" android:textAppearance="@style/Text.EV.Eyebrow" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_frequency" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_frequency" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
||||||
<Spinner android:id="@+id/interval_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:layout_marginTop="12dp" android:background="@drawable/bg_input_panel" android:popupBackground="@color/ev_surface_raised" android:contentDescription="@string/label_frequency" android:spinnerMode="dropdown" />
|
<com.google.android.material.chip.ChipGroup android:id="@+id/interval_choices" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" app:singleSelection="true" app:selectionRequired="true" app:chipSpacingHorizontal="12dp" app:chipSpacingVertical="8dp" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hint_frequency" android:textAppearance="@style/Text.EV.Secondary" android:layout_marginTop="12dp" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hint_frequency" android:textAppearance="@style/Text.EV.Secondary" android:layout_marginTop="12dp" />
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/boost_switch" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:text="@string/label_boost_low_soc" android:textAppearance="@style/Text.EV.Body" android:paddingTop="8dp" android:paddingBottom="8dp" app:useMaterialThemeColors="true" app:thumbTint="@color/switch_thumb" app:trackTint="@color/switch_track" android:textColor="@color/ev_text_primary" />
|
<com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/boost_switch" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:text="@string/label_boost_low_soc" android:textAppearance="@style/Text.EV.Body" android:paddingTop="8dp" android:paddingBottom="8dp" app:useMaterialThemeColors="true" app:thumbTint="@color/switch_thumb" app:trackTint="@color/switch_track" android:textColor="@color/ev_text_primary" />
|
||||||
<com.google.android.material.textfield.TextInputLayout android:id="@+id/low_soc_layout" style="@style/Widget.EV.Input" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" android:hint="@string/label_low_soc_threshold">
|
<com.google.android.material.textfield.TextInputLayout android:id="@+id/low_soc_layout" style="@style/Widget.EV.Input" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" android:hint="@string/label_low_soc_threshold">
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/voice_key_switch" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:text="@string/label_voice_key" android:textAppearance="@style/Text.EV.Body" android:paddingTop="8dp" android:paddingBottom="8dp" app:useMaterialThemeColors="true" app:thumbTint="@color/switch_thumb" app:trackTint="@color/switch_track" android:textColor="@color/ev_text_primary" />
|
<com.google.android.material.switchmaterial.SwitchMaterial android:id="@+id/voice_key_switch" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:text="@string/label_voice_key" android:textAppearance="@style/Text.EV.Body" android:paddingTop="8dp" android:paddingBottom="8dp" app:useMaterialThemeColors="true" app:thumbTint="@color/switch_thumb" app:trackTint="@color/switch_track" android:textColor="@color/ev_text_primary" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hint_voice_key" android:textAppearance="@style/Text.EV.Secondary" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hint_voice_key" android:textAppearance="@style/Text.EV.Secondary" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_tire_unit" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_tire_unit" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
||||||
<Spinner android:id="@+id/tire_unit_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:layout_marginTop="12dp" android:background="@drawable/bg_input_panel" android:popupBackground="@color/ev_surface_raised" android:contentDescription="@string/label_tire_unit" android:spinnerMode="dropdown" />
|
<com.google.android.material.chip.ChipGroup android:id="@+id/tire_unit_choices" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" app:singleSelection="true" app:selectionRequired="true" app:chipSpacingHorizontal="12dp" app:chipSpacingVertical="8dp" />
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_accent" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/label_accent" android:textAppearance="@style/Text.EV.Body" android:layout_marginTop="20dp" />
|
||||||
<Spinner android:id="@+id/accent_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:layout_marginTop="12dp" android:background="@drawable/bg_input_panel" android:popupBackground="@color/ev_surface_raised" android:contentDescription="@string/label_accent" android:spinnerMode="dropdown" />
|
<com.google.android.material.chip.ChipGroup android:id="@+id/accent_choices" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" app:singleSelection="true" app:selectionRequired="true" app:chipSpacingHorizontal="12dp" app:chipSpacingVertical="8dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="24dp" android:background="@drawable/bg_glass" android:layout_marginTop="16dp">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="24dp" android:background="@drawable/bg_glass" android:layout_marginTop="16dp">
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/design_battery_settings_title" android:textAppearance="@style/Text.EV.Eyebrow" />
|
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/design_battery_settings_title" android:textAppearance="@style/Text.EV.Eyebrow" />
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:minHeight="72dp" android:gravity="center_vertical"
|
|
||||||
android:paddingStart="20dp" android:paddingEnd="20dp"
|
|
||||||
android:paddingTop="12dp" android:paddingBottom="12dp"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:textAppearance="@style/Text.EV.Body" />
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:minHeight="72dp" android:gravity="center_vertical"
|
|
||||||
android:paddingStart="20dp" android:paddingEnd="20dp"
|
|
||||||
android:paddingTop="12dp" android:paddingBottom="12dp"
|
|
||||||
android:drawableEnd="@drawable/ic_chevron_down" android:drawablePadding="16dp"
|
|
||||||
android:textAppearance="@style/Text.EV.Body" />
|
|
||||||
@@ -96,4 +96,20 @@
|
|||||||
<style name="ShapeAppearanceOverlay.EV.Button" parent="">
|
<style name="ShapeAppearanceOverlay.EV.Button" parent="">
|
||||||
<item name="cornerSize">18dp</item>
|
<item name="cornerSize">18dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<!-- On-page single choice (choice_chip.xml): a full touch target, the accent when chosen. -->
|
||||||
|
<style name="Widget.EV.Choice" parent="Widget.Material3.Chip.Filter">
|
||||||
|
<item name="android:checkable">true</item>
|
||||||
|
<item name="checkedIconVisible">false</item>
|
||||||
|
<item name="chipMinHeight">@dimen/touch_target</item>
|
||||||
|
<item name="chipMinTouchTargetSize">@dimen/touch_target</item>
|
||||||
|
<item name="android:textSize">@dimen/text_body</item>
|
||||||
|
<item name="android:textColor">@color/choice_text</item>
|
||||||
|
<item name="chipBackgroundColor">@color/choice_background</item>
|
||||||
|
<item name="chipStrokeColor">@color/choice_stroke</item>
|
||||||
|
<item name="chipStrokeWidth">1dp</item>
|
||||||
|
<item name="chipStartPadding">16dp</item>
|
||||||
|
<item name="chipEndPadding">16dp</item>
|
||||||
|
<item name="ensureMinTouchTargetSize">false</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user