当前位置: 首页>>代码示例>>Java>>正文


Java DatePickerDialog类代码示例

本文整理汇总了Java中com.fourmob.datetimepicker.date.DatePickerDialog的典型用法代码示例。如果您正苦于以下问题:Java DatePickerDialog类的具体用法?Java DatePickerDialog怎么用?Java DatePickerDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DatePickerDialog类属于com.fourmob.datetimepicker.date包,在下文中一共展示了DatePickerDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sensorstartonClick

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
public void sensorstartonClick() {
    final Calendar calendar = Calendar.getInstance();
    final DatePickerDialog datePickerDialog = DatePickerDialog.newInstance((DatePickerDialog.OnDateSetListener) this, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));
    final TimePickerDialog timePickerDialog = TimePickerDialog.newInstance((TimePickerDialog.OnTimeSetListener) this, calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), false, false);
    timePickerDialog.show(getSupportFragmentManager(), "timepicker");
    datePickerDialog.setYearRange(2016, 2028);
    datePickerDialog.show(getSupportFragmentManager(), "datepicker");

    /*
    Notification notification = new NotificationCompat.Builder(getApplication())
            .setSmallIcon(R.drawable.common_google_signin_btn_icon_dark)
            .setContentTitle("Hello World")
            .setContentText("My first Android Wear notification")
            .extend(
                    new NotificationCompat.WearableExtender().setHintShowBackgroundOnly(false))
            .build();
    NotificationManagerCompat notificationManager = NotificationManagerCompat.from(getApplication());
    int notificationId = 1;
    notificationManager.notify(notificationId, notification);
    */
}
 
开发者ID:LadyViktoria,项目名称:wearDrip,代码行数:22,代码来源:MainActivity.java

示例2: onDateSet

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
public void onDateSet(DatePickerDialog datePickerDialog, int year, int month, int day) {
    dates = day + "-";
    String monthString;
    switch (month + 1) {
        case 1: monthString = "January";    break;
        case 2: monthString = "February";   break;
        case 3: monthString = "March";      break;
        case 4: monthString = "April";      break;
        case 5: monthString = "May";        break;
        case 6: monthString = "June";       break;
        case 7: monthString = "July";       break;
        case 8: monthString = "August";     break;
        case 9: monthString = "September";  break;
        case 10:monthString = "October";    break;
        case 11:monthString = "November";   break;
        case 12:monthString = "December";   break;
        default:monthString = "Invalid month";break;
    }

    dates = dates + monthString;
    dates = dates + "-" + year;
    selectdate.setText("Check In : " + dates);

    getHotellist();
}
 
开发者ID:Swati4star,项目名称:Travel-Mate,代码行数:27,代码来源:Hotels.java

示例3: onDateSet

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
public void onDateSet(DatePickerDialog datePickerDialog, int year,
		int month, int day) {	
	
	isRemind = false;
	
	// a bug in the datetimepicker-library
	// which will cause the month is month - 1
	month++;
	
	remindTimeString = String.valueOf(year) + "-";
	remindTimeString += (month < 10 ? "0" + String.valueOf(month) : String.valueOf(month)) + "-";
	remindTimeString += (day < 10 ? "0" + String.valueOf(day) : String.valueOf(day)) + "-";
	
	final Calendar calendar = Calendar.getInstance();
	
    final TimePickerDialog timePickerDialog = TimePickerDialog.newInstance(this, calendar.get(Calendar.HOUR_OF_DAY) ,calendar.get(Calendar.MINUTE), false, false);
	
	timePickerDialog.setVibrate(false);
       timePickerDialog.setCloseOnSingleTapMinute(false);
       timePickerDialog.setCancelable(false);
       timePickerDialog.show(getSupportFragmentManager(), GlobalSettings.TIMEPICKER_TAG);
}
 
开发者ID:Nightonke,项目名称:TimeFleeting,代码行数:24,代码来源:EditActivity.java

