diff options
author | Joe Onorato <joeo@android.com> | 2009-09-24 12:19:49 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-09-24 12:19:49 -0700 |
commit | 6467f30eb638ae3bf07be1ead1fb93023fd83ba1 (patch) | |
tree | a550afcd69a2492f6cedc576264ad9c52821acbf /src/com/android | |
parent | 33ed7b2f5a2456dc44dfe6e8f35a415c1495a87c (diff) | |
download | android_packages_apps_Trebuchet-6467f30eb638ae3bf07be1ead1fb93023fd83ba1.tar.gz android_packages_apps_Trebuchet-6467f30eb638ae3bf07be1ead1fb93023fd83ba1.tar.bz2 android_packages_apps_Trebuchet-6467f30eb638ae3bf07be1ead1fb93023fd83ba1.zip |
delete these unused files
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher2/AllAppsGridView.java | 97 | ||||
-rw-r--r-- | src/com/android/launcher2/AllocationIndex.java | 37 | ||||
-rw-r--r-- | src/com/android/launcher2/IntAllocation.java | 105 |
3 files changed, 0 insertions, 239 deletions
diff --git a/src/com/android/launcher2/AllAppsGridView.java b/src/com/android/launcher2/AllAppsGridView.java deleted file mode 100644 index 71cd9524a..000000000 --- a/src/com/android/launcher2/AllAppsGridView.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher2; - -import android.widget.GridView; -import android.widget.AdapterView; -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.view.View; -import android.graphics.BitmapFactory; -import android.graphics.Bitmap; -import android.graphics.Paint; -import android.graphics.Canvas; - -public class AllAppsGridView extends GridView implements AdapterView.OnItemClickListener, - AdapterView.OnItemLongClickListener, DragSource { - - private DragController mDragController; - private Launcher mLauncher; - private boolean mDraw = true; - - public AllAppsGridView(Context context) { - super(context); - } - - public AllAppsGridView(Context context, AttributeSet attrs) { - this(context, attrs, com.android.internal.R.attr.gridViewStyle); - } - - public AllAppsGridView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - - @Override - protected void onFinishInflate() { - setOnItemClickListener(this); - setOnItemLongClickListener(this); - } - - public void onItemClick(AdapterView parent, View v, int position, long id) { - ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position); - mLauncher.startActivitySafely(app.intent); - } - - public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { - if (!view.isInTouchMode()) { - return false; - } - - ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position); - app = new ApplicationInfo(app); - - mDragController.startDrag(view, this, app, DragController.DRAG_ACTION_COPY); - mLauncher.closeAllApps(); - mDraw = false; - invalidate(); - return true; - } - - @Override - protected void dispatchDraw(Canvas canvas) { - if (mDraw) { - super.dispatchDraw(canvas); - } - } - - public void setDragController(DragController dragController) { - mDragController = dragController; - } - - public void onDropCompleted(View target, boolean success) { - mLauncher.closeAllApps(); - } - - void setLauncher(Launcher launcher) { - mLauncher = launcher; - } - - void onPrepareDialog() { - mDraw = true; - } -} diff --git a/src/com/android/launcher2/AllocationIndex.java b/src/com/android/launcher2/AllocationIndex.java deleted file mode 100644 index 0202db5c6..000000000 --- a/src/com/android/launcher2/AllocationIndex.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher2; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * Annotate fields of a subclass of {@link IntAllocaiton} or - * FloatAllocation with this, and the save() method on those - * those classes will find the field an save it. - * <p> - * TODO: This would be even better if the allocations were - * named, and renderscript automatically added them into to - * the renderscript namespace. - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface AllocationIndex { - /** - * The index in the allocation to use inside renderscript. - */ - int value(); -} diff --git a/src/com/android/launcher2/IntAllocation.java b/src/com/android/launcher2/IntAllocation.java deleted file mode 100644 index dde3d22dd..000000000 --- a/src/com/android/launcher2/IntAllocation.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher2; - -import android.renderscript.Allocation; -import android.renderscript.Element; -import android.renderscript.RenderScript; -import android.util.Log; - -import java.lang.reflect.Field; - -public class IntAllocation { - private RenderScript mRS; - private int[] mBuffer; - private Allocation mAlloc; - - public IntAllocation(RenderScript rs) { - mRS = rs; - } - - public void save() { - Field[] fields = this.getClass().getFields(); - if (mBuffer == null) { - int maxIndex = 0; - for (Field f: fields) { - AllocationIndex index = f.getAnnotation(AllocationIndex.class); - if (index != null) { - int value = index.value(); - if (value > maxIndex) { - maxIndex = value; - } - } - } - mBuffer = new int[maxIndex+1]; - if (true) { - // helpful debugging check - for (Field f: fields) { - AllocationIndex index = f.getAnnotation(AllocationIndex.class); - if (index != null) { - int i = index.value(); - if (mBuffer[i] != 0) { - throw new RuntimeException("@AllocationIndex on field in class " - + this.getClass().getName() + " with duplicate value " - + i + " for field " + f.getName() + ". The other field is " - + fields[mBuffer[i]-1].getName() + '.'); - } - mBuffer[i] = i+1; - } - } - for (int i=0; i<mBuffer.length; i++) { - mBuffer[i] = 0; - } - } - mAlloc = Allocation.createSized(mRS, Element.USER_I32, mBuffer.length); - } - int[] buf = mBuffer; - for (Field f: fields) { - AllocationIndex index = f.getAnnotation(AllocationIndex.class); - if (index != null) { - try { - buf[index.value()] = f.getInt(this); - } catch (IllegalAccessException ex) { - throw new RuntimeException(ex); - } - } - } - mAlloc.data(buf); - } - - public void read() { - int[] buf = mBuffer; - if (buf != null) { - mAlloc.readData(buf); - Field[] fields = this.getClass().getFields(); - for (Field f: fields) { - AllocationIndex index = f.getAnnotation(AllocationIndex.class); - if (index != null) { - try { - f.setInt(this, buf[index.value()]); - } catch (IllegalAccessException ex) { - throw new RuntimeException(ex); - } - } - } - } - } - - Allocation getAllocation() { - return mAlloc; - } -} |