當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。