get View Elevation - Android User Interface

Android examples for User Interface:View Property

Description

get View Elevation

Demo Code


//package com.java2s;

import android.content.Context;

public class Main {
    public static float getElevation(Context context, float degree) {
        return context.getResources().getDisplayMetrics().density * degree;
    }/*from w w  w . java2 s . c  om*/

    public static float getElevation(Context context, int degree) {
        return context.getResources().getDisplayMetrics().density * degree;
    }
}

Related Tutorials