<commit_before>package cn.world.liuhui.utils;

import android.app.Activity;
import android.content.Context;

/**
 * 单位转换
 * Created by liuhui on 2015/7/27.
 */
public class DensityUtil {

    /**
     * dp转换px
     */
    public static int dp2px(Context context,float dip) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dip * scale + 0.5f);
    }

    /**
     * px转换dp
     */

    public static int px2dip(Context context,int px) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (px / scale + 0.5f);
    }

    /**<commit_msg>状态栏操作的类<commit_after>package cn.world.liuhui.utils;

import android.app.Activity;
import android.content.Context;

/**
 * 单位转换
 * Created by liuhui on 2015/7/27.
 */
public class DensityUtil {

    /**
     * dp转换px
     */
    public static int dp2px(Context context,float dip) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dip * scale + 0.5f);
    }

    /**
     * px转换dp
     */

    public static int px2dp(Context context,int px) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (px / scale + 0.5f);
    }

    /**
{'fraction_non_alphanumeric': 0.13060582218725414, 'fraction_numerical': 0.020456333595594022, 'mean_word_length': 2.465940054495913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3869784', 'n_tokens_mistral': 438, 'n_tokens_neox': 433, 'n_words': 94}