Android Open Source - TipOnDiscount Tip On Discount Application






From Project

Back to project page TipOnDiscount.

License

The source code is released under:

GNU General Public License

If you think the Android project TipOnDiscount 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

// Copyright 2013 David A. Greenbaum
/*//w w w. j a  v a  2  s .  c  om
This file is part of Tip On Discount.

Tip On Discount is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

Tip On Discount is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with Tip On Discount.  If not, see <http://www.gnu.org/licenses/>.
*/
package com.itllp.tipOnDiscount;
import com.itllp.tipOnDiscount.defaults.DefaultsFactory;
import com.itllp.tipOnDiscount.defaults.DefaultsImpl;
import com.itllp.tipOnDiscount.defaults.persistence.DefaultsPersister;
import com.itllp.tipOnDiscount.defaults.persistence.DefaultsPersisterFactory;
import com.itllp.tipOnDiscount.defaults.persistence.impl.DefaultsPersisterImpl;
import com.itllp.tipOnDiscount.model.DataModelFactory;
import com.itllp.tipOnDiscount.model.DataModelInitializerFactory;
import com.itllp.tipOnDiscount.model.impl.DataModelImpl;
import com.itllp.tipOnDiscount.model.impl.DataModelInitializerFromPersistedDefaults;
import com.itllp.tipOnDiscount.model.impl.SimpleDataModelInitializer;
import com.itllp.tipOnDiscount.model.persistence.DataModelPersisterFactory;
import com.itllp.tipOnDiscount.model.persistence.impl.DataModelPersisterImpl;
import com.itllp.tipOnDiscount.persistence.Persister;
import com.itllp.tipOnDiscount.persistence.impl.PreferencesFilePersister;

import android.app.Application;

public class TipOnDiscountApplication extends Application {
  
  public static final String TOD_PREFERENCES_FILE = "TipOnDiscountPrefs";
  public static final String DEFAULTS_PREFERENCES_FILE = "Defaults";

  @Override
  public void onCreate() {
    super.onCreate();

    DefaultsFactory.setDefaults(new DefaultsImpl());
    Persister defaultsPreferencesPersister = new PreferencesFilePersister
        (DEFAULTS_PREFERENCES_FILE);
    DefaultsPersisterFactory.setDefaultsPersister(
        new DefaultsPersisterImpl(defaultsPreferencesPersister));
    
    DefaultsPersister defaultsPersister = new DefaultsPersisterImpl(
        defaultsPreferencesPersister);
    DataModelInitializerFactory.setDataModelInitializer(
        new DataModelInitializerFromPersistedDefaults(
            defaultsPersister, new DefaultsImpl()));

    DataModelImpl dataModel = new DataModelImpl();
    SimpleDataModelInitializer simpleDataModelInitializer = new 
        SimpleDataModelInitializer();
    simpleDataModelInitializer.initialize(dataModel, this);
    DataModelFactory.setDataModel(dataModel);
    
    Persister dataModelPreferencesPersister = new PreferencesFilePersister
        (TOD_PREFERENCES_FILE);
    DataModelPersisterFactory.setDataModelPersister(
        new DataModelPersisterImpl(dataModelPreferencesPersister));
  }
}




Java Source Code List

android.content.Context.java
com.itllp.tipOnDiscount.SetDefaultsActivity.java
com.itllp.tipOnDiscount.TipOnDiscountApplication.java
com.itllp.tipOnDiscount.TipOnDiscountApplication.java
com.itllp.tipOnDiscount.TipOnDiscount.java
com.itllp.tipOnDiscount.defaults.DefaultsFactory.java
com.itllp.tipOnDiscount.defaults.DefaultsImpl.java
com.itllp.tipOnDiscount.defaults.Defaults.java
com.itllp.tipOnDiscount.defaults.persistence.DefaultsPersisterFactory.java
com.itllp.tipOnDiscount.defaults.persistence.DefaultsPersister.java
com.itllp.tipOnDiscount.defaults.persistence.impl.DefaultsPersisterImpl.java
com.itllp.tipOnDiscount.model.DataModelFactory.java
com.itllp.tipOnDiscount.model.DataModelInitializerFactory.java
com.itllp.tipOnDiscount.model.DataModelInitializer.java
com.itllp.tipOnDiscount.model.DataModelObservableTests.java
com.itllp.tipOnDiscount.model.DataModelObservable.java
com.itllp.tipOnDiscount.model.DataModelObserver.java
com.itllp.tipOnDiscount.model.DataModel.java
com.itllp.tipOnDiscount.model.impl.DataModelImplNotificationTests.java
com.itllp.tipOnDiscount.model.impl.DataModelImplTests.java
com.itllp.tipOnDiscount.model.impl.DataModelImpl.java
com.itllp.tipOnDiscount.model.impl.DataModelInitializerFromPersistedDefaultsTests.java
com.itllp.tipOnDiscount.model.impl.DataModelInitializerFromPersistedDefaults.java
com.itllp.tipOnDiscount.model.impl.SimpleDataModelInitializerTests.java
com.itllp.tipOnDiscount.model.impl.SimpleDataModelInitializer.java
com.itllp.tipOnDiscount.model.persistence.DataModelPersisterFactory.java
com.itllp.tipOnDiscount.model.persistence.DataModelPersister.java
com.itllp.tipOnDiscount.model.persistence.impl.DataModelPersisterImpl.java
com.itllp.tipOnDiscount.model.update.ActualTipAmountUpdate.java
com.itllp.tipOnDiscount.model.update.ActualTipRateUpdate.java
com.itllp.tipOnDiscount.model.update.BillSubtotalUpdate.java
com.itllp.tipOnDiscount.model.update.BillTotalUpdate.java
com.itllp.tipOnDiscount.model.update.BumpsUpdate.java
com.itllp.tipOnDiscount.model.update.DiscountUpdate.java
com.itllp.tipOnDiscount.model.update.PlannedTipAmountUpdate.java
com.itllp.tipOnDiscount.model.update.PlannedTipRateUpdate.java
com.itllp.tipOnDiscount.model.update.RoundUpToNearestUpdate.java
com.itllp.tipOnDiscount.model.update.ShareDueUpdate.java
com.itllp.tipOnDiscount.model.update.SplitBetweenUpdate.java
com.itllp.tipOnDiscount.model.update.TaxAmountUpdate.java
com.itllp.tipOnDiscount.model.update.TaxRateUpdate.java
com.itllp.tipOnDiscount.model.update.TippableAmountUpdate.java
com.itllp.tipOnDiscount.model.update.TotalDueUpdate.java
com.itllp.tipOnDiscount.model.update.UpdateSetTests.java
com.itllp.tipOnDiscount.model.update.UpdateSet.java
com.itllp.tipOnDiscount.model.update.Update.java
com.itllp.tipOnDiscount.persistence.Persister.java
com.itllp.tipOnDiscount.persistence.impl.PreferencesFilePersister.java
com.itllp.tipOnDiscount.util.BigDecimalLabelMap.java
com.itllp.tipOnDiscount.util.EqualsUtil.java