示例4: onDateSet

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
public void onDateSet(DatePickerDialog datePickerDialog, int year,
		int month, int day) {
	// TODO Auto-generated method stub

	// a bug in the datetimepicker-library
	// which will cause the month is month - 1
	month++;
	
	newRemindTimeString = String.valueOf(year) + "-";
	newRemindTimeString += (month < 10 ? "0" + String.valueOf(month) : String.valueOf(month)) + "-";
	newRemindTimeString += (day < 10 ? "0" + String.valueOf(day) : String.valueOf(day)) + "-";
	
	final Calendar calendar = Calendar.getInstance();
	
    final TimePickerDialog timePickerDialog = TimePickerDialog.newInstance(this, calendar.get(Calendar.HOUR_OF_DAY) ,calendar.get(Calendar.MINUTE), false, false);
	
	timePickerDialog.setVibrate(false);
       timePickerDialog.setCloseOnSingleTapMinute(false);
       timePickerDialog.setCancelable(false);
       timePickerDialog.show(mActivity.getSupportFragmentManager(), GlobalSettings.TIMEPICKER_TAG);
}
 
开发者ID:Nightonke,项目名称:TimeFleeting,代码行数:23,代码来源:ListViewAdapter.java

示例5: onDateSet

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
public void onDateSet(DatePickerDialog datePickerDialog, int year,
		int month, int day) {
	month++;
	dateString = String.valueOf(year) + "-";
	dateString += (month < 10 ? "0" + String.valueOf(month) : String.valueOf(month)) + "-";
	dateString += (day < 10 ? "0" + String.valueOf(day) : String.valueOf(day));
	dateString += "-00:00:00";
	dateTextView.setText(dateString.substring(0, 10));
	infoDateTextView.setText(dateString.substring(0, 10));
	
	Record tempRecord = new Record();
	tempRecord.setRemindTime(dateString);
	tempRecord.setType(repeatString);
	
	infoRemainTextView.setText(String.valueOf(TimeFleetingData.calculateRemainDays(tempRecord)));
	
	dateTextView.setText(dateTextView.getText().toString().substring(0,  10) + " " + Language.getDayOfWeekText(calDayOfWeek(dateString)));
}
 
开发者ID:Nightonke,项目名称:TimeFleeting,代码行数:20,代码来源:EditPastActivity.java

示例6: onClick

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
public void onClick(View v) {
    if (mEndDateTextView == v) {
        if (mDatePickerDialog != null) {
            mDatePickerDialog.dismiss();
        }
        mDatePickerDialog = DatePickerDialog.newInstance(this, mModel.endDate.year,
                mModel.endDate.month, mModel.endDate.monthDay);
        mDatePickerDialog.setFirstDayOfWeek(Utils.getFirstDayOfWeekAsCalendar(getActivity()));
        mDatePickerDialog.setYearRange(Utils.YEAR_MIN, Utils.YEAR_MAX);
        mDatePickerDialog.show(getFragmentManager(), FRAG_TAG_DATE_PICKER);
    } else if (mDone == v) {
        String rrule;
        if (mModel.recurrenceState == RecurrenceModel.STATE_NO_RECURRENCE) {
            rrule = null;
        } else {
            copyModelToEventRecurrence(mModel, mRecurrence);
            rrule = mRecurrence.toString();
        }
        if (mRecurrenceSetListener != null) {
            mRecurrenceSetListener.onRecurrenceSet(rrule);
        }
        dismiss();
    }
}
 
开发者ID:Shusshu,项目名称:Android-RecurrencePicker,代码行数:26,代码来源:RecurrencePickerDialog.java

