diff --git a/.idea/libraries/animated_vector_drawable_25_2_0.xml b/.idea/libraries/animated_vector_drawable_25_2_0.xml index f1fae8f..1c79b9a 100644 --- a/.idea/libraries/animated_vector_drawable_25_2_0.xml +++ b/.idea/libraries/animated_vector_drawable_25_2_0.xml @@ -1,12 +1,12 @@ - - + + - + \ No newline at end of file diff --git a/.idea/libraries/appcompat_v7_25_2_0.xml b/.idea/libraries/appcompat_v7_25_2_0.xml index 360390f..f5ce8ce 100644 --- a/.idea/libraries/appcompat_v7_25_2_0.xml +++ b/.idea/libraries/appcompat_v7_25_2_0.xml @@ -1,12 +1,12 @@ - - + + - + \ No newline at end of file diff --git a/.idea/libraries/library_1_4_0.xml b/.idea/libraries/library_1_4_0.xml index 8f2f559..587cde6 100644 --- a/.idea/libraries/library_1_4_0.xml +++ b/.idea/libraries/library_1_4_0.xml @@ -1,8 +1,8 @@ - - + + diff --git a/.idea/libraries/multidex_1_0_1.xml b/.idea/libraries/multidex_1_0_1.xml index 029b51a..db5499f 100644 --- a/.idea/libraries/multidex_1_0_1.xml +++ b/.idea/libraries/multidex_1_0_1.xml @@ -1,8 +1,8 @@ - - + + diff --git a/.idea/libraries/multidex_instrumentation_1_0_1.xml b/.idea/libraries/multidex_instrumentation_1_0_1.xml index 6e2e000..e54d1f4 100644 --- a/.idea/libraries/multidex_instrumentation_1_0_1.xml +++ b/.idea/libraries/multidex_instrumentation_1_0_1.xml @@ -1,8 +1,8 @@ - - + + diff --git a/.idea/libraries/rxandroid_1_2_1.xml b/.idea/libraries/rxandroid_1_2_1.xml index 7c1ed36..683aea9 100644 --- a/.idea/libraries/rxandroid_1_2_1.xml +++ b/.idea/libraries/rxandroid_1_2_1.xml @@ -1,8 +1,8 @@ - - + + diff --git a/.idea/libraries/support_annotations_25_2_0.xml b/.idea/libraries/support_annotations_25_2_0.xml index ca38aad..a0b9f00 100644 --- a/.idea/libraries/support_annotations_25_2_0.xml +++ b/.idea/libraries/support_annotations_25_2_0.xml @@ -1,11 +1,11 @@ - + - + \ No newline at end of file diff --git a/.idea/libraries/support_compat_25_2_0.xml b/.idea/libraries/support_compat_25_2_0.xml index 8ff254e..f38d5d8 100644 --- a/.idea/libraries/support_compat_25_2_0.xml +++ b/.idea/libraries/support_compat_25_2_0.xml @@ -1,12 +1,12 @@ - - + + - + \ No newline at end of file diff --git a/.idea/libraries/support_core_ui_25_2_0.xml b/.idea/libraries/support_core_ui_25_2_0.xml index c1cf50c..cf783db 100644 --- a/.idea/libraries/support_core_ui_25_2_0.xml +++ b/.idea/libraries/support_core_ui_25_2_0.xml @@ -1,12 +1,12 @@ - - + + - + \ No newline at end of file diff --git a/.idea/libraries/support_core_utils_25_2_0.xml b/.idea/libraries/support_core_utils_25_2_0.xml index fed42b0..ce739b8 100644 --- a/.idea/libraries/support_core_utils_25_2_0.xml +++ b/.idea/libraries/support_core_utils_25_2_0.xml @@ -1,12 +1,12 @@ - - + + - + \ No newline at end of file diff --git a/.idea/libraries/support_fragment_25_2_0.xml b/.idea/libraries/support_fragment_25_2_0.xml index d29a9b4..d1cb128 100644 --- a/.idea/libraries/support_fragment_25_2_0.xml +++ b/.idea/libraries/support_fragment_25_2_0.xml @@ -1,12 +1,12 @@ - - + + - + \ No newline at end of file diff --git a/.idea/libraries/support_media_compat_25_2_0.xml b/.idea/libraries/support_media_compat_25_2_0.xml index de84a6f..dc16ec8 100644 --- a/.idea/libraries/support_media_compat_25_2_0.xml +++ b/.idea/libraries/support_media_compat_25_2_0.xml @@ -1,12 +1,12 @@ - - + + - + \ No newline at end of file diff --git a/.idea/libraries/support_v4_25_2_0.xml b/.idea/libraries/support_v4_25_2_0.xml index 4ec35b9..16e82cb 100644 --- a/.idea/libraries/support_v4_25_2_0.xml +++ b/.idea/libraries/support_v4_25_2_0.xml @@ -1,8 +1,8 @@ - - + + diff --git a/.idea/libraries/support_vector_drawable_25_2_0.xml b/.idea/libraries/support_vector_drawable_25_2_0.xml index 0b76ace..bfb2da4 100644 --- a/.idea/libraries/support_vector_drawable_25_2_0.xml +++ b/.idea/libraries/support_vector_drawable_25_2_0.xml @@ -1,12 +1,12 @@ - - + + - + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 1e7384b..bf84c74 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cf66c1e..86361b0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -40,110 +40,79 @@ - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - - - + + + + + + + + + + - - - - - - - + + + + - - - - - - + + - - - - - - - - - - - - - - @@ -156,7 +125,7 @@ - - @@ -3349,7 +3251,7 @@ - + @@ -3363,263 +3265,147 @@ - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -3629,11 +3415,12 @@ - - - + + + + @@ -3814,31 +3601,6 @@ - - - - - - - + - + - - + + + - - + - - + @@ -4064,7 +3825,9 @@ - + + + @@ -4124,74 +3887,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4203,7 +3898,20 @@ - + + + + + + + + + + + + + + @@ -4223,20 +3931,8 @@ - - - - - - - - - - - - - - + + @@ -4251,255 +3947,263 @@ - + + + + + + + + + + + + + + + - - + + - + - - + + - - - - + - - + + - - + + + - + - - + + + - + - - + + + - + - - + + - - + - - + + + - + - - + + + - - - + - - + + + - + - - + + - - - - - + - - - + + - + - - - + + - + - - - + + - + - - + + - + - - + + - - - - - - + + + - - - - - - - + + + - + - - - - - - - - - + + + - + - - + + - + - - + + - - - - - - + + + - + + + + - - + + - + - - + + - - - - - - - - - - + + + - - - - + + - + + + + - - + + - + - - - + + + + + + + + + + - + - - + + - + - - - + + + + + + + + + + + + + + + + diff --git a/Android-LockScreenSample-DisableHomeButtonKey-master.iml b/Android-LockScreenSample-DisableHomeButtonKey-master.iml new file mode 100644 index 0000000..2ac73f7 --- /dev/null +++ b/Android-LockScreenSample-DisableHomeButtonKey-master.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Android-LockScreenSample-DisableHomeButtonKey.iml b/Android-LockScreenSample-DisableHomeButtonKey.iml deleted file mode 100644 index f553e7b..0000000 --- a/Android-LockScreenSample-DisableHomeButtonKey.iml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/app.iml b/app/app.iml index 8308ca7..aea07c0 100644 --- a/app/app.iml +++ b/app/app.iml @@ -109,7 +109,6 @@ - @@ -120,7 +119,6 @@ - diff --git a/app/src/main/java/com/github/mugku/lockscreensample/MainActivity.java b/app/src/main/java/com/github/mugku/lockscreensample/MainActivity.java index cb0fee4..e9e069b 100644 --- a/app/src/main/java/com/github/mugku/lockscreensample/MainActivity.java +++ b/app/src/main/java/com/github/mugku/lockscreensample/MainActivity.java @@ -5,6 +5,7 @@ import android.net.Uri; import android.os.Bundle; import android.provider.Settings; +import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.SwitchCompat; import android.view.Menu; diff --git a/gradle.properties b/gradle.properties index 87cf6ce..ceaa071 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,4 +22,3 @@ org.gradle.daemon=true org.gradle.parallel=true # jvm heap size org.gradle.jvmargs=-Xmx4346m -org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home diff --git a/lockscreenusingservice/lockscreenusingservice.iml b/lockscreenusingservice/lockscreenusingservice.iml index f626080..d63a307 100644 --- a/lockscreenusingservice/lockscreenusingservice.iml +++ b/lockscreenusingservice/lockscreenusingservice.iml @@ -81,6 +81,13 @@ + + + + + + + @@ -89,14 +96,6 @@ - - - - - - - - @@ -112,10 +111,7 @@ - - - diff --git a/lockscreenusingservice/src/main/java/com/github/dubu/lockscreenusingservice/service/LockscreenViewService.java b/lockscreenusingservice/src/main/java/com/github/dubu/lockscreenusingservice/service/LockscreenViewService.java index 1fbe87c..e622c4b 100644 --- a/lockscreenusingservice/src/main/java/com/github/dubu/lockscreenusingservice/service/LockscreenViewService.java +++ b/lockscreenusingservice/src/main/java/com/github/dubu/lockscreenusingservice/service/LockscreenViewService.java @@ -1,5 +1,7 @@ package com.github.dubu.lockscreenusingservice.service; +import android.animation.Animator; +import android.animation.ObjectAnimator; import android.annotation.TargetApi; import android.app.Service; import android.content.Context; @@ -28,11 +30,12 @@ import com.romainpiel.shimmer.Shimmer; import com.romainpiel.shimmer.ShimmerTextView; +import java.io.InvalidObjectException; + import rx.android.schedulers.AndroidSchedulers; import rx.functions.Action1; public class LockscreenViewService extends Service { - private final int LOCK_OPEN_OFFSET_VALUE = 50; private Context mContext = null; private LayoutInflater mInflater = null; private View mLockscreenView = null; @@ -44,7 +47,8 @@ public class LockscreenViewService extends Service { private RelativeLayout mForgroundLayout = null; private RelativeLayout mStatusBackgruondDummyView = null; private RelativeLayout mStatusForgruondDummyView = null; - private ShimmerTextView mShimmerTextView = null; + private ShimmerTextView shimmer_tv = null; + private boolean mIsLockEnable = false; private boolean mIsSoftkeyEnable = false; private int mDeviceWidth = 0; @@ -222,8 +226,10 @@ private void settingLockView() { mBackgroundInLayout = (RelativeLayout) mLockscreenView.findViewById(R.id.lockscreen_background_in_layout); mBackgroundLockImageView = (ImageView) mLockscreenView.findViewById(R.id.lockscreen_background_image); mForgroundLayout = (RelativeLayout) mLockscreenView.findViewById(R.id.lockscreen_forground_layout); - mShimmerTextView = (ShimmerTextView) mLockscreenView.findViewById(R.id.shimmer_tv); - (new Shimmer()).start(mShimmerTextView); + shimmer_tv = (ShimmerTextView) mLockscreenView.findViewById(R.id.shimmer_tv); + + new Shimmer().start(shimmer_tv); + mForgroundLayout.setOnTouchListener(mViewTouchListener); mStatusBackgruondDummyView = (RelativeLayout) mLockscreenView.findViewById(R.id.lockscreen_background_status_dummy); @@ -297,12 +303,13 @@ public boolean onTouch(View v, MotionEvent event) { firstTouchX = event.getX(); layoutPrevX = mForgroundLayout.getX(); layoutInPrevX = mBackgroundLockImageView.getX(); - if (firstTouchX <= LOCK_OPEN_OFFSET_VALUE) { - isLockOpen = true; - } + + isLockOpen = true; + } break; case MotionEvent.ACTION_MOVE: { // 2 + if (isLockOpen) { touchMoveX = (int) (event.getRawX() - firstTouchX); if (mForgroundLayout.getX() >= 0) { @@ -345,11 +352,35 @@ public boolean onTouch(View v, MotionEvent event) { private void optimizeForground(float forgroundX) { // final int devideDeviceWidth = (mDeviceWidth / 2); if (forgroundX < mDevideDeviceWidth) { - int startPostion = 0; - for (startPostion = mDevideDeviceWidth; startPostion >= 0; startPostion--) { - mForgroundLayout.setX(startPostion); - } + ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mForgroundLayout, "translationX", mForgroundLayout.getTranslationX(), 0f); + objectAnimator.setDuration(300); + objectAnimator.addListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + mBackgroundLockImageView.setX(-mBackgroundLockImageView.getWidth() / 2); + mBackgroundLockImageView.setVisibility(View.INVISIBLE); + } + + @Override + public void onAnimationEnd(Animator animation) { + mBackgroundLockImageView.setVisibility(View.VISIBLE); + } + + @Override + public void onAnimationCancel(Animator animation) { + + } + + @Override + public void onAnimationRepeat(Animator animation) { + + } + }); + objectAnimator.start(); + } else { + mBackgroundLockImageView.setX(mDevideDeviceWidth - mBackgroundLockImageView.getWidth() / 2); + //unlock TranslateAnimation animation = new TranslateAnimation(0, mDevideDeviceWidth, 0, 0); animation.setDuration(300); animation.setAnimationListener(new Animation.AnimationListener() {