@@ -1442,10 +1442,9 @@ public ConfigurationInfo getDeviceConfigurationInfo() {
14421442 public int getLauncherLargeIconDensity () {
14431443 final Resources res = mContext .getResources ();
14441444 final int density = res .getDisplayMetrics ().densityDpi ;
1445- final int sw = res .getConfiguration ().smallestScreenWidthDp ;
14461445
1447- if (sw < 600 ) {
1448- // Smaller than approx 7" tablets, use the regular icon size.
1446+ if (( res . getConfiguration (). screenLayout & Configuration . SCREENLAYOUT_SIZE_MASK )
1447+ != Configuration . SCREENLAYOUT_SIZE_XLARGE ) {
14491448 return density ;
14501449 }
14511450
@@ -1457,13 +1456,9 @@ public int getLauncherLargeIconDensity() {
14571456 case DisplayMetrics .DENSITY_HIGH :
14581457 return DisplayMetrics .DENSITY_XHIGH ;
14591458 case DisplayMetrics .DENSITY_XHIGH :
1460- return DisplayMetrics .DENSITY_XXHIGH ;
1461- case DisplayMetrics .DENSITY_XXHIGH :
1462- return DisplayMetrics .DENSITY_XHIGH * 2 ;
1459+ return DisplayMetrics .DENSITY_MEDIUM * 2 ;
14631460 default :
1464- // The density is some abnormal value. Return some other
1465- // abnormal value that is a reasonable scaling of it.
1466- return (int )(density *1.5f );
1461+ return density ;
14671462 }
14681463 }
14691464
@@ -1476,10 +1471,9 @@ public int getLauncherLargeIconDensity() {
14761471 public int getLauncherLargeIconSize () {
14771472 final Resources res = mContext .getResources ();
14781473 final int size = res .getDimensionPixelSize (android .R .dimen .app_icon_size );
1479- final int sw = res .getConfiguration ().smallestScreenWidthDp ;
14801474
1481- if (sw < 600 ) {
1482- // Smaller than approx 7" tablets, use the regular icon size.
1475+ if (( res . getConfiguration (). screenLayout & Configuration . SCREENLAYOUT_SIZE_MASK )
1476+ != Configuration . SCREENLAYOUT_SIZE_XLARGE ) {
14831477 return size ;
14841478 }
14851479
@@ -1493,13 +1487,9 @@ public int getLauncherLargeIconSize() {
14931487 case DisplayMetrics .DENSITY_HIGH :
14941488 return (size * DisplayMetrics .DENSITY_XHIGH ) / DisplayMetrics .DENSITY_HIGH ;
14951489 case DisplayMetrics .DENSITY_XHIGH :
1496- return (size * DisplayMetrics .DENSITY_XXHIGH ) / DisplayMetrics .DENSITY_XHIGH ;
1497- case DisplayMetrics .DENSITY_XXHIGH :
1498- return (size * DisplayMetrics .DENSITY_XHIGH *2 ) / DisplayMetrics .DENSITY_XXHIGH ;
1490+ return (size * DisplayMetrics .DENSITY_MEDIUM * 2 ) / DisplayMetrics .DENSITY_XHIGH ;
14991491 default :
1500- // The density is some abnormal value. Return some other
1501- // abnormal value that is a reasonable scaling of it.
1502- return (int )(size *1.5f );
1492+ return size ;
15031493 }
15041494 }
15051495
0 commit comments