Android系统完整显示壁纸, 不做X2拉伸处理
2016-11-10 16:39
253 查看
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);
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);
相关文章推荐
- IIS网站或系统验证码不显示问题——"使用了托管的处理程序,但是未安装或未完整安装 ASP.NET"
- IIS网站或系统验证码不显示问题——"使用了托管的处理程序,但是未安装或未完整安装 ASP.NET"
- Android 拍照以及一些常用的处理,例如将图片显示到相册(包含了安卓系统6.0以上调用相机的处理)
- Android开发网络图片完整显示且不拉伸
- Android 7.0系统webview 显示https页面空白处理方法
- [Android] 针对生成的图片文件在系统Gallery不显示的处理
- Android 7.0系统webview 显示https页面空白处理
- IIS网站或系统验证码不显示问题——"使用了托管的处理程序,但是未安装或未完整安装 ASP.NET"
- IIS网站或系统验证码不显示问题——"使用了托管的处理程序,但是未安装或未完整安装 ASP.NET"
- [Android] 针对生成的图片文件在系统Gallery不显示的处理
- android壁纸选取和设定后完整显示且不变形的方法
- Android的TextView/EditText使用CharacterStyle&SpannableString来处理图片显示、字体样式、超链接等
- android 系统上做GC双模的--modem 的被动消息处理
- android如何调用显示和隐藏系统默认的输入法
- android系统开发小问题-启动过程中android字符没有显示出来
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 深入理解Android消息处理系统——Looper、Handler、Thread(转)
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 一个算是比较完整的android MP3 LRC歌词滚动高亮显示