process duration correctly

This commit is contained in:
Milos Kozak 2017-06-02 23:59:34 +02:00
parent d365fcd6a4
commit 1a4e60d3a8
2 changed files with 4 additions and 3 deletions

View file

@ -1430,6 +1430,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
return; return;
} }
profileSwitch.date = trJson.getLong("mills"); profileSwitch.date = trJson.getLong("mills");
if (trJson.has("duration"))
profileSwitch.durationInMinutes = trJson.getInt("duration"); profileSwitch.durationInMinutes = trJson.getInt("duration");
profileSwitch._id = trJson.getString("_id"); profileSwitch._id = trJson.getString("_id");
profileSwitch.profileName = trJson.getString("profile"); profileSwitch.profileName = trJson.getString("profile");

View file

@ -268,7 +268,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
notificationsView.setHasFixedSize(true); notificationsView.setHasFixedSize(true);
llm = new LinearLayoutManager(view.getContext()); llm = new LinearLayoutManager(view.getContext());
notificationsView.setLayoutManager(llm); notificationsView.setLayoutManager(llm);
/*
final LinearLayout graphs = (LinearLayout)view.findViewById(R.id.overview_graphs_layout); final LinearLayout graphs = (LinearLayout)view.findViewById(R.id.overview_graphs_layout);
ViewTreeObserver observer = graphs.getViewTreeObserver(); ViewTreeObserver observer = graphs.getViewTreeObserver();
observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@ -282,7 +282,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
bgGraph.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, heightNeeded)); bgGraph.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, heightNeeded));
} }
}); });
*/
bgGraph.getGridLabelRenderer().setGridColor(Color.rgb(0x75, 0x75, 0x75)); bgGraph.getGridLabelRenderer().setGridColor(Color.rgb(0x75, 0x75, 0x75));
bgGraph.getGridLabelRenderer().reloadStyles(); bgGraph.getGridLabelRenderer().reloadStyles();
iobGraph.getGridLabelRenderer().setGridColor(Color.rgb(0x75, 0x75, 0x75)); iobGraph.getGridLabelRenderer().setGridColor(Color.rgb(0x75, 0x75, 0x75));