Fatih'sMG4 — ABRP telemetry for an MG4 EH32 on SWI69
A fork of malys/EVABRPUploader (itself a fork of Leon Kernan's ABRP_Uploader) carrying the changes that make it work on this car. History starts here: the tree is what matters, and the upstream projects are where the earlier work belongs. EVHardware is vendored rather than tracked as a submodule, so one clone builds. Telemetry. SOC, battery power and range read as unavailable on SWI69 because the vendor fallbacks were gated to SWI68 alone, while the property ids they use are the ones this car publishes — the gates now admit SWI69. Tyre pressure, the odometer and charge status come from the vendor block too, since the generic properties for all three are declared here and never publish. Tyre pressure is confirmed on the vehicle; the other two are not yet. Vehicle page. Every signal the car answers, in a table. One that it does not publish shows a dash: an unimplemented VHAL property returns zero, and "0 °C" would read as a measurement. Wi-Fi page. Joins a network the unit already has saved, so a phone hotspot does not need a trip into Settings on every drive. Tried on the upload tick and from a button, skipped while already associated. This leans on the unit being API 28 and the build being platform-signed — getConfiguredNetworks and enableNetwork are closed to ordinary apps from API 29 — and fails quietly where that does not hold. The OTA updater points at this repository. An APK from upstream is signed with a different key, which Android will not install over a platform-signed build. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
A fixed top bar above a single ViewPager2, same shape as EVProfile and EVTasker.
|
||||
|
||||
The three screens — ABRP, Service, Log — are the pages of that one pager, in the
|
||||
order the bar lists them. Each button goes to its page and a horizontal swipe walks
|
||||
through them all: the gesture and the button name the same thing. The pages
|
||||
themselves live in pane_abrp.xml / pane_service.xml / pane_log.xml, because a
|
||||
ViewPager2 takes its children from an adapter rather than from this file.
|
||||
|
||||
Button navigation rather than Material tabs: on a vehicle screen, always-visible
|
||||
64 dp targets beat a thin tab bar. The tabs share the width left by the title and
|
||||
the About button equally (weight 1), so the row can be aimed at from memory whatever
|
||||
the translated labels are.
|
||||
|
||||
No MaterialButtonToggleGroup: the group owns a checked state of its own, which would
|
||||
fight the pager for who decides the current screen. Here the pager decides alone and
|
||||
MainActivity.markCurrentPage posts isSelected — the fill, text, icon and stroke come
|
||||
from the res/color/nav_tab_*.xml selectors.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/ev_background">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:baselineAligned="false"
|
||||
android:paddingStart="@dimen/spacing_md"
|
||||
android:paddingEnd="@dimen/spacing_md"
|
||||
android:background="@drawable/bg_topbar">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textAppearance="@style/Text.EV.Title"
|
||||
android:layout_marginEnd="@dimen/spacing_lg" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tabAbrp"
|
||||
style="@style/Widget.EV.NavTab"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="@dimen/spacing_sm"
|
||||
android:text="@string/tab_abrp"
|
||||
app:icon="@drawable/ic_tab_abrp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tabService"
|
||||
style="@style/Widget.EV.NavTab"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="@dimen/spacing_sm"
|
||||
android:text="@string/tab_service"
|
||||
app:icon="@drawable/ic_tab_service" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tabVehicle"
|
||||
style="@style/Widget.EV.NavTab"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="@dimen/spacing_sm"
|
||||
android:text="@string/tab_vehicle"
|
||||
app:icon="@drawable/ic_tab_vehicle" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tabWifi"
|
||||
style="@style/Widget.EV.NavTab"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="@dimen/spacing_sm"
|
||||
android:text="@string/tab_wifi"
|
||||
app:icon="@drawable/ic_tab_wifi" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tabLog"
|
||||
style="@style/Widget.EV.NavTab"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="@dimen/spacing_lg"
|
||||
android:text="@string/tab_log"
|
||||
app:icon="@drawable/ic_tab_log" />
|
||||
|
||||
<!-- About opens a dialog, not a page: it stays a plain button so it cannot be
|
||||
mistaken for a fourth destination of the pager. -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/about_button"
|
||||
style="@style/Widget.EV.Button.Outlined"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about_action" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user