Android Context Get getResDimen(Context context, int resId)

Here you can find the source of getResDimen(Context context, int resId)

Description

get Res Dimen

Declaration

public static int getResDimen(Context context, int resId) 

Method Source Code

//package com.java2s;

import android.content.Context;

import android.util.SparseArray;

public class Main {
    private static SparseArray<Integer> sDimenMap = new SparseArray<Integer>();

    public static int getResDimen(Context context, int resId) {
        if (sDimenMap.indexOfKey(resId) > 0) {
            return sDimenMap.get(resId);
        } else {//from  www .  ja  v  a 2  s .co m
            int dimen = (int) context.getResources().getDimension(resId);
            sDimenMap.put(resId, dimen);
            return dimen;
        }
    }
}

Related

  1. getPreferences(Context context, String campaignUrn)
  2. getPrefs(Context context)
  3. getRealPathFromURI(Context context, Uri contentUri)
  4. getReceiverMetaData(Context context, Class receiverClass, String key)
  5. getRequestQueue(Context ctx)
  6. getResourcesPath(Context context, String url)
  7. getRevokedPerms(String packageName, Context ctx)
  8. getSavedPostsPath(Context context)
  9. getScaledDensity(Context context)