diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-12-27 10:23:50 +0000 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-12-27 10:23:50 +0000 |
commit | 5f6c9fbc6392f713cd24014d4a0fb76425c83189 (patch) | |
tree | 311887b872fadf5c9d4aebbe0bbf52a27c4bb535 /src | |
parent | 6fa3dd5f0f99c0c945180a64744115b9ca61285a (diff) | |
download | android_packages_apps_Trebuchet-5f6c9fbc6392f713cd24014d4a0fb76425c83189.tar.gz android_packages_apps_Trebuchet-5f6c9fbc6392f713cd24014d4a0fb76425c83189.tar.bz2 android_packages_apps_Trebuchet-5f6c9fbc6392f713cd24014d4a0fb76425c83189.zip |
EcoGallery: Don't use reflection
Change-Id: Ie59b5b522fa2436ad82ebe882d956f63e5522d28
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/widget/EcoGallery.java | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/src/com/cyanogenmod/trebuchet/widget/EcoGallery.java b/src/com/cyanogenmod/trebuchet/widget/EcoGallery.java index d70a37e02..8c7a7415d 100644 --- a/src/com/cyanogenmod/trebuchet/widget/EcoGallery.java +++ b/src/com/cyanogenmod/trebuchet/widget/EcoGallery.java @@ -156,13 +156,6 @@ public class EcoGallery extends CustomAbsSpinner implements GestureDetector.OnGe */ private boolean mIsFirstScroll; - - /** - * If true the reflection calls failed and this widget will behave - * unpredictably if used further - */ - private boolean mBroken; - public EcoGallery(Context context) { this(context, null); } @@ -174,8 +167,6 @@ public class EcoGallery extends CustomAbsSpinner implements GestureDetector.OnGe public EcoGallery(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - mBroken = true; - mGestureDetector = new GestureDetector(context, this); mGestureDetector.setIsLongpressEnabled(true); @@ -205,51 +196,8 @@ public class EcoGallery extends CustomAbsSpinner implements GestureDetector.OnGe // We draw the selected item last (because otherwise the item to the // right overlaps it) - int FLAG_USE_CHILD_DRAWING_ORDER = 0x400; - int FLAG_SUPPORT_STATIC_TRANSFORMATIONS = 0x800; - Class vgClass = ViewGroup.class; - - try { - Field childDrawingOrder = vgClass - .getDeclaredField("FLAG_USE_CHILD_DRAWING_ORDER"); - Field supportStaticTrans = vgClass - .getDeclaredField("FLAG_SUPPORT_STATIC_TRANSFORMATIONS"); - - childDrawingOrder.setAccessible(true); - supportStaticTrans.setAccessible(true); - - FLAG_USE_CHILD_DRAWING_ORDER = childDrawingOrder.getInt(this); - FLAG_SUPPORT_STATIC_TRANSFORMATIONS = supportStaticTrans.getInt(this); - } catch (NoSuchFieldException e) { - Log.e(LOG_TAG, e.getMessage(), e); - } catch (IllegalAccessException e) { - Log.e(LOG_TAG, e.getMessage(), e); - } - try { - // set new group flags - Field groupFlags = vgClass.getDeclaredField("mGroupFlags"); - groupFlags.setAccessible(true); - int groupFlagsValue = groupFlags.getInt(this); - - groupFlagsValue |= FLAG_USE_CHILD_DRAWING_ORDER; - groupFlagsValue |= FLAG_SUPPORT_STATIC_TRANSFORMATIONS; - - groupFlags.set(this, groupFlagsValue); - - // working! - mBroken = false; - } catch (NoSuchFieldException e) { - Log.e(LOG_TAG, e.getMessage(), e); - } catch (IllegalAccessException e) { - Log.e(LOG_TAG, e.getMessage(), e); - } - } - - /** - * @return Whether the widget is broken or working (functional) - */ - public boolean isBroken() { - return mBroken; + mGroupFlags |= FLAG_USE_CHILD_DRAWING_ORDER; + mGroupFlags |= FLAG_SUPPORT_STATIC_TRANSFORMATIONS; } /** |