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


Java ViewCompat.setLayerType方法代码示例

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


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

示例1: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	if (USE_HW_LAYERS) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE
				: View.LAYER_TYPE_NONE);
	}

	switch (getPullToRefreshScrollDirection()) {
		case VERTICAL:
			scrollTo(0, value);
			break;
		case HORIZONTAL:
			scrollTo(value, 0);
			break;
	}
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:46,代码来源:PullToRefreshBase.java

示例2: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 *
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	if (USE_HW_LAYERS) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE
				: View.LAYER_TYPE_NONE);
	}

	switch (getPullToRefreshScrollDirection()) {
		case VERTICAL:
			scrollTo(0, value);
			break;
		case HORIZONTAL:
			scrollTo(value, 0);
			break;
	}
}
 
开发者ID:liupengandroid,项目名称:ywApplication,代码行数:46,代码来源:PullToRefreshBase.java

示例3: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(final int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	/**
	 * Use a Hardware Layer on the Refreshable View if we've scrolled at
	 * all. We don't use them on the Header/Footer Views as they change
	 * often, which would negate any HW layer performance boost.
	 */
	ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE);

	switch (getPullToRefreshScrollDirection()) {
		case VERTICAL:
			scrollTo(0, value);
			break;
		case HORIZONTAL:
			scrollTo(value, 0);
			break;
	}
}
 
开发者ID:scoute-dich,项目名称:K9-MailClient,代码行数:39,代码来源:PullToRefreshBase.java

示例4: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 *
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(int value) {
    if (DEBUG) {
        Log.d(LOG_TAG, "setHeaderScroll: " + value);
    }

    // Clamp value to with pull scroll range
    final int maximumPullScroll = getMaximumPullScroll();
    value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

    if (mLayoutVisibilityChangesEnabled) {
        if (value < 0) {
            mHeaderLayout.setVisibility(View.VISIBLE);
        } else if (value > 0) {
            mFooterLayout.setVisibility(View.VISIBLE);
        } else {
            mHeaderLayout.setVisibility(View.INVISIBLE);
            mFooterLayout.setVisibility(View.INVISIBLE);
        }
    }

    if (USE_HW_LAYERS) {
        /**
         * Use a Hardware Layer on the Refreshable View if we've scrolled at
         * all. We don't use them on the Header/Footer Views as they change
         * often, which would negate any HW layer performance boost.
         */
        ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE
                : View.LAYER_TYPE_NONE);
    }

    switch (getPullToRefreshScrollDirection()) {
        case VERTICAL:
            scrollTo(0, value);
            break;
        case HORIZONTAL:
            scrollTo(value, 0);
            break;
    }
}
 
开发者ID:BigAppOS,项目名称:BigApp_Discuz_Android,代码行数:46,代码来源:PullToRefreshBase.java

示例5: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value
 *            - New Scroll value
 */
protected final void setHeaderScroll(int value) {
    if (DEBUG) {
        Log.d(LOG_TAG, "setHeaderScroll: " + value);
    }
    // Clamp value to with pull scroll range
    final int maximumPullScroll = getMaximumPullScroll();
    value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));
    if (mLayoutVisibilityChangesEnabled) {
        if (value < 0) {
            mHeaderLayout.setVisibility(View.VISIBLE);
        }
        else if (value > 0) {
            mFooterLayout.setVisibility(View.VISIBLE);
        }
        else {
            mHeaderLayout.setVisibility(View.INVISIBLE);
            mFooterLayout.setVisibility(View.INVISIBLE);
        }
    }
    if (USE_HW_LAYERS) {
        /**
         * Use a Hardware Layer on the Refreshable View if we've scrolled at
         * all. We don't use them on the Header/Footer Views as they change
         * often, which would negate any HW layer performance boost.
         */
        ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE
                : View.LAYER_TYPE_NONE);
    }
    switch (getPullToRefreshScrollDirection()) {
        case VERTICAL:
            scrollTo(0, value);
            break;
        case HORIZONTAL:
            scrollTo(value, 0);
            break;
    }
}
 
开发者ID:harichen,项目名称:PullToRefreshLibrary,代码行数:45,代码来源:PullToRefreshBase.java

示例6: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 *
 * @param value
 *            - New Scroll value
 */