示例7: onClick

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
public void onClick(View v) {
    super.onClick(v);
    switch (v.getId()) {
        case R.id.team_diary_pager_right:
            int currentPage1 = mPager.getCurrentItem();
            if (currentPage1 < mPager.getAdapter().getCount()) {
                mPager.setCurrentItem(currentPage1 + 1);
            }
            break;
        case R.id.team_diary_pager_left:
            int currentPage2 = mPager.getCurrentItem();
            if (currentPage2 > 0) {
                mPager.setCurrentItem(currentPage2 - 1);
            }
            break;
        case R.id.team_diary_pager_calendar:
            final DatePickerDialog datePickerDialog = DatePickerDialog
                    .newInstance(this, calendar.get(Calendar.YEAR),
                            calendar.get(Calendar.MONTH),
                            calendar.get(Calendar.DAY_OF_MONTH), false);
            datePickerDialog.setVibrate(false);
            datePickerDialog.setYearRange(2014, 2015);
            datePickerDialog.show(getFragmentManager(), "datepicker");
            break;
        default:
            break;
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:30,代码来源:TeamDiaryFragment.java

示例8: onDateSet

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
public void onDateSet(DatePickerDialog datePickerDialog, int year,
                      int month, int day) {
    int[] dateBundle = StringUtils.getCurrentDate();
    if ((dateBundle[0] == year && dateBundle[1] <= month)
            || (dateBundle[0] == year && dateBundle[1] == month + 1 && dateBundle[2] < day)) {
        AppContext.showToast("这天怎么会有周报呢");
    } else {
        currentYear = year;
        currentWeek = StringUtils.getWeekOfYear(new Date(year, month, day)) - 1;
        mPager.setAdapter(new TeamDiaryPagerAdapter(aty, year, team.getId()));
        changeUI(currentWeek, mPager.getAdapter().getCount());
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:15,代码来源:TeamDiaryFragment.java

示例9: onCreate

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add_new_trip);

    ButterKnife.bind(this);

    sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    userid = sharedPreferences.getString(Constants.USER_ID, "1");
    mHandler = new Handler(Looper.getMainLooper());

    cityname.setThreshold(1);

    final Calendar calendar = Calendar.getInstance();
    datePickerDialog = DatePickerDialog.newInstance(this,
                    calendar.get(Calendar.YEAR),
                    calendar.get(Calendar.MONTH),
                    calendar.get(Calendar.DAY_OF_MONTH),
                    isVibrate());

    sdate.setOnClickListener(this);
    edate.setOnClickListener(this);
    ok.setOnClickListener(this);

    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
开发者ID:Swati4star,项目名称:Travel-Mate,代码行数:28,代码来源:AddNewTrip.java

示例10: onCreate

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_hotels);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    ButterKnife.bind(this);

    mHandler    = new Handler(Looper.getMainLooper());
    s           = PreferenceManager.getDefaultSharedPreferences(this);
    source      = s.getString(Constants.SOURCE_CITY_ID, "1");
    dest        = s.getString(Constants.DESTINATION_CITY_ID, "1");
    sourcet     = s.getString(Constants.SOURCE_CITY, "Delhi");
    destt       = s.getString(Constants.DESTINATION_CITY, "Mumbai");

    city.setText("Showing " + destt + " hotels");
    selectdate.setText("Check In : " + dates);

    final Calendar calendar = Calendar.getInstance();
    datePickerDialog = DatePickerDialog.newInstance(this, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), isVibrate());

    getHotellist();

    setTitle("Hotels");

    selectdate.setOnClickListener(this);
    city.setOnClickListener(this);

    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

}
 
开发者ID:Swati4star,项目名称:Travel-Mate,代码行数:35,代码来源:Hotels.java

示例11: onCreate

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_bus_list);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    mHandler = new Handler(Looper.getMainLooper());

    ButterKnife.bind(this);

    sharedPreferences   = PreferenceManager.getDefaultSharedPreferences(this);
    source              = sharedPreferences.getString(Constants.SOURCE_CITY, "delhi");
    dest                = sharedPreferences.getString(Constants.DESTINATION_CITY, "mumbai");

    selectdate.setText(dates);
    city.setText(source + " to " + dest);


    getBuslist();
    final Calendar calendar = Calendar.getInstance();
    datePickerDialog = DatePickerDialog.newInstance(this,
            calendar.get(Calendar.YEAR),
            calendar.get(Calendar.MONTH),
            calendar.get(Calendar.DAY_OF_MONTH),
            isVibrate());

    setTitle("Buses");

    city.setOnClickListener(this);
    selectdate.setOnClickListener(this);

    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
