android.content.res.Configuration#SCREENLAYOUT_SIZE_XLARGE源码实例Demo

下面列出了android.content.res.Configuration#SCREENLAYOUT_SIZE_XLARGE 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android-lockpattern   文件: UI.java
/**
 * Gets current screen size.
 * 
 * @param context
 *            the context.
 * @return current screen size.
 */
public static ScreenSize getCurrent(Context context) {
    switch (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) {
    case Configuration.SCREENLAYOUT_SIZE_SMALL:
        return SMALL;
    case Configuration.SCREENLAYOUT_SIZE_NORMAL:
        return NORMAL;
    case Configuration.SCREENLAYOUT_SIZE_LARGE:
        return LARGE;
    case Configuration.SCREENLAYOUT_SIZE_XLARGE:
        return XLARGE;
    default:
        return UNDEFINED;
    }
}
 
源代码2 项目: TurkcellUpdater_android_sdk   文件: Utilities.java
@SuppressLint("NewApi")
static boolean isTablet(Context context) {
	if (android.os.Build.VERSION.SDK_INT > 12) {
		return context.getResources().getConfiguration().smallestScreenWidthDp > 600;
	} else if (android.os.Build.VERSION.SDK_INT > 10) {
		int size = context.getResources().getConfiguration().screenLayout
				& Configuration.SCREENLAYOUT_SIZE_MASK;
		return (size == Configuration.SCREENLAYOUT_SIZE_LARGE)
				|| (size == Configuration.SCREENLAYOUT_SIZE_XLARGE);
	} else {
		return false;
	}
}
 
源代码3 项目: openScale   文件: TableFragment.java
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    LinearLayout row = new LinearLayout(getContext());
    row.setLayoutParams(new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.WRAP_CONTENT));

    final int screenSize = getResources().getConfiguration()
            .screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
    final boolean isSmallScreen =
            screenSize != Configuration.SCREENLAYOUT_SIZE_XLARGE
                    && screenSize != Configuration.SCREENLAYOUT_SIZE_LARGE;

    final int count = viewType == VIEW_TYPE_YEAR ? 1 : visibleMeasurements.size();
    for (int i = 0; i < count; ++i) {
        TextView column = new TextView(getContext());
        column.setLayoutParams(new LinearLayout.LayoutParams(
                0, ViewGroup.LayoutParams.WRAP_CONTENT, 1));

        if (viewType == VIEW_TYPE_MEASUREMENT) {
            column.setMinLines(2);
            column.setGravity(Gravity.CENTER_HORIZONTAL);

            if (isSmallScreen) {
                column.setTextSize(COMPLEX_UNIT_DIP, 9);
            }
        }
        else {
            column.setPadding(0, 10, 0, 10);
            column.setGravity(Gravity.CENTER);
            column.setTextSize(COMPLEX_UNIT_DIP, 16);
        }

        row.addView(column);
    }

    return new ViewHolder(row);
}
 
源代码4 项目: coursera-android   文件: BrowserProvider.java
@Override
public boolean onCreate() {
    final Context context = getContext();
    boolean xlargeScreenSize = (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK)
            == Configuration.SCREENLAYOUT_SIZE_XLARGE;
    boolean isPortrait = (context.getResources().getConfiguration().orientation
            == Configuration.ORIENTATION_PORTRAIT);


    if (xlargeScreenSize && isPortrait) {
        mMaxSuggestionLongSize = MAX_SUGGEST_LONG_LARGE;
        mMaxSuggestionShortSize = MAX_SUGGEST_SHORT_LARGE;
    } else {
        mMaxSuggestionLongSize = MAX_SUGGEST_LONG_SMALL;
        mMaxSuggestionShortSize = MAX_SUGGEST_SHORT_SMALL;
    }
    mOpenHelper = new DatabaseHelper(context);
    mBackupManager = new BackupManager(context);
    // we added "picasa web album" into default bookmarks for version 19.
    // To avoid erasing the bookmark table, we added it explicitly for
    // version 18 and 19 as in the other cases, we will erase the table.
    if (DATABASE_VERSION == 18 || DATABASE_VERSION == 19) {
        SharedPreferences p = PreferenceManager
                .getDefaultSharedPreferences(context);
        boolean fix = p.getBoolean("fix_picasa", true);
        if (fix) {
            fixPicasaBookmark();
            Editor ed = p.edit();
            ed.putBoolean("fix_picasa", false);
            ed.apply();
        }
    }
    mSettings = BrowserSettings.getInstance();
    return true;
}
 
源代码5 项目: NightWatch   文件: BgGraphBuilder.java
static public boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码6 项目: Xndroid   文件: ThemableBrowserActivity.java
boolean isTablet() {
    return (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码7 项目: xDrip-plus   文件: BgGraphBuilder.java
static public boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码8 项目: kolabnotes-android   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码9 项目: GreenBits   文件: GaPreferenceActivity.java
@Override
public boolean onIsMultiPane() {
    final int layout = getResources().getConfiguration().screenLayout;
    return (layout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码10 项目: xDrip   文件: BgGraphBuilder.java
static public boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码11 项目: logmein-android   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
    & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码12 项目: ScreenShift   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码13 项目: HAPP   文件: SettingsActivity.java
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码14 项目: beaconloc   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码15 项目: Android-Carbon-Forum   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码16 项目: shrinker   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码17 项目: WiFiKeyShare   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码18 项目: GitJourney   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码20 项目: android-slideshow   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
	return (context.getResources().getConfiguration().screenLayout
			& Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}