Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;

import android.content.res.Configuration;

public class Main {
    public static int getNavigationBarHeight(Context context) {
        int id = context.getResources().getIdentifier(
                context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT
                        ? "navigation_bar_height"
                        : "navigation_bar_height_landscape",
                "dimen", "android");
        if (id > 0) {
            return context.getResources().getDimensionPixelSize(id);
        }
        return 0;
    }
}