From 84c91021d138cd0d3b6e4abf69c2f7968cdf3be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Thu, 3 Oct 2024 23:29:51 +0100 Subject: [PATCH] Fix body energy page scroll --- .../activities/charts/BodyEnergyFragment.java | 7 ++++ .../main/res/layout/fragment_body_energy.xml | 39 ++++++++++--------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/BodyEnergyFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/BodyEnergyFragment.java index 6839bcf3b..b7f311116 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/BodyEnergyFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/BodyEnergyFragment.java @@ -4,6 +4,7 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; +import android.os.Build; import android.os.Bundle; import android.util.TypedValue; import android.view.LayoutInflater; @@ -63,6 +64,12 @@ public class BodyEnergyFragment extends AbstractChartFragment= Build.VERSION_CODES.M) { + rootView.setOnScrollChangeListener((v, scrollX, scrollY, oldScrollX, oldScrollY) -> { + getChartsHost().enableSwipeRefresh(scrollY == 0); + }); + } + mDateView = rootView.findViewById(R.id.body_energy_date_view); bodyEnergyGauge = rootView.findViewById(R.id.body_energy_gauge); bodyEnergyGained = rootView.findViewById(R.id.body_energy_gained); diff --git a/app/src/main/res/layout/fragment_body_energy.xml b/app/src/main/res/layout/fragment_body_energy.xml index bc7723ec6..8b6d8053f 100644 --- a/app/src/main/res/layout/fragment_body_energy.xml +++ b/app/src/main/res/layout/fragment_body_energy.xml @@ -1,4 +1,4 @@ - + android:gravity="center" + android:textSize="20sp" /> + android:layout_gravity="center" + android:scaleType="fitStart" /> + android:background="@color/gauge_line_color" + android:columnCount="2"> + + android:layout_marginTop="2dp" + android:layout_marginEnd="1dp"> + + + + android:layout_marginTop="2dp" + android:layout_marginEnd="1dp"> + + android:layout_height="250sp"> + - +