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,7 +1430,8 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
return;
}
profileSwitch.date = trJson.getLong("mills");
profileSwitch.durationInMinutes = trJson.getInt("duration");
if (trJson.has("duration"))
profileSwitch.durationInMinutes = trJson.getInt("duration");
profileSwitch._id = trJson.getString("_id");
profileSwitch.profileName = trJson.getString("profile");
profileSwitch.isCPP = trJson.has("CircadianPercentageProfile");

View file

@ -268,7 +268,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
notificationsView.setHasFixedSize(true);
llm = new LinearLayoutManager(view.getContext());
notificationsView.setLayoutManager(llm);
/*
final LinearLayout graphs = (LinearLayout)view.findViewById(R.id.overview_graphs_layout);
ViewTreeObserver observer = graphs.getViewTreeObserver();
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.getGridLabelRenderer().setGridColor(Color.rgb(0x75, 0x75, 0x75));
bgGraph.getGridLabelRenderer().reloadStyles();
iobGraph.getGridLabelRenderer().setGridColor(Color.rgb(0x75, 0x75, 0x75));