135071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng/*
235071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * Copyright (C) 2012 The Android Open Source Project
335071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng *
435071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * Licensed under the Apache License, Version 2.0 (the "License");
535071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * you may not use this file except in compliance with the License.
635071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * You may obtain a copy of the License at
735071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng *
835071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng *      http://www.apache.org/licenses/LICENSE-2.0
935071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng *
1035071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * Unless required by applicable law or agreed to in writing, software
1135071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * distributed under the License is distributed on an "AS IS" BASIS,
1235071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1335071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * See the License for the specific language governing permissions and
1435071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * limitations under the License
1535071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng */
1635071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng
1735071c06d1587942f5a66c8f12e6247e8f904d26Chiao Chengpackage com.android.dialer.util;
1835071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng
1935071c06d1587942f5a66c8f12e6247e8f904d26Chiao Chengimport android.content.Context;
2035071c06d1587942f5a66c8f12e6247e8f904d26Chiao Chengimport android.content.res.Configuration;
2135071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng
2235071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng/**
2335071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng * Static methods related to device orientation.
2435071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng */
2535071c06d1587942f5a66c8f12e6247e8f904d26Chiao Chengpublic class OrientationUtil {
2635071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng
2735071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng    /**
2835071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng     * @return if the context is in landscape orientation.
2935071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng     */
3035071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng    public static boolean isLandscape(Context context) {
3135071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng        return context.getResources().getConfiguration().orientation
3235071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng                == Configuration.ORIENTATION_LANDSCAPE;
3335071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng    }
3435071c06d1587942f5a66c8f12e6247e8f904d26Chiao Cheng}
35