protected final void setHeaderScroll(int value) {
    if (DEBUG) {
        Log.d(LOG_TAG, "setHeaderScroll: " + value);
    }

    // Clamp value to with pull scroll range
    final int maximumPullScroll = getMaximumPullScroll();
    value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

    if (mLayoutVisibilityChangesEnabled) {
        if (value < 0) {
            mHeaderLayout.setVisibility(View.VISIBLE);
        } else if (value > 0) {
            mFooterLayout.setVisibility(View.VISIBLE);
        } else {
            mHeaderLayout.setVisibility(View.INVISIBLE);
            mFooterLayout.setVisibility(View.INVISIBLE);
        }
    }

    if (USE_HW_LAYERS) {
        /**
         * Use a Hardware Layer on the Refreshable View if we've scrolled at
         * all. We don't use them on the Header/Footer Views as they change
         * often, which would negate any HW layer performance boost.
         */
        ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE);
    }

    switch (getPullToRefreshScrollDirection()) {
    case VERTICAL:
        scrollTo(0, value);
        break;
    case HORIZONTAL:
        scrollTo(value, 0);
        break;
    }
}
 
开发者ID:GMAndroidTeam,项目名称:Android-PullToRefresh,代码行数:46,代码来源:PullToRefreshBase.java

示例7: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}
	if (USE_HW_LAYERS && Build.VERSION.SDK_INT >= 11) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE
				: View.LAYER_TYPE_NONE);
	}

	switch (getPullToRefreshScrollDirection()) {
		case VERTICAL:
			scrollTo(0, value);
			break;
		case HORIZONTAL:
			scrollTo(value, 0);
			break;
	}
}
 
开发者ID:ikantech,项目名称:IkantechSupport,代码行数:45,代码来源:PullToRefreshBase.java

示例8: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		//Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	if (USE_HW_LAYERS) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE
				: View.LAYER_TYPE_NONE);
	}

	switch (getPullToRefreshScrollDirection()) {
		case VERTICAL:
			scrollTo(0, value);
			break;
		case HORIZONTAL:
			scrollTo(value, 0);
			break;
	}
}
 
开发者ID:Litterfeldt,项目名称:AStory,代码行数:46,代码来源:PullToRefreshBase.java

示例9: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value
 *            - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	if (USE_HW_LAYERS) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE
				: View.LAYER_TYPE_NONE);
	}

	switch (getPullToRefreshScrollDirection()) {
	case VERTICAL:
		scrollTo(0, value);
		break;
	case HORIZONTAL:
		scrollTo(value, 0);
		break;
	}
}
 
开发者ID:qianweicheng,项目名称:Qmusic,代码行数:47,代码来源:PullToRefreshBase.java

示例10: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			switch (mCurrentMode) {
				case GOOGLE_STYLE:
					mGoogleStyleViewLayout.setVisibility(View.VISIBLE);
					break;
				default:	
				case PULL_FROM_START:
					mHeaderLayout.setVisibility(View.VISIBLE);
					break;
			}
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	if (USE_HW_LAYERS) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? LAYER_TYPE_HARDWARE 
				: LAYER_TYPE_NONE /* View.LAYER_TYPE_NONE */);
	}

	// skip ScrollTo(...) 
	if (mMode.showGoogleStyle() ) {
		return;
	}

	switch (getFilteredPullToRefreshScrollDirection()) {
		case VERTICAL:
			scrollTo(0, value);
			break;
		case HORIZONTAL:
			scrollTo(value, 0);
			break;
	}
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:59,代码来源:PullToRefreshBase.java

示例11: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 *
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(int value) {
    if (DEBUG) {
        Log.d(LOG_TAG, "setHeaderScroll: " + value);
    }

    // Clamp value to with pull scroll range
    final int maximumPullScroll = getMaximumPullScroll();
    value = Math
            .min(maximumPullScroll, Math.max(-maximumPullScroll, value));

    if (mLayoutVisibilityChangesEnabled) {
        if (value < 0) {
            mHeaderLayout.setVisibility(View.VISIBLE);
        } else if (value > 0) {
            mFooterLayout.setVisibility(View.VISIBLE);
        } else {
            mHeaderLayout.setVisibility(View.INVISIBLE);
            mFooterLayout.setVisibility(View.INVISIBLE);
        }
    }

    if (USE_HW_LAYERS) {
        /**
         * Use a Hardware Layer on the Refreshable View if we've scrolled at
         * all. We don't use them on the Header/Footer Views as they change
         * often, which would negate any HW layer performance boost.
         */
        ViewCompat.setLayerType(mRefreshableViewWrapper,
                value != 0 ? View.LAYER_TYPE_HARDWARE
                        : View.LAYER_TYPE_NONE);
    }

    switch (getPullToRefreshScrollDirection()) {
        case VERTICAL:
            scrollTo(0, value);
            break;
        case HORIZONTAL:
            scrollTo(value, 0);
            break;
    }
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:48,代码来源:PullToRefreshBase.java

示例12: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value
 *            - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	if (USE_HW_LAYERS) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0
				? View.LAYER_TYPE_HARDWARE
				: View.LAYER_TYPE_NONE);
	}

	switch (getPullToRefreshScrollDirection()) {
		case VERTICAL :
			scrollTo(0, value);
			break;
		case HORIZONTAL :
			scrollTo(value, 0);
			break;
	}
}
 
