Code Monkey home page Code Monkey logo

food-controller's Introduction

Build Status

Food Controller

Simple application for controlling food intake. Requirements:

  • Absolutely self contained - all it's data is comming from and stored in SQLite database
  • Extensive list of food products, that covers most use cases
  • Food products are divided into categories
  • Allows for defining new products, assigned to existing categories
  • Product data consists of name, calories and protein in 100 grams
  • Has editable history of days which consists of meals which consists of products
  • Allows for adding entries as described above
  • Requires to define daily calories and protein goal
  • Shows difference between entry calories and protein and that of then required goals
  • Has easy to use, intuitive ui
  • Allows for making exceptions to daily goals based on more/less calories burned
  • Lets adding notes to each entry

food-controller's People

Contributors

binaryigor avatar

Watchers

James Cloos avatar

food-controller's Issues

Remove android dependencies from .travis.yaml

This dependencies are seriously slowing down our build time. We should remove them as we do not need them now. Moreover, we can write most of the tests as unit tests that are not dependent on Android Framework, so they probably will not be needed at all.

Last eaten meals

Create a Fragment that will allow selecting a meal from 10 - 20 last eaten. It should be accessible from MealFragment and allow both selecting and editing.

Complete HistoryFragment

Complete this fragment by creating its layout that will show list of available months with years division. Add new classes related to this view as needed.

Create FoodPortionViewModel

It should allow adding FoodPortions to a given meal. It must reuse existing portions, adding new ones only if necessary.

Landscape layouts

Create landscape version of layouts. If a portrait version looks good enough, do not change it, but remember to make it scrollable if necessary.

Complete MenuFragment

If day is not yet created it should be created after weight is given in mentioned above fragment. Its id should be given to DayFragment.

Minimal json as database source

Minimal json containing categories and food products as data source is needed. It should not have many entries, as it will be extended later.

MealFragment lacking features

Get current/meal time from view model and setup NumberPicker properly. It also needs proper logic for listening to changes and updating meal time accordingly. Adding new food to meal and loading list of it should be handled as well. Each item should be deletable and editable. Create reusable component as popup menu for that.

Complete GoalsViewModel

Create ViewModel for GoalsFragment that will allow reading and saving goals from SharedPreferences. If needed, create new models for that purpose.

InformationDialog with error title

Create a way to instantiate InformationDialog with a title suggesting that an error had ocurred. Use it in every fragment that has callback to Result.

Change goals button

It will often be the case that user may want to change nutritional goals only for a given day. Add this functionality to DayFragment.

Cursor decorator

We need an object that will simplify and enhance Android Cursor usage.

Refactor rows api

It should implement iterable instead of having next() method that returns next row, which is often very difficult to use. Refactor all classes using it

Complete FoodFragment

Create its layout that should look like CategoryFoodDefinitionsLayout, but it should display all of the food items without splitting them into categories. It should enable searching, adding new definition and redirecting to FoodPortionFragment on clicking food item.

Create MealViewModel

It should allow updating meal time, loading meal, refreshing its content and deleting it from day.

Complete DaysFragment/ViewModel

Its layout should show list of days sorted by date with month statistics at the top. Each item in the list should be clickable and show popup menu with details/edit options. Create viewModel that will allow this, add/refactor models as necessary.

Propagate Meal changes to DayFragment

Currently, if we go from DayFragment to MealFragment and edit it, former does not know anything about it and is keeping old data. Message that MealFragment is receiving from FoodFragment needs to be propagated up.

Complete CategoryProductsFragment and populate it with data

Complete mentioned aboved Fragment layout and create its bare bones viewModel that will only return data by now. Layout should include search engine, its functionality will be implemented later. Code to Categories and Category need to be added to complete this task.

Double values format

Create class that will format double according to rules:

  • if it is an integer, do not show reminder
  • else show as many digits as it was configured in a constructor

Simplify asynchronous function calls

The way that asynchronous processes are called is too complex and , in case of returning Result, full of boiler plate code. We need object/objects that will make it simpler. Lifecycle awareness and making sure that callbacks are always called on main thread is also needed.

Years and Months view models

Complete mentioned above view models. They just have to return list of years/months available. Create new models that will fetch this data from database and views for displaying them. It needs to be possible to go from year to its months.

Delete EmptyMeal

In MealFragment check if created/updated meal does no contain any food. If not, delete it. Functionality should belong to MealViewModel, call should come from Fragment onDestroy().

Reuse existing food definitions

Before creating new food definition make sure that it does not exist in deleted state. If yes, just change its state and update values.

Proper history perspective

Currently, history stack, from main menu, is always -> years -> months -> days. It does not have sense if user have short history, so it needs to be flatten in that case.

Complete FoodPortionFragment

Create its layout that will display food name, calories, protein and make choosing portion size comfortable. It should also calculate food nutritional values on portion change.

Complete MealFragment

Create its layout that displays list of food and editable time. Items should be clickable and link to FoodFragment, time component should be implemented using NumberPicker. It should also have button for adding new food to a meal.

Create classes for populating database

Most of food products and all categories will come from database.json. We need classes that will read this file and populate database properly, if it does not exist.

Update current day goals

Currently day goals are set in a separate view, which can lead to current day not having up to date goals. In GoalsFragment, if current day exists it should be updated.

Complete GoalsFragment

Create GoalsFragment layout that will display weight, calories and protein goals. It should also allow to edit them.

Complete database.json

Complete this file by adding the most frequently used food categories and its products.

Refactor FoodDefinitionFragment

Refactor this Fragment so that it is possible to create it without giving neither food_id nor category_id. In this mode Spinner with Categories should be displayed. Change layout and viewModel as needed.

Add update/delete meal functionality to DayFragment

DayFragment needs to allow updating and deleting its meals. It should be done by using PopupMenu, that needs to be created as separate component. Add needed logic to DayViewModel and to related models, if necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.