Giter VIP home page Giter VIP logo

fastkotlin's Introduction

FastKotlin

用于自己快速开发的框架,加入了许多项目通用的东西,免去重复造轮子,待完善。。。

抛弃了xml,完全采用anko DSL布局。

kotlin常用插件 JsonToKotlinClass同java的GsonFormat

use Gradle:

repositories {
  maven { url "https://jitpack.io" }
  mavenCentral()
  google()
}
dependencies {
  implementation 'com.github.czh235285:FastKotlin:1.5.8'
}

介绍

  • 一个简单的Demo,初学kotlin的可以看看,kotlin+rxjava2+retrofit2+mvp+anko
  • 内容不多,但是网络请求,图片,数据库,RecyclerView的adapter写法都有涉及到,差不多常见项目也就这些了吧!
  • 沉浸式状态栏,浅色状态栏。
  • 大量常用工具类,扩展函数
  • 网络请求用的 xsnow(基于Retrofit2二次封装的框架,缓存方面封装比较好,直接拿来用了)
  • 数据库 dbflow(目前最好用的安卓数据库,lib中未添加,具体用法可以看demo)
  • 通用adapter BaseRecyclerViewAdapterHelper。换anko后已经弃用这个,目前用的基类是自己写的。
  • 下拉刷新/上拉加载库 SmartRefreshLayout
  • 6.0动态权限申请 acp

一键生成MVP代码

加载图片:


一行代码简单调用

imageView.load(url)  

跳转Activity:


不带参数
openActivity<OtherActivity>()  或者
openActivityForResult<OtherActivity>(500)

传值
openActivity<OtherActivity>("id" to 1,"name" to "姓名")  或者
openActivityForResult<OtherActivity>(500,"id" to 1,"name" to "姓名")

OtherActivity获取参数

val id=intent.extras.getInt("id")
val name=intent.extras.getString("name")

Dialog:


一行代码简单调用

 showDialog("提示语")  或者
 showDialog("提示语",{ //确定按钮操作})

网络请求加载动画:


仿百度加载动画
 showLoading()
 stopLoading()

fastkotlin's People

Contributors

czh235285 avatar

Stargazers

andy avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.