SillyAndroid.java 文件源码

java
阅读 37 收藏 0 点赞 0 评论 0

项目:silly-android 作者:
/**
 * Sets the left/start and right/end padding to the given View, keeping the vertical padding values as the were.
 *
 * @param view    Which view to set the padding to, must not be {@code null}
 * @param padding The horizontal padding value
 */
public static void setPaddingHorizontal(@NonNull final View view, @Px final int padding) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        view.setPaddingRelative(padding, view.getPaddingTop(), padding, view.getPaddingBottom());
    } else {
        view.setPadding(padding, view.getPaddingTop(), padding, view.getPaddingBottom());
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号