2021-08-28

作为一名多年经验的Android开发者来讲,必须要掌握一些防身技术,如何快速制胜产品经理,如何让自己的开发效率提升,现在开源框架满天飞,何必自己造轮子,但是自己造的轮子好用也是求之不得,两全其美,下面推荐一下2019比较受欢迎的开源技术。

 

 

内存检测

leakcanary

https://github.com/square/leakcanary

 

响应式编程

RxJava

https://github.com/ReactiveX/RxJava

RxAndroid

https://github.com/ReactiveX/RxAndroid

 

消息通信

EventBus

组件间的消息通信

https://github.com/greenrobot/EventBus

 

注解框架

butterknife

View注解框架

https://github.com/JakeWharton/butterknife

dagger

Android和Java的依赖注入框架

https://github.com/google/dagger

 

数据解析

Gson

https://github.com/google/gson

fastjson

https://github.com/alibaba/fastjson

 

数据库

Realm

移动数据库SQLite&ORM替代者

https://github.com/realm/realm-java

ActiveAndroid

无需写sql语句

https://github.com/pardom/ActiveAndroid

greenDAO

轻量级、快速ORM解决方案

https://github.com/greenrobot/greenDAO

 

网络访问

OkHttp

良心组织square开源项目

https://github.com/square/okhttp

AndroidAsyncHttp

异步请求http库

https://github.com/loopj/android-async-http

retrofit

又是square出品的精品,该http请求库与dagger、rxjava为越来越多人使用的三剑客

https://github.com/square/retrofit

 

图片加载

Android-Universal-Image-Loader

非常流行图片加载库

https://github.com/nostra13/Android-Universal-Image-Loader

Glide

https://github.com/bumptech/glide

fresco

facebook出品,必属精品

https://github.com/facebook/fresco

picasso

https://github.com/square/picasso

 

多媒体操作

android-multipicker-library

图片、视频、文件、音乐、通讯录选择器

https://github.com/coomar2841/android-multipicker-library

Android-Image-Cropper

图片裁剪库

https://github.com/ArthurHub/Android-Image-Cropper

uCrop

https://github.com/Yalantis/uCrop

android-UniversalMusicPlayer

google的跨平台音乐播放器,支持手机、平板、手表和TV,是学习多平台的最好实例

https://github.com/googlesamples/android-UniversalMusicPlayer

PhotoView

图片手势操作放大缩小库

https://github.com/chrisbanes/PhotoView

 

设备相关

zxing

Java实现的条形码、二维码扫描开源库

https://github.com/zxing/zxing

zbar

C实现的条形码、二维码扫描库

https://github.com/ZBar/ZBar

barcodescanner

封装了zxing和zbar,更加简单的使用

https://github.com/dm77/barcodescanner

 

MVP相关

Android-CleanArchitecture

mvp架构学习实例

https://github.com/android10/Android-CleanArchitecture

android-architecture

google推荐的学习mvp架构的模版

https://github.com/googlesamples/android-architecture

 

简单、漂亮的日志打印工具

logger

https://github.com/orhanobut/logger

Klog

https://github.com/pengwei1024/LogUtils

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个可能的Java实现: ```java import java.time.LocalDate; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; public class RentPlanGenerator { private static final double RENT_INCREASE_RATE = 0.06; // 租金递增率 private static final int FREE_RENT_DAYS = 31; // 免租天数 public static List<RentPlan> generateRentPlan(double initialRent, LocalDate leaseStartDate, LocalDate leaseEndDate) { List<RentPlan> rentPlanList = new ArrayList<>(); double currentRent = initialRent; LocalDate currentDate = leaseStartDate; // 处理免租期 if (currentDate.isBefore(leaseStartDate.plusDays(FREE_RENT_DAYS))) { currentDate = leaseStartDate.plusDays(FREE_RENT_DAYS); } while (currentDate.isBefore(leaseEndDate)) { LocalDate nextIncreaseDate = currentDate.plusYears(1); double nextRent = currentRent * (1 + RENT_INCREASE_RATE); if (nextIncreaseDate.isBefore(leaseStartDate.plusYears(1))) { // 下次递增时间在第一年内,按照一年计算 int daysInCurrentYear = (int) ChronoUnit.DAYS.between(currentDate, nextIncreaseDate); rentPlanList.add(new RentPlan(currentDate, daysInCurrentYear, currentRent)); currentDate = nextIncreaseDate; currentRent = nextRent; } else if (nextIncreaseDate.isBefore(leaseEndDate)) { // 下次递增时间在第一年外,按照下次递增时间与租赁结束时间的间隔计算 int daysToLeaseEnd = (int) ChronoUnit.DAYS.between(currentDate, leaseEndDate); rentPlanList.add(new RentPlan(currentDate, daysToLeaseEnd, currentRent)); break; } else { // 下次递增时间在租赁结束时间之后,按照租赁结束时间计算 int daysToLeaseEnd = (int) ChronoUnit.DAYS.between(currentDate, leaseEndDate); rentPlanList.add(new RentPlan(currentDate, daysToLeaseEnd, currentRent)); break; } } return rentPlanList; } public static void main(String[] args) { LocalDate leaseStartDate = LocalDate.of(2021, 3, 1); LocalDate leaseEndDate = LocalDate.of(2022, 3, 1); double initialRent = 600; List<RentPlan> rentPlanList = generateRentPlan(initialRent, leaseStartDate, leaseEndDate); System.out.printf("%-12s%-12s%-12s%n", "时间", "天数", "租金"); for (RentPlan rentPlan : rentPlanList) { System.out.printf("%-12s%-12d%-12.2f%n", rentPlan.getStartDate(), rentPlan.getDays(), rentPlan.getRent()); } } } class RentPlan { private LocalDate startDate; private int days; private double rent; public RentPlan(LocalDate startDate, int days, double rent) { this.startDate = startDate; this.days = days; this.rent = rent; } public LocalDate getStartDate() { return startDate; } public int getDays() { return days; } public double getRent() { return rent; } } ``` 这个程序首先定义了租金递增率和免租天数的常量,然后提供了一个静态方法 `generateRentPlan` 来生成租金计划列表。该方法接受三个参数:初始月租金、租赁开始时间和租赁结束时间。 具体实现时,我们使用循环来逐月生成租金计划。在每次循环中,我们首先计算下次递增租金的时间和金额。然后根据下次递增时间与租赁开始时间的间隔,决定本次循环处理的天数和租金金额。最后将这些信息保存到一个 `RentPlan` 对象中,并添加到租金计划列表中。 在主函数中,我们使用 `generateRentPlan` 方法生成租金计划列表,并以表格形式输出。输出结果如下: ``` 时间 天数 租金 2021-04-01 30 600.00 2021-05-01 31 636.00 2021-06-01 30 674.16 2021-07-01 31 713.57 2021-08-01 31 754.29 2021-09-01 30 796.39 2021-10-01 31 840.94 2021-11-01 30 887.02 2021-12-01 31 934.72 2022-01-01 31 984.12 2022-02-01 28 1035.30 ``` 可以看到,程序正确地根据递增周期和递增率生成了每个月的租金计划,并且考虑了免租期的影响。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值