1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-01 14:32:54 +01:00

Add Activity info into Device Card: make cards center alighed with shorter text

This commit is contained in:
vanous 2021-11-20 17:04:39 +01:00
parent 8caa529fbb
commit 296dbb16aa
3 changed files with 13 additions and 13 deletions

View File

@ -872,13 +872,13 @@ public class GBDeviceAdapterv2 extends RecyclerView.Adapter<GBDeviceAdapterv2.Vi
holder.cardViewActivityCardDistanceProgress.setProgress(steps * stepLength);
setUpChart(holder.TotalStepsChart);
setChartsData(holder.TotalStepsChart, steps, stepGoal, context.getString(R.string.live_activity_total_steps), context);
setChartsData(holder.TotalStepsChart, steps, stepGoal, context.getString(R.string.steps), context);
setUpChart(holder.TotalDistanceChart);
setChartsData(holder.TotalDistanceChart, steps * stepLength, distanceGoal, context.getString(R.string.live_activity_total_distance), context);
setChartsData(holder.TotalDistanceChart, steps * stepLength, distanceGoal, context.getString(R.string.distance), context);
setUpChart(holder.SleepTimeChart);
setChartsData(holder.SleepTimeChart, sleep, sleepGoalMinutes, context.getString(R.string.live_activity_sleep_duration), context);
setChartsData(holder.SleepTimeChart, sleep, sleepGoalMinutes, context.getString(R.string.prefs_activity_in_device_card_sleep_title), context);
boolean showActivityCard = GBApplication.getDeviceSpecificSharedPrefs(device.getAddress()).getBoolean(DeviceSettingsPreferenceConst.PREFS_ACTIVITY_IN_DEVICE_CARD, true);
holder.cardViewActivityCardLayout.setVisibility(showActivityCard ? View.VISIBLE : View.GONE);
@ -900,6 +900,7 @@ public class GBDeviceAdapterv2 extends RecyclerView.Adapter<GBDeviceAdapterv2.Vi
return DateTimeUtils.formatDurationHoursMinutes(value, TimeUnit.MINUTES);
}
private void setUpChart(PieChart DashboardChart) {
DashboardChart.setTouchEnabled(false);
DashboardChart.setNoDataText("");
DashboardChart.getLegend().setEnabled(false);
DashboardChart.setDrawHoleEnabled(true);

View File

@ -477,8 +477,8 @@
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingBottom="15dp">
<LinearLayout
@ -488,17 +488,18 @@
android:layout_gravity="bottom|center"
android:layout_marginBottom="0dp"
android:layout_weight="1"
android:orientation="horizontal">
android:orientation="vertical">
<ImageView
android:id="@+id/card_view_activity_card_steps_icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="start|bottom"
android:layout_gravity="center|bottom"
android:background="@drawable/ic_shoe_prints_many"
android:contentDescription="@string/icon_placeholder"
android:padding="0dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -531,13 +532,13 @@
android:layout_gravity="bottom|center"
android:layout_marginBottom="0dp"
android:layout_weight="1"
android:orientation="horizontal">
android:orientation="vertical">
<ImageView
android:id="@+id/card_view_activity_card_distance_icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="start|bottom"
android:layout_gravity="center|bottom"
android:background="@drawable/ic_distance_total"
android:contentDescription="@string/icon_placeholder"
android:padding="0dp" />
@ -574,13 +575,13 @@
android:layout_gravity="bottom|center"
android:layout_marginBottom="0dp"
android:layout_weight="1"
android:orientation="horizontal">
android:orientation="vertical">
<ImageView
android:id="@+id/card_view_activity_card_sleep_icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="start|bottom"
android:layout_gravity="center|bottom"
android:background="@drawable/ic_activity_sleep"
android:contentDescription="@string/icon_placeholder" />

View File

@ -561,8 +561,6 @@
<string name="live_activity_steps_history">Steps history</string>
<string name="live_activity_current_steps_per_minute">Current steps/min</string>
<string name="live_activity_total_steps">Total steps</string>
<string name="live_activity_total_distance">Total distance</string>
<string name="live_activity_sleep_duration">Sleep time</string>
<string name="live_activity_steps_per_minute_history">Steps per minute history</string>
<string name="live_activity_start_your_activity">Start your activity</string>
<string name="live_activity_max_heart_rate">Current / Max heart rate: %1$d / %2$d</string>