1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-28 19:45:50 +01:00

Redesign of activity pages and workout page

This commit is contained in:
a0z 2024-09-24 10:10:02 +02:00 committed by José Rebelo
parent ae02bbc9c3
commit 9f3ab8c810
11 changed files with 770 additions and 1148 deletions

View File

@ -43,9 +43,10 @@ import android.view.animation.AnimationUtils;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.FrameLayout;
import androidx.gridlayout.widget.GridLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;
@ -428,7 +429,7 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
String units = GBApplication.getPrefs().getString(SettingsActivity.PREF_MEASUREMENT_SYSTEM, GBApplication.getContext().getString(R.string.p_unit_metric));
String UNIT_IMPERIAL = GBApplication.getContext().getString(R.string.p_unit_imperial);
TableLayout fieldLayout = findViewById(R.id.summaryDetails);
LinearLayout fieldLayout = findViewById(R.id.summaryDetails);
fieldLayout.removeAllViews(); //remove old widgets
ActivitySummaryJsonSummary activitySummaryJsonSummary = new ActivitySummaryJsonSummary(summaryParser, item);
JSONObject data = activitySummaryJsonSummary.getSummaryGroupedList(); //get list, grouped by groups
@ -444,22 +445,38 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
TableRow label_row = new TableRow(ActivitySummaryDetail.this);
TextView label_field = new TextView(ActivitySummaryDetail.this);
label_field.setTextSize(16);
label_field.setPadding(0, 10, 0, 0);
label_field.setId(View.generateViewId());
label_field.setTextSize(18);
label_field.setPadding(dpToPx(8), dpToPx(20), 0, dpToPx(20));
label_field.setTypeface(null, Typeface.BOLD);
label_field.setText(String.format("%s", getStringResourceByName(key)));
label_row.addView(label_field);
fieldLayout.addView(label_row);
for (int i = 0; i < innerList.length(); i++) {
TextView name_field = new TextView(ActivitySummaryDetail.this);
TextView value_field = new TextView(ActivitySummaryDetail.this);
name_field.setGravity(Gravity.START);
value_field.setGravity(Gravity.END);
GridLayout gridLayout = new GridLayout(ActivitySummaryDetail.this);
gridLayout.setBackgroundColor(getResources().getColor(R.color.gauge_line_color));
gridLayout.setColumnCount(2);
gridLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
int lastRow = (int) Math.floor((innerList.length() - 1) / 2);
int i;
for (i = 0; i < innerList.length(); i++) {
LinearLayout linearLayout = generateLinearLayout(i, lastRow);
// Value
TextView valueTextView = new TextView(ActivitySummaryDetail.this);
valueTextView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
valueTextView.setText(String.format("%s", "-"));
valueTextView.setTextSize(20);
// Label
TextView labelTextView = new TextView(ActivitySummaryDetail.this);
labelTextView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
labelTextView.setTextSize(12);
JSONObject innerData = innerList.getJSONObject(i);
String unit = innerData.getString("unit");
String name = innerData.getString("name");
labelTextView.setText(getStringResourceByName(name));
if (!unit.equals("string")) {
double value = innerData.getDouble("value");
@ -518,32 +535,31 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
}
if (unit.equals("seconds") && !show_raw_data) { //rather then plain seconds, show formatted duration
value_field.setText(DateTimeUtils.formatDurationHoursMinutes((long) value, TimeUnit.SECONDS));
valueTextView.setText(DateTimeUtils.formatDurationHoursMinutes((long) value, TimeUnit.SECONDS));
} else if (unit.equals("minutes_km") || unit.equals("minutes_mi")) {
// Format pace
value_field.setText(String.format(
valueTextView.setText(String.format(
Locale.getDefault(),
"%d:%02d %s",
(int) Math.floor(value), (int) Math.round(60 * (value - (int) Math.floor(value))),
getStringResourceByName(unit)
));
} else {
value_field.setText(String.format("%s %s", df.format(value), getStringResourceByName(unit)));
valueTextView.setText(String.format("%s %s", df.format(value), getStringResourceByName(unit)));
}
} else {
value_field.setText(getStringResourceByName(innerData.getString("value"))); //we could optimize here a bit and only do this for particular activities (swim at the moment...)
valueTextView.setText(getStringResourceByName(innerData.getString("value"))); //we could optimize here a bit and only do this for particular activities (swim at the moment...)
}
TableRow field_row = new TableRow(ActivitySummaryDetail.this);
if (i % 2 == 0) field_row.setBackgroundColor(alternateColor);
name_field.setText(getStringResourceByName(name));
TableRow.LayoutParams params = new TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT, 1f);
value_field.setLayoutParams(params);
field_row.addView(name_field);
field_row.addView(value_field);
fieldLayout.addView(field_row);
linearLayout.addView(valueTextView);
linearLayout.addView(labelTextView);
gridLayout.addView(linearLayout);
}
if (gridLayout.getChildCount() > 0) {
if (gridLayout.getChildCount() % 2 != 0) {
gridLayout.addView(generateLinearLayout(i, lastRow));
}
fieldLayout.addView(gridLayout);
}
} catch (JSONException e) {
LOG.error("SportsActivity", e);
@ -551,6 +567,45 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
}
}
public LinearLayout generateLinearLayout(int i, int lastRow) {
LinearLayout linearLayout = new LinearLayout(ActivitySummaryDetail.this);
GridLayout.LayoutParams columnParams = new GridLayout.LayoutParams();
columnParams.columnSpec = GridLayout.spec(i % 2 == 0 ? 0 : 1, 1);
GridLayout.LayoutParams layoutParams = new GridLayout.LayoutParams(
GridLayout.spec(GridLayout.UNDEFINED, GridLayout.FILL,1f),
GridLayout.spec(GridLayout.UNDEFINED, 1, GridLayout.FILL,1f)
);
layoutParams.width = 0;
linearLayout.setLayoutParams(layoutParams);
linearLayout.setOrientation(LinearLayout.VERTICAL);
linearLayout.setGravity(Gravity.CENTER);
linearLayout.setPadding(dpToPx(20), dpToPx(20),dpToPx(20), dpToPx(20));
linearLayout.setBackgroundColor(GBApplication.getWindowBackgroundColor(ActivitySummaryDetail.this));
int marginLeft = 0;
int marginTop = 0;
int marginBottom = 0;
int marginRight = 0;
if (i % 2 == 0) {
marginTop = 2;
marginRight = 1;
}
if (i % 2 == 1) {
marginTop = 2;
marginLeft = 1;
}
if (i / 2 >= lastRow) {
marginBottom = 2;
}
layoutParams.setMargins(dpToPx(marginLeft), dpToPx(marginTop), dpToPx(marginRight), dpToPx(marginBottom));
return linearLayout;
}
public int dpToPx(int dp) {
float density = getResources().getDisplayMetrics().density;
return Math.round(dp * density);
}
private String getStringResourceByName(String aString) {
String packageName = getPackageName();
int resId = getResources().getIdentifier(aString, "string", packageName);

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_summary_detail_scroll_layout"
@ -11,7 +10,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp">
>
<LinearLayout
@ -19,7 +18,9 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="?attr/sports_activity_summary_background"
android:orientation="horizontal">
android:orientation="horizontal"
android:layout_margin="8dp"
>
<ImageView
android:id="@+id/item_image"
@ -164,10 +165,11 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TableLayout
<LinearLayout
android:id="@+id/summaryDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
<FrameLayout
android:id="@+id/chartsFragmentHolder"

View File

@ -29,86 +29,51 @@
android:id="@+id/body_energy_gauge" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="183dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="30dp"
android:layout_weight="3"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
>
<LinearLayout
android:layout_marginTop="2dp"
android:layout_marginEnd="1dp"
style="@style/GridTile"
>
<TextView
android:id="@+id/body_energy_gained"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/body_energy_gained"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="+ 0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/body_energy_gained"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:text="+ 0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="@string/body_energy_gained"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="2dp"
android:layout_marginEnd="1dp"
style="@style/GridTile"
>
<TextView
android:id="@+id/body_energy_lost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="- 0"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/body_energy_lost"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/body_energy_lost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="- 0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/body_energy_lost"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
</TableLayout>
</GridLayout>
<LinearLayout
android:layout_width="match_parent"

View File

@ -29,152 +29,95 @@
android:layout_weight="2" />
</LinearLayout>
<TableLayout
android:layout_width="fill_parent"
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="30dp"
android:layout_weight="3"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:columnCount="2"
android:layout_marginTop="15dp"
>
<LinearLayout
style="@style/GridTile"
android:layout_marginEnd="1dp"
android:layout_marginTop="2dp"
>
<TextView
android:id="@+id/hr_minimum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="0"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/hr_minimum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/hr_minimum"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="@string/hr_minimum"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/hr_maximum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/hr_maximum"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
<LinearLayout
style="@style/GridTile"
android:layout_marginStart="1dp"
android:layout_marginTop="2dp"
>
<TextView
android:id="@+id/hr_maximum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="0"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hr_maximum"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/hr_average"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<LinearLayout
style="@style/GridTile"
android:layout_marginEnd="1dp"
>
<TextView
android:id="@+id/hr_average"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/hr_average"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hr_average"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginStart="1dp"
>
<LinearLayout
android:id="@+id/hr_resting_wrapper"
android:layout_width="0dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
>
<TextView
android:id="@+id/hr_resting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/hr_resting"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
</TableLayout>
</LinearLayout>
</GridLayout>
<TextView
android:id="@+id/steps_chart_title"

View File

@ -52,233 +52,121 @@
</RelativeLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:layout_marginTop="5dp"
android:layout_weight="3"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
>
<LinearLayout
style="@style/GridTile"
android:layout_marginEnd="1dp"
android:layout_marginTop="2dp"
>
<TextView
android:id="@+id/hrv_status_seven_days_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="-"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/hrv_status_seven_days_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="-"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/hrv_status_seven_days_avg"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/hrv_status_seven_days_avg_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="-"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/hrv_status_seven_days_avg_status"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:id="@+id/hrv_status_day_avg_wrapper"
android:layout_width="0dp"
android:text="@string/hrv_status_seven_days_avg"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginStart="1dp"
android:layout_marginTop="2dp"
>
<TextView
android:id="@+id/hrv_status_seven_days_avg_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/hrv_status_day_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:text="-"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/hrv_status_day_avg"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/hrv_status_baseline_wrapper"
android:layout_width="0dp"
android:text="-"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/hrv_status_baseline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:text="-"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/hrv_status_baseline_label"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:id="@+id/sleep_chart_legend_rem_time_wrapper"
android:layout_width="0dp"
android:text="@string/hrv_status_seven_days_avg_status"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/hrv_status_day_avg_wrapper"
style="@style/GridTile"
android:layout_marginEnd="1dp"
>
<TextView
android:id="@+id/hrv_status_day_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="-"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/hrv_status_last_night"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:text="-"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/hrv_status_last_night"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/hrv_status_last_night_highest_5_wrapper"
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="@string/hrv_status_day_avg"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<LinearLayout
android:id="@+id/hrv_status_baseline_wrapper"
style="@style/GridTile"
android:layout_marginStart="1dp"
>
<TextView
android:id="@+id/hrv_status_baseline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="20sp" />
<TextView
android:id="@+id/hrv_status_last_night_highest_5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:text="-"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hrv_status_baseline_label"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/sleep_chart_legend_rem_time_wrapper"
style="@style/GridTile"
android:layout_marginEnd="1dp"
>
<TextView
android:id="@+id/hrv_status_last_night"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hrv_status_last_night"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/hrv_status_last_night_highest_5"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<LinearLayout
android:id="@+id/hrv_status_last_night_highest_5_wrapper"
style="@style/GridTile"
android:layout_marginStart="1dp"
>
<TextView
android:id="@+id/hrv_status_last_night_highest_5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="20sp" />
</TableLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hrv_status_last_night_highest_5"
android:textSize="12sp" />
</LinearLayout>
</GridLayout>
<LinearLayout
android:layout_width="match_parent"

View File

@ -29,43 +29,31 @@
android:layout_height="200dp"
android:layout_marginTop="15dp"
android:layout_weight="2" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="30dp"
android:layout_weight="3"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2">
android:columnCount="2"
>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_deep_sleep_dark" />
android:background="@color/chart_deep_sleep_dark"
android:layout_marginBottom="10dp"
/>
<TextView
android:id="@+id/sleep_chart_legend_deep_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:layout_marginTop="10dp"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
@ -73,33 +61,25 @@
android:id="@+id/sleep_chart_legend_deep_legend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/sleep_colored_stats_deep"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_light_sleep_dark" />
android:background="@color/chart_light_sleep_dark"
android:layout_marginBottom="10dp"
/>
<TextView
android:id="@+id/sleep_chart_legend_light_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:layout_marginTop="10dp"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
@ -107,91 +87,81 @@
android:id="@+id/sleep_chart_legend_light_legend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/sleep_colored_stats_light"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:id="@+id/sleep_chart_legend_rem_time_wrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<LinearLayout
android:id="@+id/sleep_chart_legend_rem_time_wrapper"
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_rem_sleep_dark" />
<TextView
android:id="@+id/sleep_chart_legend_rem_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
android:orientation="vertical"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_rem_sleep_dark"
android:layout_marginBottom="10dp"
/>
<TextView
android:id="@+id/sleep_chart_legend_rem_legend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:gravity="center"
android:text="@string/sleep_colored_stats_rem"
android:textSize="12sp" />
<TextView
android:id="@+id/sleep_chart_legend_rem_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<TextView
android:id="@+id/sleep_chart_legend_rem_legend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/sleep_colored_stats_rem"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/sleep_chart_legend_awake_time_wrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<LinearLayout
android:id="@+id/sleep_chart_legend_awake_time_wrapper"
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_awake_sleep_dark" />
<TextView
android:id="@+id/sleep_chart_legend_awake_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:gravity="center"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
android:orientation="vertical"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_awake_sleep_dark"
android:layout_marginBottom="10dp"
/>
<TextView
android:id="@+id/sleep_chart_legend_awake_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<TextView
android:id="@+id/sleep_chart_legend_awake_legend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:gravity="center"
android:text="@string/abstract_chart_fragment_kind_awake_sleep"
android:textSize="12sp" />
<TextView
android:id="@+id/sleep_chart_legend_awake_legend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/abstract_chart_fragment_kind_awake_sleep"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</TableRow>
</TableLayout>
</GridLayout>
</LinearLayout>
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/sleepchart"
@ -200,114 +170,75 @@
android:layout_marginBottom="25dp"
android:layout_weight="4" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="30dp"
android:layout_weight="3"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="2"
android:rowCount="2"
android:layout_marginBottom="15dp"
>
<LinearLayout
android:layout_marginTop="2dp"
android:layout_marginEnd="1dp"
style="@style/GridTile"
>
<TextView
android:id="@+id/sleep_hr_lowest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="0"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/sleep_hr_lowest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/stats_lowest_hr"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/sleep_hr_highest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/stats_highest_hr"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:text="@string/stats_lowest_hr"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="2dp"
android:layout_marginStart="1dp"
style="@style/GridTile"
>
<TextView
android:id="@+id/sleep_hr_highest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
android:text="0"
android:textSize="20sp" />
<TextView
android:id="@+id/sleep_movement_intensity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/stats_highest_hr"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_marginBottom="2dp"
android:layout_marginEnd="1dp"
style="@style/GridTile"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/movement_intensity"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
</TableLayout>
<TextView
android:id="@+id/sleep_movement_intensity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/movement_intensity"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_marginBottom="2dp"
android:layout_marginStart="1dp"
style="@style/GridTile"
/>
</GridLayout>
</LinearLayout>

View File

@ -42,86 +42,50 @@
android:scaleType="fitStart"
android:id="@+id/steps_gauge" />
<TableLayout
android:layout_width="fill_parent"
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="30dp"
android:layout_weight="3"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:columnCount="2"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
>
<LinearLayout
style="@style/GridTile"
android:layout_marginEnd="1dp"
android:layout_marginTop="2dp"
>
<TextView
android:id="@+id/steps_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="0"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/steps_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/steps"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/steps_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/distance"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
</TableLayout>
android:text="@string/steps"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginStart="1dp"
android:layout_marginTop="2dp"
>
<TextView
android:id="@+id/steps_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/distance"
android:textSize="12sp" />
</LinearLayout>
</GridLayout>
<LinearLayout
android:layout_width="match_parent"

View File

@ -31,151 +31,89 @@
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/steps_chart"
android:layout_width="fill_parent"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2" />
</LinearLayout>
<TableLayout
android:layout_width="fill_parent"
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="30dp"
android:layout_weight="3"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:columnCount="2"
android:layout_marginTop="15dp"
>
<LinearLayout
style="@style/GridTile"
android:layout_marginEnd="1dp"
android:layout_marginTop="2dp"
>
<TextView
android:id="@+id/steps_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="0"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/steps_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/steps_avg"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="@string/steps_avg"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginEnd="1dp"
android:layout_marginTop="2dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/steps_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/steps_total"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
<TextView
android:id="@+id/steps_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="0"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/distance_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/distance_avg"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
<View
android:layout_width="fill_parent"
android:layout_height="5px"
android:background="@color/value_line_color" />
<TextView
android:id="@+id/distance_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="20dip"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/distance_total"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
</TableLayout>
android:text="@string/steps_total"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginEnd="1dp"
>
<TextView
android:id="@+id/distance_avg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/distance_avg"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginStart="1dp"
>
<TextView
android:id="@+id/distance_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/distance_total"
android:textSize="12sp" />
</LinearLayout>
</GridLayout>
</LinearLayout>

View File

@ -21,162 +21,125 @@
android:layout_marginTop="15dp"
android:layout_weight="2" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="30dp"
android:layout_weight="3"
android:shrinkColumns="*"
android:stretchColumns="*">
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:layout_marginTop="15dp"
>
<LinearLayout
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_stress_relaxed"
android:layout_marginBottom="10dp"
/>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_marginTop="10dp"
android:id="@+id/stress_chart_relaxed_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_stress_relaxed" />
<TextView
android:id="@+id/stress_chart_relaxed_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/stress_relaxed"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/stress_relaxed"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_stress_mild"
android:layout_marginBottom="10dp"
/>
<TextView
android:layout_marginTop="10dp"
android:id="@+id/stress_chart_mild_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/stress_mild"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_stress_moderate"
android:layout_marginBottom="10dp"
/>
<TextView
android:layout_marginTop="10dp"
android:id="@+id/stress_chart_moderate_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_stress_mild" />
<TextView
android:id="@+id/stress_chart_mild_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/stress_mild"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="@string/stress_moderate"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_stress_moderate" />
<LinearLayout
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<TextView
android:id="@+id/stress_chart_moderate_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:gravity="center"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_stress_high"
android:layout_marginBottom="10dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:gravity="center"
android:text="@string/stress_moderate"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
<TextView
android:layout_marginTop="10dp"
android:id="@+id/stress_chart_high_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingRight="20dip">
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_stress_high" />
<TextView
android:id="@+id/stress_chart_high_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="20dip"
android:gravity="center"
android:text="@string/stats_empty_value"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:gravity="center"
android:text="@string/stress_high"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
</TableLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/stress_high"
android:textSize="12sp" />
</LinearLayout>
</GridLayout>
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/stress_line_chart"

View File

@ -18,163 +18,126 @@
android:layout_marginTop="15dp"
/>
<TableLayout
android:layout_weight="3"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:shrinkColumns="*"
android:stretchColumns="*"
android:layout_marginBottom="20dp"
android:layout_marginTop="5dp"
>
<TableRow
android:id="@+id/tableRow1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:weightSum="2"
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
>
<LinearLayout
android:orientation="vertical"
android:paddingTop="20dip"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
<LinearLayout
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_deep_sleep_dark"/>
<TextView
android:layout_marginTop="20dip"
android:id="@+id/sleep_chart_legend_deep_time"
android:text="@string/stats_empty_value"
android:textSize="20sp"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/sleep_chart_legend_deep_legend"
android:text="@string/sleep_colored_stats_deep_avg"
android:textSize="12sp"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:paddingTop="20dip"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_light_sleep_dark"/>
<TextView
android:layout_marginTop="20dip"
android:id="@+id/sleep_chart_legend_light_time"
android:text="@string/stats_empty_value"
android:textSize="20sp"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/sleep_chart_legend_light_legend"
android:text="@string/sleep_colored_stats_light_avg"
android:textSize="12sp"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_height="wrap_content"
<View
android:layout_width="fill_parent"
android:weightSum="2"
>
<LinearLayout
android:id="@+id/sleep_chart_legend_rem_time_wrapper"
android:orientation="vertical"
android:paddingTop="20dip"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="5dp"
android:background="@color/chart_deep_sleep_dark"
android:layout_marginBottom="10dp"
/>
<TextView
android:layout_marginTop="20dip"
android:id="@+id/sleep_chart_legend_deep_time"
android:text="@string/stats_empty_value"
android:textSize="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/sleep_chart_legend_deep_legend"
android:text="@string/sleep_colored_stats_deep_avg"
android:textSize="12sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_rem_sleep_dark"/>
<TextView
android:layout_marginTop="20dip"
android:id="@+id/sleep_chart_legend_rem_time"
android:text="@string/stats_empty_value"
android:textSize="20sp"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
<TextView
android:id="@+id/sleep_chart_legend_rem_legend"
android:text="@string/sleep_colored_stats_rem_avg"
android:textSize="12sp"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:id="@+id/sleep_chart_legend_awake_time_wrapper"
android:orientation="vertical"
android:paddingTop="20dip"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_light_sleep_dark"
android:layout_marginBottom="10dp"
/>
<TextView
android:layout_marginTop="10dp"
android:id="@+id/sleep_chart_legend_light_time"
android:text="@string/stats_empty_value"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/sleep_chart_legend_light_legend"
android:text="@string/sleep_colored_stats_light_avg"
android:textSize="12sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/sleep_chart_legend_rem_time_wrapper"
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_rem_sleep_dark"
android:layout_marginBottom="10dp"
/>
<TextView
android:layout_marginTop="10dp"
android:id="@+id/sleep_chart_legend_rem_time"
android:text="@string/stats_empty_value"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
<TextView
android:id="@+id/sleep_chart_legend_rem_legend"
android:text="@string/sleep_colored_stats_rem_avg"
android:textSize="12sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:id="@+id/sleep_chart_legend_awake_time_wrapper"
style="@style/GridTile"
android:layout_marginBottom="0dp"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
>
<View
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_awake_sleep_dark"/>
android:layout_width="fill_parent"
android:layout_height="5dp"
android:background="@color/chart_awake_sleep_dark"
android:layout_marginBottom="10dp"
/>
<TextView
android:layout_marginTop="20dip"
android:id="@+id/sleep_chart_legend_awake_time"
android:text="@string/stats_empty_value"
android:textSize="20sp"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
android:layout_marginTop="10dp"
android:id="@+id/sleep_chart_legend_awake_time"
android:text="@string/stats_empty_value"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
<TextView
android:id="@+id/sleep_chart_legend_awake_legend"
android:text="@string/sleep_colored_stats_awake_avg"
android:textSize="12sp"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
android:id="@+id/sleep_chart_legend_awake_legend"
android:text="@string/sleep_colored_stats_awake_avg"
android:textSize="12sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
</LinearLayout>
</TableRow>
</TableLayout>
</LinearLayout>
</GridLayout>
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/weekstepschart"

View File

@ -199,4 +199,14 @@
<style name="AppSwitchPreference" parent="@style/Preference.SwitchPreferenceCompat.Material">
<item name="widgetLayout">@layout/preference_material_switch</item>
</style>
<style name="GridTile">
<item name="android:background">?android:attr/windowBackground</item>
<item name="android:padding">20dp</item>
<item name="android:gravity">center</item>
<item name="android:orientation">vertical</item>
<item name="android:layout_columnWeight">1</item>
<item name="android:layout_marginBottom">2dp</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_rowWeight">1</item>
</style>
</resources>