开发者ID:tangqifa,项目名称:Common-App-Architecture,代码行数:48,代码来源:PullToRefreshBase.java

示例13: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	if (USE_HW_LAYERS) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper, value != 0 ? View.LAYER_TYPE_HARDWARE
				: View.LAYER_TYPE_NONE);
	}

	switch (getPullToRefreshScrollDirection()) {
		case HORIZONTAL:
			scrollTo(value, 0);
			break;
		case VERTICAL:
		default:
			scrollTo(0, value);
			break;
	}
}
 
开发者ID:LiuJQ,项目名称:Android-PullToRefresh-Extention,代码行数:47,代码来源:PullToRefreshBase.java

示例14: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value
 *            - New Scroll value
 */
protected final void setHeaderScroll(int value) {
	if (DEBUG) {
		Log.d(LOG_TAG, "setHeaderScroll: " + value);
	}

	// Clamp value to with pull scroll range
	final int maximumPullScroll = getMaximumPullScroll();
	value = Math
			.min(maximumPullScroll, Math.max(-maximumPullScroll, value));

	if (mLayoutVisibilityChangesEnabled) {
		if (value < 0) {
			mHeaderLayout.setVisibility(View.VISIBLE);
		} else if (value > 0) {
			mFooterLayout.setVisibility(View.VISIBLE);
		} else {
			mHeaderLayout.setVisibility(View.INVISIBLE);
			mFooterLayout.setVisibility(View.INVISIBLE);
		}
	}

	if (USE_HW_LAYERS) {
		/**
		 * Use a Hardware Layer on the Refreshable View if we've scrolled at
		 * all. We don't use them on the Header/Footer Views as they change
		 * often, which would negate any HW layer performance boost.
		 */
		ViewCompat.setLayerType(mRefreshableViewWrapper,
				value != 0 ? View.LAYER_TYPE_HARDWARE
						: View.LAYER_TYPE_NONE);
	}

	switch (getPullToRefreshScrollDirection()) {
	case VERTICAL:
		scrollTo(0, value);
		break;
	case HORIZONTAL:
		scrollTo(value, 0);
		break;
	}
}
 
开发者ID:lingganhezi,项目名称:dedecmsapp,代码行数:49,代码来源:PullToRefreshBase.java

示例15: setHeaderScroll

import com.handmark.pulltorefresh.library.internal.ViewCompat; //导入方法依赖的package包/类
/**
 * Helper method which just calls scrollTo() in the correct scrolling
 * direction.
 * 
 * @param value
 *            - New Scroll value
 */
protected final void setHeaderScroll(int value) {
    if (DEBUG) {
        Log.d(LOG_TAG, "setHeaderScroll: " + value);
    }

    // Clamp value to with pull scroll range
    final int maximumPullScroll = getMaximumPullScroll();
    value = Math
            .min(maximumPullScroll, Math.max(-maximumPullScroll, value));

    if (mLayoutVisibilityChangesEnabled) {
        if (value < 0) {
            mHeaderLayout.setVisibility(View.VISIBLE);
        } else if (value > 0) {
            mFooterLayout.setVisibility(View.VISIBLE);
        } else {
            mHeaderLayout.setVisibility(View.INVISIBLE);
            mFooterLayout.setVisibility(View.INVISIBLE);
        }
    }

    if (USE_HW_LAYERS) {
        /**
         * Use a Hardware Layer on the Refreshable View if we've scrolled at
         * all. We don't use them on the Header/Footer Views as they change
         * often, which would negate any HW layer performance boost.
         */
        ViewCompat.setLayerType(mRefreshableViewWrapper,
                value != 0 ? View.LAYER_TYPE_HARDWARE
                        : View.LAYER_TYPE_NONE);
    }

    switch (getPullToRefreshScrollDirection()) {
    case VERTICAL:
        scrollTo(0, value);
        break;
    case HORIZONTAL:
        scrollTo(value, 0);
        break;
    }
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:49,代码来源:PullToRefreshBase.java


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