當前位置: 首頁>>代碼示例>>Java>>正文


Java DatePickerDialog.setTitle方法代碼示例

本文整理匯總了Java中android.app.DatePickerDialog.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java DatePickerDialog.setTitle方法的具體用法?Java DatePickerDialog.setTitle怎麽用?Java DatePickerDialog.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.DatePickerDialog的用法示例。


在下文中一共展示了DatePickerDialog.setTitle方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showDatePickerDialog

import android.app.DatePickerDialog; //導入方法依賴的package包/類
private void showDatePickerDialog(Calendar calendar) {
    DebugLog.logMethod();
    if (calendar == null) {
        DebugLog.logMessage("Null calendar");
        return;
    }

    DebugLog.logMessage("Calendar time: " + calendar.getTime().toString());
    datePickerDialog = new DatePickerDialog(
            getContext(),
            R.style.PickerTheme,
            CouponFragment.this,
            calendar.get(Calendar.YEAR),
            calendar.get(Calendar.MONTH),
            calendar.get(Calendar.DAY_OF_MONTH)
    );
    datePickerDialog.getDatePicker().setMinDate(calendar.getTimeInMillis());
    datePickerDialog.setTitle(getString(R.string.title_date_picker));
    datePickerDialog.show();
}
 
開發者ID:darsh2,項目名稱:CouponsTracker,代碼行數:21,代碼來源:CouponFragment.java

示例2: onCreateDialog

import android.app.DatePickerDialog; //導入方法依賴的package包/類
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    chooseDate = (TextView) getActivity().findViewById(R.id.choose_date);
    chooseDate2 = (TextView) getActivity().findViewById(R.id.choose_date2);

    String date = chooseDate.getText().toString();
    int year = Integer.parseInt(date.split("-")[0]);
    int month = Integer.parseInt(date.split("-")[1]);
    int day = Integer.parseInt(date.split("-")[2]);

    DatePickerDialog dialog = new DatePickerDialog(getContext(), this, year, month - 1, day);
    dialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000);
    dialog.getDatePicker().setMaxDate(System.currentTimeMillis() + (long) 29 * 24 * 60 * 60 * 1000);
    dialog.setTitle(null);
    return dialog;
}
 
開發者ID:Akari10032,項目名稱:12306_Android,代碼行數:17,代碼來源:DatePickerFragment.java

示例3: onClick

import android.app.DatePickerDialog; //導入方法依賴的package包/類
@Optional @OnClick(R2.id.custom_date_view_text_main) protected void onClick() {
    final Calendar calendar = new GregorianCalendar();
    DatePickerDialog datePickerDialog =
            new DatePickerDialog(mContext, new DatePickerDialog.OnDateSetListener() {
                @Override public void onDateSet(DatePicker datePicker, int i, int i1, int i2) {
                    txtHintLayout.setVisibility(VISIBLE);
                    calendar.set(i, i1, i2);
                    SimpleDateFormat format1 =
                            new SimpleDateFormat("dd MMM yyyy", Locale.getDefault());
                    dateText.setText(format1.format(calendar.getTime()));
                    if (mListener != null) {
                        mValidity = mListener.getDateValidity(CustomDateView.this, calendar);
                        validityIcon.setImageDrawable(ContextCompat.getDrawable(getContext(),
                                mValidity ? R.drawable.ic_check_green : R.drawable.ic_error));
                    }
                    if (mValidityListener != null) mValidityListener.checkValidity();
                }
            }, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
                    calendar.get(Calendar.DAY_OF_MONTH));
    if (mListener != null) {
        if (mListener.setMaxDate(this) != 0) {
            datePickerDialog.getDatePicker().setMaxDate(mListener.setMaxDate(this));
        }
        if (mListener.setMinDate(this) != 0) {
            datePickerDialog.getDatePicker().setMinDate(mListener.setMinDate(this));
        }
    }
    datePickerDialog.setTitle(mTitle);
    datePickerDialog.show();
}
 
開發者ID:riteshakya037,項目名稱:CustomFormViews,代碼行數:31,代碼來源:CustomDateView.java

示例4: onClick

import android.app.DatePickerDialog; //導入方法依賴的package包/類
@Optional @OnClick(R.id.custom_date_view_text_main) void onClick() {
    final Calendar calendar = new GregorianCalendar();
    DatePickerDialog datePickerDialog =
            new DatePickerDialog(mContext, (datePicker, i, i1, i2) -> {
                calendar.set(i, i1, i2);
                SimpleDateFormat format1 =
                        new SimpleDateFormat(DATE_FORMAT, Locale.getDefault());
                dateText.setText(format1.format(calendar.getTime()));
            }, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
                    calendar.get(Calendar.DAY_OF_MONTH));
    datePickerDialog.setTitle("Select Date");
    datePickerDialog.show();
}
 
開發者ID:riteshakya037,項目名稱:Subs,代碼行數:14,代碼來源:CustomDateView.java


注:本文中的android.app.DatePickerDialog.setTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。