android4.0默认界面旋转180之最近使用程序视图倒立

系统默认旋转了180度后,点击状态栏的最近使用程序,发现里面视图还是倒的。跟踪代码修改如下:

1>frameworks/base/packages/systemui/res/values-sw720dp/config.xml

<bool name="config_recents_thumbnail_image_fits_to_xy">false</bool>

2>frameworks/base/packages/systemui/src/com/android/systemui/recent/recentsPanelView.java

import android.os.SystemProperties;//by caoyi 20130301

 private int mThumbnailWidth;
 private int mThumbnailHeight;//by caoyi 20130301

public void updateValuesFromResources() {

mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width));
mThumbnailHeight=Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_height));  //by caoyi 20130301

}

private void updateThumbnail(ViewHolder h, Bitmap thumbnail, boolean show, boolean anim) {

else {
                    Matrix scaleMatrix = new Matrix();
                    float scale = mThumbnailWidth / (float) thumbnail.getWidth();
                    scaleMatrix.postScale(scale, scale);//setScale 
                    h.thumbnailViewImage.setScaleType(ScaleType.MATRIX);
                    h.thumbnailViewImage.setImageMatrix(scaleMatrix);
//by caoyi 20130301
if( SystemProperties.getInt("ro.sf.hwrotation",0)==180){
Log.v(TAG, "Nothing to show");
               Matrix rotateMatrix = new Matrix();
    rotateMatrix.setRotate(180,mThumbnailWidth/2,mThumbnailHeight/2);
                   h.thumbnailViewImage.setImageMatrix(rotateMatrix);
    }
//end by caoyi 20130301
                }

}

android4.0默认界面旋转180

你可能感兴趣的:(android4.0默认界面旋转180之最近使用程序视图倒立)