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
<activity | |
android:name=".MainActivity" | |
android:label="@string/app_name" | |
android:theme="@style/Launcher"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN"/> | |
<category android:name="android.intent.category.LAUNCHER"/> | |
</intent-filter> | |
</activity> |
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 Properties properties = new Properties() | |
properties.load(project.rootProject.file('local.properties').newDataInputStream()) | |
bintray { | |
user = properties.getProperty("bintray.user") | |
key = properties.getProperty("bintray.apikey") | |
configurations = ["archives"] | |
pkg { | |
repo = "maven" |
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
/** | |
* 获取当前进程名 | |
* @param context | |
* @return | |
*/ | |
public static String getCurrProcessName(Context context) { | |
try { | |
final int currProcessId = android.os.Process.myPid(); | |
final ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); | |
List<ActivityManager.RunningAppProcessInfo> processInfos = am.getRunningAppProcesses(); |
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 static int resolveSizeAndState(int desireSize, int measureSpec) { | |
int result = desireSize; | |
int specMode = MeasureSpec.getMode(measureSpec); | |
int specSize = MeasureSpec.getSize(measureSpec); | |
switch (specMode) { | |
case MeasureSpec.UNSPECIFIED: | |
result = desireSize; | |
break; | |
case MeasureSpec.AT_MOST: | |
if (specSize < desireSize) { |
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
/** | |
* 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
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
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
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
/** | |
* Created by chensuilun on 16-9-20. | |
*/ | |
public abstract class ViewStubWidget { | |
private ViewGroup mParent; | |
private int mStubId; | |
private ViewStub mViewStub; | |
private View mRoot; | |
OlderNewer