大概的原因是因为不同的屏幕由于分辨率的不一样,现在的分辨率是480x960,导致图标显示的有问题,导致代码里面的算法有问题
文件路径vendorfreeze_system_t/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/keyguard/LockIconViewController.java
private void updateLockIconLocation() {
final float scaleFactor = mAuthController.getScaleFactor();
final int scaledPadding = (int) (mDefaultPaddingPx * scaleFactor);
if (mUdfpsSupported) {
mView.setCenterLocation(mAuthController.getUdfpsLocation(),
mAuthController.getUdfpsRadius(), scaledPadding);
} else {
mView.setCenterLocation(
new PointF(mWidthPixels / 2,
mHeightPixels - ((mBottomPaddingPx + sLockIconRadiusPx) * scaleFactor)),
sLockIconRadiusPx * scaleFactor, scaledPadding);
}
}
经过测试他是执行else
修改后是这样的
private void updateLockIconLocation() {
final float scaleFactor = mAuthController.getScaleFactor();
final int scaledPadding = (int) (mDefaultPaddingPx * scaleFactor);
if (mUdfpsSupported) {
mView.setCenterLocation(mAuthController.getUdfpsLocation(),
mAuthController.getUdfpsRadius(), scaledPadding);
} else {
DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics();
if (displayMetrics.widthPixels <= 480) {
mView.setCenterLocation(
new PointF(mWidthPixels / 2,
mHeightPixels - ((mBottomPaddingPx + sLockIconRadiusPxSmallPanel) * scaleFactor)),
sLockIconRadiusPxSmallPanel * scaleFactor, scaledPadding);
} else {
mView.setCenterLocation(
new PointF(mWidthPixels / 2,
mHeightPixels - ((mBottomPaddingPx + sLockIconRadiusPx) * scaleFactor)),
sLockIconRadiusPx * scaleFactor, scaledPadding);
}
}
}
这个sLockIconRadiusPxSmallPanel需要自己重新定义
还是在这个文件里面
private static final int sLockIconRadiusPxSmallPanel=(int)(sDefaultDensity * 50);