mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-29 11:10:35 +02:00
refactored fragment overview to use constraint layout
This commit is contained in:
@@ -55,6 +55,10 @@ public class ChartActionBarView extends HorizontalScrollView {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if (isInEditMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
actionBarView = new LinearLayout(getContext());
|
||||
actionBarView.setOrientation(LinearLayout.HORIZONTAL);
|
||||
actionBarView.setBackgroundColor(ColorUtil.COLOR_BLACK);
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.health.openscale.gui.measurement;
|
||||
|
||||
import static java.time.temporal.ChronoUnit.DAYS;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
@@ -53,8 +55,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
|
||||
import static java.time.temporal.ChronoUnit.DAYS;
|
||||
|
||||
public class ChartMeasurementView extends LineChart {
|
||||
public enum ViewMode {
|
||||
DAY_OF_MONTH,
|
||||
@@ -195,6 +195,10 @@ public class ChartMeasurementView extends LineChart {
|
||||
}
|
||||
|
||||
private void initChart() {
|
||||
if (isInEditMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
openScale = OpenScale.getInstance();
|
||||
measurementViews = MeasurementView.getMeasurementList(getContext(), MeasurementView.DateTimeOrder.NONE);
|
||||
|
@@ -537,9 +537,6 @@ public abstract class FloatMeasurementView extends MeasurementView {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasExtraPreferences() { return true; }
|
||||
|
||||
private class ListPreferenceWithNeutralButton extends ListPreference {
|
||||
ListPreferenceWithNeutralButton(Context context) {
|
||||
super(context);
|
||||
|
@@ -424,7 +424,6 @@ public abstract class MeasurementView extends TableLayout {
|
||||
}
|
||||
|
||||
public String getPreferenceSummary() { return ""; }
|
||||
public boolean hasExtraPreferences() { return true; }
|
||||
public void prepareExtraPreferencesScreen(PreferenceScreen screen) {
|
||||
MeasurementViewSettings settings = getSettings();
|
||||
|
||||
|
@@ -1,12 +1,17 @@
|
||||
package com.health.openscale.gui.overview;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
@@ -16,6 +21,7 @@ import androidx.transition.AutoTransition;
|
||||
import androidx.transition.TransitionManager;
|
||||
|
||||
import com.health.openscale.R;
|
||||
import com.health.openscale.core.OpenScale;
|
||||
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
||||
import com.health.openscale.gui.measurement.DateMeasurementView;
|
||||
import com.health.openscale.gui.measurement.MeasurementEntryFragment;
|
||||
@@ -36,6 +42,38 @@ class OverviewAdapter extends RecyclerView.Adapter<OverviewAdapter.ViewHolder> {
|
||||
this.scaleMeasurementList = scaleMeasurementList;
|
||||
}
|
||||
|
||||
private void deleteMeasurement(int measurementId) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
boolean deleteConfirmationEnable = prefs.getBoolean("deleteConfirmationEnable", true);
|
||||
|
||||
if (deleteConfirmationEnable) {
|
||||
AlertDialog.Builder deleteAllDialog = new AlertDialog.Builder(activity);
|
||||
deleteAllDialog.setMessage(activity.getResources().getString(R.string.question_really_delete));
|
||||
|
||||
deleteAllDialog.setPositiveButton(activity.getResources().getString(R.string.label_yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
doDeleteMeasurement(measurementId);
|
||||
}
|
||||
});
|
||||
|
||||
deleteAllDialog.setNegativeButton(activity.getResources().getString(R.string.label_no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
deleteAllDialog.show();
|
||||
}
|
||||
else {
|
||||
doDeleteMeasurement(measurementId);
|
||||
}
|
||||
}
|
||||
|
||||
private void doDeleteMeasurement(int measurementId) {
|
||||
OpenScale.getInstance().deleteScaleMeasurement(measurementId);
|
||||
Toast.makeText(activity, activity.getResources().getString(R.string.info_data_deleted), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public OverviewAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_overview, parent, false);
|
||||
@@ -48,13 +86,16 @@ class OverviewAdapter extends RecyclerView.Adapter<OverviewAdapter.ViewHolder> {
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull OverviewAdapter.ViewHolder holder, int position) {
|
||||
ScaleMeasurement scaleMeasurement = scaleMeasurementList.get(position);
|
||||
ScaleMeasurement prevScaleMeasurement = new ScaleMeasurement();
|
||||
ScaleMeasurement prevScaleMeasurement;
|
||||
|
||||
if (scaleMeasurementList.size() > 2) {
|
||||
// for the first measurement no previous measurement are available, use standard measurement instead
|
||||
if (position == 0) {
|
||||
prevScaleMeasurement = new ScaleMeasurement();
|
||||
} else {
|
||||
prevScaleMeasurement = scaleMeasurementList.get(position - 1);
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
holder.showEntry.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
OverviewFragmentDirections.ActionNavOverviewToNavDataentry action = OverviewFragmentDirections.actionNavOverviewToNavDataentry();
|
||||
@@ -64,6 +105,22 @@ class OverviewAdapter extends RecyclerView.Adapter<OverviewAdapter.ViewHolder> {
|
||||
}
|
||||
});
|
||||
|
||||
holder.editEntry.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
OverviewFragmentDirections.ActionNavOverviewToNavDataentry action = OverviewFragmentDirections.actionNavOverviewToNavDataentry();
|
||||
action.setMeasurementId(scaleMeasurement.getId());
|
||||
action.setMode(MeasurementEntryFragment.DATA_ENTRY_MODE.EDIT);
|
||||
Navigation.findNavController(activity, R.id.nav_host_fragment).navigate(action);
|
||||
}
|
||||
});
|
||||
holder.deleteEntry.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
deleteMeasurement(scaleMeasurement.getId());
|
||||
}
|
||||
});
|
||||
|
||||
holder.expandMeasurementView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -113,6 +170,9 @@ class OverviewAdapter extends RecyclerView.Adapter<OverviewAdapter.ViewHolder> {
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView dateView;
|
||||
ImageView showEntry;
|
||||
ImageView editEntry;
|
||||
ImageView deleteEntry;
|
||||
TableLayout measurementHighlightViews;
|
||||
ImageView expandMeasurementView;
|
||||
TableLayout measurementViews;
|
||||
@@ -121,6 +181,9 @@ class OverviewAdapter extends RecyclerView.Adapter<OverviewAdapter.ViewHolder> {
|
||||
super(itemView);
|
||||
|
||||
dateView = itemView.findViewById(R.id.dateView);
|
||||
showEntry = itemView.findViewById(R.id.showEntry);
|
||||
editEntry = itemView.findViewById(R.id.editEntry);
|
||||
deleteEntry = itemView.findViewById(R.id.deleteEntry);
|
||||
measurementHighlightViews = itemView.findViewById(R.id.measurementHighlightViews);
|
||||
expandMeasurementView = itemView.findViewById(R.id.expandMoreView);
|
||||
measurementViews = itemView.findViewById(R.id.measurementViews);
|
||||
|
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.health.openscale.gui.overview;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
@@ -35,14 +33,14 @@ import android.widget.ImageView;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.transition.ChangeScroll;
|
||||
import androidx.transition.TransitionManager;
|
||||
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.github.mikephil.charting.highlight.Highlight;
|
||||
@@ -54,10 +52,7 @@ import com.health.openscale.core.datatypes.ScaleUser;
|
||||
import com.health.openscale.core.utils.DateTimeHelpers;
|
||||
import com.health.openscale.gui.measurement.ChartActionBarView;
|
||||
import com.health.openscale.gui.measurement.ChartMeasurementView;
|
||||
import com.health.openscale.gui.measurement.MeasurementEntryFragment;
|
||||
import com.health.openscale.gui.measurement.MeasurementView;
|
||||
import com.health.openscale.gui.measurement.WeightMeasurementView;
|
||||
import com.health.openscale.gui.utils.ColorUtil;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -69,8 +64,6 @@ public class OverviewFragment extends Fragment {
|
||||
|
||||
private TextView txtTitleUser;
|
||||
|
||||
private List<MeasurementView> lastMeasurementViews;
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private OverviewAdapter overviewAdapter;
|
||||
private ChartMeasurementView chartView;
|
||||
@@ -80,10 +73,6 @@ public class OverviewFragment extends Fragment {
|
||||
|
||||
private PopupMenu rangePopupMenu;
|
||||
|
||||
private ImageView showEntry;
|
||||
private ImageView editEntry;
|
||||
private ImageView deleteEntry;
|
||||
|
||||
private TextView differenceWeightView;
|
||||
private TextView initialWeightView;
|
||||
private TextView goalWeightView;
|
||||
@@ -94,6 +83,7 @@ public class OverviewFragment extends Fragment {
|
||||
|
||||
private SharedPreferences prefs;
|
||||
|
||||
private List<ScaleMeasurement> scaleMeasurementList;
|
||||
private ScaleMeasurement markedMeasurement;
|
||||
|
||||
@Override
|
||||
@@ -102,8 +92,6 @@ public class OverviewFragment extends Fragment {
|
||||
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(overviewView.getContext());
|
||||
|
||||
txtTitleUser = overviewView.findViewById(R.id.txtTitleUser);
|
||||
|
||||
differenceWeightView = overviewView.findViewById(R.id.differenceWeightView);
|
||||
initialWeightView = overviewView.findViewById(R.id.initialWeightView);
|
||||
goalWeightView = overviewView.findViewById(R.id.goalWeightView);
|
||||
@@ -203,9 +191,6 @@ public class OverviewFragment extends Fragment {
|
||||
chartActionBarView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
lastMeasurementViews = MeasurementView.getMeasurementList(
|
||||
getContext(), MeasurementView.DateTimeOrder.LAST);
|
||||
|
||||
recyclerView = overviewView.findViewById(R.id.recyclerView);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
|
||||
layoutManager.setInitialPrefetchItemCount(5);
|
||||
@@ -224,39 +209,6 @@ public class OverviewFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
showEntry = overviewView.findViewById(R.id.showEntry);
|
||||
showEntry.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
OverviewFragmentDirections.ActionNavOverviewToNavDataentry action = OverviewFragmentDirections.actionNavOverviewToNavDataentry();
|
||||
action.setMeasurementId(markedMeasurement.getId());
|
||||
action.setMode(MeasurementEntryFragment.DATA_ENTRY_MODE.VIEW);
|
||||
Navigation.findNavController(getActivity(), R.id.nav_host_fragment).navigate(action);
|
||||
}
|
||||
});
|
||||
|
||||
editEntry = overviewView.findViewById(R.id.editEntry);
|
||||
editEntry.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
OverviewFragmentDirections.ActionNavOverviewToNavDataentry action = OverviewFragmentDirections.actionNavOverviewToNavDataentry();
|
||||
action.setMeasurementId(markedMeasurement.getId());
|
||||
action.setMode(MeasurementEntryFragment.DATA_ENTRY_MODE.EDIT);
|
||||
Navigation.findNavController(getActivity(), R.id.nav_host_fragment).navigate(action);
|
||||
}
|
||||
});
|
||||
deleteEntry = overviewView.findViewById(R.id.deleteEntry);
|
||||
deleteEntry.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
deleteMeasurement();
|
||||
}
|
||||
});
|
||||
|
||||
showEntry.setEnabled(false);
|
||||
editEntry.setEnabled(false);
|
||||
deleteEntry.setEnabled(false);
|
||||
|
||||
chartView.animateY(700);
|
||||
|
||||
OpenScale.getInstance().getScaleMeasurementsLiveData().observe(getViewLifecycleOwner(), new Observer<List<ScaleMeasurement>>() {
|
||||
@@ -279,17 +231,12 @@ public class OverviewFragment extends Fragment {
|
||||
}
|
||||
|
||||
public void updateOnView(List<ScaleMeasurement> scaleMeasurementList) {
|
||||
if (scaleMeasurementList.isEmpty()) {
|
||||
markedMeasurement = new ScaleMeasurement();
|
||||
} else {
|
||||
markedMeasurement = scaleMeasurementList.get(0);
|
||||
}
|
||||
this.scaleMeasurementList = scaleMeasurementList;
|
||||
|
||||
overviewAdapter = new OverviewAdapter(getActivity(), scaleMeasurementList);
|
||||
recyclerView.setAdapter(overviewAdapter);
|
||||
|
||||
updateUserSelection();
|
||||
updateMesurementViews(markedMeasurement);
|
||||
chartView.updateMeasurementList(scaleMeasurementList);
|
||||
updateChartView();
|
||||
}
|
||||
@@ -299,15 +246,6 @@ public class OverviewFragment extends Fragment {
|
||||
chartView.setViewRange(selectedRangeMode);
|
||||
}
|
||||
|
||||
private void updateMesurementViews(ScaleMeasurement selectedMeasurement) {
|
||||
ScaleMeasurement[] tupleScaleData = OpenScale.getInstance().getTupleOfScaleMeasurement(selectedMeasurement.getId());
|
||||
ScaleMeasurement prevScaleMeasurement = tupleScaleData[0];
|
||||
|
||||
for (MeasurementView measurement : lastMeasurementViews) {
|
||||
measurement.loadFrom(selectedMeasurement, prevScaleMeasurement);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateUserSelection() {
|
||||
currentScaleUser = OpenScale.getInstance().getSelectedScaleUser();
|
||||
|
||||
@@ -328,7 +266,6 @@ public class OverviewFragment extends Fragment {
|
||||
|
||||
// Hide user selector when there is only one user
|
||||
int visibility = spinUserAdapter.getCount() < 2 ? View.GONE : View.VISIBLE;
|
||||
txtTitleUser.setVisibility(visibility);
|
||||
spinUser.setVisibility(visibility);
|
||||
|
||||
|
||||
@@ -409,26 +346,15 @@ public class OverviewFragment extends Fragment {
|
||||
markedMeasurement = (ScaleMeasurement)extraData[0];
|
||||
//MeasurementView measurementView = (MeasurementView)extraData[1];
|
||||
|
||||
showEntry.setEnabled(true);
|
||||
editEntry.setEnabled(true);
|
||||
deleteEntry.setEnabled(true);
|
||||
|
||||
showEntry.setColorFilter(ColorUtil.COLOR_BLUE);
|
||||
editEntry.setColorFilter(ColorUtil.COLOR_GREEN);
|
||||
deleteEntry.setColorFilter(ColorUtil.COLOR_RED);
|
||||
|
||||
updateMesurementViews(markedMeasurement);
|
||||
if (scaleMeasurementList.contains(markedMeasurement)) {
|
||||
TransitionManager.beginDelayedTransition(recyclerView, new ChangeScroll());
|
||||
recyclerView.scrollToPosition(scaleMeasurementList.indexOf(markedMeasurement));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected() {
|
||||
showEntry.setEnabled(false);
|
||||
editEntry.setEnabled(false);
|
||||
deleteEntry.setEnabled(false);
|
||||
|
||||
showEntry.setColorFilter(ColorUtil.COLOR_GRAY);
|
||||
editEntry.setColorFilter(ColorUtil.COLOR_GRAY);
|
||||
deleteEntry.setColorFilter(ColorUtil.COLOR_GRAY);
|
||||
// empty
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,44 +380,4 @@ public class OverviewFragment extends Fragment {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteMeasurement() {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(overviewView.getContext());
|
||||
boolean deleteConfirmationEnable = prefs.getBoolean("deleteConfirmationEnable", true);
|
||||
|
||||
if (deleteConfirmationEnable) {
|
||||
AlertDialog.Builder deleteAllDialog = new AlertDialog.Builder(overviewView.getContext());
|
||||
deleteAllDialog.setMessage(getResources().getString(R.string.question_really_delete));
|
||||
|
||||
deleteAllDialog.setPositiveButton(getResources().getString(R.string.label_yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
doDeleteMeasurement();
|
||||
}
|
||||
});
|
||||
|
||||
deleteAllDialog.setNegativeButton(getResources().getString(R.string.label_no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
deleteAllDialog.show();
|
||||
}
|
||||
else {
|
||||
doDeleteMeasurement();
|
||||
}
|
||||
}
|
||||
|
||||
private void doDeleteMeasurement() {
|
||||
OpenScale.getInstance().deleteScaleMeasurement(markedMeasurement.getId());
|
||||
Toast.makeText(overviewView.getContext(), getResources().getString(R.string.info_data_deleted), Toast.LENGTH_SHORT).show();
|
||||
|
||||
showEntry.setEnabled(false);
|
||||
editEntry.setEnabled(false);
|
||||
deleteEntry.setEnabled(false);
|
||||
|
||||
showEntry.setColorFilter(ColorUtil.COLOR_GRAY);
|
||||
editEntry.setColorFilter(ColorUtil.COLOR_GRAY);
|
||||
deleteEntry.setColorFilter(ColorUtil.COLOR_GRAY);
|
||||
}
|
||||
}
|
||||
|
@@ -245,13 +245,6 @@ public class MeasurementPreferences extends PreferenceFragmentCompat {
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
boundView.setPressed(false);
|
||||
|
||||
if (!measurement.hasExtraPreferences()) {
|
||||
if (switchView.getVisibility() == View.VISIBLE) {
|
||||
switchView.toggle();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Must be enabled to show extra preferences screen
|
||||
if (!measurement.getSettings().isEnabled()) {
|
||||
return true;
|
||||
|
@@ -1,140 +1,94 @@
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="100">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<Spinner
|
||||
android:id="@+id/spinUser"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:spinnerMode="dialog"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimaryDark"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/rangeOptionMenu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:scaleType="centerInside"
|
||||
android:translationZ="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/chartView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@drawable/ic_options" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtTitleUser"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_title_user"
|
||||
android:textColor="@android:color/white" />
|
||||
<com.health.openscale.gui.measurement.ChartActionBarView
|
||||
android:id="@+id/chartActionBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:fillViewport="true"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinUser"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<com.health.openscale.gui.measurement.ChartMeasurementView
|
||||
android:id="@+id/chartView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/spinUser"></com.health.openscale.gui.measurement.ChartMeasurementView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimaryDark"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
<TextView
|
||||
android:id="@+id/initialWeightView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="TextView"
|
||||
app:layout_constraintEnd_toStartOf="@+id/differenceWeightView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/chartView" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/showEntry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:scaleType="centerInside"
|
||||
app:tint="#d3d3d3"
|
||||
app:srcCompat="@drawable/ic_show" />
|
||||
<TextView
|
||||
android:id="@+id/differenceWeightView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="TextView"
|
||||
app:layout_constraintEnd_toStartOf="@+id/goalWeightView"
|
||||
app:layout_constraintStart_toEndOf="@+id/initialWeightView"
|
||||
app:layout_constraintTop_toTopOf="@+id/initialWeightView" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/editEntry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:scaleType="centerInside"
|
||||
app:tint="#d3d3d3"
|
||||
app:srcCompat="@drawable/ic_editable" />
|
||||
<TextView
|
||||
android:id="@+id/goalWeightView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="TextView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/differenceWeightView"
|
||||
app:layout_constraintTop_toTopOf="@+id/differenceWeightView" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/deleteEntry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="20dp"
|
||||
android:scaleType="centerInside"
|
||||
app:tint="#d3d3d3"
|
||||
app:srcCompat="@drawable/ic_delete" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rangeOptionMenu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="centerInside"
|
||||
app:tint="@android:color/white"
|
||||
app:srcCompat="@drawable/ic_options" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.health.openscale.gui.measurement.ChartActionBarView
|
||||
android:id="@+id/chartActionBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:fillViewport="true"/>
|
||||
|
||||
<com.health.openscale.gui.measurement.ChartMeasurementView
|
||||
android:id="@+id/chartView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center" >
|
||||
|
||||
</com.health.openscale.gui.measurement.ChartMeasurementView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/initialWeightView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="TextView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/differenceWeightView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="TextView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/goalWeightView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="TextView" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/differenceWeightView" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_anchor="@id/chartView"
|
||||
app:layout_anchorGravity="center"
|
||||
/>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
app:layout_constraintBottom_toBottomOf="@+id/chartView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/chartActionBar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@@ -25,22 +25,56 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView"
|
||||
android:textSize="12sp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="normal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/showEntry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_show"
|
||||
app:tint="#33B5E5" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/editEntry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintEnd_toStartOf="@+id/showEntry"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_editable"
|
||||
app:tint="#99CC00" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/deleteEntry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintEnd_toStartOf="@+id/editEntry"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_delete"
|
||||
app:tint="#FF4444" />
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/measurementHighlightViews"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/dateView">
|
||||
</TableLayout>
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/dateView"></TableLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/expandMoreView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/measurementHighlightViews"
|
||||
|
@@ -2,9 +2,7 @@
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="?attr/spinnerDropDownItemStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/dropdownListPreferredItemHeight"
|
||||
android:background="?attr/colorPrimaryDark"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="8dp"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/white" />
|
||||
android:gravity="center" />
|
||||
|
Reference in New Issue
Block a user