随笔分类 -  方法记录

1
摘要:/** * date2比date1多的天数,只看天数,不看秒数 * * @param date1 * @param date2 * @return */ private static int calDateDistance(Date date1, Date date2) { Calendar cal 阅读全文
posted @ 2022-10-25 17:06 指切 编辑
摘要:android:elevation="10dp" //或 android:translationZ="10dp" View.setElevation(20); //或 View.setTranslationZ(20); 阅读全文
posted @ 2022-08-10 17:40 指切 阅读(164) 评论(0) 推荐(0) 编辑
摘要:public interface UserConstant { /** * 性别 */ int GIRL = 0; int BOY = 1; } @Retention(RetentionPolicy.SOURCE) @Target({ElementType.PARAMETER}) @IntDef(v 阅读全文
posted @ 2022-07-12 11:21 指切 阅读(62) 评论(0) 推荐(0) 编辑
摘要:private final ActivityResultLauncher<String> requestPermissionLauncher = registerForActivityResult(new ActivityResultContracts.RequestPermission(), re 阅读全文
posted @ 2022-06-01 11:36 指切 阅读(1344) 评论(0) 推荐(0) 编辑
摘要:int scaledTouchSlop = ViewConfiguration.get(getBaseContext()).getScaledTouchSlop() 阅读全文
posted @ 2022-05-28 14:14 指切 阅读(253) 评论(0) 推荐(0) 编辑
摘要:/** * 将本地图片转换为 Drawable * @param context 上下文 * @param file 文件路径 * @return */ public static Drawable path2Drawable(Context context, String file) { if ( 阅读全文
posted @ 2022-05-19 18:14 指切 阅读(1048) 评论(0) 推荐(0) 编辑
摘要:/** * 根据图片路径获取需要矫正的角度 * @param filepath 图片路径 * @return 需矫正的角度 */ public static int getExifOrientation(String filepath) { int degrees = 0; ExifInterfac 阅读全文
posted @ 2022-04-24 15:45 指切 阅读(449) 评论(0) 推荐(0) 编辑
摘要://手指离开屏幕时还原 public static void addScaleTouch(View view) { view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v 阅读全文
posted @ 2022-04-14 09:31 指切 阅读(251) 评论(0) 推荐(0) 编辑
摘要:/** * 判断SD卡是否可用 * * @return true : 可用<br>false : 不可用 */ public static boolean isSDCardEnable() { return Environment.MEDIA_MOUNTED.equals(Environment.g 阅读全文
posted @ 2022-04-14 09:27 指切 阅读(131) 评论(0) 推荐(0) 编辑
摘要:重写dispatchKeyEvent方法即可 @Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && isTiming) { retu 阅读全文
posted @ 2022-04-02 16:25 指切 阅读(576) 评论(0) 推荐(0) 编辑
摘要:private boolean banClick; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); new Thread(new Runnable() 阅读全文
posted @ 2022-03-30 18:50 指切 阅读(88) 评论(0) 推荐(0) 编辑
摘要:<androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/csl_target_select_clock_in_test" android:layout_width="0dp" android:layout_height= 阅读全文
posted @ 2022-03-17 17:08 指切 阅读(337) 评论(0) 推荐(0) 编辑

1
点击右上角即可分享
微信分享提示