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 String time() { | |
Calendar instance = Calendar.getInstance(); | |
int year = instance.get(Calendar.YEAR); | |
int month = instance.get(Calendar.MONTH) + 1; | |
int day = instance.get(Calendar.DAY_OF_MONTH); | |
int hour = instance.get(Calendar.HOUR_OF_DAY); | |
int minute = instance.get(Calendar.MINUTE); | |
int second = instance.get(Calendar.SECOND); | |
int millis = instance.get(Calendar.MILLISECOND); |
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 org.victor.testlivedata.widget; | |
import android.animation.ObjectAnimator; | |
import android.animation.ValueAnimator; | |
import android.animation.ValueAnimator.AnimatorUpdateListener; | |
import android.content.Context; | |
import android.graphics.Color; | |
import android.os.Build; | |
import android.os.Handler; | |
import android.os.Looper; |
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 HorizontalView extends ViewGroup { | |
private static final int DEFAULT_DP = 20; | |
int defaultSize; | |
private int touchSlop; | |
private float downInterceptX; | |
private float downInterceptY; | |
private int tapTimeout; | |
private Scroller mScroller; | |
private long elapsedRealtime; |
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 ViewUtils { | |
private ViewUtils() { | |
} | |
public static String formatSpecMode(int mode) { | |
String format; | |
switch (mode) { | |
case View.MeasureSpec.EXACTLY: | |
format = "EXACTLY"; |
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 class StaggeredGridItemDecoration( | |
context: Context, | |
orientation: Int, | |
private val spanCount: Int | |
) : RecyclerView.ItemDecoration() { | |
companion object { | |
const val HORIZONTAL = LinearLayout.HORIZONTAL | |
const val VERTICAL = LinearLayout.VERTICAL | |
const val STAGGEREDGRID = 31 | |
private val TAG = "DividerItem" |
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.python.cat.mvvm.widgets; | |
import android.animation.Animator; | |
import android.animation.AnimatorListenerAdapter; | |
import android.animation.ObjectAnimator; | |
import android.animation.PropertyValuesHolder; | |
import android.animation.ValueAnimator; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.TypedArray; |
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.python.cat.mvvm.widgets; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.os.Build; | |
import android.os.SystemClock; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.VelocityTracker; | |
import android.view.View; |
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.python.cat.needwork.widgets.measure; | |
import android.content.Context; | |
import android.os.SystemClock; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.VelocityTracker; | |
import android.view.View; | |
import android.view.ViewConfiguration; | |
import android.view.ViewGroup; |
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.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.Rect; | |
import android.os.SystemClock; | |
import android.util.AttributeSet; |
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.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Path; | |
import android.util.AttributeSet; | |
/** | |
* 通过裁切 onDraw 里面的 canvas,让其在绘制内容之前,先裁切出一个圆形出来即可! | |
*/ | |
public class CircleImageView extends android.support.v7.widget.AppCompatImageView { |
NewerOlder