Android Dip to Pixel Convert sp2px(float sp, Context context)

Here you can find the source of sp2px(float sp, Context context)

Description

sppx

Declaration

public static float sp2px(float sp, Context context) 

Method Source Code

//package com.java2s;
import android.content.Context;

public class Main {
    public static float sp2px(float sp, Context context) {
        final float scale = context.getResources().getDisplayMetrics().scaledDensity;
        return sp * scale;
    }//from w  w w . j a  va  2s .c  o m
}

Related

  1. scaleDpToPixels(double value, Resources res)
  2. convertDpToPixel(float dp, Context context)
  3. convertDpToPixel(float dp, Resources resources)
  4. dipToPixels(int dip)
  5. sp2px(Context context, float spValue)
  6. convertDiptoPix(int dip, Context context)