打赏
摘要: 由于在Android 7.0 采用了StrictMode API政策禁,其中有一条限制就是对目录访问的限制。 这项变更意味着我们无法通过File API访问手机存储上的数据,也就是说,给其他应用传递 file:// URI 类型的Uri,可能会导致接受者无法访问该路径,并且会会触发 FileUriE 阅读全文
posted @ 2020-05-08 13:21 张学涛 阅读(794) 评论(0) 推荐(0)
摘要: List<Student> testList = new ArrayList<Student>(); List<Student> repeatList = new ArrayList<Student>();//用于存放重复的元素的list Map<String, Integer> map = new 阅读全文
posted @ 2020-05-08 10:52 张学涛 阅读(9174) 评论(0) 推荐(1)
摘要: Stream 中文称为 “流”,通过将集合转换为这么一种叫做 “流” 的元素序列,通过声明性方式,能够对集合中的每个元素进行一系列并行或串行的流水线操作。 函数式编程带来的好处尤为明显。这种代码更多地表达了业务逻辑的意图,而不是它的实现机制。易读的代码也易于维护、更可靠、更不容易出错。 面对一对多结 阅读全文
posted @ 2020-05-08 10:36 张学涛 阅读(351) 评论(0) 推荐(0)
摘要: List<User> userList=userList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(User :: ge 阅读全文
posted @ 2020-05-08 10:22 张学涛 阅读(3609) 评论(0) 推荐(0)
摘要: switch (receive.getConditionWhere()) { case "0": break; case "1": //新品优先 Collections.sort(likeFloorGoods, new Comparator<ReturnGoodsStockBean>(){ @Ove 阅读全文
posted @ 2020-05-08 10:18 张学涛 阅读(2706) 评论(0) 推荐(0)
摘要: list.stream().mapToDouble(User::getAge).sum()//和 list.stream().mapToDouble(User::getAge).max()//最大 list.stream().mapToDouble(User::getAge).min()//最小 l 阅读全文
posted @ 2020-05-08 10:16 张学涛 阅读(5459) 评论(0) 推荐(1)
摘要: 集成步骤 Java 项目配置 dependencies { compile 'com.cuieney:rxpay-api:2.2.3' annotationProcessor 'com.cuieney:rxpay-compiler:2.1.1' //如果你项目配置了kotlin请忽略下面这行的配置 阅读全文
posted @ 2020-05-07 14:30 张学涛 阅读(961) 评论(0) 推荐(0)
摘要: 代码思路 VegaLayoutManager RecyclerView最顶部的itemView,会随着手指滑动实现收缩隐藏与放大显示,并伴随recycler的回收与复用。代码比较简单粗暴,使用自定义的LayoutManger,内置SnapHelper。由于想要在任意时刻都能snap到第一个子View 阅读全文
posted @ 2020-05-07 14:25 张学涛 阅读(2250) 评论(0) 推荐(0)
摘要: 运行效果: 1. 添加OnePush主要依赖 项目project的build.gradle allprojects { repositories { jcenter() maven { url 'https://jitpack.io' } //由于魅族个推等第三方库使用了不同的仓库,需要加上这个 m 阅读全文
posted @ 2020-05-07 14:16 张学涛 阅读(805) 评论(0) 推荐(0)
摘要: 1.查询今天的数据 select * from 表名 where to_days(时间字段名) = to_days(now()); 2.查询昨天的数据 SELECT * FROM 表名 WHERE TO_DAYS( NOW( ) ) - TO_DAYS( 时间字段名) <= 1 3.查询7天内的数据 阅读全文
posted @ 2020-05-06 15:47 张学涛 阅读(192) 评论(0) 推荐(0)