Waistline Documentation

repository·master·Indexed 20 days ago

https://github.com/davidhealey/waistline

Waistline is an open-source calorie counter and weight tracker for Android built with Cordova and Framework7. It features a food diary, a local food database with barcode scanning, and integrations with Open Food Facts and the USDA food databases. The application allows users to track daily nutrition, manage body statistics, and import/export data for backup.

Tokens
5.5K
Snippets
11
Records
32
Agent score
72%

What's inside Waistline

  1. Overview of Waistline features

    master

    Waistline is a libre calorie counter and weight tracker application for Android, built using Cordova and Framework7.

    Key features include:

    • Diary: A day-by-day log for tracking food consumption at specific times.
    • Food List: A local database of foods that can be populated via manual entry, barcode scanning, or online searching. It integrates with the Open Food Facts and USDA food databases.
    • Data Management: Supports import and export functionality for backing up and restoring app data.
    • Platform Support: Designed for Android devices running version 5.0 or higher.
    • Monetization: The app is free, open-source, and contains no ads or in-app purchases.
  2. Difference between Meals and Recipes

    master

    While both involve multiple ingredients, they behave differently when added to the Diary:

    • Meal: A collection of food items consumed together. When added to the Diary, each ingredient is added as a separate entry.
    • Recipe: A dish consisting of several ingredients. When added to the Diary, it appears as a single entry.
  3. Privacy and Data Usage in Waistline

    master

    Waistline is designed with privacy in mind, but requires certain permissions and internet access for specific features:

    Data Collection

    • Personal Data: No personal data is collected by the software.
    • Usage Data: Usage data is only collected when interacting with the Open Food Facts or USDA databases.

    Internet and Permissions

    • Internet Connection: Required only when scanning barcodes, searching for products online, or uploading a product to the Open Food Facts database. During these actions, only the product barcode or search terms are sent to the external databases.
    • Camera Permission: Required for scanning barcodes.
    • Storage Permission: Required for uploading product images and performing data import/export operations.
  4. Use the link button in the Food Editor

    master

    The link button (chain icon) in the Food Editor menu bar controls the relationship between serving sizes and nutrition values.

    • When Active (not crossed out): Changes to the serving size or individual nutriments are applied proportionally to all other fields. For example, doubling the serving size doubles all nutrition values.
    • When Inactive: Fields are independent.

    Default Behavior: The link button is disabled by default when creating new items, but enabled by default when editing existing items.

  5. Use Material Icons via CSS Classes (Alternative)

    master

    You can use specific CSS classes for icons (e.g., mi mi-face).

    Note: This method is not recommended because it requires importing a large CSS file and may not support newer icons if Google hasn't updated the codepoints.

    1. Import the CSS

    <link rel="stylesheet" href="/path/to/material-icons/css/material-icons.min.css">

    2. Display Icons

    Use the mi prefix followed by the icon name:

    <span class="mi mi-face"></span>

    3. Customize with Sass

    Import the CSS Sass file:

    @import 'material-icons/css/material-icons.scss';
    // Or for webpack:
    @import '~material-icons/css/material-icons.scss';

    Available Sass Variables

    • $material-icons-css-prefix: The class prefix (default: 'mi').
    • $material-icons-css-search: The separator used for searching (default: '_').
    • $material-icons-css-replace: Character used to replace _ with - in class names (default: '-').

    Available Sass Mixins

    .mi-face {
      @include material-icon('face');
    }
  6. Quick add calories to the Diary

    master

    To quickly log calories without navigating menus:

    1. Press and hold the + button in the Diary.
    2. Enter the number of calories in the text field.
    3. (Optional) Add a description.

    Note: Enter a negative number to log burned calories from exercise.

  7. Get started with Framework7

    master

    Framework7 is a full-featured mobile HTML framework designed for building iOS and Android applications. To begin building with Framework7, follow these core steps:

    1. Introduction: Understand the framework's capabilities and core concepts.
    2. Installation: Set up the framework in your development environment.
    3. App Layout: Define the structure of your mobile application.
    4. Initialize App: Write the code required to boot the Framework7 instance and start your application.

    For detailed implementation details, refer to the official Framework7 Documentation.

  8. Use Material Icons via Icon Font (Recommended)

    master

    The recommended way to use these icons is via the icon font method. This involves importing the CSS and using the material-icons class with the icon name as the element content.

    1. Import the CSS

    Include the stylesheet in your HTML:

    <link rel="stylesheet" href="/path/to/material-icons/iconfont/material-icons.css">

    2. Display Icons

    Use a <span> with the appropriate class and the icon name as text:

    Standard Icons:

    <span class="material-icons">home</span>

    Style Variants:

    • Outlined: <span class="material-icons-outlined">home</span>
    • Round: <span class="material-icons-round">home</span>
    • Sharp: <span class="material-icons-sharp">home</span>
    • Two Tone: <span class="material-icons-two-tone">home</span>
  9. View nutrition breakdowns (Overview and Meals)

    master

    To see detailed nutrition data:

    • Daily Overview: Tap the pie chart button in the Diary menu bar to see the macro nutriment split (Fat : Carbs : Proteins) and other totals.
    • Meal Breakdown: In the Diary, tap the energy total at the bottom of a specific meal group to open a dialog with detailed information (e.g., sugar content).
  10. Customize Diary categories, food lists, and nutriments

    master

    Waistline allows extensive customization of the user interface and data tracking:

    • Meal Names: Customize names like "Breakfast" or "Lunch" under Settings > Diary > Categories.
    • Food List Sorting: Change the sort order (e.g., most recently used first) under Settings > Foods, Meals, Recipes > Sort Foods.
    • Food Categories & Labels:
      • Assign custom categories to foods/meals/recipes via Settings > Foods, Meals, Recipes > Labels and Categories.
      • Enable Show Category Labels under Settings > Foods, Meals, Recipes to see category names preceding food names in the list.
    • Nutriments:
      • Manage the list of tracked nutriments under Settings > Nutriments. You can add custom ones (e.g., "water") or rearrange them.
      • In the Food Editor, tap Show more Nutriments to see hidden ones.
      • Enable Show all nutriments on Overview page under Settings > Diary to see everything on the Diary overview.
    • Body Stats: Customize tracked stats (e.g., "blood pressure") under Settings > Body Stats. Only enabled fields appear on the Statistics page.
    • Displaying Goals: Control which nutriments appear at the bottom of the Diary or on the Statistics page via the Goals page. Tap a nutriment to toggle Show in Diary and Show in Statistics.