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


Java NumberPickerDialogFragment类代码示例

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


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

示例1: onTimeSet

import com.codetroopers.betterpickers.numberpicker.NumberPickerDialogFragment; //导入依赖的package包/类
/**
 *
 * @param dialog
 * @param hourOfDay
 * @param minute
 */
@Override
public void onTimeSet(RadialTimePickerDialogFragment dialog, final int hourOfDay, final int minute) {
    NumberPickerBuilder npb = new NumberPickerBuilder()
            .addNumberPickerDialogHandler(new NumberPickerDialogFragment.NumberPickerDialogHandlerV2() {
                @Override
                public void onDialogNumberSet(int reference, BigInteger number, double decimal, boolean isNegative, BigDecimal fullNumber) {
                    _calendar.set(_calendar.get(Calendar.YEAR),
                            _calendar.get(Calendar.MONTH),
                            _calendar.get(Calendar.DAY_OF_MONTH),
                            hourOfDay,
                            minute,
                            number.intValue());

                    _lastDateSet = _calendar.getTime();
                    System.out.println("Last date : " + _lastDateSet.getTime() / 1000);
                    _rView.setDate(_lastDateSet);
                }
            })
            .setFragmentManager(getBaseActivity().getSupportFragmentManager())
            .setStyleResId(R.style.BetterPickersDialogFragment)
            .setLabelText("Seconds!");
    npb.show();
}
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:30,代码来源:RecoverFragment.java

示例2: onSelectYear

import com.codetroopers.betterpickers.numberpicker.NumberPickerDialogFragment; //导入依赖的package包/类
@OnClick(R.id.budgetYearTextView)
public void onSelectYear(View v) {
    int currentYear = new MmxDate().getYear();
    int year;
    if (mModel.year != 0) {
        year = mModel.year;
    } else {
        year = currentYear;
    }

    new NumberPickerBuilder()
        .setFragmentManager(getSupportFragmentManager())
        .setStyleResId(R.style.BetterPickersDialogFragment)
        .setLabelText(getString(R.string.year))
        .setPlusMinusVisibility(View.INVISIBLE)
        .setDecimalVisibility(View.INVISIBLE)
        .setMinNumber(BigDecimal.valueOf(currentYear - 10))
        .setMaxNumber(BigDecimal.valueOf(currentYear + 10))
        .setCurrentNumber(year)
        .addNumberPickerDialogHandler(new NumberPickerDialogFragment.NumberPickerDialogHandlerV2() {
            @Override
            public void onDialogNumberSet(int reference, BigInteger number, double decimal, boolean isNegative, BigDecimal fullNumber) {
                mModel.setYear(number.intValue());
                viewHolder.refreshYear();
                viewHolder.refreshName();
            }
        })
        .show();
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:30,代码来源:BudgetEditActivity.java

示例3: onSelectMonth

import com.codetroopers.betterpickers.numberpicker.NumberPickerDialogFragment; //导入依赖的package包/类
@OnClick(R.id.budgetMonthTextView)
public void onSelectMonth(View v) {
    int month;
    if (mModel.month != 0) {
        month = mModel.month;
    } else {
        month = new MmxDate().getMonthOfYear();
    }

    new NumberPickerBuilder()
        .setFragmentManager(getSupportFragmentManager())
        .setStyleResId(R.style.BetterPickersDialogFragment)
        .setLabelText(getString(R.string.month))
        .setPlusMinusVisibility(View.INVISIBLE)
        .setDecimalVisibility(View.INVISIBLE)
        .setMinNumber(BigDecimal.ONE)
        .setMaxNumber(BigDecimal.valueOf(12))
        .setCurrentNumber(month)
        .addNumberPickerDialogHandler(new NumberPickerDialogFragment.NumberPickerDialogHandlerV2() {
            @Override
            public void onDialogNumberSet(int reference, BigInteger number, double decimal, boolean isNegative, BigDecimal fullNumber) {
                mModel.setMonth(number.intValue());
                viewHolder.refreshMonth();
                viewHolder.refreshName();
            }
        })
        .show();
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:29,代码来源:BudgetEditActivity.java


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