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
./gradlew clean assembleDebug | |
adb install -r app/build/outputs/apk/debug/app-debug.apk |
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 java.util.HashMap; | |
import java.util.Map; | |
/** | |
* 服务管理器<hr/> | |
* 1. 模块之间是相互独立的并列关系, 不能相互调用<br/> | |
* 2. 需要调用时, 通过下沉{@link Service}的方式<br/> | |
* <p> | |
* | |
* @author puke |
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.support.annotation.FloatRange; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
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
import android.support.annotation.NonNull; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.support.v7.widget.StaggeredGridLayoutManager; | |
/** | |
* 封装加载更多通用辅助类 | |
* | |
* @author puke | |
* @version 2020-07-24 |
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.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; | |
/** | |
* 带有RecyclerView的列表页统一封装 | |
* | |
* @author puke | |
* @version 2019/2/13 | |
*/ |
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.graphics.Bitmap; | |
import android.media.MediaExtractor; | |
import android.media.MediaFormat; | |
import android.media.MediaMetadataRetriever; | |
import android.os.Environment; | |
import android.support.annotation.Nullable; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; |
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 java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.Locale; | |
import java8.util.function.Function; | |
/** | |
* @author puke | |
* @version 2018/5/15 |
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.Context; | |
import android.content.res.Resources; | |
import android.graphics.Color; | |
import android.os.Build; | |
import android.provider.Settings; | |
import android.view.View; | |
import android.view.Window; | |
import android.view.WindowManager; |
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.text.TextPaint; | |
import android.text.style.CharacterStyle; | |
/** | |
* @author puke | |
* @version 2020-11-10 | |
*/ | |
public class StyleSpan extends CharacterStyle { | |
private final boolean bold; |
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
private static List<Class<?>> scanClass(Context context) throws IOException { | |
Enumeration<String> entries = new DexFile(context.getPackageCodePath()).entries(); | |
List<Class<?>> result = new ArrayList<>(); | |
while (entries.hasMoreElements()) { | |
String className = entries.nextElement(); | |
try { | |
Class<?> type = Class.forName(className); | |
// do something here | |
} catch (Throwable t) { | |
Log.e(TAG, String.format("Load %s failure.", className), t); |
NewerOlder