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


Java ViewCompat.resolveSizeAndState方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:h6ah4i,项目名称:android-numberpickercompat,代码行数:20,代码来源:NumberPicker.java


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