android 壁纸完整显示,Android系统完整显示壁纸, 不做X2拉伸处理

Android系统内置墙纸尺寸跟屏幕尺寸相同, 全尺寸完整显示壁纸, 不做X2拉伸处理:

packages\apps\Launcher3\src\com\android\launcher3\util\WallpaperUtils.java

@@ -24,6 +24,9 @@ import android.graphics.Point;

import android.os.Build;

import android.view.WindowManager;

+// lds add for fix wallpaper size same as lcm screen size at 20160530

+import android.os.SystemProperties;

+

import com.android.launcher3.Utilities;

/**

@@ -100,22 +103,43 @@ public final class WallpaperUtils {

int maxDim = Math.max(maxDims.x, maxDims.y);

int minDim = Math.max(minDims.x, minDims.y);

+

+ // lds add for fix wallpaper size same as lcm screen size at 20160530

+ int realWith = minDim;

if (Utilities.ATLEAST_JB_MR1) {

Point realSize = new Point();

windowManager.getDefaultDisplay().getRealSize(realSize);

maxDim = Math.max(realSize.x, realSize.y);

minDim = Math.min(realSize.x, realSize.y);

+

+ // lds add for fix wallpaper size same as lcm screen size at 20160530

+ if(SystemProperties.get("ro.wallpaper.same.phonescreen").equals("1")){

+ realWith = realSize.x;

+ }

+ // add end

}

// We need to ensure that there is enough extra space in the wallpaper

// for the intended parallax effects

final int defaultWidth, defaultHeight;

if (res.getConfiguration().smallestScreenWidthDp >= 720) {

- defaultWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim));

+ // lds add for fix wallpaper size same as lcm screen size at 20160530

+ if(SystemProperties.get("ro.wallpaper.same.phonescreen").equals("1")){

+ defaultWidth = realWith;

+ } else {

+ defaultWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim));

+ }

+ // add end

defaultHeight = maxDim;

} else {

- defaultWidth = Math.max((int) (minDim * WALLPAPER_SCREENS_SPAN), maxDim);

+ // lds add for fix wallpaper size same as lcm screen size at 20160530

+ if(SystemProperties.get("ro.wallpaper.same.phonescreen").equals("1")){

+ defaultWidth = realWith;

+ } else {

+ defaultWidth = Math.max((int) (minDim * WALLPAPER_SCREENS_SPAN), maxDim);

+ }

+ // add end

defaultHeight = maxDim;

}

sDefaultWallpaperSize = new Point(defaultWidth, defaultHeight);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值