Android Open Source - SNISI-droid Nutrition U R E N I Report






From Project

Back to project page SNISI-droid.

License

The source code is released under:

Apache License

If you think the Android project SNISI-droid 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.yeleman.nutrition;
/*from  w w w .j a v a2s.co m*/
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.yeleman.snisidroid.CheckedFormActivity;
import com.yeleman.snisidroid.Constants;
import com.yeleman.snisidroid.R;

/**
 * Created by fad on 29/10/14.
 */
public class NutritionURENIReport extends CheckedFormActivity implements View.OnClickListener {
    private final static String TAG = Constants.getLogTag("NutritionURENIReport");

    private TextView instructionLabel;
    private Button u6ReportButton;
    private Button u59o6URENASButton;
    private Button o59ReportButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.nutrition_ureni_report);
        setTitle(String.format(getString(R.string.sub_app_name_nut),
                getString(R.string.ureni)));
        Log.d(TAG, "onCreate NutritionURENIReport");

        setupSMSReceiver();
        setupUI();
    }

    @Override
    public void onResume() {
        super.onResume(); 
        setupUI();
    }

    protected void setupUI() {
        Log.d(TAG, "setupUI NutritionURENIReport");
        NutritionURENIReportData report = NutritionURENIReportData.get();

        instructionLabel = (TextView) findViewById(R.id.instructionLabel);
        if (report.isComplete()) {
            instructionLabel.setText(R.string.nutrition_instructions_complete);
        } else{
            instructionLabel.setText(R.string.nutrition_instructions_incomplete);
        }

        u6ReportButton = (Button) findViewById(R.id.u6URENIButton);
        u6ReportButton.setText(String.format(getString(R.string.nutrition_fillout_section), getString(R.string.u6)));
        Constants.updateButtonCompletion(u6ReportButton, report.u6_is_complete);
        u6ReportButton.setOnClickListener(this);

        u59o6URENASButton = (Button) findViewById(R.id.u59o6URENASButton);
        u59o6URENASButton.setText(String.format(getString(R.string.nutrition_fillout_section), getString(R.string.u59o6)));
        Constants.updateButtonCompletion(u59o6URENASButton, report.u59o6_is_complete);
        u59o6URENASButton.setOnClickListener(this);

        o59ReportButton = (Button) findViewById(R.id.o59URENiButton);
        o59ReportButton.setText(String.format(getString(R.string.nutrition_fillout_section), getString(R.string.o59)));
        Constants.updateButtonCompletion(o59ReportButton, report.o59_is_complete);
        o59ReportButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Object activity = null;
        switch (view.getId()) {
            case R.id.u6URENIButton:
                activity = NutritionURENIU6Report.class;
                break;
            case R.id.u59o6URENASButton:
                activity = NutritionURENIU59O6Report.class;
                break;
            case R.id.o59URENiButton:
                activity = NutritionURENIO59Report.class;
                break;
        }
        Intent intent = new Intent(
                getApplicationContext(),
                (Class<?>) activity);
        startActivity(intent);
    }

    protected String buildSMSText() {
        NutritionURENIReportData report = NutritionURENIReportData.get();
        return report.buildSMSText();
    }
}




Java Source Code List

com.yeleman.nutrition.NutritionHome.java
com.yeleman.nutrition.NutritionInputsReportData.java
com.yeleman.nutrition.NutritionInputsReport.java
com.yeleman.nutrition.NutritionMonthlyHome.java
com.yeleman.nutrition.NutritionMonthlyReportData.java
com.yeleman.nutrition.NutritionSummaryReport.java
com.yeleman.nutrition.NutritionURENAMExsamReport.java
com.yeleman.nutrition.NutritionURENAMO59Report.java
com.yeleman.nutrition.NutritionURENAMPWReport.java
com.yeleman.nutrition.NutritionURENAMReportData.java
com.yeleman.nutrition.NutritionURENAMReport.java
com.yeleman.nutrition.NutritionURENAMU23O6Report.java
com.yeleman.nutrition.NutritionURENAMU59O23Report.java
com.yeleman.nutrition.NutritionURENASO59Report.java
com.yeleman.nutrition.NutritionURENASReportData.java
com.yeleman.nutrition.NutritionURENASReport.java
com.yeleman.nutrition.NutritionURENASU59O6Report.java
com.yeleman.nutrition.NutritionURENFormIface.java
com.yeleman.nutrition.NutritionURENForm.java
com.yeleman.nutrition.NutritionURENIO59Report.java
com.yeleman.nutrition.NutritionURENIReportData.java
com.yeleman.nutrition.NutritionURENIReport.java
com.yeleman.nutrition.NutritionURENIU59O6Report.java
com.yeleman.nutrition.NutritionURENIU6Report.java
com.yeleman.nutrition.NutritionWeeklyReportData.java
com.yeleman.nutrition.NutritionWeeklyReport.java
com.yeleman.projetsnisi.ApplicationTest.java
com.yeleman.smir.Constants.java
com.yeleman.smir.CustomOnItemSelectedListener.java
com.yeleman.smir.SMIRAlert.java
com.yeleman.smir.SMIRHome.java
com.yeleman.smir.SharedChecks.java
com.yeleman.snisidroid.ChangePassword.java
com.yeleman.snisidroid.CheckedFormActivity.java
com.yeleman.snisidroid.Constants.java
com.yeleman.snisidroid.Popups.java
com.yeleman.snisidroid.Preferences.java
com.yeleman.snisidroid.ReportData.java
com.yeleman.snisidroid.SMSDeliveredReceiver.java
com.yeleman.snisidroid.SMSReceiver.java
com.yeleman.snisidroid.SMSSentReceiver.java
com.yeleman.snisidroid.SMSUpdater.java
com.yeleman.snisidroid.SNISIAbout.java
com.yeleman.snisidroid.SNISIApp.java
com.yeleman.snisidroid.SNISIHome.java
com.yeleman.snisidroid.SharedChecks.java