![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android
枕中书
Android、前端、小程序
展开
-
Android 口令实现(自己复制,返回首页设置不显示)
1.获取剪切板口令onResume()中运行 /** * 判断是否有复制口令 */ public void gangUpInvite() { ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); //无数据时直接返回 if (clipboard == null || !clipboard.hasPri原创 2021-10-22 09:07:45 · 485 阅读 · 0 评论 -
SmartRefreshLayout数据不满一页时上滑不完全回弹
1.SmartRefreshLayout+RecyclerView使用。项目build.gradle引入//核心必须依赖implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3' //经典刷新头 implementation 'com.scwang.smart:refresh-header-classics:2.0.3' <com.scwang.smart.refresh.layout.SmartRe原创 2021-10-14 10:18:59 · 1970 阅读 · 0 评论 -
Android 常用的时间处理工具类
1.获取当前时间,返回Date格式。public static Date getCurrentDate() { Date curDate = new Date(System.currentTimeMillis()); return curDate;}2.获取当前时间,返回String格式。public static String getCurrentStr(String pattern) { //pattern可以为"yyyy-MM-dd原创 2021-05-19 16:49:55 · 167 阅读 · 0 评论 -
RecyclerView——基础实现、学习
本文使用的是Kotlin编写RecyclerView,提供一种插拔式的体验,高度的解耦,异常的灵活,它本身只管回收与复用View,其他的开发者通过设置它提供的不同LayoutManager,ItemDecoration , ItemAnimator实现各种不同的效果。一、项目使用1.添加依赖implementation 'com.android.support:recyclerview-v7:27...原创 2018-07-12 14:45:36 · 170 阅读 · 0 评论 -
Kotlin基础用法记录一
数据类:类名前加data =》data class User,可以自动生成基本属性数组容器:Arrays:通过arrayOf()创建普通数组实现:arrayOf(‘a’,'b')int数组:intArrayOf(10,20,30)运算数组:Array(10,{k->k+k})空数组:emptyArray<>()List:通过listof创建只读序列:listOf<>(...原创 2018-07-13 10:31:45 · 137 阅读 · 0 评论