Android Open Source - rebudget Plans Activity






From Project

Back to project page rebudget.

License

The source code is released under:

Copyright (c) 2012, Alexander Lopatin 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 rebudget 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.sbar.rebudget.activities;
//from   w w w  .j a v  a  2  s  .  c  o m
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.sbar.rebudget.Common;
import com.sbar.rebudget.R;
import com.sbar.rebudget.views.ChartView;

public class PlansActivity extends Activity {
    LinearLayout m_layout = null;
    ChartView m_chartView = null;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.plans);

        ScrollView scrollView = (ScrollView) findViewById(R.id.chart_scrollview);
        m_chartView = new ChartView(this);
        updateChartView();
        scrollView.addView(m_chartView);
    }

    public void updateChartView() {
        Cursor c = MainTabActivity.s_dc.selectCategories();
        if (c.moveToFirst()) {
            do {
                m_chartView.addPiece(
                    c.getString(0), c.getInt(1),
                    c.getFloat(2), c.getFloat(3)
                );
            } while (c.moveToNext());
            m_chartView.sortPieces();
        } else {
            if (MainTabActivity.s_dc.addDefaultCategories())
                updateChartView();
            else
                Common.LOGE("failed to create default categories");
        }
    }
}




Java Source Code List

com.sbar.rebudget.Common.java
com.sbar.rebudget.FilterStruct.java
com.sbar.rebudget.Pair.java
com.sbar.rebudget.activities.AddFilterCostActivity.java
com.sbar.rebudget.activities.AddFilterRemainingActivity.java
com.sbar.rebudget.activities.AddFilterStoreActivity.java
com.sbar.rebudget.activities.AddOutcomeFilterActivity.java
com.sbar.rebudget.activities.CategoriesActivity.java
com.sbar.rebudget.activities.MainTabActivity.java
com.sbar.rebudget.activities.PlansActivity.java
com.sbar.rebudget.activities.StatsActivity.java
com.sbar.rebudget.activities.WalletsActivity.java
com.sbar.rebudget.database.DatabaseConnector.java
com.sbar.rebudget.database.DatabaseHelper.java
com.sbar.rebudget.receivers.SmsListener.java
com.sbar.rebudget.views.ChartView.java