This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# power button | |
adb shell input keyevent 26 && | |
adb shell sleep 0.1 && | |
# swipe to unlock | |
adb shell input swipe 655 1774 655 874 && | |
adb shell sleep 0.1 && | |
# input 2 | |
adb shell input tap 612 726 && | |
adb shell sleep 0.1 && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BaseFragment extends Fragment { | |
public static final String IS_SHOW = "is_show"; | |
protected View mRootView; | |
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
if (BuildConfig.DEBUG) { | |
Log.d(getClass().getSimpleName(), "onCreate:"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by chensuilun on 16-9-20. | |
*/ | |
public abstract class ViewStubWidget { | |
private ViewGroup mParent; | |
private int mStubId; | |
private ViewStub mViewStub; | |
private View mRoot; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HeaderRoundDrawable extends Drawable { | |
private static final float ROUND_RADIUS = ScreenUtil.dip2px(AppApplication.getContext(), 6); | |
private final RectF mRect = new RectF(), mBitmapRect; | |
private final BitmapShader mBitmapShader; | |
private final Paint mPaint; | |
private Path mPath = new Path(); | |
private float[] mRadius; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* copy from github:https://github.com/justasm/DragLinearLayout | |
* <p/> | |
* Edited by @author chensuilun | |
* add support for HORIZONTAL , simplify code , some useful callback ,add OverScroll constrain , long click to drag support | |
*/ | |
public class DragLinearLayout extends LinearLayout { | |
private static final String TAG = DragLinearLayout.class.getSimpleName(); | |
private static final long NOMINAL_SWITCH_DURATION = 150; | |
private static final long MIN_SWITCH_DURATION = NOMINAL_SWITCH_DURATION; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ParallaxListView extends ListView { | |
private ImageView iv_header; | |
/**图片的高度*/ | |
private int drawableHeight; | |
/**ImageView的原始高度*/ | |
private int originalHeight; | |
public ParallaxListView(Context context) { | |
super(context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ViewConfiguration configuration = ViewConfiguration.get(mContext); | |
mTouchSlop = configuration.getScaledTouchSlop(); | |
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); | |
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); | |
mOverscrollDistance = configuration.getScaledOverscrollDistance(); | |
mOverflingDistance = configuration.getScaledOverflingDistance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An animation that rotates the view on the Y axis between two specified angles. | |
* This animation also adds a translation on the Z axis (depth) to improve the effect. | |
*/ | |
public class Rotate3dAnimation extends Animation { | |
private final float mFromDegrees; | |
private final float mToDegrees; | |
private final float mCenterX; | |
private final float mCenterY; | |
private final float mDepthZ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VerticalFlipReceiver implements SensorEventListener { | |
private static final String TAG = "VerticalFlipReceiver"; | |
private static final float CRITICAL_DOWN_ANGLE = -6.75f; | |
private static final float CRITICAL_UP_ANGLE = 6.75f; | |
private static final int Z_ORATIATION = 2; | |
private static final int SCREEN_FLIP_UP = 0; | |
private static final int SCREEN_FLIP_DOWN = 1; | |
private int mReverseDownFlg = -1; | |
private Context mContext; | |
private SensorManager mSensorManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* https://github.com/niorgai/StatusBarCompat | |
* */ | |
public class StatusBarCompat { | |
private static final int COLOR_TRANSLUCENT = Color.parseColor("#00000000"); | |
public static final int DEFAULT_COLOR_ALPHA = 112; | |
/** |