Live Wallpaper动态壁纸开发
2011-07-01 20:50:24 来源:本站整理mGradientRect = new Rect(mColorRectangles[15].left, mColorRectangles[15].bottom, mColorRectangles[15].right, mRectFrame.bottom * 9 / 12);
mGradient = new GradientDrawable(Orientation.LEFT_RIGHT, new int[] { 0xff050505, 0xfffdfdfd });
mGradient.setBounds(mGradientRect);
mColorRectangles[16] = new Rect(0, bottomHeight, wideColumnWidth, mRectFrame.right);
mColorRectangles[17] = new Rect(mColorRectangles[16].right, bottomHeight, mRectFrame.right * 9 / 56 + mColorRectangles[16].right, mRectFrame.bottom);
mColorRectangles[18] = new Rect(mColorRectangles[17].right, bottomHeight, mRectFrame.right * 3 / 14 + mColorRectangles[17].right, mRectFrame.bottom);
mColorRectangles[19] = new Rect(mColorRectangles[18].right, bottomHeight, mRectFrame.right * 45 / 448 + mColorRectangles[18].right, mRectFrame.bottom);
for (int i = 20; i < 25; i++)
{
mColorRectangles[i] = new Rect(mColorRectangles[i - 1].right, bottomHeight, mRectFrame.right * 15 / 448 + mColorRectangles[i - 1].right, mRectFrame.right);
}
mColorRectangles[25] = new Rect(mColorRectangles[24].right, bottomHeight, narrowColumnWidth + mColorRectangles[24].right, mRectFrame.bottom);
mColorRectangles[26] = new Rect(mColorRectangles[25].right, bottomHeight, mRectFrame.right, mRectFrame.bottom);
}
else
{
int topHeight = mRectFrame.right * 5 / 12;
int bottomHeight = mRectFrame.right / 4;
int wideColumnWidth = mRectFrame.bottom / 8;
int narrowColumnWidth = mRectFrame.bottom * 3 / 28;
mColorRectangles[0] = new Rect(topHeight, 0, mRectFrame.bottom, wideColumnWidth);
for (int i = 1; i < 8; i++)
{
mColorRectangles[i] = new Rect(topHeight, mColorRectangles[i - 1].bottom, mRectFrame.right, narrowColumnWidth + mColorRectangles[i - 1].bottom);
}
mColorRectangles[8] = new Rect(topHeight, mColorRectangles[7].bottom, mRectFrame.right, mRectFrame.bottom);
for (int i = 0; i < 2; i++)
{
int middleLeft = mRectFrame.right * (4 - i) / 12;
int middleRight = mRectFrame.right * (5 - i) / 12;
mColorRectangles[i + 9] = new Rect(middleLeft, 0, middleRight, wideColumnWidth);
mColorRectangles[i + 11] = new Rect(middleLeft, wideColumnWidth, middleRight, narrowColumnWidth + wideColumnWidth);
mColorRectangles[i + 13] = new Rect(middleLeft, narrowColumnWidth * 7 + wideColumnWidth, middleRight, mRectFrame.bottom);
}
mColorRectangles[15] = new Rect(mRectFrame.right * 4 / 12, narrowColumnWidth + wideColumnWidth, mRectFrame.right * 5 / 12, narrowColumnWidth * 7 + wideColumnWidth);
mGradientRect = new Rect(mRectFrame.right * 3 / 12, mColorRectangles[15].top, mColorRectangles[15].left, mColorRectangles[15].bottom);
mGradient = new GradientDrawable(Orientation.TOP_BOTTOM, new int[] { 0xff050505, 0xfffdfdfd });
mGradient.setBounds(mGradientRect);
mColorRectangles[16] = new Rect(0, 0, bottomHeight, wideColumnWidth);
mColorRectangles[17] = new Rect(0, mColorRectangles[16].bottom, bottomHeight, mRectFrame.bottom * 9 / 56 + mColorRectangles[16].bottom);
mColorRectangles[18] = new Rect(0, mColorRectangles[17].bottom, bottomHeight, mRectFrame.bottom * 3 / 14 + mColorRectangles[17].bottom);
mColorRectangles[19] = new Rect(0, mColorRectangles[18].bottom, bottomHeight, mRectFrame.bottom * 45 / 448 + mColorRectangles[18].bottom);
for (int i = 20; i < 25; i++)
{
mColorRectangles[i] = new Rect(0, mColorRectangles[i - 1].bottom, bottomHeight, mRectFrame.bottom * 15 / 448 + mColorRectangles[i - 1].bottom);
}
mColorRectangles[25] = new Rect(0, mColorRectangles[24].bottom, bottomHeight, narrowColumnWidth + mColorRectangles[24].bottom);
mColorRectangles[26] = new Rect(0, mColorRectangles[25].bottom, bottomHeight, mRectFrame.bottom);
}
更多精彩
赞助商链接