Android Open Source - Alkomer Drinks






From Project

Back to project page Alkomer.

License

The source code is released under:

MIT License

If you think the Android project Alkomer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package cz.jmx.tomik.alkomer.android.drinks;
/*from  www .j  av a 2s.  c  o m*/
import java.util.ArrayList;

/**
 * Alkomer - Server App
 * --------------------
 * List of All Drinks in App
 *
 * @copyright   Copyright (c) 2011 Tomas Vitek
 * @author      Tomas Vitek ~ http://tomik.jmx.cz

 * @package     Alkomer
 * @version     1.0
 */
public class Drinks {
  
  protected ArrayList<ArrayList<Drink>> drinks;
  protected ArrayList<String> groups;
    
  public Drinks() {
    drinks = new ArrayList<ArrayList<Drink>>();
    groups = new ArrayList<String>();
    
    ArrayList<Drink> temp = new ArrayList<Drink>();    
    
    temp.add(new Drink(10, "Pivo 12", 4.5f, 500, "0,5l", "drink_1"));
    temp.add(new Drink(11, "Pivo 11", 4.0f, 500, "0,5l","drink_6"));
    temp.add(new Drink(1, "Pivo 10", 3.5f, 500, "0,5l","drink_7"));    
    temp.add(new Drink(2, "Pivo 12", 4.5f, 300, "0,3l","drink_9"));
    temp.add(new Drink(12, "Pivo 11", 4.0f, 300, "0,3l","drink_15"));
    temp.add(new Drink(3, "Pivo 10", 3.5f, 300, "0,3l","drink_4"));
    
    drinks.add(temp);
    groups.add("Piva");
    
    temp = new ArrayList<Drink>();
    temp.add(new Drink(4, "Vno", 12f, 200, "2dl","drink_2"));
    temp.add(new Drink(5, "Vno", 12f, 300, "3dl","drink_10"));

    drinks.add(temp);
    groups.add("Vna");    
    
    temp = new ArrayList<Drink>();
    temp.add(new Drink(6, "Mal pank 40%", 40f, 20, "20ml", "drink_12"));
    temp.add(new Drink(7, "Velk pank 40%", 40f, 40, "40ml", "drink_13"));
    temp.add(new Drink(13, "Velk pank 40%", 40f, 50, "50ml","drink_8"));
    temp.add(new Drink(8, "Mal pank 20%", 20f, 20, "20ml","drink_14"));
    temp.add(new Drink(9, "Velk pank 20%", 20f, 40, "40ml","drink_5"));
    temp.add(new Drink(14, "Velk pank 20%", 20f, 50, "50ml","drink_11"));
    
    drinks.add(temp);
    groups.add("Panky");    
    
    temp = new ArrayList<Drink>();
    temp.add(new Drink(15, "Mojito", 10f, 400, "0,4l", "drink_4"));
    temp.add(new Drink(17, "Cuba Libre", 15f, 330, "0,33l","drink_16"));
    temp.add(new Drink(16, "Martini", 50f, 70, "7cl", "drink_3"));
    temp.add(new Drink(18, "Pia Colada", 28f, 150, "15cl","drink_2"));    
    
    drinks.add(temp);
    groups.add("Drinky");        
  }
  
  public ArrayList<ArrayList<Drink>> getDrinksList() {
        return drinks;    
  }
  
  public ArrayList<String> getGroupsList() {
        return groups;    
  }  
  
  public Drink findDrink(int id) {
    for (ArrayList<Drink> gr : drinks) {
      for (Drink d : gr) {
        if (d.getId() == id) return d;
      }
    }
    return null;
  }
}




Java Source Code List

cz.jmx.tomik.alkomer.android.BaseActivity.java
cz.jmx.tomik.alkomer.android.DashboardActivity.java
cz.jmx.tomik.alkomer.android.DrinkListActivity.java
cz.jmx.tomik.alkomer.android.ForgottenPasswordActivity.java
cz.jmx.tomik.alkomer.android.GlassListActivity.java
cz.jmx.tomik.alkomer.android.LoginActivity.java
cz.jmx.tomik.alkomer.android.Main.java
cz.jmx.tomik.alkomer.android.RegistrationActivity.java
cz.jmx.tomik.alkomer.android.SettingsActivity.java
cz.jmx.tomik.alkomer.android.StatisticsActivity.java
cz.jmx.tomik.alkomer.android.StatisticsFlowAdapter.java
cz.jmx.tomik.alkomer.android.database.DataHelper.java
cz.jmx.tomik.alkomer.android.drinks.DrinkAdapter.java
cz.jmx.tomik.alkomer.android.drinks.Drink.java
cz.jmx.tomik.alkomer.android.drinks.Drinks.java
cz.jmx.tomik.alkomer.android.drinks.GlassAdapter.java
cz.jmx.tomik.alkomer.android.drinks.Glass.java
cz.jmx.tomik.alkomer.android.models.Gender.java
cz.jmx.tomik.alkomer.android.models.User.java
cz.jmx.tomik.alkomer.android.threads.DeleteDrinkThread.java
cz.jmx.tomik.alkomer.android.threads.DeleteDrinksThread.java
cz.jmx.tomik.alkomer.android.threads.DrinkThread.java
cz.jmx.tomik.alkomer.android.threads.ForgottenPasswordAsyncTask.java
cz.jmx.tomik.alkomer.android.threads.ImageDownloadAsyncTask.java
cz.jmx.tomik.alkomer.android.threads.LoginAsyncTask.java
cz.jmx.tomik.alkomer.android.threads.RegistrationAsyncTask.java
cz.jmx.tomik.alkomer.android.threads.UpdateSettingsThread.java
cz.jmx.tomik.alkomer.android.tools.Calculator.java
cz.jmx.tomik.alkomer.android.tools.DataTime.java
cz.jmx.tomik.alkomer.android.tools.EmailValidator.java
cz.jmx.tomik.alkomer.android.tools.IntEditTextPreference.java