Android Open Source - AndroidCouponAssistant Date Chooser Dialog






From Project

Back to project page AndroidCouponAssistant.

License

The source code is released under:

MIT License

If you think the Android project AndroidCouponAssistant 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.corylucasjeffery.couponassistant;
//from  w  w  w .j av a  2 s.com

import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.DatePicker;

import com.corylucasjeffery.couponassistant.activities.MainActivity;

import java.util.Calendar;

public class DateChooserDialog extends DialogFragment {
    private int year;
    private int month;
    private int day;

    private final String TAG = "DATECHOOSER";
    private final int DEFAULT_MONTH = 12;
    private final int DEFAULT_DAY = 31;

    public DateChooserDialog() {}

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        // Use the current date as the default date in the picker
        final Calendar c = Calendar.getInstance();
        this.year = c.get(Calendar.YEAR);
        this.month = DEFAULT_MONTH - 1; //for some reason, setting it to 12 moves it up to Jan?
        this.day = DEFAULT_DAY;

        Log.v(TAG, "on create: "+Integer.toString(year)+ " "+Integer.toString(month)+" "+Integer.toString(day));

        // Create a new instance of DatePickerDialog and return it
        DatePickerDialog dpd = new DatePickerDialog(getActivity(),
                (MainActivity)getActivity(), year, month, day);
        dpd.setTitle(R.string.date_chooser_title);
        return dpd;
    }
}




Java Source Code List

com.corylucasjeffery.couponassistant.BMPtoBlob.java
com.corylucasjeffery.couponassistant.BarcodeGenerator.java
com.corylucasjeffery.couponassistant.BlobtoBMP.java
com.corylucasjeffery.couponassistant.CameraPreview.java
com.corylucasjeffery.couponassistant.CouponAdapter.java
com.corylucasjeffery.couponassistant.Coupon.java
com.corylucasjeffery.couponassistant.DateChooserDialog.java
com.corylucasjeffery.couponassistant.DbGetCoupons.java
com.corylucasjeffery.couponassistant.DbPurchaseItem.java
com.corylucasjeffery.couponassistant.DbSubmitCoupon.java
com.corylucasjeffery.couponassistant.DbSubmitItem.java
com.corylucasjeffery.couponassistant.DbUserRegister.java
com.corylucasjeffery.couponassistant.DbUserStats.java
com.corylucasjeffery.couponassistant.GlobalCart.java
com.corylucasjeffery.couponassistant.Item.java
com.corylucasjeffery.couponassistant.ManualEntryDialog.java
com.corylucasjeffery.couponassistant.ParseUPC.java
com.corylucasjeffery.couponassistant.PhpWrapper.java
com.corylucasjeffery.couponassistant.ProgressBarHelper.java
com.corylucasjeffery.couponassistant.Statistics.java
com.corylucasjeffery.couponassistant.UserInfo.java
com.corylucasjeffery.couponassistant.ValueCodeDict.java
com.corylucasjeffery.couponassistant.activities.AndroidBarcodeView.java
com.corylucasjeffery.couponassistant.activities.CheckoutActivity.java
com.corylucasjeffery.couponassistant.activities.LoginActivity.java
com.corylucasjeffery.couponassistant.activities.MainActivity.java
com.corylucasjeffery.couponassistant.activities.SettingsActivity.java
com.corylucasjeffery.couponassistant.activities.ShowCouponsActivity.java
com.corylucasjeffery.couponassistant.activities.StatisticsActivity.java
com.google.zxing.integration.android.IntentIntegrator.java
com.google.zxing.integration.android.IntentResult.java