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 void main(String[] args) throws ParseException { | |
String query = "hello=world"; | |
List<String> list = new ArrayList<>(); | |
String url; | |
url = "http://www.baidu.com"; // no ?, no # | |
list.add(url); url = "http://www.baidu.com?"; // has ?, no # : just ? | |
list.add(url); url = "http://www.baidu.com?&"; // has ?, no # : ?& | |
list.add(url); url = "http://www.baidu.com?query"; // has ?, no # : ?query | |
list.add(url); url = "http://www.baidu.com?query&"; // has ?, no # : ?query& | |
list.add(url); url = "http://www.baidu.com#e"; // no ?, has # : #e |
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 List<WeekBean> parseNatureWeek(long startMs, long endMs) { | |
if (startMs > endMs) { | |
return Collections.emptyList(); | |
} | |
Calendar calendar = Calendar.getInstance(); | |
// end date | |
calendar.setTimeInMillis(endMs); | |
clearTime(calendar); | |
endMs = calendar.getTimeInMillis(); |
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 MultiXLCall<R> { | |
@SuppressWarnings("unchecked") | |
public static <T1, T2, R> MultiXLCall<R> wrap(@NonNull XLCall<T1> call1, @NonNull XLCall<T2> call2, @NonNull Zip2<T1, T2, R> zip) { | |
return new MultiXLCall<>(fromZip2(zip), new XLCall[]{call1, call2}); | |
} | |
@SuppressWarnings("unchecked") | |
public static <T1, T2, T3, R> MultiXLCall<R> wrap(@NonNull XLCall<T1> call1, @NonNull XLCall<T2> call2, @NonNull XLCall<T3> call3, @NonNull Zip3<T1, T2, T3, R> zip) { | |
return new MultiXLCall<>(fromZip3(zip), new XLCall[]{call1, call2, call3}); |
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 BlockDetect { | |
// BlockDetectByPrinter | |
public static void start() { | |
Looper.getMainLooper().setMessageLogging(new Printer() { | |
private static final String START = ">>>>> Dispatching"; | |
private static final String END = "<<<<< Finished"; | |
@Override |
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 com.wyon.util; | |
import android.os.Build; | |
import android.support.annotation.RequiresApi; | |
import android.util.Log; | |
import android.view.Choreographer; | |
/** | |
* 功能:分析丢帧情况和帧绘制耗时 | |
* 描述:需要分析的代码前后加上 FrameAnalyze.start(), FrameAnalyze.stop() |
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 class DividerDecoration extends RecyclerView.ItemDecoration { | |
final int bottomOffset = DisplayUtil.dip2px(15); | |
final int hOffset = DisplayUtil.dip2px(7); | |
final ShadowHelper mShadowHelper; | |
DividerDecoration(Context context) { | |
mShadowHelper = new ShadowHelper(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 CenterBottomRoundImageView extends RoundCornerImageView { | |
private Matrix mMatrix; | |
public CenterBottomRoundImageView(Context context) { | |
super(context); | |
init(); | |
} | |
public CenterBottomRoundImageView(Context context, @Nullable AttributeSet attrs) { |
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 RoundCornerImageView extends ImageView { | |
private final RectF mTmpRectF = new RectF(); | |
private int topLeftRadius; | |
private int topRightRadius; | |
private int bottomLeftRadius; | |
private int bottomRightRadius; | |
// todo canvas.clipPath(Round Rect)? |
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 StringBuilder printMotionEvent(MotionEvent event, StringBuilder stringBuilder) { | |
if (stringBuilder == null) { | |
stringBuilder = new StringBuilder(); | |
} | |
stringBuilder.append("[RawAction:0x").append(Integer.toHexString(event.getAction())) | |
.append(""); | |
switch (event.getAction()) { | |
case MotionEvent.ACTION_DOWN: | |
stringBuilder.append("(down)"); |
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
// 二叉树 | |
// 节点construct | |
function Node(data, left, right) { | |
this.data = data; | |
this.left = left; | |
this.right = right; | |
this.show = show; | |
} |
NewerOlder