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:
+2
-2
@@ -34,8 +34,8 @@ android {
|
||||
applicationId "com.stinnesbeck.nilsmg4"
|
||||
minSdk 27
|
||||
targetSdk 36
|
||||
versionCode 86
|
||||
versionName "2.16.2"
|
||||
versionCode 87
|
||||
versionName "2.16.3"
|
||||
|
||||
// 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.
|
||||
|
||||
@@ -126,7 +126,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
/** Upload page: live telemetry switch and cadence. */
|
||||
private SwitchMaterial liveTelemetrySwitch, boostSwitch, voiceKeySwitch, fullScreenSwitch;
|
||||
private TextView steeringKeysText;
|
||||
private android.widget.Spinner intervalSpinner;
|
||||
private com.google.android.material.chip.ChipGroup intervalChoices;
|
||||
private TextInputLayout lowSocLayout;
|
||||
private TextInputEditText lowSocInput;
|
||||
|
||||
@@ -305,6 +305,26 @@ public class MainActivity extends AppCompatActivity {
|
||||
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";
|
||||
|
||||
@Override
|
||||
@@ -332,7 +352,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
.setView(content)
|
||||
.create();
|
||||
content.<MaterialButton>findViewById(R.id.about_close).setOnClickListener(v -> dialog.dismiss());
|
||||
dialog.show();
|
||||
showKeepingFullScreen(dialog);
|
||||
if (dialog.getWindow() != null) {
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
android.util.DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||
@@ -440,7 +460,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
.setView(panel)
|
||||
.setCancelable(false)
|
||||
.create();
|
||||
dialog.show();
|
||||
showKeepingFullScreen(dialog);
|
||||
UpdateHook.checkInBackground(this, new UpdateHook.Listener() {
|
||||
@Override public void onProgress(int percent) {
|
||||
if (percent < 0) {
|
||||
@@ -457,11 +477,11 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override public void onResult(String message) {
|
||||
button.setEnabled(true);
|
||||
dialog.dismiss();
|
||||
new MaterialAlertDialogBuilder(MainActivity.this)
|
||||
showKeepingFullScreen(new MaterialAlertDialogBuilder(MainActivity.this)
|
||||
.setTitle(R.string.update_dialog_title)
|
||||
.setMessage(message)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
.create());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -796,7 +816,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
qr.setVisibility(View.GONE);
|
||||
code.setVisibility(View.GONE);
|
||||
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. */
|
||||
@@ -1032,7 +1052,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
applyFullScreen();
|
||||
});
|
||||
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);
|
||||
lowSocInput = servicePane.findViewById(R.id.low_soc_input);
|
||||
lowSocLayout = servicePane.findViewById(R.id.low_soc_layout);
|
||||
@@ -1105,47 +1125,52 @@ public class MainActivity extends AppCompatActivity {
|
||||
}, "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. */
|
||||
private void bindAccentColor() {
|
||||
android.widget.Spinner spinner = settingsPane.findViewById(R.id.accent_spinner);
|
||||
AccentColor[] colors = AccentColor.values();
|
||||
String[] labels = new String[colors.length];
|
||||
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));
|
||||
spinner.setSelection(current.ordinal());
|
||||
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;
|
||||
prefs.edit().putString(AccentColor.PREF_KEY, colors[position].name()).apply();
|
||||
recreate();
|
||||
}
|
||||
@Override public void onNothingSelected(android.widget.AdapterView<?> parent) { }
|
||||
bindChoices(settingsPane.findViewById(R.id.accent_choices), labels, current.ordinal(), position -> {
|
||||
if (colors[position] == current) return;
|
||||
prefs.edit().putString(AccentColor.PREF_KEY, colors[position].name()).apply();
|
||||
recreate();
|
||||
});
|
||||
}
|
||||
|
||||
/** Tyre pressure unit: display only, read on every refresh of the Overview. */
|
||||
private void bindTireUnit() {
|
||||
android.widget.Spinner spinner = settingsPane.findViewById(R.id.tire_unit_spinner);
|
||||
PressureUnit[] units = PressureUnit.values();
|
||||
String[] labels = new String[units.length];
|
||||
for (int i = 0; i < units.length; i++) labels[i] = units[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);
|
||||
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) { }
|
||||
});
|
||||
int current = PressureUnit.fromPref(prefs.getString(PressureUnit.PREF_KEY, null)).ordinal();
|
||||
bindChoices(settingsPane.findViewById(R.id.tire_unit_choices), labels, current, position ->
|
||||
prefs.edit().putString(PressureUnit.PREF_KEY, units[position].name()).apply());
|
||||
}
|
||||
|
||||
/** 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);
|
||||
if (sec == current.intervalSec) selected = i;
|
||||
}
|
||||
android.widget.ArrayAdapter<String> adapter = new android.widget.ArrayAdapter<>(
|
||||
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) {
|
||||
bindChoices(intervalChoices, labels, selected, position ->
|
||||
prefs.edit().putInt(UploadSettings.KEY_INTERVAL_SEC,
|
||||
UploadSettings.INTERVAL_CHOICES_SEC[position]).apply();
|
||||
}
|
||||
@Override public void onNothingSelected(android.widget.AdapterView<?> parent) { }
|
||||
});
|
||||
UploadSettings.INTERVAL_CHOICES_SEC[position]).apply());
|
||||
|
||||
boostSwitch.setOnCheckedChangeListener(null);
|
||||
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;
|
||||
String name = getString(consumptionPeriod == ConsumptionTracker.Period.TRIP_A
|
||||
? 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)
|
||||
.setNegativeButton(R.string.pair_cancel, null)
|
||||
.setPositiveButton(R.string.trip_reset_confirm, (d, w) -> {
|
||||
consumptionTracker.reset(consumptionPeriod);
|
||||
refreshConsumption();
|
||||
}).show();
|
||||
}).create());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1671,7 +1687,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
dialog.getDatePicker().setMaxDate(System.currentTimeMillis());
|
||||
dialog.getDatePicker().setMinDate(java.time.LocalDate.now().minusMonths(4)
|
||||
.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">
|
||||
<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" />
|
||||
<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" />
|
||||
<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">
|
||||
|
||||
@@ -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" />
|
||||
<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" />
|
||||
<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" />
|
||||
<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 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" />
|
||||
|
||||
@@ -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">
|
||||
<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" />
|
||||
<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" />
|
||||
<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">
|
||||
|
||||
@@ -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" />
|
||||
<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" />
|
||||
<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" />
|
||||
<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 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" />
|
||||
|
||||
@@ -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="">
|
||||
<item name="cornerSize">18dp</item>
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user