Android Open Source - openxcKPL Historical Fuel Consumption Chart Fragment






From Project

Back to project page openxcKPL.

License

The source code is released under:

Copyright (c) 2012 Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are me...

If you think the Android project openxcKPL 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 com.ford.openxc.kpl;
/*from  w w w.  j  a  v a2 s.c o  m*/
import org.achartengine.model.XYSeries;

import android.graphics.Color;
import android.os.Bundle;

public class HistoricalFuelConsumptionChartFragment extends
    HistoricalChartFragment {
  private final int DEFAULT_COLOR = Color.parseColor("#FFFFFF");
  private final int PER_TRIP_COLOR = Color.parseColor("#F46E8F");
  private final int DAILY_COLOR = Color.parseColor("#F43D6B");
  private final int WEEKLY_COLOR = Color.parseColor("#AE2C4C");
  private final int MONTHLY_COLOR = Color.parseColor("#E9003A");

  @Override
  public void onCreate(Bundle savedInstanceState) {
    init("Fuel Consumption", "Time", "Liters");
    super.onCreate(savedInstanceState);
  }

  @Override
  protected int getLineColor() {
    Timeframe timeframe = getTimeframe();
    switch (timeframe) {
    case DAILY:
      return DAILY_COLOR;
    case WEEKLY:
      return WEEKLY_COLOR;
    case MONTHLY:
      return MONTHLY_COLOR;
    case PER_TRIP:
      return PER_TRIP_COLOR;
    default:
      return DEFAULT_COLOR;
    }

  }

  @Override
  protected XYSeries getSeries() {
    mSeries = getSeries(DbHelper.C_FUEL, "Fuel Consumption (Gallons)", true);
    return mSeries;
  }
}




Java Source Code List

com.ford.openxc.kpl.ChartFragment.java
com.ford.openxc.kpl.DbHelper.java
com.ford.openxc.kpl.HistoricalChartFragment.java
com.ford.openxc.kpl.HistoricalFuelConsumptionChartFragment.java
com.ford.openxc.kpl.HistoricalKplChartFragment.java
com.ford.openxc.kpl.KPLActivity.java
com.ford.openxc.kpl.KplChartFragment.java
com.ford.openxc.kpl.OverviewActivity.java
com.ford.openxc.kpl.ShowSettingsActivity.java
com.ford.openxc.kpl.SpeedChartFragment.java
com.ford.openxc.kpl.TabListener.java
com.ford.openxc.kpl.TabsAdapter.java
com.ford.openxc.kpl.Timeframe.java