Code Monkey home page Code Monkey logo

red-calorie's Introduction

Red Calorie

Red Calorie Build Status

Android app for keeping your calories in check. Previous known as: Count Them Calories

Free and open source.

No advertisement.

Limited functionality, very, very slowly growing due to real life responsibilities.

Application is available on Google Play

Changelog available here.

General project goal:

  • TDD from the beginning via espresso
  • dagger2 + rxJava + Glide + GreenDao + lots other libraries

All critique is welcomed and appreciated.

Build flavors

  • devtools - manual testing flavor, contains LeakCanary and other debug settings
  • production - clean flavor for publishing, automatic testing etc.

Testing

Mayor functionality is tested with android tests.

  • Runs on Android 26 Virtual Device.
  • For all tests to pass: Window animation scale, Transition animation scale and Animator duration scale must be turn off in developer options.

red-calorie's People

Contributors

st1hy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

red-calorie's Issues

Use contraint layout

Replace current view hierarchy with constraint layout when possible.

Optionally: test performance gain for fun and profit.

Improve activity transitions

Transitions between activities should be more like material design.

For example: clicking edit meal should expand meal row to a new activity; expand detail into large view.

Fast scrolling sluggishness

Fast scrolling causes large cpu consumption spikes and low fps.
Cause: recycler view is not recycling views during scrolling animation.

What was tried:

  • using different fast scroll library. Result: issue stayed the same.
  • using 'native' fast scrolling available in support library 26. Result: issue seems to be fixed but there are side effects:
  • scroll bar handle shrinks to 0 when there are too many items in the list (no customization (?))

  • no bubble with text (this could be mitigated by implementing one or using something from existing libraries)

Native seems to be way to go, but not without medium work involved.

feature/native-fastscroll

Replace current circular image view solution

Current image is using CardView corner radius to create circular effect.

Current solution does not work correctly on >=4.4.

Replace with proper CircularImageView or better alternative.

4.4 layout fixes

On 4.4 shadows are incorrectly displayed
No points of graph.
Small but visible gap in graph line.

Add ingredient quick search

In add ingredient screen add ability to quickly search for this name in browser.

  1. Add button next to ingredient name
  2. Clicking button launches system browser with query i.e. google.com/#q=replace+spaces
  3. Add setting for adding kewords to search query i.e. " calories" ; add sensible default.

Editing newly created copy of existing meal causes app crash

Steps to reproduce on 1.5.6:

  1. Copy a meal to today
  2. Edit this mel
  3. Click save

Application crashes on Android Oreo:
Crash report is not uploading to Play Services, no errors are reported to Logcat (Android 8.0 only)
Under investigation (manual error logging) problem was found in:

09-29 22:52:59.150 2426-2493/? E/AddMealPresenterImp$$La: org.greenrobot.greendao.DaoException: Entity is detached from DAO context at com.github.st1hy.countthemcalories.database.IngredientTemplate.getChildIngredients(IngredientTemplate.java:164) at com.github.st1hy.countthemcalories.activities.overview.meals.model.RxMealsDatabaseModel.performInsertOrUpdate(RxMealsDatabaseModel.java:69) at com.github.st1hy.countthemcalories.activities.overview.meals.model.RxMealsDatabaseModel.lambda$insertOrUpdate$1(RxMealsDatabaseModel.java:58) at com.github.st1hy.countthemcalories.activities.overview.meals.model.RxMealsDatabaseModel$$Lambda$2.call(Unknown Source:0) at org.greenrobot.greendao.AbstractDaoSession.callInTx(AbstractDaoSession.java:166) at com.github.st1hy.countthemcalories.core.rx.AbstractRxDatabaseModel.lambda$callInTx$0(AbstractRxDatabaseModel.java:32) at com.github.st1hy.countthemcalories.core.rx.AbstractRxDatabaseModel$$Lambda$1.call(Unknown Source:0) at rx.internal.operators.OnSubscribeFromCallable.call(OnSubscribeFromCallable.java:48) at rx.internal.operators.OnSubscribeFromCallable.call(OnSubscribeFromCallable.java:33) at rx.Observable.unsafeSubscribe(Observable.java:10346) at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100) at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230) at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

Wrong orientation of images with EXIF data.

Picasso at version used in the app: 2.5.3-SNAPSHOT incorrectly loads images made with camera in vertical orientation. They are rotated 90 degrees.

Picasso version tested:
2.5.2 - images scaled incorrectly.
2.5.3-SNAPSHOT, 2.6.0-SNAPSHOT - EXIF bug

Solution is to fix bug in picasso: fix has been submitted and await merge.
Until picasso is fixed workaround is needed:

  1. Create aar with fix from forked repo and add as dependency.
    OR
  2. Apply different workaround using version existing snapshot.

Permission check needs to be present before loading images.

Currently permission for write external storage is asked and requested when selecting image to be added to new meal or ingredient.

If user revokes permission and restarts the app images do not load leaving empty spaces.

Solution:

  1. Check and ask permission before loading images.
  2. If permission is not granted use default images, do not attempt reading external storage.

Macronutrients

Hi,

I hope this is still being developed on. If so, I'd be happy if you could add the possibilities to add macros (carbs, protein, fat). I'd even donate to have this function.

Thanks!

Add multi selecting ingredients for a tag

On category screen there should be a possibility to edit what ingredients belong to a tag (most likely the same way multi selection works for ingredient tags but reverse)

Architecture modernization

Current application structure and design could be improved.
Goal is to make the code modularized better, easier to read and maintain so that new feature could be introduced faster or just to look cooler.

  • Modularization and refactoring: current code is too much all over the place. Logic can and should separated more cleanly. General idea it to change from database centric to business logic centric. Go full hexagonal architecture (or as close as I can design it)
  • Migrate to RxJava2. Leave old things behind.
  • MVVM for ui module, full databinding.
  • Migrate to Kotlin or at least start slowly rewriting the code base.
  • Go SOLID. As I said before some code is all over the place.
  • Simplify everything as much as possible but not more.
  • Use Constraint layout where it makes sense to do so.

Improve layout on tablets

Currently on tablets in many screens layout fills entire screen width without any significant padding.

For very least this padding needs to be bigger and match standards for 7' and 10' screens.
Other improvements to sizes and positioning.
After that make new screen captures for phone, 7' and 10' tablets and update store description.

1.3 broke recycling views

RecyclerView inside NestedScrollView have unlimited height: it loads all the views.
Remove NestedScrollView and replace it with more item view types:

  1. for top padding
  2. for item
  3. for bottom padding

All item should create mosaic that looks the same as it does now in respectful orientations.

Scrolling is also broken: it sometimes freezes instead of doing smooth fling. No such behaviour with just recycler

Target: all affected views
in order: tags, ingredients, overview, add ingredient, add meal

Add more espresso tests

Current tests does not cover every possible user actions for activity.

Consider recording them with Espresso test recorder

Fix shared view between activities

When meal is clicked image jumps way below its original position then animates up on an arc, finally jumps up to the position of the target image view. Closing animation has the same bug in reverse.

Bug affects:
Opening meal detail activity in overview
Opening ingredient detail activity in add meal.
Device affected:
Nexus 5X with Android 6.0

Add new funtion: planner

Add new functionality calorie planner:

  1. New activity with entry in swipe menu
  2. Enter weight and calculate current calories input for maintain, setup goal as -20% or similar
  3. Display graph on overview with daily goals and week history

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.