1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-09-18 12:16:36 +02:00

Horizontally center activity chart legend

This commit is contained in:
Arjan Schrijver 2024-01-08 17:23:37 +01:00
parent 8d7641b24e
commit d9f0c4764a
2 changed files with 4 additions and 3 deletions

View File

@ -108,7 +108,7 @@ public class DashboardTodayWidget extends AbstractDashboardWidget {
SpannableString l_light_sleep = new SpannableString("" + getString(R.string.activity_type_light_sleep));
l_light_sleep.setSpan(new ForegroundColorSpan(Color.rgb(150, 150, 255)), 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
SpannableStringBuilder legendBuilder = new SpannableStringBuilder();
legend.setText(legendBuilder.append(l_not_worn).append(" ").append(l_activity).append(" ").append(l_light_sleep).append(" ").append(l_deep_sleep));
legend.setText(legendBuilder.append(l_not_worn).append(" ").append(l_activity).append("\n").append(l_light_sleep).append(" ").append(l_deep_sleep));
// Retrieve activity data
List<GBDevice> devices = GBApplication.app().getDeviceManager().getDevices();

View File

@ -30,7 +30,8 @@
<TextView
android:id="@+id/dashboard_piechart_legend"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp" />
android:layout_marginHorizontal="8dp"
android:textAlignment="center" />
</LinearLayout>