开发者ID:Swati4star,项目名称:Travel-Mate,代码行数:35,代码来源:BusList.java

示例12: populateViews

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
private void populateViews() {

        name.setText(updatePatient.getNom());
        prenom.setText(updatePatient.getPrenom());
        telephone.setText(updatePatient.getTelephone());
        cas.setText(updatePatient.getCasPatient());

        date.setText(MyFunctions.getReadableShortDate(calendarDate.getTimeInMillis()));

        this.datePickerDialog = DatePickerDialog.newInstance(
                this,
                calendarDate.get(Calendar.YEAR),
                calendarDate.get(Calendar.MONTH),
                calendarDate.get(Calendar.DAY_OF_MONTH));

        //on limite l'age des patients à contacter à 85 ans
        try {
            datePickerDialog.setYearRange((calendarDate.get(Calendar.YEAR) - 85), calendarDate.get(Calendar.YEAR));
        }catch (IllegalArgumentException ex){
            Log.e("_____","min year end must > 1902");
        }
        Log.e("sex val__","__"+updatePatient.getSexe());
        //On
        if(updatePatient.getSexe().toLowerCase().equals("m"))
            ((RadioButton)sexe.findViewById(R.id.radioM)).setChecked(true);
        else
            ((RadioButton)sexe.findViewById(R.id.radioF)).setChecked(true);

        btnAdd.setText(getResources().getString(R.string.btn_patient_update));
    }
 
开发者ID:fongwama,项目名称:Mosungi,代码行数:31,代码来源:AddPatientActivity.java

示例13: onDateSet

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
@Override
public void onDateSet(DatePickerDialog datePickerDialog, int year, int month, int day) {
    //show date to the User
    Calendar mCalendar = Calendar.getInstance();
    mCalendar.setTimeZone(TimeZone.getDefault());
    mCalendar.set(cYear, cMonth, cDay);

    cYear = year;
    cMonth = month;
    cDay = day;

    String tmpDate = MyFunctions.getReadableDate(mCalendar.getTimeInMillis()).replaceAll("\n"," ");
    ((TextInputEditText) findViewById(R.id.dates) ).setText(tmpDate);
}
 
开发者ID:fongwama,项目名称:Mosungi,代码行数:15,代码来源:AddAgendaActivity.java

示例14: setRemindTime

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
private void setRemindTime() {
	isRemind = false;
	final Calendar calendar = Calendar.getInstance();
	final DatePickerDialog datePickerDialog = DatePickerDialog.newInstance(this, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), false);
	datePickerDialog.setYearRange(2015, 2036);
       datePickerDialog.setCloseOnSingleTapDay(false);
       datePickerDialog.setCancelable(false);
       datePickerDialog.show(getSupportFragmentManager(), GlobalSettings.DATEPICKER_TAG);
}
 
开发者ID:Nightonke,项目名称:TimeFleeting,代码行数:10,代码来源:EditActivity.java

示例15: setRemindTime

import com.fourmob.datetimepicker.date.DatePickerDialog; //导入依赖的package包/类
public void setRemindTime(int position) {
	
	setTimeRecord = TimeFleetingData.futureRecords.get(position);
	
	final Calendar calendar = Calendar.getInstance();
	final DatePickerDialog datePickerDialog = DatePickerDialog.newInstance(this, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), false);
	datePickerDialog.setYearRange(2015, 2036);
       datePickerDialog.setCloseOnSingleTapDay(false);
       datePickerDialog.setCancelable(false);
       datePickerDialog.show(mActivity.getSupportFragmentManager(), GlobalSettings.DATEPICKER_TAG);
}
 
开发者ID:Nightonke,项目名称:TimeFleeting,代码行数:12,代码来源:ListViewAdapter.java


注:本文中的com.fourmob.datetimepicker.date.DatePickerDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。