App 2.7.0: voice-key double press opens the app; no scroll jumps
Steering wheel: a double press of the voice key (code 287) opens the app. The floating button from 2.6.0 does not show over the MG4 launcher, so this is the way back into the app. The head unit reports keys as the broadcast com.saic.keyevent.hardkey.report, whose extras are not documented: the receiver tries the usual names (and an embedded KeyEvent), and counts one press per report whichever way the up/down field turns out to work; long presses never open the app. The last 20 reports are listed raw on the Logs tab, so if the guess misses, a photo of that list gives the real format. A switch in the Upload tab turns it off. DoublePressDetector (500 ms window) has 5 tests; on the emulator, simulated double presses open the app and single presses, other keys and long presses do not. Scrolling: pages jumped back to the top on every 2 s refresh. A stack trace on the emulator showed why: ViewPager2's RecyclerView lays the pages out while measuring, at a provisional height, and ScrollView.onLayout clamps the position to 0. StableScrollView keeps the driver's position across layouts and is now the root of every page; the scrolled Charging page stays put across refreshes. Vehicle tab: all six value tiles, including both range estimates, sit in one row at the top, so nothing needs scrolling at 1920x720. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
@@ -20,6 +20,13 @@ final class UploadSettings {
|
||||
static final String KEY_FLOATING_BUTTON = "floating_button";
|
||||
static final boolean DEFAULT_FLOATING_BUTTON = true;
|
||||
|
||||
/** A double press of the steering wheel's voice key opens the app. */
|
||||
static final String KEY_VOICE_KEY_OPENS = "voice_key_opens_app";
|
||||
|
||||
static boolean voiceKeyOpensApp(SharedPreferences prefs) {
|
||||
return prefs.getBoolean(KEY_VOICE_KEY_OPENS, true);
|
||||
}
|
||||
|
||||
static boolean floatingButtonEnabled(SharedPreferences prefs) {
|
||||
return prefs.getBoolean(KEY_FLOATING_BUTTON, DEFAULT_FLOATING_BUTTON);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user