From 683e643a498bc3500773b3ea2cced8b3c31e0366 Mon Sep 17 00:00:00 2001 From: zst123 Date: Sat, 10 May 2014 22:27:30 +0800 Subject: [PATCH 1/2] Add Support for ICS --- AndroidManifest.xml | 2 +- res/layout/slider_preference.xml | 2 +- src/us/shandian/mod/swipeback/hook/ModSwipeBack.java | 3 ++- src/us/shandian/mod/swipeback/widget/SwipeBackLayout.java | 8 +++++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index fc2d112..3584f14 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -5,7 +5,7 @@ android:versionName="2.0.0" > diff --git a/src/us/shandian/mod/swipeback/hook/ModSwipeBack.java b/src/us/shandian/mod/swipeback/hook/ModSwipeBack.java index 8ba55cd..90e5c57 100755 --- a/src/us/shandian/mod/swipeback/hook/ModSwipeBack.java +++ b/src/us/shandian/mod/swipeback/hook/ModSwipeBack.java @@ -294,7 +294,8 @@ public void handleMessage(Message msg) if (!(Boolean) msg.obj) { mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); } else { - mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); + mActivity.setRequestedOrientation(Build.VERSION.SDK_INT <= 15 ? + ActivityInfo.SCREEN_ORIENTATION_NOSENSOR : ActivityInfo.SCREEN_ORIENTATION_LOCKED); } } } diff --git a/src/us/shandian/mod/swipeback/widget/SwipeBackLayout.java b/src/us/shandian/mod/swipeback/widget/SwipeBackLayout.java index bd03072..e8c2cd5 100755 --- a/src/us/shandian/mod/swipeback/widget/SwipeBackLayout.java +++ b/src/us/shandian/mod/swipeback/widget/SwipeBackLayout.java @@ -7,6 +7,7 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; +import android.os.Build; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -453,7 +454,12 @@ public void attachToActivity(Activity activity) { public void computeScroll() { mScrimOpacity = 1 - mScrollPercent; if (mDragHelper.continueSettling(true)) { - this.postInvalidateOnAnimation(); + if (Build.VERSION.SDK_INT <= 15) { + this.postInvalidateDelayed(10); + // Workaround from Support Library v4 in ViewCompatImpl + } else { + this.postInvalidateOnAnimation(); + } } } From aeea25b4a1466beaba4f3ccb5bf7053ad5ce5ce5 Mon Sep 17 00:00:00 2001 From: zst123 Date: Sat, 10 May 2014 22:44:24 +0800 Subject: [PATCH 2/2] eclipse changes (do not merge) --- .classpath | 18 ++++++++++-------- project.properties | 1 - 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.classpath b/.classpath index a4f1e40..0ec76c3 100755 --- a/.classpath +++ b/.classpath @@ -1,8 +1,10 @@ - - - - - - - - + + + + + + + + + + diff --git a/project.properties b/project.properties index 183f993..a5578ba 100755 --- a/project.properties +++ b/project.properties @@ -9,4 +9,3 @@ # Project target. target=android-19 -android.library.reference.1=libs/ShowcaseView