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
package android.support.v4.app; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.view.Gravity; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.view.animation.AnimationUtils; |
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
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB_MR1) { | |
task.execute(); | |
} else { | |
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); | |
} |
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
import android.app.Activity; | |
import android.content.DialogInterface; | |
import android.content.pm.PackageManager; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.annotation.StringRes; | |
import android.support.v4.app.ActivityCompat; | |
import java.util.Map; |
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
//call if(BuildConfig.DEBUG) registerActivityLifecycleCallbacks(new ActivityLifecycleLogger()) in your own Application class. | |
public class ActivityLifecycleLogger implements Application.ActivityLifecycleCallbacks { | |
private static final String TAG = "LifeCycleLogger"; | |
private static final Class[] LOG_CYCLE_ACTIVITIES = new Class[] { | |
//add activities you want to log here | |
MainActivity.class | |
}; |
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
1.debug false | |
2.sign true | |
3.test proguard | |
4.change version code | |
5.upload new apk to umeng and test update works | |
6.merge master to release branch | |
7.upload new apk to appstores |
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
-optimizationpasses 5 | |
# 混淆时不会产生形形色色的类名 | |
-dontusemixedcaseclassnames | |
# 指定不去忽略非公共的类库 | |
-dontskipnonpubliclibraryclasses | |
# 不预校验 | |
-dontpreverify |
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 SquareRelativeLayout extends RelativeLayout{ | |
public SquareRelativeLayout(Context context) { | |
super(context); | |
} | |
public SquareRelativeLayout(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public SquareRelativeLayout(Context context, AttributeSet attrs, int defStyle) { |
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 ExpandedGridView extends GridView{ | |
public ExpandedGridView(Context context) { | |
super(context); | |
} | |
public ExpandedGridView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public ExpandedGridView(Context context, AttributeSet attrs, int defStyle) { |
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
listView.addHeaderView(headerView); | |
//add adapter and show the header | |
listView.setAdapter(myAdapter); |
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 Bitmap convert(Bitmap bitmap, Bitmap.Config config) { | |
Bitmap convertedBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), config); | |
Canvas canvas = new Canvas(convertedBitmap); | |
Paint paint = new Paint(); | |
paint.setColor(Color.BLACK); | |
canvas.drawBitmap(bitmap, 0, 0, paint); | |
return convertedBitmap; | |
} |