本文整理汇总了Java中android.support.v4.view.ViewCompat.resolveSizeAndState方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.resolveSizeAndState方法的具体用法?Java ViewCompat.resolveSizeAndState怎么用?Java ViewCompat.resolveSizeAndState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.ViewCompat
的用法示例。
在下文中一共展示了ViewCompat.resolveSizeAndState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveSizeAndStateRespectingMinSize
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* Utility to reconcile a desired size and state, with constraints imposed
* by a MeasureSpec. Tries to respect the min size, unless a different size
* is imposed by the constraints.
*
* @param minSize The minimal desired size.
* @param measuredSize The currently measured size.
* @param measureSpec The current measure spec.
* @return The resolved size and state.
*/
private int resolveSizeAndStateRespectingMinSize(
int minSize, int measuredSize, int measureSpec) {
if (minSize != SIZE_UNSPECIFIED) {
final int desiredWidth = Math.max(minSize, measuredSize);
return ViewCompat.resolveSizeAndState(desiredWidth, measureSpec, 0);
} else {
return measuredSize;
}
}