no texture for the all apps grid.
This commit is contained in:
parent
7404ee4a16
commit
fde104bfe9
Binary file not shown.
Before Width: | Height: | Size: 419 B |
|
@ -22,8 +22,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
|
||||
launcher:texture="@drawable/pattern_carbon_fiber_dark"
|
||||
|
||||
android:scrollbarStyle="outsideInset"
|
||||
android:drawSelectorOnTop="false"
|
||||
android:listSelector="@drawable/grid_selector"
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
|
||||
launcher:texture="@drawable/pattern_carbon_fiber_dark"
|
||||
|
||||
android:scrollbarStyle="outsideInset"
|
||||
android:drawSelectorOnTop="false"
|
||||
android:listSelector="@drawable/grid_selector"
|
||||
|
|
|
@ -69,13 +69,6 @@
|
|||
<attr name="direction" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- AllAppsGridView specific attributes. These attributes are used to customize
|
||||
the list of all apps in XML files. -->
|
||||
<declare-styleable name="AllAppsGridView">
|
||||
<!-- The background texture. -->
|
||||
<attr name="texture" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- XML attributes used by default_workspace.xml -->
|
||||
<declare-styleable name="Favorite">
|
||||
<attr name="className" format="string" />
|
||||
|
|
|
@ -32,10 +32,6 @@ public class AllAppsGridView extends GridView implements AdapterView.OnItemClick
|
|||
|
||||
private DragController mDragger;
|
||||
private Launcher mLauncher;
|
||||
private Bitmap mTexture;
|
||||
private Paint mPaint;
|
||||
private int mTextureWidth;
|
||||
private int mTextureHeight;
|
||||
|
||||
public AllAppsGridView(Context context) {
|
||||
super(context);
|
||||
|
@ -47,18 +43,6 @@ public class AllAppsGridView extends GridView implements AdapterView.OnItemClick
|
|||
|
||||
public AllAppsGridView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AllAppsGridView, defStyle, 0);
|
||||
final int textureId = a.getResourceId(R.styleable.AllAppsGridView_texture, 0);
|
||||
if (textureId != 0) {
|
||||
mTexture = BitmapFactory.decodeResource(getResources(), textureId);
|
||||
mTextureWidth = mTexture.getWidth();
|
||||
mTextureHeight = mTexture.getHeight();
|
||||
|
||||
mPaint = new Paint();
|
||||
mPaint.setDither(false);
|
||||
}
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -67,32 +51,6 @@ public class AllAppsGridView extends GridView implements AdapterView.OnItemClick
|
|||
setOnItemLongClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
final Bitmap texture = mTexture;
|
||||
final Paint paint = mPaint;
|
||||
|
||||
final int width = getWidth();
|
||||
final int height = getHeight();
|
||||
|
||||
final int textureWidth = mTextureWidth;
|
||||
final int textureHeight = mTextureHeight;
|
||||
|
||||
int x = 0;
|
||||
int y;
|
||||
|
||||
while (x < width) {
|
||||
y = 0;
|
||||
while (y < height) {
|
||||
canvas.drawBitmap(texture, x, y, paint);
|
||||
y += textureHeight;
|
||||
}
|
||||
x += textureWidth;
|
||||
}
|
||||
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
public void onItemClick(AdapterView parent, View v, int position, long id) {
|
||||
ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
|
||||
mLauncher.startActivitySafely(app.intent);
|
||||
|
|
Loading…
Reference in New Issue