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


Java DateTime.equals方法代码示例

本文整理汇总了Java中hirondelle.date4j.DateTime.equals方法的典型用法代码示例。如果您正苦于以下问题:Java DateTime.equals方法的具体用法?Java DateTime.equals怎么用?Java DateTime.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hirondelle.date4j.DateTime的用法示例。


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

示例1: customizeTextView

import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
/**
     * Customize colors of text and background based on states of the cell
     * (disabled, active, selected, etc)
     * <p/>
     * To be used only in getView method
     *
     * @param position
     * @param cellView
     */
    protected void customizeTextView(int position, CellView cellView) {
        // Get the padding of cell so that it can be restored later
//        int topPadding = cellView.getPaddingTop();
//        int leftPadding = cellView.getPaddingLeft();
//        int bottomPadding = cellView.getPaddingBottom();
//        int rightPadding = cellView.getPaddingRight();

        // Get dateTime of this cell
        DateTime dateTime = this.datetimeList.get(position);

        cellView.resetCustomStates();
        resetCustomResources(cellView);

        if (dateTime.equals(getToday())) {
            cellView.addCustomState(CellView.STATE_TODAY);
        }

        // Set color of the dates in previous / next month
        if (dateTime.getMonth() != month) {
            cellView.addCustomState(CellView.STATE_PREV_NEXT_MONTH);
        }

        // Customize for disabled dates and date outside min/max dates
        if ((minDateTime != null && dateTime.lt(minDateTime))
                || (maxDateTime != null && dateTime.gt(maxDateTime))
                || (disableDates != null && disableDatesMap
                .containsKey(dateTime))) {

            cellView.addCustomState(CellView.STATE_DISABLED);
        }

        // Customize for selected dates
        if (selectedDates != null && selectedDatesMap.containsKey(dateTime)) {
            cellView.addCustomState(CellView.STATE_SELECTED);
        }

        cellView.refreshDrawableState();

        // Set text
        cellView.setText("" + dateTime.getDay());

        // Set custom color if required
        setCustomResources(dateTime, cellView, cellView);

        // Somehow after setBackgroundResource, the padding collapse.
        // This is to recover the padding
//        cellView.setPadding(leftPadding, topPadding, rightPadding,
//                bottomPadding);
    }
 
开发者ID:maheswaranapk,项目名称:Andorid-Material-Drop-Down-Date-Picker,代码行数:59,代码来源:CaldroidGridAdapter.java

示例2: customizeTextView

import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
/**
 * Customize colors of text and background based on states of the cell
 * (disabled, active, selected, etc)
 * 
 * To be used only in getView method
 * 
 * @param position
 * @param cellView
 */
protected void customizeTextView(int position, TextView cellView) {
	cellView.setTextColor(Color.BLACK);

	// Get dateTime of this cell
	DateTime dateTime = this.datetimeList.get(position);

	// Set color of the dates in previous / next month
	if (dateTime.getMonth() != month) {
		cellView.setTextColor(resources
				.getColor(R.color.caldroid_darker_gray));
	}

	boolean shouldResetDiabledView = false;
	boolean shouldResetSelectedView = false;

	// Customize for disabled dates and date outside min/max dates
	if ((minDateTime != null && dateTime.lt(minDateTime)) || (maxDateTime != null && dateTime.gt(maxDateTime))) {

		cellView.setTextColor(CaldroidFragment.disabledTextColor);
		if (CaldroidFragment.disabledBackgroundDrawable == -1) {
			cellView.setBackgroundResource(R.drawable.disable_cell);
		} else {
			cellView.setBackgroundResource(CaldroidFragment.disabledBackgroundDrawable);
		}

		if (dateTime.equals(getToday())) {
			cellView.setBackgroundResource(R.drawable.today_border_grey);
		}
	} else {
		shouldResetDiabledView = true;
	}

	// Customize for selected dates
	if (selectedDates != null && selectedDatesMap.containsKey(dateTime)) {
		if (CaldroidFragment.selectedBackgroundDrawable != -1) {
			cellView.setBackgroundResource(CaldroidFragment.selectedBackgroundDrawable);
		} else {
			cellView.setBackgroundColor(resources.getColor(R.color.caldroid_sky_blue));
		}

		cellView.setTextColor(CaldroidFragment.selectedTextColor);
	} else {
		shouldResetSelectedView = true;
	}

	if (shouldResetDiabledView && shouldResetSelectedView) {
		// Customize for today
		if (dateTime.equals(getToday())) {
			cellView.setBackgroundResource(R.drawable.today_without_border_selector);
		} else {
			cellView.setBackgroundResource(R.drawable.cell_bg);
		}
	}

	cellView.setText("" + dateTime.getDay());

	// Set custom color if required
	setCustomResources(dateTime, cellView);
}
 
开发者ID:FrancescoDesogus,项目名称:IUM_Project_SwimDroid,代码行数:69,代码来源:CaldroidGridAdapter.java

示例3: customizeTextView

import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
/**
 * Customize colors of text and background based on states of the cell
 * (disabled, active, selected, etc)
 * 
 * To be used only in getView method
 * 
 * @param position
 * @param cellView
 */
protected void customizeTextView(int position, TextView cellView) {
	cellView.setTextColor(Color.BLACK);

	// Get dateTime of this cell
	DateTime dateTime = this.datetimeList.get(position);

	// Set color of the dates in previous / next month
	if (dateTime.getMonth() != month) {
		cellView.setTextColor(resources
				.getColor(R.color.caldroid_darker_gray));
	}

	boolean shouldResetDiabledView = false;
	boolean shouldResetSelectedView = false;

	// Customize for disabled dates and date outside min/max dates
	if ((minDateTime != null && dateTime.lt(minDateTime))
			|| (maxDateTime != null && dateTime.gt(maxDateTime))
			|| (disableDates != null && disableDatesMap
					.containsKey(dateTime))) {

		cellView.setTextColor(CaldroidFragment.disabledTextColor);
		if (CaldroidFragment.disabledBackgroundDrawable == -1) {
			cellView.setBackgroundResource(R.drawable.disable_cell);
		} else {
			cellView.setBackgroundResource(CaldroidFragment.disabledBackgroundDrawable);
		}

		if (dateTime.equals(getToday())) {
			cellView.setBackgroundResource(R.drawable.red_border_gray_bg);
		}
	} else {
		shouldResetDiabledView = true;
	}

	// Customize for selected dates
	if (selectedDates != null && selectedDatesMap.containsKey(dateTime)) {
		if (CaldroidFragment.selectedBackgroundDrawable != -1) {
			cellView.setBackgroundResource(CaldroidFragment.selectedBackgroundDrawable);
		} else {
			cellView.setBackgroundColor(resources
					.getColor(R.color.caldroid_sky_blue));
		}

		cellView.setTextColor(CaldroidFragment.selectedTextColor);
	} else {
		shouldResetSelectedView = true;
	}

	if (shouldResetDiabledView && shouldResetSelectedView) {
		// Customize for today
		if (dateTime.equals(getToday())) {
			cellView.setBackgroundResource(R.drawable.red_border);
		} else {
			cellView.setBackgroundResource(R.drawable.cell_bg);
		}
	}

	cellView.setText("" + dateTime.getDay());

	// Set custom color if required
	setCustomResources(dateTime, cellView);
}
 
开发者ID:iSCAU,项目名称:iSCAU-Android,代码行数:73,代码来源:CaldroidGridAdapter.java


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