Android Pixel to Dip Convert px2sp(float pxValue, float fontScale)

Here you can find the source of px2sp(float pxValue, float fontScale)

Description

pxsp

Declaration

public static int px2sp(float pxValue, float fontScale) 

Method Source Code

//package com.java2s;

public class Main {

    public static int px2sp(float pxValue, float fontScale) {
        return (int) (pxValue / fontScale + 0.5f);
    }//w  w w  .  jav a 2  s . com
}

Related

  1. px2dip(Context context, float pxvalue)
  2. px2dip(float pxValue, float scale)
  3. px2dp(Context context, int px)
  4. px2sp(Context context, float pxValue)
  5. px2sp(Context context, float pxValue)
  6. pxToDp(Context context, int pxValue)
  7. pxToDp(Context ctx, int px)
  8. pxToSp(Context context, int pxValue)
  9. getDpFromPixel(float px, Context context)